bkui-vue 2.0.2-beta.6 → 2.0.2-beta.61
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/License.txt +1 -2
- package/dist/cli.css +1 -0
- package/dist/index.cjs.js +133 -132
- package/dist/index.esm.js +17093 -15160
- package/dist/index.umd.js +133 -132
- package/dist/locale/en.esm.js.map +1 -1
- package/dist/locale/en.umd.js.map +1 -1
- package/dist/locale/ja-jp.esm.js +2 -0
- package/dist/locale/ja-jp.esm.js.map +1 -0
- package/dist/locale/ja-jp.umd.js +2 -0
- package/dist/locale/ja-jp.umd.js.map +1 -0
- package/dist/locale/zh-cn.esm.js.map +1 -1
- package/dist/locale/zh-cn.umd.js.map +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.variable.css +1 -0
- package/lib/affix/index.js +24 -32
- package/lib/alert/alert.variable.css +1 -0
- package/lib/alert/index.js +24 -32
- package/lib/animate-number/index.js +12 -16
- package/lib/backtop/backtop.variable.css +1 -0
- package/lib/backtop/index.js +24 -34
- package/lib/badge/badge.variable.css +1 -0
- package/lib/badge/index.js +20 -26
- package/lib/breadcrumb/breadcrumb.variable.css +1 -0
- package/lib/breadcrumb/index.js +26 -34
- package/lib/button/button.d.ts +1 -1
- package/lib/button/button.variable.css +1 -0
- package/lib/button/index.js +29 -39
- package/lib/card/card.variable.css +1 -0
- package/lib/card/index.js +35 -49
- package/lib/cascader/cascader.css +26 -24
- package/lib/cascader/cascader.d.ts +311 -0
- package/lib/cascader/cascader.less +78 -76
- package/lib/cascader/cascader.variable.css +27 -24
- package/lib/cascader/index.d.ts +610 -0
- package/lib/cascader/index.js +810 -748
- package/lib/checkbox/checkbox.variable.css +1 -0
- package/lib/checkbox/index.js +39 -49
- package/lib/code-diff/code-diff.variable.css +1 -0
- package/lib/code-diff/index.js +81 -85
- package/lib/collapse/collapse.variable.css +1 -0
- package/lib/collapse/index.js +36 -42
- package/lib/collapse-transition/collapse-transition.variable.css +1 -0
- package/lib/collapse-transition/index.js +16 -22
- package/lib/color-picker/color-picker.variable.css +1 -0
- package/lib/color-picker/index.js +637 -656
- package/lib/components.js +1 -1
- package/lib/config-provider/config-provider.variable.css +1 -0
- package/lib/config-provider/index.d.ts +1 -1
- package/lib/config-provider/index.js +32 -40
- package/lib/container/container.variable.css +1 -0
- package/lib/container/index.js +26 -32
- package/lib/date-picker/date-picker.d.ts +2 -1
- package/lib/date-picker/date-picker.variable.css +1 -0
- package/lib/date-picker/index.d.ts +6 -2
- package/lib/date-picker/index.js +713 -738
- package/lib/date-picker/panel/date-range.d.ts +2 -1
- package/lib/date-picker/panel/time.d.ts +1 -1
- package/lib/date-picker/utils.d.ts +5 -17
- package/lib/dialog/dialog.css +20 -1
- package/lib/dialog/dialog.variable.css +21 -1
- package/lib/dialog/index.js +100 -137
- package/lib/directives/index.js +518 -529
- package/lib/dist.index.js +1 -1
- package/lib/divider/divider.variable.css +1 -0
- package/lib/divider/index.js +18 -24
- package/lib/dropdown/dropdown.d.ts +1 -0
- package/lib/dropdown/dropdown.variable.css +1 -0
- package/lib/dropdown/index.d.ts +3 -0
- package/lib/dropdown/index.js +45 -52
- package/lib/exception/exception.variable.css +1 -0
- package/lib/exception/index.js +51 -57
- package/lib/fixed-navbar/fixed-navbar.variable.css +1 -0
- package/lib/fixed-navbar/index.js +16 -22
- package/lib/form/form-item.d.ts +19 -0
- package/lib/form/form.css +16 -4
- package/lib/form/form.less +24 -6
- package/lib/form/form.variable.css +17 -4
- package/lib/form/index.d.ts +13 -0
- package/lib/form/index.js +662 -685
- package/lib/hooks.js +1 -1
- package/lib/icon/angle-double-down-line.js +13 -15
- package/lib/icon/angle-double-left-line.js +13 -15
- package/lib/icon/angle-double-left.js +13 -15
- package/lib/icon/angle-double-right-line.js +13 -15
- package/lib/icon/angle-double-right.js +13 -15
- package/lib/icon/angle-double-up-line.js +13 -15
- package/lib/icon/angle-down-fill.js +13 -15
- package/lib/icon/angle-down-line.js +13 -15
- package/lib/icon/angle-down.js +13 -15
- package/lib/icon/angle-left.js +13 -15
- package/lib/icon/angle-right.js +13 -15
- package/lib/icon/angle-up-fill.js +13 -15
- package/lib/icon/angle-up.js +13 -15
- package/lib/icon/archive-fill.js +13 -15
- package/lib/icon/arrows-left.js +13 -15
- package/lib/icon/arrows-right.js +13 -15
- package/lib/icon/assistant.js +13 -15
- package/lib/icon/audio-fill.js +13 -15
- package/lib/icon/bk.js +13 -15
- package/lib/icon/circle.js +13 -15
- package/lib/icon/close-line.js +13 -15
- package/lib/icon/close.js +13 -15
- package/lib/icon/code.js +13 -15
- package/lib/icon/cog-shape.js +13 -15
- package/lib/icon/collapse-left.js +13 -15
- package/lib/icon/copy-shape.js +13 -15
- package/lib/icon/copy.js +13 -15
- package/lib/icon/data-shape.js +13 -15
- package/lib/icon/del.js +13 -15
- package/lib/icon/doc-fill.js +13 -15
- package/lib/icon/done.js +13 -15
- package/lib/icon/down-shape.js +13 -15
- package/lib/icon/down-small.js +13 -15
- package/lib/icon/edit-line.js +13 -15
- package/lib/icon/ellipsis.js +13 -15
- package/lib/icon/enlarge-line.js +13 -15
- package/lib/icon/error.js +13 -15
- package/lib/icon/excel-fill.js +13 -15
- package/lib/icon/exclamation-circle-shape.js +13 -15
- package/lib/icon/eye.js +13 -15
- package/lib/icon/filliscreen-line.js +13 -15
- package/lib/icon/fix-line.js +13 -15
- package/lib/icon/fix-shape.js +13 -15
- package/lib/icon/folder-open.js +13 -15
- package/lib/icon/folder-shape-open.js +13 -15
- package/lib/icon/folder-shape.js +13 -15
- package/lib/icon/folder.js +13 -15
- package/lib/icon/funnel.js +13 -15
- package/lib/icon/grag-fill.js +13 -15
- package/lib/icon/help-document-fill.js +13 -15
- package/lib/icon/help-fill.js +13 -15
- package/lib/icon/help.js +13 -15
- package/lib/icon/image-fill.js +13 -15
- package/lib/icon/img-error.js +13 -15
- package/lib/icon/img-placehoulder.js +13 -15
- package/lib/icon/index.js +1 -1
- package/lib/icon/info-line.js +13 -15
- package/lib/icon/info.js +13 -15
- package/lib/icon/left-shape.js +13 -15
- package/lib/icon/left-turn-line.js +13 -15
- package/lib/icon/loading.js +13 -15
- package/lib/icon/narrow-line.js +13 -15
- package/lib/icon/original.js +13 -15
- package/lib/icon/pdf-fill.js +13 -15
- package/lib/icon/play-shape.js +13 -15
- package/lib/icon/plus.js +13 -15
- package/lib/icon/ppt-fill.js +13 -15
- package/lib/icon/qq.js +13 -15
- package/lib/icon/right-shape.js +13 -15
- package/lib/icon/right-turn-line.js +13 -15
- package/lib/icon/search.js +13 -15
- package/lib/icon/share.js +13 -15
- package/lib/icon/spinner.js +13 -15
- package/lib/icon/success.js +13 -15
- package/lib/icon/switcher-loading.js +13 -15
- package/lib/icon/text-all.js +13 -15
- package/lib/icon/text-file.js +13 -15
- package/lib/icon/text-fill.js +13 -15
- package/lib/icon/transfer.js +13 -15
- package/lib/icon/tree-application-shape.js +13 -15
- package/lib/icon/unfull-screen.js +13 -15
- package/lib/icon/unvisible.js +13 -15
- package/lib/icon/up-shape.js +13 -15
- package/lib/icon/upload.js +13 -15
- package/lib/icon/video-fill.js +13 -15
- package/lib/icon/warn.js +13 -15
- package/lib/icon/weixin-pro.js +13 -15
- package/lib/icon/weixin.js +13 -15
- package/lib/image/image-viewer.variable.css +1 -0
- package/lib/image/image.variable.css +1 -0
- package/lib/image/index.js +333 -352
- package/lib/index.js +1 -1
- package/lib/info-box/index.js +109 -108
- package/lib/info-box/info-box.css +20 -1
- package/lib/info-box/info-box.d.ts +1 -0
- package/lib/info-box/info-box.less +28 -2
- package/lib/info-box/info-box.variable.css +22 -2
- package/lib/input/index.d.ts +39 -20
- package/lib/input/index.js +363 -358
- package/lib/input/input.d.ts +30 -16
- package/lib/input/input.variable.css +1 -0
- package/lib/link/index.js +20 -28
- package/lib/link/link.variable.css +1 -0
- package/lib/loading/index.js +22 -28
- package/lib/loading/loading.variable.css +1 -0
- package/lib/locale/index.d.ts +1 -0
- package/lib/locale/index.js +175 -7
- package/lib/locale/lang/ja-jp.d.ts +3 -0
- package/lib/menu/index.js +44 -49
- package/lib/menu/menu.variable.css +1 -0
- package/lib/menu/submenu.variable.css +1 -0
- package/lib/message/index.js +45 -51
- package/lib/message/message.variable.css +1 -0
- package/lib/modal/index.js +43 -45
- package/lib/modal/modal.css +20 -1
- package/lib/modal/modal.variable.css +21 -1
- package/lib/navigation/index.js +22 -30
- package/lib/navigation/navigation.variable.css +1 -0
- package/lib/notify/index.js +30 -40
- package/lib/notify/notify.variable.css +1 -0
- package/lib/overflow-title/index.js +32 -44
- package/lib/pagination/index.js +68 -76
- package/lib/pagination/pagination.css +1 -0
- package/lib/pagination/pagination.less +1 -0
- package/lib/pagination/pagination.variable.css +2 -0
- package/lib/pop-confirm/index.d.ts +584 -0
- package/lib/pop-confirm/index.js +43 -55
- package/lib/pop-confirm/pop-confirm.d.ts +292 -0
- package/lib/pop-confirm/pop-confirm.variable.css +1 -0
- package/lib/pop-confirm/props.d.ts +146 -0
- package/lib/popover/index.js +363 -382
- package/lib/popover/popover.variable.css +1 -0
- package/lib/popover2/index.js +12 -16
- package/lib/preset.js +1 -1
- package/lib/process/index.js +76 -80
- package/lib/process/process.d.ts +1 -1
- package/lib/process/process.variable.css +1 -0
- package/lib/progress/index.js +24 -30
- package/lib/progress/progress.variable.css +1 -0
- package/lib/radio/index.js +36 -44
- package/lib/radio/radio.variable.css +1 -0
- package/lib/rate/index.js +22 -28
- package/lib/rate/rate.variable.css +1 -0
- package/lib/resize-layout/index.js +24 -32
- package/lib/resize-layout/resize-layout.variable.css +1 -0
- package/lib/scrollbar/css/scrollbar.variable.css +1 -0
- package/lib/scrollbar/index.js +31 -31
- package/lib/search-select/index.d.ts +21 -3
- package/lib/search-select/index.js +558 -543
- package/lib/search-select/input.d.ts +3 -0
- package/lib/search-select/search-select.d.ts +7 -1
- package/lib/search-select/search-select.variable.css +1 -0
- package/lib/search-select/selected.d.ts +6 -0
- package/lib/select/index.d.ts +22 -3
- package/lib/select/index.js +560 -597
- package/lib/select/select.d.ts +11 -1
- package/lib/select/select.variable.css +1 -0
- package/lib/shared/index.d.ts +1 -1
- package/lib/shared/index.js +59 -67
- package/lib/shared/z-index-manager.d.ts +1 -1
- package/lib/sideslider/index.js +84 -92
- package/lib/sideslider/sideslider.variable.css +1 -0
- package/lib/slider/index.d.ts +1 -1
- package/lib/slider/index.js +80 -89
- package/lib/slider/slider-button.d.ts +1 -1
- package/lib/slider/slider.d.ts +1 -1
- package/lib/slider/slider.variable.css +1 -0
- package/lib/steps/index.js +74 -80
- package/lib/steps/steps.d.ts +1 -1
- package/lib/steps/steps.variable.css +1 -0
- package/lib/styles/mixins/animate.variable.css +1 -0
- package/lib/styles/mixins/popper.variable.css +1 -0
- package/lib/styles/mixins/scroll.variable.css +1 -0
- package/lib/styles/reset.variable.css +1 -0
- package/lib/styles/themes/themes.less +3 -0
- package/lib/swiper/index.js +20 -26
- package/lib/swiper/swiper.variable.css +1 -0
- package/lib/switcher/index.js +24 -32
- package/lib/switcher/switcher.variable.css +1 -0
- package/lib/tab/index.d.ts +12 -0
- package/lib/tab/index.js +341 -352
- package/lib/tab/props.d.ts +3 -0
- package/lib/tab/tab.d.ts +6 -0
- package/lib/tab/tab.variable.css +1 -0
- package/lib/table/index.js +630 -691
- package/lib/table/plugins/head-filter.variable.css +1 -0
- package/lib/table/plugins/head-sort.variable.css +1 -0
- package/lib/table/plugins/settings.variable.css +1 -0
- package/lib/table/table.css +1 -0
- package/lib/table/table.variable.css +2 -0
- package/lib/table-column/index.js +10 -14
- package/lib/tag/index.js +28 -38
- package/lib/tag/tag.variable.css +1 -0
- package/lib/tag-input/index.d.ts +3 -0
- package/lib/tag-input/index.js +2190 -851
- package/lib/tag-input/tag-input.d.ts +1 -0
- package/lib/tag-input/tag-input.variable.css +1 -0
- package/lib/time-picker/index.js +10 -14
- package/lib/time-picker/time-picker.variable.css +1 -0
- package/lib/timeline/index.js +1368 -25
- package/lib/timeline/timeline.d.ts +1 -1
- package/lib/timeline/timeline.variable.css +1 -0
- package/lib/transfer/index.d.ts +1 -24
- package/lib/transfer/index.js +61 -67
- package/lib/transfer/props.d.ts +0 -5
- package/lib/transfer/transfer.css +26 -8
- package/lib/transfer/transfer.d.ts +1 -12
- package/lib/transfer/transfer.less +18 -8
- package/lib/transfer/transfer.variable.css +27 -8
- package/lib/tree/constant.d.ts +2 -0
- package/lib/tree/index.d.ts +48 -0
- package/lib/tree/index.js +297 -171
- package/lib/tree/props.d.ts +20 -0
- package/lib/tree/tree.css +46 -0
- package/lib/tree/tree.d.ts +22 -0
- package/lib/tree/tree.less +57 -2
- package/lib/tree/tree.variable.css +47 -0
- package/lib/tree/use-node-action.d.ts +2 -2
- package/lib/upload/index.js +570 -582
- package/lib/upload/upload.variable.css +1 -0
- package/lib/virtual-render/index.js +50 -62
- package/lib/virtual-render/virtual-render.variable.css +1 -0
- package/lib/volar.components.d.ts +2 -1
- package/package.json +13 -2
- package/dist/style.css +0 -1
package/lib/tag-input/index.js
CHANGED
@@ -17,7 +17,15 @@ import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
|
17
17
|
import * as __WEBPACK_EXTERNAL_MODULE_lodash_has_e9e453be__ from "lodash/has";
|
18
18
|
/******/ var __webpack_modules__ = ({
|
19
19
|
|
20
|
-
/***/
|
20
|
+
/***/ 2439:
|
21
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
22
|
+
|
23
|
+
module.exports = __webpack_require__(2527);
|
24
|
+
|
25
|
+
|
26
|
+
/***/ }),
|
27
|
+
|
28
|
+
/***/ 7430:
|
21
29
|
/***/ ((module) => {
|
22
30
|
|
23
31
|
/**
|
@@ -67,104 +75,393 @@ module.exports = ExecutionEnvironment;
|
|
67
75
|
|
68
76
|
/***/ }),
|
69
77
|
|
70
|
-
/***/
|
71
|
-
/***/ ((module
|
78
|
+
/***/ 6377:
|
79
|
+
/***/ ((module) => {
|
72
80
|
|
73
81
|
/**
|
74
|
-
* Copyright
|
75
|
-
* All rights reserved.
|
76
|
-
*
|
77
|
-
* This source code is licensed under the BSD-style license found in the
|
78
|
-
* LICENSE file in the root directory of this source tree. An additional grant
|
79
|
-
* of patent rights can be found in the PATENTS file in the same directory.
|
82
|
+
* Copyright 2004-present Facebook. All Rights Reserved.
|
80
83
|
*
|
81
|
-
* @providesModule
|
84
|
+
* @providesModule UserAgent_DEPRECATED
|
82
85
|
*/
|
83
86
|
|
84
|
-
|
85
|
-
|
86
|
-
var ExecutionEnvironment = __webpack_require__(1043);
|
87
|
-
|
88
|
-
var useHasFeature;
|
89
|
-
if (ExecutionEnvironment.canUseDOM) {
|
90
|
-
useHasFeature =
|
91
|
-
document.implementation &&
|
92
|
-
document.implementation.hasFeature &&
|
93
|
-
// always returns true in newer browsers as per the standard.
|
94
|
-
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
95
|
-
document.implementation.hasFeature('', '') !== true;
|
96
|
-
}
|
97
|
-
|
98
87
|
/**
|
99
|
-
*
|
88
|
+
* Provides entirely client-side User Agent and OS detection. You should prefer
|
89
|
+
* the non-deprecated UserAgent module when possible, which exposes our
|
90
|
+
* authoritative server-side PHP-based detection to the client.
|
100
91
|
*
|
101
|
-
*
|
102
|
-
* `reset`, `load`, `error`, and `select`.
|
92
|
+
* Usage is straightforward:
|
103
93
|
*
|
104
|
-
*
|
94
|
+
* if (UserAgent_DEPRECATED.ie()) {
|
95
|
+
* // IE
|
96
|
+
* }
|
97
|
+
*
|
98
|
+
* You can also do version checks:
|
99
|
+
*
|
100
|
+
* if (UserAgent_DEPRECATED.ie() >= 7) {
|
101
|
+
* // IE7 or better
|
102
|
+
* }
|
103
|
+
*
|
104
|
+
* The browser functions will return NaN if the browser does not match, so
|
105
|
+
* you can also do version compares the other way:
|
106
|
+
*
|
107
|
+
* if (UserAgent_DEPRECATED.ie() < 7) {
|
108
|
+
* // IE6 or worse
|
109
|
+
* }
|
110
|
+
*
|
111
|
+
* Note that the version is a float and may include a minor version number,
|
112
|
+
* so you should always use range operators to perform comparisons, not
|
113
|
+
* strict equality.
|
114
|
+
*
|
115
|
+
* **Note:** You should **strongly** prefer capability detection to browser
|
116
|
+
* version detection where it's reasonable:
|
117
|
+
*
|
118
|
+
* http://www.quirksmode.org/js/support.html
|
119
|
+
*
|
120
|
+
* Further, we have a large number of mature wrapper functions and classes
|
121
|
+
* which abstract away many browser irregularities. Check the documentation,
|
122
|
+
* grep for things, or ask on javascript@lists.facebook.com before writing yet
|
123
|
+
* another copy of "event || window.event".
|
105
124
|
*
|
106
|
-
* @param {string} eventNameSuffix Event name, e.g. "click".
|
107
|
-
* @param {?boolean} capture Check if the capture phase is supported.
|
108
|
-
* @return {boolean} True if the event is supported.
|
109
|
-
* @internal
|
110
|
-
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
111
125
|
*/
|
112
|
-
function isEventSupported(eventNameSuffix, capture) {
|
113
|
-
if (!ExecutionEnvironment.canUseDOM ||
|
114
|
-
capture && !('addEventListener' in document)) {
|
115
|
-
return false;
|
116
|
-
}
|
117
126
|
|
118
|
-
|
119
|
-
var isSupported = eventName in document;
|
127
|
+
var _populated = false;
|
120
128
|
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
129
|
+
// Browsers
|
130
|
+
var _ie, _firefox, _opera, _webkit, _chrome;
|
131
|
+
|
132
|
+
// Actual IE browser for compatibility mode
|
133
|
+
var _ie_real_version;
|
134
|
+
|
135
|
+
// Platforms
|
136
|
+
var _osx, _windows, _linux, _android;
|
137
|
+
|
138
|
+
// Architectures
|
139
|
+
var _win64;
|
140
|
+
|
141
|
+
// Devices
|
142
|
+
var _iphone, _ipad, _native;
|
143
|
+
|
144
|
+
var _mobile;
|
145
|
+
|
146
|
+
function _populate() {
|
147
|
+
if (_populated) {
|
148
|
+
return;
|
125
149
|
}
|
126
150
|
|
127
|
-
|
128
|
-
|
129
|
-
|
151
|
+
_populated = true;
|
152
|
+
|
153
|
+
// To work around buggy JS libraries that can't handle multi-digit
|
154
|
+
// version numbers, Opera 10's user agent string claims it's Opera
|
155
|
+
// 9, then later includes a Version/X.Y field:
|
156
|
+
//
|
157
|
+
// Opera/9.80 (foo) Presto/2.2.15 Version/10.10
|
158
|
+
var uas = navigator.userAgent;
|
159
|
+
var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
|
160
|
+
var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
|
161
|
+
|
162
|
+
_iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
|
163
|
+
_ipad = /\b(iP[ao]d)/.exec(uas);
|
164
|
+
_android = /Android/i.exec(uas);
|
165
|
+
_native = /FBAN\/\w+;/i.exec(uas);
|
166
|
+
_mobile = /Mobile/i.exec(uas);
|
167
|
+
|
168
|
+
// Note that the IE team blog would have you believe you should be checking
|
169
|
+
// for 'Win64; x64'. But MSDN then reveals that you can actually be coming
|
170
|
+
// from either x64 or ia64; so ultimately, you should just check for Win64
|
171
|
+
// as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
|
172
|
+
// Windows will send 'WOW64' instead.
|
173
|
+
_win64 = !!(/Win64/.exec(uas));
|
174
|
+
|
175
|
+
if (agent) {
|
176
|
+
_ie = agent[1] ? parseFloat(agent[1]) : (
|
177
|
+
agent[5] ? parseFloat(agent[5]) : NaN);
|
178
|
+
// IE compatibility mode
|
179
|
+
if (_ie && document && document.documentMode) {
|
180
|
+
_ie = document.documentMode;
|
181
|
+
}
|
182
|
+
// grab the "true" ie version from the trident token if available
|
183
|
+
var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
|
184
|
+
_ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
|
185
|
+
|
186
|
+
_firefox = agent[2] ? parseFloat(agent[2]) : NaN;
|
187
|
+
_opera = agent[3] ? parseFloat(agent[3]) : NaN;
|
188
|
+
_webkit = agent[4] ? parseFloat(agent[4]) : NaN;
|
189
|
+
if (_webkit) {
|
190
|
+
// We do not add the regexp to the above test, because it will always
|
191
|
+
// match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
|
192
|
+
// the userAgent string.
|
193
|
+
agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
|
194
|
+
_chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
|
195
|
+
} else {
|
196
|
+
_chrome = NaN;
|
197
|
+
}
|
198
|
+
} else {
|
199
|
+
_ie = _firefox = _opera = _chrome = _webkit = NaN;
|
130
200
|
}
|
131
201
|
|
132
|
-
|
202
|
+
if (os) {
|
203
|
+
if (os[1]) {
|
204
|
+
// Detect OS X version. If no version number matches, set _osx to true.
|
205
|
+
// Version examples: 10, 10_6_1, 10.7
|
206
|
+
// Parses version number as a float, taking only first two sets of
|
207
|
+
// digits. If only one set of digits is found, returns just the major
|
208
|
+
// version number.
|
209
|
+
var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
|
210
|
+
|
211
|
+
_osx = ver ? parseFloat(ver[1].replace('_', '.')) : true;
|
212
|
+
} else {
|
213
|
+
_osx = false;
|
214
|
+
}
|
215
|
+
_windows = !!os[2];
|
216
|
+
_linux = !!os[3];
|
217
|
+
} else {
|
218
|
+
_osx = _windows = _linux = false;
|
219
|
+
}
|
133
220
|
}
|
134
221
|
|
135
|
-
|
222
|
+
var UserAgent_DEPRECATED = {
|
136
223
|
|
224
|
+
/**
|
225
|
+
* Check if the UA is Internet Explorer.
|
226
|
+
*
|
227
|
+
*
|
228
|
+
* @return float|NaN Version number (if match) or NaN.
|
229
|
+
*/
|
230
|
+
ie: function() {
|
231
|
+
return _populate() || _ie;
|
232
|
+
},
|
137
233
|
|
138
|
-
|
234
|
+
/**
|
235
|
+
* Check if we're in Internet Explorer compatibility mode.
|
236
|
+
*
|
237
|
+
* @return bool true if in compatibility mode, false if
|
238
|
+
* not compatibility mode or not ie
|
239
|
+
*/
|
240
|
+
ieCompatibilityMode: function() {
|
241
|
+
return _populate() || (_ie_real_version > _ie);
|
242
|
+
},
|
139
243
|
|
140
|
-
/***/ 5022:
|
141
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
142
244
|
|
143
|
-
/**
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
* @providesModule normalizeWheel
|
152
|
-
* @typechecks
|
153
|
-
*/
|
245
|
+
/**
|
246
|
+
* Whether the browser is 64-bit IE. Really, this is kind of weak sauce; we
|
247
|
+
* only need this because Skype can't handle 64-bit IE yet. We need to remove
|
248
|
+
* this when we don't need it -- tracked by #601957.
|
249
|
+
*/
|
250
|
+
ie64: function() {
|
251
|
+
return UserAgent_DEPRECATED.ie() && _win64;
|
252
|
+
},
|
154
253
|
|
254
|
+
/**
|
255
|
+
* Check if the UA is Firefox.
|
256
|
+
*
|
257
|
+
*
|
258
|
+
* @return float|NaN Version number (if match) or NaN.
|
259
|
+
*/
|
260
|
+
firefox: function() {
|
261
|
+
return _populate() || _firefox;
|
262
|
+
},
|
155
263
|
|
156
264
|
|
157
|
-
|
265
|
+
/**
|
266
|
+
* Check if the UA is Opera.
|
267
|
+
*
|
268
|
+
*
|
269
|
+
* @return float|NaN Version number (if match) or NaN.
|
270
|
+
*/
|
271
|
+
opera: function() {
|
272
|
+
return _populate() || _opera;
|
273
|
+
},
|
158
274
|
|
159
|
-
var isEventSupported = __webpack_require__(2586);
|
160
275
|
|
276
|
+
/**
|
277
|
+
* Check if the UA is WebKit.
|
278
|
+
*
|
279
|
+
*
|
280
|
+
* @return float|NaN Version number (if match) or NaN.
|
281
|
+
*/
|
282
|
+
webkit: function() {
|
283
|
+
return _populate() || _webkit;
|
284
|
+
},
|
161
285
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
286
|
+
/**
|
287
|
+
* For Push
|
288
|
+
* WILL BE REMOVED VERY SOON. Use UserAgent_DEPRECATED.webkit
|
289
|
+
*/
|
290
|
+
safari: function() {
|
291
|
+
return UserAgent_DEPRECATED.webkit();
|
292
|
+
},
|
166
293
|
|
167
|
-
/**
|
294
|
+
/**
|
295
|
+
* Check if the UA is a Chrome browser.
|
296
|
+
*
|
297
|
+
*
|
298
|
+
* @return float|NaN Version number (if match) or NaN.
|
299
|
+
*/
|
300
|
+
chrome : function() {
|
301
|
+
return _populate() || _chrome;
|
302
|
+
},
|
303
|
+
|
304
|
+
|
305
|
+
/**
|
306
|
+
* Check if the user is running Windows.
|
307
|
+
*
|
308
|
+
* @return bool `true' if the user's OS is Windows.
|
309
|
+
*/
|
310
|
+
windows: function() {
|
311
|
+
return _populate() || _windows;
|
312
|
+
},
|
313
|
+
|
314
|
+
|
315
|
+
/**
|
316
|
+
* Check if the user is running Mac OS X.
|
317
|
+
*
|
318
|
+
* @return float|bool Returns a float if a version number is detected,
|
319
|
+
* otherwise true/false.
|
320
|
+
*/
|
321
|
+
osx: function() {
|
322
|
+
return _populate() || _osx;
|
323
|
+
},
|
324
|
+
|
325
|
+
/**
|
326
|
+
* Check if the user is running Linux.
|
327
|
+
*
|
328
|
+
* @return bool `true' if the user's OS is some flavor of Linux.
|
329
|
+
*/
|
330
|
+
linux: function() {
|
331
|
+
return _populate() || _linux;
|
332
|
+
},
|
333
|
+
|
334
|
+
/**
|
335
|
+
* Check if the user is running on an iPhone or iPod platform.
|
336
|
+
*
|
337
|
+
* @return bool `true' if the user is running some flavor of the
|
338
|
+
* iPhone OS.
|
339
|
+
*/
|
340
|
+
iphone: function() {
|
341
|
+
return _populate() || _iphone;
|
342
|
+
},
|
343
|
+
|
344
|
+
mobile: function() {
|
345
|
+
return _populate() || (_iphone || _ipad || _android || _mobile);
|
346
|
+
},
|
347
|
+
|
348
|
+
nativeApp: function() {
|
349
|
+
// webviews inside of the native apps
|
350
|
+
return _populate() || _native;
|
351
|
+
},
|
352
|
+
|
353
|
+
android: function() {
|
354
|
+
return _populate() || _android;
|
355
|
+
},
|
356
|
+
|
357
|
+
ipad: function() {
|
358
|
+
return _populate() || _ipad;
|
359
|
+
}
|
360
|
+
};
|
361
|
+
|
362
|
+
module.exports = UserAgent_DEPRECATED;
|
363
|
+
|
364
|
+
|
365
|
+
/***/ }),
|
366
|
+
|
367
|
+
/***/ 3541:
|
368
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
369
|
+
|
370
|
+
/**
|
371
|
+
* Copyright 2013-2015, Facebook, Inc.
|
372
|
+
* All rights reserved.
|
373
|
+
*
|
374
|
+
* This source code is licensed under the BSD-style license found in the
|
375
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
376
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
377
|
+
*
|
378
|
+
* @providesModule isEventSupported
|
379
|
+
*/
|
380
|
+
|
381
|
+
|
382
|
+
|
383
|
+
var ExecutionEnvironment = __webpack_require__(7430);
|
384
|
+
|
385
|
+
var useHasFeature;
|
386
|
+
if (ExecutionEnvironment.canUseDOM) {
|
387
|
+
useHasFeature =
|
388
|
+
document.implementation &&
|
389
|
+
document.implementation.hasFeature &&
|
390
|
+
// always returns true in newer browsers as per the standard.
|
391
|
+
// @see http://dom.spec.whatwg.org/#dom-domimplementation-hasfeature
|
392
|
+
document.implementation.hasFeature('', '') !== true;
|
393
|
+
}
|
394
|
+
|
395
|
+
/**
|
396
|
+
* Checks if an event is supported in the current execution environment.
|
397
|
+
*
|
398
|
+
* NOTE: This will not work correctly for non-generic events such as `change`,
|
399
|
+
* `reset`, `load`, `error`, and `select`.
|
400
|
+
*
|
401
|
+
* Borrows from Modernizr.
|
402
|
+
*
|
403
|
+
* @param {string} eventNameSuffix Event name, e.g. "click".
|
404
|
+
* @param {?boolean} capture Check if the capture phase is supported.
|
405
|
+
* @return {boolean} True if the event is supported.
|
406
|
+
* @internal
|
407
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
408
|
+
*/
|
409
|
+
function isEventSupported(eventNameSuffix, capture) {
|
410
|
+
if (!ExecutionEnvironment.canUseDOM ||
|
411
|
+
capture && !('addEventListener' in document)) {
|
412
|
+
return false;
|
413
|
+
}
|
414
|
+
|
415
|
+
var eventName = 'on' + eventNameSuffix;
|
416
|
+
var isSupported = eventName in document;
|
417
|
+
|
418
|
+
if (!isSupported) {
|
419
|
+
var element = document.createElement('div');
|
420
|
+
element.setAttribute(eventName, 'return;');
|
421
|
+
isSupported = typeof element[eventName] === 'function';
|
422
|
+
}
|
423
|
+
|
424
|
+
if (!isSupported && useHasFeature && eventNameSuffix === 'wheel') {
|
425
|
+
// This is the only way to test support for the `wheel` event in IE9+.
|
426
|
+
isSupported = document.implementation.hasFeature('Events.wheel', '3.0');
|
427
|
+
}
|
428
|
+
|
429
|
+
return isSupported;
|
430
|
+
}
|
431
|
+
|
432
|
+
module.exports = isEventSupported;
|
433
|
+
|
434
|
+
|
435
|
+
/***/ }),
|
436
|
+
|
437
|
+
/***/ 2527:
|
438
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
439
|
+
|
440
|
+
/**
|
441
|
+
* Copyright (c) 2015, Facebook, Inc.
|
442
|
+
* All rights reserved.
|
443
|
+
*
|
444
|
+
* This source code is licensed under the BSD-style license found in the
|
445
|
+
* LICENSE file in the root directory of this source tree. An additional grant
|
446
|
+
* of patent rights can be found in the PATENTS file in the same directory.
|
447
|
+
*
|
448
|
+
* @providesModule normalizeWheel
|
449
|
+
* @typechecks
|
450
|
+
*/
|
451
|
+
|
452
|
+
|
453
|
+
|
454
|
+
var UserAgent_DEPRECATED = __webpack_require__(6377);
|
455
|
+
|
456
|
+
var isEventSupported = __webpack_require__(3541);
|
457
|
+
|
458
|
+
|
459
|
+
// Reasonable defaults
|
460
|
+
var PIXEL_STEP = 10;
|
461
|
+
var LINE_HEIGHT = 40;
|
462
|
+
var PAGE_HEIGHT = 800;
|
463
|
+
|
464
|
+
/**
|
168
465
|
* Mouse wheel (and 2-finger trackpad) support on the web sucks. It is
|
169
466
|
* complicated, thus this doc is long and (hopefully) detailed enough to answer
|
170
467
|
* your questions.
|
@@ -323,495 +620,196 @@ normalizeWheel.getEventType = function() /*string*/ {
|
|
323
620
|
module.exports = normalizeWheel;
|
324
621
|
|
325
622
|
|
326
|
-
/***/ })
|
623
|
+
/***/ })
|
327
624
|
|
328
|
-
|
329
|
-
|
625
|
+
/******/ });
|
626
|
+
/************************************************************************/
|
627
|
+
/******/ // The module cache
|
628
|
+
/******/ var __webpack_module_cache__ = {};
|
629
|
+
/******/
|
630
|
+
/******/ // The require function
|
631
|
+
/******/ function __webpack_require__(moduleId) {
|
632
|
+
/******/ // Check if module is in cache
|
633
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
634
|
+
/******/ if (cachedModule !== undefined) {
|
635
|
+
/******/ return cachedModule.exports;
|
636
|
+
/******/ }
|
637
|
+
/******/ // Create a new module (and put it into the cache)
|
638
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
639
|
+
/******/ // no module.id needed
|
640
|
+
/******/ // no module.loaded needed
|
641
|
+
/******/ exports: {}
|
642
|
+
/******/ };
|
643
|
+
/******/
|
644
|
+
/******/ // Execute the module function
|
645
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
646
|
+
/******/
|
647
|
+
/******/ // Return the exports of the module
|
648
|
+
/******/ return module.exports;
|
649
|
+
/******/ }
|
650
|
+
/******/
|
651
|
+
/************************************************************************/
|
652
|
+
/******/ /* webpack/runtime/compat get default export */
|
653
|
+
/******/ (() => {
|
654
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
655
|
+
/******/ __webpack_require__.n = (module) => {
|
656
|
+
/******/ var getter = module && module.__esModule ?
|
657
|
+
/******/ () => (module['default']) :
|
658
|
+
/******/ () => (module);
|
659
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
660
|
+
/******/ return getter;
|
661
|
+
/******/ };
|
662
|
+
/******/ })();
|
663
|
+
/******/
|
664
|
+
/******/ /* webpack/runtime/define property getters */
|
665
|
+
/******/ (() => {
|
666
|
+
/******/ // define getter functions for harmony exports
|
667
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
668
|
+
/******/ for(var key in definition) {
|
669
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
670
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
671
|
+
/******/ }
|
672
|
+
/******/ }
|
673
|
+
/******/ };
|
674
|
+
/******/ })();
|
675
|
+
/******/
|
676
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
677
|
+
/******/ (() => {
|
678
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
679
|
+
/******/ })();
|
680
|
+
/******/
|
681
|
+
/************************************************************************/
|
682
|
+
var __webpack_exports__ = {};
|
683
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
684
|
+
(() => {
|
330
685
|
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
*/
|
686
|
+
// EXPORTS
|
687
|
+
__webpack_require__.d(__webpack_exports__, {
|
688
|
+
TagInput: () => (/* binding */ TagInput),
|
689
|
+
"default": () => (/* binding */ src),
|
690
|
+
useTagsOverflow: () => (/* reexport */ useTagsOverflow)
|
691
|
+
});
|
336
692
|
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
* if (UserAgent_DEPRECATED.ie()) {
|
345
|
-
* // IE
|
346
|
-
* }
|
347
|
-
*
|
348
|
-
* You can also do version checks:
|
349
|
-
*
|
350
|
-
* if (UserAgent_DEPRECATED.ie() >= 7) {
|
351
|
-
* // IE7 or better
|
352
|
-
* }
|
353
|
-
*
|
354
|
-
* The browser functions will return NaN if the browser does not match, so
|
355
|
-
* you can also do version compares the other way:
|
356
|
-
*
|
357
|
-
* if (UserAgent_DEPRECATED.ie() < 7) {
|
358
|
-
* // IE6 or worse
|
359
|
-
* }
|
360
|
-
*
|
361
|
-
* Note that the version is a float and may include a minor version number,
|
362
|
-
* so you should always use range operators to perform comparisons, not
|
363
|
-
* strict equality.
|
364
|
-
*
|
365
|
-
* **Note:** You should **strongly** prefer capability detection to browser
|
366
|
-
* version detection where it's reasonable:
|
367
|
-
*
|
368
|
-
* http://www.quirksmode.org/js/support.html
|
369
|
-
*
|
370
|
-
* Further, we have a large number of mature wrapper functions and classes
|
371
|
-
* which abstract away many browser irregularities. Check the documentation,
|
372
|
-
* grep for things, or ask on javascript@lists.facebook.com before writing yet
|
373
|
-
* another copy of "event || window.event".
|
374
|
-
*
|
375
|
-
*/
|
376
|
-
|
377
|
-
var _populated = false;
|
378
|
-
|
379
|
-
// Browsers
|
380
|
-
var _ie, _firefox, _opera, _webkit, _chrome;
|
381
|
-
|
382
|
-
// Actual IE browser for compatibility mode
|
383
|
-
var _ie_real_version;
|
384
|
-
|
385
|
-
// Platforms
|
386
|
-
var _osx, _windows, _linux, _android;
|
387
|
-
|
388
|
-
// Architectures
|
389
|
-
var _win64;
|
390
|
-
|
391
|
-
// Devices
|
392
|
-
var _iphone, _ipad, _native;
|
693
|
+
;// CONCATENATED MODULE: external "../shared"
|
694
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
695
|
+
var y = x => () => x
|
696
|
+
const shared_namespaceObject = x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager, ["checkOverflow"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.checkOverflow, ["resolveClassName"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.resolveClassName, ["useFormItem"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.useFormItem, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall });
|
697
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
698
|
+
function _typeof(o) {
|
699
|
+
"@babel/helpers - typeof";
|
393
700
|
|
394
|
-
|
701
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
702
|
+
return typeof o;
|
703
|
+
} : function (o) {
|
704
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
705
|
+
}, _typeof(o);
|
706
|
+
}
|
707
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
395
708
|
|
396
|
-
function
|
397
|
-
if (
|
398
|
-
|
709
|
+
function toPrimitive(t, r) {
|
710
|
+
if ("object" != _typeof(t) || !t) return t;
|
711
|
+
var e = t[Symbol.toPrimitive];
|
712
|
+
if (void 0 !== e) {
|
713
|
+
var i = e.call(t, r || "default");
|
714
|
+
if ("object" != _typeof(i)) return i;
|
715
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
399
716
|
}
|
717
|
+
return ("string" === r ? String : Number)(t);
|
718
|
+
}
|
719
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
400
720
|
|
401
|
-
_populated = true;
|
402
|
-
|
403
|
-
// To work around buggy JS libraries that can't handle multi-digit
|
404
|
-
// version numbers, Opera 10's user agent string claims it's Opera
|
405
|
-
// 9, then later includes a Version/X.Y field:
|
406
|
-
//
|
407
|
-
// Opera/9.80 (foo) Presto/2.2.15 Version/10.10
|
408
|
-
var uas = navigator.userAgent;
|
409
|
-
var agent = /(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(uas);
|
410
|
-
var os = /(Mac OS X)|(Windows)|(Linux)/.exec(uas);
|
411
|
-
|
412
|
-
_iphone = /\b(iPhone|iP[ao]d)/.exec(uas);
|
413
|
-
_ipad = /\b(iP[ao]d)/.exec(uas);
|
414
|
-
_android = /Android/i.exec(uas);
|
415
|
-
_native = /FBAN\/\w+;/i.exec(uas);
|
416
|
-
_mobile = /Mobile/i.exec(uas);
|
417
|
-
|
418
|
-
// Note that the IE team blog would have you believe you should be checking
|
419
|
-
// for 'Win64; x64'. But MSDN then reveals that you can actually be coming
|
420
|
-
// from either x64 or ia64; so ultimately, you should just check for Win64
|
421
|
-
// as in indicator of whether you're in 64-bit IE. 32-bit IE on 64-bit
|
422
|
-
// Windows will send 'WOW64' instead.
|
423
|
-
_win64 = !!(/Win64/.exec(uas));
|
424
|
-
|
425
|
-
if (agent) {
|
426
|
-
_ie = agent[1] ? parseFloat(agent[1]) : (
|
427
|
-
agent[5] ? parseFloat(agent[5]) : NaN);
|
428
|
-
// IE compatibility mode
|
429
|
-
if (_ie && document && document.documentMode) {
|
430
|
-
_ie = document.documentMode;
|
431
|
-
}
|
432
|
-
// grab the "true" ie version from the trident token if available
|
433
|
-
var trident = /(?:Trident\/(\d+.\d+))/.exec(uas);
|
434
|
-
_ie_real_version = trident ? parseFloat(trident[1]) + 4 : _ie;
|
435
|
-
|
436
|
-
_firefox = agent[2] ? parseFloat(agent[2]) : NaN;
|
437
|
-
_opera = agent[3] ? parseFloat(agent[3]) : NaN;
|
438
|
-
_webkit = agent[4] ? parseFloat(agent[4]) : NaN;
|
439
|
-
if (_webkit) {
|
440
|
-
// We do not add the regexp to the above test, because it will always
|
441
|
-
// match 'safari' only since 'AppleWebKit' appears before 'Chrome' in
|
442
|
-
// the userAgent string.
|
443
|
-
agent = /(?:Chrome\/(\d+\.\d+))/.exec(uas);
|
444
|
-
_chrome = agent && agent[1] ? parseFloat(agent[1]) : NaN;
|
445
|
-
} else {
|
446
|
-
_chrome = NaN;
|
447
|
-
}
|
448
|
-
} else {
|
449
|
-
_ie = _firefox = _opera = _chrome = _webkit = NaN;
|
450
|
-
}
|
451
721
|
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
// digits. If only one set of digits is found, returns just the major
|
458
|
-
// version number.
|
459
|
-
var ver = /(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(uas);
|
722
|
+
function toPropertyKey(t) {
|
723
|
+
var i = toPrimitive(t, "string");
|
724
|
+
return "symbol" == _typeof(i) ? i : String(i);
|
725
|
+
}
|
726
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
460
727
|
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
728
|
+
function _defineProperty(obj, key, value) {
|
729
|
+
key = toPropertyKey(key);
|
730
|
+
if (key in obj) {
|
731
|
+
Object.defineProperty(obj, key, {
|
732
|
+
value: value,
|
733
|
+
enumerable: true,
|
734
|
+
configurable: true,
|
735
|
+
writable: true
|
736
|
+
});
|
467
737
|
} else {
|
468
|
-
|
738
|
+
obj[key] = value;
|
469
739
|
}
|
740
|
+
return obj;
|
470
741
|
}
|
742
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
743
|
+
function _arrayLikeToArray(arr, len) {
|
744
|
+
if (len == null || len > arr.length) len = arr.length;
|
745
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
746
|
+
return arr2;
|
747
|
+
}
|
748
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
471
749
|
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
ie: function() {
|
481
|
-
return _populate() || _ie;
|
482
|
-
},
|
483
|
-
|
484
|
-
/**
|
485
|
-
* Check if we're in Internet Explorer compatibility mode.
|
486
|
-
*
|
487
|
-
* @return bool true if in compatibility mode, false if
|
488
|
-
* not compatibility mode or not ie
|
489
|
-
*/
|
490
|
-
ieCompatibilityMode: function() {
|
491
|
-
return _populate() || (_ie_real_version > _ie);
|
492
|
-
},
|
493
|
-
|
750
|
+
function _arrayWithoutHoles(arr) {
|
751
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
752
|
+
}
|
753
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
754
|
+
function _iterableToArray(iter) {
|
755
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
756
|
+
}
|
757
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
494
758
|
|
495
|
-
|
496
|
-
|
497
|
-
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
759
|
+
function _unsupportedIterableToArray(o, minLen) {
|
760
|
+
if (!o) return;
|
761
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
762
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
763
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
764
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
765
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
766
|
+
}
|
767
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
768
|
+
function _nonIterableSpread() {
|
769
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
770
|
+
}
|
771
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
503
772
|
|
504
|
-
/**
|
505
|
-
* Check if the UA is Firefox.
|
506
|
-
*
|
507
|
-
*
|
508
|
-
* @return float|NaN Version number (if match) or NaN.
|
509
|
-
*/
|
510
|
-
firefox: function() {
|
511
|
-
return _populate() || _firefox;
|
512
|
-
},
|
513
773
|
|
514
774
|
|
515
|
-
/**
|
516
|
-
* Check if the UA is Opera.
|
517
|
-
*
|
518
|
-
*
|
519
|
-
* @return float|NaN Version number (if match) or NaN.
|
520
|
-
*/
|
521
|
-
opera: function() {
|
522
|
-
return _populate() || _opera;
|
523
|
-
},
|
524
775
|
|
776
|
+
function _toConsumableArray(arr) {
|
777
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
778
|
+
}
|
779
|
+
;// CONCATENATED MODULE: external "vue"
|
780
|
+
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
781
|
+
var external_vue_y = x => () => x
|
782
|
+
const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["h"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.h, ["markRaw"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.markRaw, ["mergeProps"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.mergeProps, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["toRefs"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.toRefs, ["vModelText"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vModelText, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
783
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/common.ts
|
525
784
|
|
526
|
-
/**
|
527
|
-
* Check if the UA is WebKit.
|
528
|
-
*
|
529
|
-
*
|
530
|
-
* @return float|NaN Version number (if match) or NaN.
|
531
|
-
*/
|
532
|
-
webkit: function() {
|
533
|
-
return _populate() || _webkit;
|
534
|
-
},
|
535
785
|
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
/**
|
566
|
-
* Check if the user is running Mac OS X.
|
567
|
-
*
|
568
|
-
* @return float|bool Returns a float if a version number is detected,
|
569
|
-
* otherwise true/false.
|
570
|
-
*/
|
571
|
-
osx: function() {
|
572
|
-
return _populate() || _osx;
|
573
|
-
},
|
574
|
-
|
575
|
-
/**
|
576
|
-
* Check if the user is running Linux.
|
577
|
-
*
|
578
|
-
* @return bool `true' if the user's OS is some flavor of Linux.
|
579
|
-
*/
|
580
|
-
linux: function() {
|
581
|
-
return _populate() || _linux;
|
582
|
-
},
|
583
|
-
|
584
|
-
/**
|
585
|
-
* Check if the user is running on an iPhone or iPod platform.
|
586
|
-
*
|
587
|
-
* @return bool `true' if the user is running some flavor of the
|
588
|
-
* iPhone OS.
|
589
|
-
*/
|
590
|
-
iphone: function() {
|
591
|
-
return _populate() || _iphone;
|
592
|
-
},
|
593
|
-
|
594
|
-
mobile: function() {
|
595
|
-
return _populate() || (_iphone || _ipad || _android || _mobile);
|
596
|
-
},
|
597
|
-
|
598
|
-
nativeApp: function() {
|
599
|
-
// webviews inside of the native apps
|
600
|
-
return _populate() || _native;
|
601
|
-
},
|
602
|
-
|
603
|
-
android: function() {
|
604
|
-
return _populate() || _android;
|
605
|
-
},
|
606
|
-
|
607
|
-
ipad: function() {
|
608
|
-
return _populate() || _ipad;
|
609
|
-
}
|
610
|
-
};
|
611
|
-
|
612
|
-
module.exports = UserAgent_DEPRECATED;
|
613
|
-
|
614
|
-
|
615
|
-
/***/ }),
|
616
|
-
|
617
|
-
/***/ 8283:
|
618
|
-
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
619
|
-
|
620
|
-
module.exports = __webpack_require__(5022);
|
621
|
-
|
622
|
-
|
623
|
-
/***/ })
|
624
|
-
|
625
|
-
/******/ });
|
626
|
-
/************************************************************************/
|
627
|
-
/******/ // The module cache
|
628
|
-
/******/ var __webpack_module_cache__ = {};
|
629
|
-
/******/
|
630
|
-
/******/ // The require function
|
631
|
-
/******/ function __webpack_require__(moduleId) {
|
632
|
-
/******/ // Check if module is in cache
|
633
|
-
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
634
|
-
/******/ if (cachedModule !== undefined) {
|
635
|
-
/******/ return cachedModule.exports;
|
636
|
-
/******/ }
|
637
|
-
/******/ // Create a new module (and put it into the cache)
|
638
|
-
/******/ var module = __webpack_module_cache__[moduleId] = {
|
639
|
-
/******/ // no module.id needed
|
640
|
-
/******/ // no module.loaded needed
|
641
|
-
/******/ exports: {}
|
642
|
-
/******/ };
|
643
|
-
/******/
|
644
|
-
/******/ // Execute the module function
|
645
|
-
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
646
|
-
/******/
|
647
|
-
/******/ // Return the exports of the module
|
648
|
-
/******/ return module.exports;
|
649
|
-
/******/ }
|
650
|
-
/******/
|
651
|
-
/************************************************************************/
|
652
|
-
/******/ /* webpack/runtime/compat get default export */
|
653
|
-
/******/ (() => {
|
654
|
-
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
655
|
-
/******/ __webpack_require__.n = (module) => {
|
656
|
-
/******/ var getter = module && module.__esModule ?
|
657
|
-
/******/ () => (module['default']) :
|
658
|
-
/******/ () => (module);
|
659
|
-
/******/ __webpack_require__.d(getter, { a: getter });
|
660
|
-
/******/ return getter;
|
661
|
-
/******/ };
|
662
|
-
/******/ })();
|
663
|
-
/******/
|
664
|
-
/******/ /* webpack/runtime/define property getters */
|
665
|
-
/******/ (() => {
|
666
|
-
/******/ // define getter functions for harmony exports
|
667
|
-
/******/ __webpack_require__.d = (exports, definition) => {
|
668
|
-
/******/ for(var key in definition) {
|
669
|
-
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
670
|
-
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
671
|
-
/******/ }
|
672
|
-
/******/ }
|
673
|
-
/******/ };
|
674
|
-
/******/ })();
|
675
|
-
/******/
|
676
|
-
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
677
|
-
/******/ (() => {
|
678
|
-
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
679
|
-
/******/ })();
|
680
|
-
/******/
|
681
|
-
/************************************************************************/
|
682
|
-
var __webpack_exports__ = {};
|
683
|
-
|
684
|
-
// EXPORTS
|
685
|
-
__webpack_require__.d(__webpack_exports__, {
|
686
|
-
TagInput: () => (/* binding */ TagInput),
|
687
|
-
"default": () => (/* binding */ src),
|
688
|
-
useTagsOverflow: () => (/* reexport */ useTagsOverflow)
|
689
|
-
});
|
690
|
-
|
691
|
-
;// external "../shared"
|
692
|
-
var x = (y) => {
|
693
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
694
|
-
}
|
695
|
-
var y = (x) => (() => (x))
|
696
|
-
const shared_namespaceObject = x({ ["PropTypes"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.PropTypes), ["bkZIndexManager"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.bkZIndexManager), ["checkOverflow"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.checkOverflow), ["resolveClassName"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.resolveClassName), ["useFormItem"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.useFormItem), ["withInstall"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_shared_edbdfb03__.withInstall) });
|
697
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
698
|
-
function _typeof(o) {
|
699
|
-
"@babel/helpers - typeof";
|
700
|
-
|
701
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
702
|
-
return typeof o;
|
703
|
-
} : function (o) {
|
704
|
-
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
705
|
-
}, _typeof(o);
|
706
|
-
}
|
707
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
708
|
-
|
709
|
-
function toPrimitive(t, r) {
|
710
|
-
if ("object" != _typeof(t) || !t) return t;
|
711
|
-
var e = t[Symbol.toPrimitive];
|
712
|
-
if (void 0 !== e) {
|
713
|
-
var i = e.call(t, r || "default");
|
714
|
-
if ("object" != _typeof(i)) return i;
|
715
|
-
throw new TypeError("@@toPrimitive must return a primitive value.");
|
716
|
-
}
|
717
|
-
return ("string" === r ? String : Number)(t);
|
718
|
-
}
|
719
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
720
|
-
|
721
|
-
|
722
|
-
function toPropertyKey(t) {
|
723
|
-
var i = toPrimitive(t, "string");
|
724
|
-
return "symbol" == _typeof(i) ? i : String(i);
|
725
|
-
}
|
726
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
727
|
-
|
728
|
-
function _defineProperty(obj, key, value) {
|
729
|
-
key = toPropertyKey(key);
|
730
|
-
if (key in obj) {
|
731
|
-
Object.defineProperty(obj, key, {
|
732
|
-
value: value,
|
733
|
-
enumerable: true,
|
734
|
-
configurable: true,
|
735
|
-
writable: true
|
736
|
-
});
|
737
|
-
} else {
|
738
|
-
obj[key] = value;
|
739
|
-
}
|
740
|
-
return obj;
|
741
|
-
}
|
742
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
743
|
-
function _arrayLikeToArray(arr, len) {
|
744
|
-
if (len == null || len > arr.length) len = arr.length;
|
745
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
746
|
-
return arr2;
|
747
|
-
}
|
748
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
749
|
-
|
750
|
-
function _arrayWithoutHoles(arr) {
|
751
|
-
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
752
|
-
}
|
753
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
754
|
-
function _iterableToArray(iter) {
|
755
|
-
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
756
|
-
}
|
757
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
758
|
-
|
759
|
-
function _unsupportedIterableToArray(o, minLen) {
|
760
|
-
if (!o) return;
|
761
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
762
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
763
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
764
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
765
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
766
|
-
}
|
767
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
768
|
-
function _nonIterableSpread() {
|
769
|
-
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
770
|
-
}
|
771
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
function _toConsumableArray(arr) {
|
777
|
-
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
778
|
-
}
|
779
|
-
;// external "vue"
|
780
|
-
var external_vue_x = (y) => {
|
781
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
782
|
-
}
|
783
|
-
var external_vue_y = (x) => (() => (x))
|
784
|
-
const external_vue_namespaceObject = external_vue_x({ ["computed"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.computed), ["createTextVNode"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode), ["createVNode"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.createVNode), ["defineComponent"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.defineComponent), ["h"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.h), ["markRaw"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.markRaw), ["mergeProps"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.mergeProps), ["nextTick"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.nextTick), ["onMounted"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.onMounted), ["reactive"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.reactive), ["ref"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.ref), ["render"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.render), ["resolveDirective"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective), ["toRefs"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.toRefs), ["vModelText"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.vModelText), ["vShow"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.vShow), ["watch"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.watch), ["withDirectives"]: () => (__WEBPACK_EXTERNAL_MODULE_vue__.withDirectives) });
|
785
|
-
;// ../../packages/tag-input/src/common.ts
|
786
|
-
|
787
|
-
|
788
|
-
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
789
|
-
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
790
|
-
/*
|
791
|
-
* Tencent is pleased to support the open source community by making
|
792
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
793
|
-
*
|
794
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
795
|
-
*
|
796
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
797
|
-
*
|
798
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
799
|
-
*
|
800
|
-
* ---------------------------------------------------
|
801
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
802
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
803
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
804
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
805
|
-
*
|
806
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
807
|
-
* the Software.
|
808
|
-
*
|
809
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
810
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
811
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
812
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
813
|
-
* IN THE SOFTWARE.
|
814
|
-
*/
|
786
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
787
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
788
|
+
/*
|
789
|
+
* Tencent is pleased to support the open source community by making
|
790
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
791
|
+
*
|
792
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
793
|
+
*
|
794
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
795
|
+
*
|
796
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
797
|
+
*
|
798
|
+
* ---------------------------------------------------
|
799
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
800
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
801
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
802
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
803
|
+
*
|
804
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
805
|
+
* the Software.
|
806
|
+
*
|
807
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
808
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
809
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
810
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
811
|
+
* IN THE SOFTWARE.
|
812
|
+
*/
|
815
813
|
|
816
814
|
var INPUT_MIN_WIDTH = 10;
|
817
815
|
function useDebouncedRef(value) {
|
@@ -963,11 +961,11 @@ var useTagsOverflow = function useTagsOverflow(tagInputRef, collapseTags, select
|
|
963
961
|
overflowTagIndex: overflowTagIndex
|
964
962
|
};
|
965
963
|
};
|
966
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
964
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js
|
967
965
|
function _arrayWithHoles(arr) {
|
968
966
|
if (Array.isArray(arr)) return arr;
|
969
967
|
}
|
970
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
968
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js
|
971
969
|
function _iterableToArrayLimit(r, l) {
|
972
970
|
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
973
971
|
if (null != t) {
|
@@ -995,11 +993,11 @@ function _iterableToArrayLimit(r, l) {
|
|
995
993
|
return a;
|
996
994
|
}
|
997
995
|
}
|
998
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
996
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js
|
999
997
|
function _nonIterableRest() {
|
1000
998
|
throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1001
999
|
}
|
1002
|
-
;// ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
1000
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js
|
1003
1001
|
|
1004
1002
|
|
1005
1003
|
|
@@ -1007,13 +1005,11 @@ function _nonIterableRest() {
|
|
1007
1005
|
function _slicedToArray(arr, i) {
|
1008
1006
|
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest();
|
1009
1007
|
}
|
1010
|
-
;// external "../config-provider"
|
1011
|
-
var config_provider_x = (y)
|
1012
|
-
|
1013
|
-
}
|
1014
|
-
|
1015
|
-
const config_provider_namespaceObject = config_provider_x({ ["useLocale"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.useLocale), ["usePrefix"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix) });
|
1016
|
-
;// ../../packages/directives/src/clickoutside.ts
|
1008
|
+
;// CONCATENATED MODULE: external "../config-provider"
|
1009
|
+
var config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1010
|
+
var config_provider_y = x => () => x
|
1011
|
+
const config_provider_namespaceObject = config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_config_provider_fe8577a3__.usePrefix });
|
1012
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/clickoutside.ts
|
1017
1013
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = clickoutside_unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; }
|
1018
1014
|
function clickoutside_unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return clickoutside_arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return clickoutside_arrayLikeToArray(o, minLen); }
|
1019
1015
|
function clickoutside_arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
@@ -1021,7 +1017,7 @@ function clickoutside_arrayLikeToArray(arr, len) { if (len == null || len > arr.
|
|
1021
1017
|
* Tencent is pleased to support the open source community by making
|
1022
1018
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1023
1019
|
*
|
1024
|
-
* Copyright (C)
|
1020
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1025
1021
|
*
|
1026
1022
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1027
1023
|
*
|
@@ -1139,19 +1135,17 @@ ClickOutside.install = function (app) {
|
|
1139
1135
|
app.directive('bkTooltips', ClickOutside);
|
1140
1136
|
};
|
1141
1137
|
/* harmony default export */ const clickoutside = ((/* unused pure expression or super */ null && (ClickOutside)));
|
1142
|
-
;// external "../popover"
|
1143
|
-
var popover_x = (y)
|
1144
|
-
|
1145
|
-
}
|
1146
|
-
|
1147
|
-
const popover_namespaceObject = popover_x({ ["$bkPopover"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__.$bkPopover), ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__["default"]) });
|
1148
|
-
;// ../../packages/directives/src/ellipsis.ts
|
1138
|
+
;// CONCATENATED MODULE: external "../popover"
|
1139
|
+
var popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1140
|
+
var popover_y = x => () => x
|
1141
|
+
const popover_namespaceObject = popover_x({ ["$bkPopover"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__.$bkPopover, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_popover_9b03f19d__["default"] });
|
1142
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/ellipsis.ts
|
1149
1143
|
|
1150
1144
|
/*
|
1151
1145
|
* Tencent is pleased to support the open source community by making
|
1152
1146
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1153
1147
|
*
|
1154
|
-
* Copyright (C)
|
1148
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1155
1149
|
*
|
1156
1150
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1157
1151
|
*
|
@@ -1256,14 +1250,14 @@ var ellipsis = {
|
|
1256
1250
|
};
|
1257
1251
|
/* harmony default export */ const src_ellipsis = ((/* unused pure expression or super */ null && (ellipsis)));
|
1258
1252
|
// EXTERNAL MODULE: ../../node_modules/normalize-wheel/index.js
|
1259
|
-
var normalize_wheel = __webpack_require__(
|
1253
|
+
var normalize_wheel = __webpack_require__(2439);
|
1260
1254
|
var normalize_wheel_default = /*#__PURE__*/__webpack_require__.n(normalize_wheel);
|
1261
|
-
;// ../../packages/directives/src/mousewheel.ts
|
1255
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/mousewheel.ts
|
1262
1256
|
/*
|
1263
1257
|
* Tencent is pleased to support the open source community by making
|
1264
1258
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1265
1259
|
*
|
1266
|
-
* Copyright (C)
|
1260
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1267
1261
|
*
|
1268
1262
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1269
1263
|
*
|
@@ -1300,13 +1294,11 @@ var mousewheel = {
|
|
1300
1294
|
}
|
1301
1295
|
};
|
1302
1296
|
/* harmony default export */ const src_mousewheel = ((/* unused pure expression or super */ null && (mousewheel)));
|
1303
|
-
;// external "@popperjs/core"
|
1304
|
-
var core_x = (y)
|
1305
|
-
|
1306
|
-
}
|
1307
|
-
|
1308
|
-
const core_namespaceObject = core_x({ ["createPopper"]: () => (__WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__.createPopper) });
|
1309
|
-
;// ../../packages/directives/src/tooltips.ts
|
1297
|
+
;// CONCATENATED MODULE: external "@popperjs/core"
|
1298
|
+
var core_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1299
|
+
var core_y = x => () => x
|
1300
|
+
const core_namespaceObject = core_x({ ["createPopper"]: () => __WEBPACK_EXTERNAL_MODULE__popperjs_core_a5c7319c__.createPopper });
|
1301
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/tooltips.ts
|
1310
1302
|
|
1311
1303
|
|
1312
1304
|
|
@@ -1316,7 +1308,7 @@ function tooltips_objectSpread(e) { for (var r = 1; r < arguments.length; r++) {
|
|
1316
1308
|
* Tencent is pleased to support the open source community by making
|
1317
1309
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1318
1310
|
*
|
1319
|
-
* Copyright (C)
|
1311
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1320
1312
|
*
|
1321
1313
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1322
1314
|
*
|
@@ -1371,9 +1363,6 @@ var tooltips = {
|
|
1371
1363
|
hide(el);
|
1372
1364
|
}, 100);
|
1373
1365
|
});
|
1374
|
-
el.addEventListener('click', function () {
|
1375
|
-
hide(el);
|
1376
|
-
});
|
1377
1366
|
popper.addEventListener('mouseleave', function () {
|
1378
1367
|
clearTimeout(delayTimeout);
|
1379
1368
|
hideTimeout = setTimeout(function () {
|
@@ -1387,7 +1376,7 @@ var tooltips = {
|
|
1387
1376
|
show(el);
|
1388
1377
|
clearTimeout(delayTimeout);
|
1389
1378
|
}, opts.delay);
|
1390
|
-
} else if (popper.hasAttribute('data-show')) {
|
1379
|
+
} else if (!el.contains(event.target) && popper.hasAttribute('data-show')) {
|
1391
1380
|
hide(el);
|
1392
1381
|
}
|
1393
1382
|
});
|
@@ -1428,264 +1417,1596 @@ function initOptions() {
|
|
1428
1417
|
onShow: function onShow() {},
|
1429
1418
|
onHide: function onHide() {}
|
1430
1419
|
};
|
1431
|
-
return defaultOpts;
|
1432
|
-
}
|
1433
|
-
/**
|
1434
|
-
* 获取配置
|
1435
|
-
* @returns tooltips配置
|
1436
|
-
*/
|
1437
|
-
function getOpts(binding) {
|
1438
|
-
var opts = initOptions();
|
1439
|
-
if (_typeof(binding.value) === 'object') {
|
1440
|
-
Object.assign(opts, binding.value);
|
1441
|
-
} else {
|
1442
|
-
opts.content = binding.value;
|
1443
|
-
}
|
1444
|
-
return opts;
|
1445
|
-
}
|
1446
|
-
/**
|
1447
|
-
* 创建tooltips DOM
|
1448
|
-
* @param opts
|
1449
|
-
* @returns
|
1450
|
-
*/
|
1451
|
-
function renderContext(value, content) {
|
1452
|
-
if (typeof value === 'string') {
|
1453
|
-
content.innerText = value;
|
1454
|
-
} else {
|
1455
|
-
// 如果 content 是 Vue 组件的实例,则挂载它
|
1456
|
-
var container = document.createElement('div');
|
1457
|
-
var vnode = (0,external_vue_namespaceObject.h)(value);
|
1458
|
-
(0,external_vue_namespaceObject.render)(vnode, container);
|
1459
|
-
content.innerHTML = container.innerHTML;
|
1460
|
-
}
|
1461
|
-
}
|
1462
|
-
function renderContent(opts) {
|
1463
|
-
var value = opts.content,
|
1464
|
-
hasArrow = opts.arrow,
|
1465
|
-
theme = opts.theme,
|
1466
|
-
extCls = opts.extCls;
|
1467
|
-
var isLight = theme === 'light';
|
1468
|
-
var zIndex = shared_namespaceObject.bkZIndexManager.getPopperIndex();
|
1469
|
-
var content = document.createElement('div');
|
1470
|
-
var prefix = document.documentElement.style.getPropertyValue('--bk-prefix') || 'bk';
|
1471
|
-
content.className = "".concat((0,shared_namespaceObject.resolveClassName)('popper', prefix), " ").concat(isLight ? 'light' : 'dark', " ").concat(extCls);
|
1472
|
-
content.innerText = value;
|
1473
|
-
content.style.zIndex = String(zIndex);
|
1474
|
-
renderContext(value, content);
|
1475
|
-
if (hasArrow) {
|
1476
|
-
var arrow = renderArrow();
|
1477
|
-
content.appendChild(arrow);
|
1478
|
-
}
|
1479
|
-
return content;
|
1480
|
-
}
|
1481
|
-
/**
|
1482
|
-
* 渲染箭头dom
|
1483
|
-
* @returns arrow DOM
|
1484
|
-
*/
|
1485
|
-
function renderArrow() {
|
1486
|
-
var arrow = document.createElement('div');
|
1487
|
-
var prefix = document.documentElement.style.getPropertyValue('--bk-prefix') || 'bk';
|
1488
|
-
arrow.className = (0,shared_namespaceObject.resolveClassName)('popper-arrow', prefix);
|
1489
|
-
arrow.setAttribute('data-popper-arrow', '');
|
1490
|
-
return arrow;
|
1491
|
-
}
|
1492
|
-
/**
|
1493
|
-
* 创建popper实例
|
1494
|
-
* @param el
|
1495
|
-
* @param popper
|
1496
|
-
* @returns popper实例
|
1497
|
-
*/
|
1498
|
-
function createPopperInstance(el, popper) {
|
1499
|
-
var _nodeList$get = tooltips_nodeList.get(el),
|
1500
|
-
opts = _nodeList$get.opts;
|
1501
|
-
var placement = opts.placement,
|
1502
|
-
distance = opts.distance,
|
1503
|
-
sameWidth = opts.sameWidth;
|
1504
|
-
var popperInstance = (0,core_namespaceObject.createPopper)(el, popper, {
|
1505
|
-
placement: placement,
|
1506
|
-
modifiers: [{
|
1507
|
-
name: 'offset',
|
1508
|
-
options: {
|
1509
|
-
offset: [0, distance]
|
1420
|
+
return defaultOpts;
|
1421
|
+
}
|
1422
|
+
/**
|
1423
|
+
* 获取配置
|
1424
|
+
* @returns tooltips配置
|
1425
|
+
*/
|
1426
|
+
function getOpts(binding) {
|
1427
|
+
var opts = initOptions();
|
1428
|
+
if (_typeof(binding.value) === 'object') {
|
1429
|
+
Object.assign(opts, binding.value);
|
1430
|
+
} else {
|
1431
|
+
opts.content = binding.value;
|
1432
|
+
}
|
1433
|
+
return opts;
|
1434
|
+
}
|
1435
|
+
/**
|
1436
|
+
* 创建tooltips DOM
|
1437
|
+
* @param opts
|
1438
|
+
* @returns
|
1439
|
+
*/
|
1440
|
+
function renderContext(value, content) {
|
1441
|
+
if (typeof value === 'string') {
|
1442
|
+
content.innerText = value;
|
1443
|
+
} else {
|
1444
|
+
// 如果 content 是 Vue 组件的实例,则挂载它
|
1445
|
+
var container = document.createElement('div');
|
1446
|
+
var vnode = (0,external_vue_namespaceObject.h)(value);
|
1447
|
+
(0,external_vue_namespaceObject.render)(vnode, container);
|
1448
|
+
content.innerHTML = container.innerHTML;
|
1449
|
+
}
|
1450
|
+
}
|
1451
|
+
function renderContent(opts) {
|
1452
|
+
var value = opts.content,
|
1453
|
+
hasArrow = opts.arrow,
|
1454
|
+
theme = opts.theme,
|
1455
|
+
extCls = opts.extCls;
|
1456
|
+
var isLight = theme === 'light';
|
1457
|
+
var zIndex = shared_namespaceObject.bkZIndexManager.getPopperIndex();
|
1458
|
+
var content = document.createElement('div');
|
1459
|
+
var prefix = document.documentElement.style.getPropertyValue('--bk-prefix') || 'bk';
|
1460
|
+
content.className = "".concat((0,shared_namespaceObject.resolveClassName)('popper', prefix), " ").concat(isLight ? 'light' : 'dark', " ").concat(extCls);
|
1461
|
+
content.innerText = value;
|
1462
|
+
content.style.zIndex = String(zIndex);
|
1463
|
+
renderContext(value, content);
|
1464
|
+
if (hasArrow) {
|
1465
|
+
var arrow = renderArrow();
|
1466
|
+
content.appendChild(arrow);
|
1467
|
+
}
|
1468
|
+
return content;
|
1469
|
+
}
|
1470
|
+
/**
|
1471
|
+
* 渲染箭头dom
|
1472
|
+
* @returns arrow DOM
|
1473
|
+
*/
|
1474
|
+
function renderArrow() {
|
1475
|
+
var arrow = document.createElement('div');
|
1476
|
+
var prefix = document.documentElement.style.getPropertyValue('--bk-prefix') || 'bk';
|
1477
|
+
arrow.className = (0,shared_namespaceObject.resolveClassName)('popper-arrow', prefix);
|
1478
|
+
arrow.setAttribute('data-popper-arrow', '');
|
1479
|
+
return arrow;
|
1480
|
+
}
|
1481
|
+
/**
|
1482
|
+
* 创建popper实例
|
1483
|
+
* @param el
|
1484
|
+
* @param popper
|
1485
|
+
* @returns popper实例
|
1486
|
+
*/
|
1487
|
+
function createPopperInstance(el, popper) {
|
1488
|
+
var _nodeList$get = tooltips_nodeList.get(el),
|
1489
|
+
opts = _nodeList$get.opts;
|
1490
|
+
var placement = opts.placement,
|
1491
|
+
distance = opts.distance,
|
1492
|
+
sameWidth = opts.sameWidth;
|
1493
|
+
var popperInstance = (0,core_namespaceObject.createPopper)(el, popper, {
|
1494
|
+
placement: placement,
|
1495
|
+
modifiers: [{
|
1496
|
+
name: 'offset',
|
1497
|
+
options: {
|
1498
|
+
offset: [0, distance]
|
1499
|
+
}
|
1500
|
+
}, {
|
1501
|
+
name: 'arrow',
|
1502
|
+
options: {
|
1503
|
+
padding: 5
|
1504
|
+
}
|
1505
|
+
}].concat(_toConsumableArray(sameWidth ? [{
|
1506
|
+
name: 'sameWidth',
|
1507
|
+
enabled: true,
|
1508
|
+
phase: 'beforeWrite',
|
1509
|
+
requires: ['computeStyles'],
|
1510
|
+
fn: function fn(_ref) {
|
1511
|
+
var state = _ref.state;
|
1512
|
+
state.styles.popper.width = "".concat(state.rects.reference.width, "px");
|
1513
|
+
},
|
1514
|
+
effect: function effect(_ref2) {
|
1515
|
+
var state = _ref2.state;
|
1516
|
+
state.elements.popper.style.overflowWrap = 'break-word';
|
1517
|
+
state.elements.popper.style.width = "".concat(state.elements.reference.offsetWidth, "px");
|
1518
|
+
}
|
1519
|
+
}] : []))
|
1520
|
+
});
|
1521
|
+
return popperInstance;
|
1522
|
+
}
|
1523
|
+
/**
|
1524
|
+
* 显示
|
1525
|
+
* @param el
|
1526
|
+
*/
|
1527
|
+
function show(el) {
|
1528
|
+
var _nodeList$get2 = tooltips_nodeList.get(el),
|
1529
|
+
popper = _nodeList$get2.popper,
|
1530
|
+
opts = _nodeList$get2.opts;
|
1531
|
+
var disabled = opts.disabled,
|
1532
|
+
content = opts.content,
|
1533
|
+
hasArrow = opts.arrow,
|
1534
|
+
onShow = opts.onShow,
|
1535
|
+
boundary = opts.boundary,
|
1536
|
+
_opts$modifiers = opts.modifiers,
|
1537
|
+
modifiers = _opts$modifiers === void 0 ? [] : _opts$modifiers;
|
1538
|
+
if (disabled) return;
|
1539
|
+
renderContext(content, popper);
|
1540
|
+
if (hasArrow) {
|
1541
|
+
var arrow = renderArrow();
|
1542
|
+
popper.appendChild(arrow);
|
1543
|
+
}
|
1544
|
+
var container = document.body;
|
1545
|
+
if (boundary) {
|
1546
|
+
if (boundary === 'parent') {
|
1547
|
+
container = el.parentElement;
|
1548
|
+
} else if (boundary instanceof HTMLElement) {
|
1549
|
+
container = boundary;
|
1550
|
+
}
|
1551
|
+
}
|
1552
|
+
container.appendChild(popper);
|
1553
|
+
var popperInstance = createPopperInstance(el, popper);
|
1554
|
+
onShow();
|
1555
|
+
// Make the tooltip visible
|
1556
|
+
popper.setAttribute('data-show', '');
|
1557
|
+
// Enable the event listeners
|
1558
|
+
popperInstance.setOptions(function (options) {
|
1559
|
+
return tooltips_objectSpread(tooltips_objectSpread({}, options), {}, {
|
1560
|
+
modifiers: [].concat(_toConsumableArray(options.modifiers), _toConsumableArray(modifiers), [{
|
1561
|
+
name: 'eventListeners',
|
1562
|
+
enabled: true
|
1563
|
+
}])
|
1564
|
+
});
|
1565
|
+
});
|
1566
|
+
// Update its position
|
1567
|
+
popperInstance.forceUpdate();
|
1568
|
+
tooltips_nodeList.get(el).popperInstance = popperInstance;
|
1569
|
+
}
|
1570
|
+
/**
|
1571
|
+
* 隐藏
|
1572
|
+
* @param el
|
1573
|
+
*/
|
1574
|
+
function hide(el) {
|
1575
|
+
if (!tooltips_nodeList.get(el)) return;
|
1576
|
+
var _nodeList$get3 = tooltips_nodeList.get(el),
|
1577
|
+
popper = _nodeList$get3.popper,
|
1578
|
+
popperInstance = _nodeList$get3.popperInstance,
|
1579
|
+
opts = _nodeList$get3.opts;
|
1580
|
+
var onHide = opts.onHide;
|
1581
|
+
if (popper && document.body.contains(popper)) {
|
1582
|
+
var _popper$parentNode;
|
1583
|
+
popper.removeAttribute('data-show');
|
1584
|
+
popperInstance === null || popperInstance === void 0 || popperInstance.destroy();
|
1585
|
+
popper === null || popper === void 0 || (_popper$parentNode = popper.parentNode) === null || _popper$parentNode === void 0 || _popper$parentNode.removeChild(popper);
|
1586
|
+
onHide();
|
1587
|
+
}
|
1588
|
+
}
|
1589
|
+
/* harmony default export */ const src_tooltips = (tooltips);
|
1590
|
+
;// CONCATENATED MODULE: external "../loading"
|
1591
|
+
var external_loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1592
|
+
var external_loading_y = x => () => x
|
1593
|
+
const external_loading_namespaceObject = external_loading_x({ });
|
1594
|
+
;// CONCATENATED MODULE: external "../overflow-title"
|
1595
|
+
var external_overflow_title_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1596
|
+
var external_overflow_title_y = x => () => x
|
1597
|
+
const external_overflow_title_namespaceObject = external_overflow_title_x({ });
|
1598
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/index.ts
|
1599
|
+
/*
|
1600
|
+
* Tencent is pleased to support the open source community by making
|
1601
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1602
|
+
*
|
1603
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1604
|
+
*
|
1605
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1606
|
+
*
|
1607
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1608
|
+
*
|
1609
|
+
* ---------------------------------------------------
|
1610
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1611
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1612
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1613
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1614
|
+
*
|
1615
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1616
|
+
* the Software.
|
1617
|
+
*
|
1618
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1619
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1620
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1621
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1622
|
+
* IN THE SOFTWARE.
|
1623
|
+
*/
|
1624
|
+
|
1625
|
+
|
1626
|
+
|
1627
|
+
|
1628
|
+
|
1629
|
+
|
1630
|
+
// export { createInstance as bkEllipsisInstance } from './ellipsis';
|
1631
|
+
;// CONCATENATED MODULE: external "../icon"
|
1632
|
+
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1633
|
+
var icon_y = x => () => x
|
1634
|
+
const icon_namespaceObject = icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error });
|
1635
|
+
;// CONCATENATED MODULE: external "../loading"
|
1636
|
+
var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1637
|
+
var loading_y = x => () => x
|
1638
|
+
const loading_namespaceObject = loading_x({ ["BkLoadingSize"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingSize, ["default"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__["default"] });
|
1639
|
+
;// CONCATENATED MODULE: external "../loading/loading.less"
|
1640
|
+
var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1641
|
+
var loading_less_y = x => () => x
|
1642
|
+
const loading_less_namespaceObject = loading_less_x({ });
|
1643
|
+
;// CONCATENATED MODULE: external "../popover/popover.less"
|
1644
|
+
var popover_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1645
|
+
var popover_less_y = x => () => x
|
1646
|
+
const popover_less_namespaceObject = popover_less_x({ });
|
1647
|
+
;// CONCATENATED MODULE: external "lodash/debounce"
|
1648
|
+
var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1649
|
+
var debounce_y = x => () => x
|
1650
|
+
const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
|
1651
|
+
;// CONCATENATED MODULE: external "lodash/trim"
|
1652
|
+
var trim_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1653
|
+
var trim_y = x => () => x
|
1654
|
+
const trim_namespaceObject = trim_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_trim_5cdad98c__["default"] });
|
1655
|
+
;// CONCATENATED MODULE: ../../node_modules/dompurify/dist/purify.es.mjs
|
1656
|
+
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
|
1657
|
+
|
1658
|
+
const {
|
1659
|
+
entries,
|
1660
|
+
setPrototypeOf,
|
1661
|
+
isFrozen,
|
1662
|
+
getPrototypeOf,
|
1663
|
+
getOwnPropertyDescriptor
|
1664
|
+
} = Object;
|
1665
|
+
let {
|
1666
|
+
freeze,
|
1667
|
+
seal,
|
1668
|
+
create
|
1669
|
+
} = Object; // eslint-disable-line import/no-mutable-exports
|
1670
|
+
let {
|
1671
|
+
apply,
|
1672
|
+
construct
|
1673
|
+
} = typeof Reflect !== 'undefined' && Reflect;
|
1674
|
+
if (!freeze) {
|
1675
|
+
freeze = function freeze(x) {
|
1676
|
+
return x;
|
1677
|
+
};
|
1678
|
+
}
|
1679
|
+
if (!seal) {
|
1680
|
+
seal = function seal(x) {
|
1681
|
+
return x;
|
1682
|
+
};
|
1683
|
+
}
|
1684
|
+
if (!apply) {
|
1685
|
+
apply = function apply(fun, thisValue, args) {
|
1686
|
+
return fun.apply(thisValue, args);
|
1687
|
+
};
|
1688
|
+
}
|
1689
|
+
if (!construct) {
|
1690
|
+
construct = function construct(Func, args) {
|
1691
|
+
return new Func(...args);
|
1692
|
+
};
|
1693
|
+
}
|
1694
|
+
const arrayForEach = unapply(Array.prototype.forEach);
|
1695
|
+
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
1696
|
+
const arrayPop = unapply(Array.prototype.pop);
|
1697
|
+
const arrayPush = unapply(Array.prototype.push);
|
1698
|
+
const arraySplice = unapply(Array.prototype.splice);
|
1699
|
+
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
1700
|
+
const stringToString = unapply(String.prototype.toString);
|
1701
|
+
const stringMatch = unapply(String.prototype.match);
|
1702
|
+
const stringReplace = unapply(String.prototype.replace);
|
1703
|
+
const stringIndexOf = unapply(String.prototype.indexOf);
|
1704
|
+
const stringTrim = unapply(String.prototype.trim);
|
1705
|
+
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
1706
|
+
const regExpTest = unapply(RegExp.prototype.test);
|
1707
|
+
const typeErrorCreate = unconstruct(TypeError);
|
1708
|
+
/**
|
1709
|
+
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
1710
|
+
*
|
1711
|
+
* @param func - The function to be wrapped and called.
|
1712
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
1713
|
+
*/
|
1714
|
+
function unapply(func) {
|
1715
|
+
return function (thisArg) {
|
1716
|
+
if (thisArg instanceof RegExp) {
|
1717
|
+
thisArg.lastIndex = 0;
|
1718
|
+
}
|
1719
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
1720
|
+
args[_key - 1] = arguments[_key];
|
1721
|
+
}
|
1722
|
+
return apply(func, thisArg, args);
|
1723
|
+
};
|
1724
|
+
}
|
1725
|
+
/**
|
1726
|
+
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
1727
|
+
*
|
1728
|
+
* @param func - The constructor function to be wrapped and called.
|
1729
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
1730
|
+
*/
|
1731
|
+
function unconstruct(func) {
|
1732
|
+
return function () {
|
1733
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
1734
|
+
args[_key2] = arguments[_key2];
|
1735
|
+
}
|
1736
|
+
return construct(func, args);
|
1737
|
+
};
|
1738
|
+
}
|
1739
|
+
/**
|
1740
|
+
* Add properties to a lookup table
|
1741
|
+
*
|
1742
|
+
* @param set - The set to which elements will be added.
|
1743
|
+
* @param array - The array containing elements to be added to the set.
|
1744
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
1745
|
+
* @returns The modified set with added elements.
|
1746
|
+
*/
|
1747
|
+
function addToSet(set, array) {
|
1748
|
+
let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
1749
|
+
if (setPrototypeOf) {
|
1750
|
+
// Make 'in' and truthy checks like Boolean(set.constructor)
|
1751
|
+
// independent of any properties defined on Object.prototype.
|
1752
|
+
// Prevent prototype setters from intercepting set as a this value.
|
1753
|
+
setPrototypeOf(set, null);
|
1754
|
+
}
|
1755
|
+
let l = array.length;
|
1756
|
+
while (l--) {
|
1757
|
+
let element = array[l];
|
1758
|
+
if (typeof element === 'string') {
|
1759
|
+
const lcElement = transformCaseFunc(element);
|
1760
|
+
if (lcElement !== element) {
|
1761
|
+
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
1762
|
+
if (!isFrozen(array)) {
|
1763
|
+
array[l] = lcElement;
|
1764
|
+
}
|
1765
|
+
element = lcElement;
|
1766
|
+
}
|
1767
|
+
}
|
1768
|
+
set[element] = true;
|
1769
|
+
}
|
1770
|
+
return set;
|
1771
|
+
}
|
1772
|
+
/**
|
1773
|
+
* Clean up an array to harden against CSPP
|
1774
|
+
*
|
1775
|
+
* @param array - The array to be cleaned.
|
1776
|
+
* @returns The cleaned version of the array
|
1777
|
+
*/
|
1778
|
+
function cleanArray(array) {
|
1779
|
+
for (let index = 0; index < array.length; index++) {
|
1780
|
+
const isPropertyExist = objectHasOwnProperty(array, index);
|
1781
|
+
if (!isPropertyExist) {
|
1782
|
+
array[index] = null;
|
1783
|
+
}
|
1784
|
+
}
|
1785
|
+
return array;
|
1786
|
+
}
|
1787
|
+
/**
|
1788
|
+
* Shallow clone an object
|
1789
|
+
*
|
1790
|
+
* @param object - The object to be cloned.
|
1791
|
+
* @returns A new object that copies the original.
|
1792
|
+
*/
|
1793
|
+
function clone(object) {
|
1794
|
+
const newObject = create(null);
|
1795
|
+
for (const [property, value] of entries(object)) {
|
1796
|
+
const isPropertyExist = objectHasOwnProperty(object, property);
|
1797
|
+
if (isPropertyExist) {
|
1798
|
+
if (Array.isArray(value)) {
|
1799
|
+
newObject[property] = cleanArray(value);
|
1800
|
+
} else if (value && typeof value === 'object' && value.constructor === Object) {
|
1801
|
+
newObject[property] = clone(value);
|
1802
|
+
} else {
|
1803
|
+
newObject[property] = value;
|
1804
|
+
}
|
1805
|
+
}
|
1806
|
+
}
|
1807
|
+
return newObject;
|
1808
|
+
}
|
1809
|
+
/**
|
1810
|
+
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
1811
|
+
*
|
1812
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
1813
|
+
* @param prop - The property name for which to find the getter function.
|
1814
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
1815
|
+
*/
|
1816
|
+
function lookupGetter(object, prop) {
|
1817
|
+
while (object !== null) {
|
1818
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
1819
|
+
if (desc) {
|
1820
|
+
if (desc.get) {
|
1821
|
+
return unapply(desc.get);
|
1822
|
+
}
|
1823
|
+
if (typeof desc.value === 'function') {
|
1824
|
+
return unapply(desc.value);
|
1825
|
+
}
|
1826
|
+
}
|
1827
|
+
object = getPrototypeOf(object);
|
1828
|
+
}
|
1829
|
+
function fallbackValue() {
|
1830
|
+
return null;
|
1831
|
+
}
|
1832
|
+
return fallbackValue;
|
1833
|
+
}
|
1834
|
+
|
1835
|
+
const html$1 = freeze(['a', 'abbr', 'acronym', 'address', 'area', 'article', 'aside', 'audio', 'b', 'bdi', 'bdo', 'big', 'blink', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'center', 'cite', 'code', 'col', 'colgroup', 'content', 'data', 'datalist', 'dd', 'decorator', 'del', 'details', 'dfn', 'dialog', 'dir', 'div', 'dl', 'dt', 'element', 'em', 'fieldset', 'figcaption', 'figure', 'font', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'img', 'input', 'ins', 'kbd', 'label', 'legend', 'li', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meter', 'nav', 'nobr', 'ol', 'optgroup', 'option', 'output', 'p', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'section', 'select', 'shadow', 'small', 'source', 'spacer', 'span', 'strike', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'template', 'textarea', 'tfoot', 'th', 'thead', 'time', 'tr', 'track', 'tt', 'u', 'ul', 'var', 'video', 'wbr']);
|
1836
|
+
const svg$1 = freeze(['svg', 'a', 'altglyph', 'altglyphdef', 'altglyphitem', 'animatecolor', 'animatemotion', 'animatetransform', 'circle', 'clippath', 'defs', 'desc', 'ellipse', 'filter', 'font', 'g', 'glyph', 'glyphref', 'hkern', 'image', 'line', 'lineargradient', 'marker', 'mask', 'metadata', 'mpath', 'path', 'pattern', 'polygon', 'polyline', 'radialgradient', 'rect', 'stop', 'style', 'switch', 'symbol', 'text', 'textpath', 'title', 'tref', 'tspan', 'view', 'vkern']);
|
1837
|
+
const svgFilters = freeze(['feBlend', 'feColorMatrix', 'feComponentTransfer', 'feComposite', 'feConvolveMatrix', 'feDiffuseLighting', 'feDisplacementMap', 'feDistantLight', 'feDropShadow', 'feFlood', 'feFuncA', 'feFuncB', 'feFuncG', 'feFuncR', 'feGaussianBlur', 'feImage', 'feMerge', 'feMergeNode', 'feMorphology', 'feOffset', 'fePointLight', 'feSpecularLighting', 'feSpotLight', 'feTile', 'feTurbulence']);
|
1838
|
+
// List of SVG elements that are disallowed by default.
|
1839
|
+
// We still need to know them so that we can do namespace
|
1840
|
+
// checks properly in case one wants to add them to
|
1841
|
+
// allow-list.
|
1842
|
+
const svgDisallowed = freeze(['animate', 'color-profile', 'cursor', 'discard', 'font-face', 'font-face-format', 'font-face-name', 'font-face-src', 'font-face-uri', 'foreignobject', 'hatch', 'hatchpath', 'mesh', 'meshgradient', 'meshpatch', 'meshrow', 'missing-glyph', 'script', 'set', 'solidcolor', 'unknown', 'use']);
|
1843
|
+
const mathMl$1 = freeze(['math', 'menclose', 'merror', 'mfenced', 'mfrac', 'mglyph', 'mi', 'mlabeledtr', 'mmultiscripts', 'mn', 'mo', 'mover', 'mpadded', 'mphantom', 'mroot', 'mrow', 'ms', 'mspace', 'msqrt', 'mstyle', 'msub', 'msup', 'msubsup', 'mtable', 'mtd', 'mtext', 'mtr', 'munder', 'munderover', 'mprescripts']);
|
1844
|
+
// Similarly to SVG, we want to know all MathML elements,
|
1845
|
+
// even those that we disallow by default.
|
1846
|
+
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
1847
|
+
const purify_es_text = freeze(['#text']);
|
1848
|
+
|
1849
|
+
const html = freeze(['accept', 'action', 'align', 'alt', 'autocapitalize', 'autocomplete', 'autopictureinpicture', 'autoplay', 'background', 'bgcolor', 'border', 'capture', 'cellpadding', 'cellspacing', 'checked', 'cite', 'class', 'clear', 'color', 'cols', 'colspan', 'controls', 'controlslist', 'coords', 'crossorigin', 'datetime', 'decoding', 'default', 'dir', 'disabled', 'disablepictureinpicture', 'disableremoteplayback', 'download', 'draggable', 'enctype', 'enterkeyhint', 'face', 'for', 'headers', 'height', 'hidden', 'high', 'href', 'hreflang', 'id', 'inputmode', 'integrity', 'ismap', 'kind', 'label', 'lang', 'list', 'loading', 'loop', 'low', 'max', 'maxlength', 'media', 'method', 'min', 'minlength', 'multiple', 'muted', 'name', 'nonce', 'noshade', 'novalidate', 'nowrap', 'open', 'optimum', 'pattern', 'placeholder', 'playsinline', 'popover', 'popovertarget', 'popovertargetaction', 'poster', 'preload', 'pubdate', 'radiogroup', 'readonly', 'rel', 'required', 'rev', 'reversed', 'role', 'rows', 'rowspan', 'spellcheck', 'scope', 'selected', 'shape', 'size', 'sizes', 'span', 'srclang', 'start', 'src', 'srcset', 'step', 'style', 'summary', 'tabindex', 'title', 'translate', 'type', 'usemap', 'valign', 'value', 'width', 'wrap', 'xmlns', 'slot']);
|
1850
|
+
const svg = freeze(['accent-height', 'accumulate', 'additive', 'alignment-baseline', 'amplitude', 'ascent', 'attributename', 'attributetype', 'azimuth', 'basefrequency', 'baseline-shift', 'begin', 'bias', 'by', 'class', 'clip', 'clippathunits', 'clip-path', 'clip-rule', 'color', 'color-interpolation', 'color-interpolation-filters', 'color-profile', 'color-rendering', 'cx', 'cy', 'd', 'dx', 'dy', 'diffuseconstant', 'direction', 'display', 'divisor', 'dur', 'edgemode', 'elevation', 'end', 'exponent', 'fill', 'fill-opacity', 'fill-rule', 'filter', 'filterunits', 'flood-color', 'flood-opacity', 'font-family', 'font-size', 'font-size-adjust', 'font-stretch', 'font-style', 'font-variant', 'font-weight', 'fx', 'fy', 'g1', 'g2', 'glyph-name', 'glyphref', 'gradientunits', 'gradienttransform', 'height', 'href', 'id', 'image-rendering', 'in', 'in2', 'intercept', 'k', 'k1', 'k2', 'k3', 'k4', 'kerning', 'keypoints', 'keysplines', 'keytimes', 'lang', 'lengthadjust', 'letter-spacing', 'kernelmatrix', 'kernelunitlength', 'lighting-color', 'local', 'marker-end', 'marker-mid', 'marker-start', 'markerheight', 'markerunits', 'markerwidth', 'maskcontentunits', 'maskunits', 'max', 'mask', 'media', 'method', 'mode', 'min', 'name', 'numoctaves', 'offset', 'operator', 'opacity', 'order', 'orient', 'orientation', 'origin', 'overflow', 'paint-order', 'path', 'pathlength', 'patterncontentunits', 'patterntransform', 'patternunits', 'points', 'preservealpha', 'preserveaspectratio', 'primitiveunits', 'r', 'rx', 'ry', 'radius', 'refx', 'refy', 'repeatcount', 'repeatdur', 'restart', 'result', 'rotate', 'scale', 'seed', 'shape-rendering', 'slope', 'specularconstant', 'specularexponent', 'spreadmethod', 'startoffset', 'stddeviation', 'stitchtiles', 'stop-color', 'stop-opacity', 'stroke-dasharray', 'stroke-dashoffset', 'stroke-linecap', 'stroke-linejoin', 'stroke-miterlimit', 'stroke-opacity', 'stroke', 'stroke-width', 'style', 'surfacescale', 'systemlanguage', 'tabindex', 'tablevalues', 'targetx', 'targety', 'transform', 'transform-origin', 'text-anchor', 'text-decoration', 'text-rendering', 'textlength', 'type', 'u1', 'u2', 'unicode', 'values', 'viewbox', 'visibility', 'version', 'vert-adv-y', 'vert-origin-x', 'vert-origin-y', 'width', 'word-spacing', 'wrap', 'writing-mode', 'xchannelselector', 'ychannelselector', 'x', 'x1', 'x2', 'xmlns', 'y', 'y1', 'y2', 'z', 'zoomandpan']);
|
1851
|
+
const mathMl = freeze(['accent', 'accentunder', 'align', 'bevelled', 'close', 'columnsalign', 'columnlines', 'columnspan', 'denomalign', 'depth', 'dir', 'display', 'displaystyle', 'encoding', 'fence', 'frame', 'height', 'href', 'id', 'largeop', 'length', 'linethickness', 'lspace', 'lquote', 'mathbackground', 'mathcolor', 'mathsize', 'mathvariant', 'maxsize', 'minsize', 'movablelimits', 'notation', 'numalign', 'open', 'rowalign', 'rowlines', 'rowspacing', 'rowspan', 'rspace', 'rquote', 'scriptlevel', 'scriptminsize', 'scriptsizemultiplier', 'selection', 'separator', 'separators', 'stretchy', 'subscriptshift', 'supscriptshift', 'symmetric', 'voffset', 'width', 'xmlns']);
|
1852
|
+
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
1853
|
+
|
1854
|
+
// eslint-disable-next-line unicorn/better-regex
|
1855
|
+
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
1856
|
+
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
1857
|
+
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
1858
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
1859
|
+
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
1860
|
+
const IS_ALLOWED_URI = seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i // eslint-disable-line no-useless-escape
|
1861
|
+
);
|
1862
|
+
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
1863
|
+
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
1864
|
+
);
|
1865
|
+
const DOCTYPE_NAME = seal(/^html$/i);
|
1866
|
+
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
1867
|
+
|
1868
|
+
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
1869
|
+
__proto__: null,
|
1870
|
+
ARIA_ATTR: ARIA_ATTR,
|
1871
|
+
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
1872
|
+
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
1873
|
+
DATA_ATTR: DATA_ATTR,
|
1874
|
+
DOCTYPE_NAME: DOCTYPE_NAME,
|
1875
|
+
ERB_EXPR: ERB_EXPR,
|
1876
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
1877
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
1878
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
1879
|
+
TMPLIT_EXPR: TMPLIT_EXPR
|
1880
|
+
});
|
1881
|
+
|
1882
|
+
/* eslint-disable @typescript-eslint/indent */
|
1883
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
1884
|
+
const NODE_TYPE = {
|
1885
|
+
element: 1,
|
1886
|
+
attribute: 2,
|
1887
|
+
text: 3,
|
1888
|
+
cdataSection: 4,
|
1889
|
+
entityReference: 5,
|
1890
|
+
// Deprecated
|
1891
|
+
entityNode: 6,
|
1892
|
+
// Deprecated
|
1893
|
+
progressingInstruction: 7,
|
1894
|
+
comment: 8,
|
1895
|
+
document: 9,
|
1896
|
+
documentType: 10,
|
1897
|
+
documentFragment: 11,
|
1898
|
+
notation: 12 // Deprecated
|
1899
|
+
};
|
1900
|
+
const getGlobal = function getGlobal() {
|
1901
|
+
return typeof window === 'undefined' ? null : window;
|
1902
|
+
};
|
1903
|
+
/**
|
1904
|
+
* Creates a no-op policy for internal use only.
|
1905
|
+
* Don't export this function outside this module!
|
1906
|
+
* @param trustedTypes The policy factory.
|
1907
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
1908
|
+
* @return The policy created (or null, if Trusted Types
|
1909
|
+
* are not supported or creating the policy failed).
|
1910
|
+
*/
|
1911
|
+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
1912
|
+
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
1913
|
+
return null;
|
1914
|
+
}
|
1915
|
+
// Allow the callers to control the unique policy name
|
1916
|
+
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
1917
|
+
// Policy creation with duplicate names throws in Trusted Types.
|
1918
|
+
let suffix = null;
|
1919
|
+
const ATTR_NAME = 'data-tt-policy-suffix';
|
1920
|
+
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
|
1921
|
+
suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
1922
|
+
}
|
1923
|
+
const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
1924
|
+
try {
|
1925
|
+
return trustedTypes.createPolicy(policyName, {
|
1926
|
+
createHTML(html) {
|
1927
|
+
return html;
|
1928
|
+
},
|
1929
|
+
createScriptURL(scriptUrl) {
|
1930
|
+
return scriptUrl;
|
1931
|
+
}
|
1932
|
+
});
|
1933
|
+
} catch (_) {
|
1934
|
+
// Policy creation failed (most likely another DOMPurify script has
|
1935
|
+
// already run). Skip creating the policy, as this will only cause errors
|
1936
|
+
// if TT are enforced.
|
1937
|
+
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
|
1938
|
+
return null;
|
1939
|
+
}
|
1940
|
+
};
|
1941
|
+
const _createHooksMap = function _createHooksMap() {
|
1942
|
+
return {
|
1943
|
+
afterSanitizeAttributes: [],
|
1944
|
+
afterSanitizeElements: [],
|
1945
|
+
afterSanitizeShadowDOM: [],
|
1946
|
+
beforeSanitizeAttributes: [],
|
1947
|
+
beforeSanitizeElements: [],
|
1948
|
+
beforeSanitizeShadowDOM: [],
|
1949
|
+
uponSanitizeAttribute: [],
|
1950
|
+
uponSanitizeElement: [],
|
1951
|
+
uponSanitizeShadowNode: []
|
1952
|
+
};
|
1953
|
+
};
|
1954
|
+
function createDOMPurify() {
|
1955
|
+
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
1956
|
+
const DOMPurify = root => createDOMPurify(root);
|
1957
|
+
DOMPurify.version = '3.2.6';
|
1958
|
+
DOMPurify.removed = [];
|
1959
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
1960
|
+
// Not running in a browser, provide a factory function
|
1961
|
+
// so that you can pass your own Window
|
1962
|
+
DOMPurify.isSupported = false;
|
1963
|
+
return DOMPurify;
|
1964
|
+
}
|
1965
|
+
let {
|
1966
|
+
document
|
1967
|
+
} = window;
|
1968
|
+
const originalDocument = document;
|
1969
|
+
const currentScript = originalDocument.currentScript;
|
1970
|
+
const {
|
1971
|
+
DocumentFragment,
|
1972
|
+
HTMLTemplateElement,
|
1973
|
+
Node,
|
1974
|
+
Element,
|
1975
|
+
NodeFilter,
|
1976
|
+
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
1977
|
+
HTMLFormElement,
|
1978
|
+
DOMParser,
|
1979
|
+
trustedTypes
|
1980
|
+
} = window;
|
1981
|
+
const ElementPrototype = Element.prototype;
|
1982
|
+
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
1983
|
+
const remove = lookupGetter(ElementPrototype, 'remove');
|
1984
|
+
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
1985
|
+
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
1986
|
+
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
1987
|
+
// As per issue #47, the web-components registry is inherited by a
|
1988
|
+
// new document created via createHTMLDocument. As per the spec
|
1989
|
+
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
1990
|
+
// a new empty registry is used when creating a template contents owner
|
1991
|
+
// document, so we use that as our parent document to ensure nothing
|
1992
|
+
// is inherited.
|
1993
|
+
if (typeof HTMLTemplateElement === 'function') {
|
1994
|
+
const template = document.createElement('template');
|
1995
|
+
if (template.content && template.content.ownerDocument) {
|
1996
|
+
document = template.content.ownerDocument;
|
1997
|
+
}
|
1998
|
+
}
|
1999
|
+
let trustedTypesPolicy;
|
2000
|
+
let emptyHTML = '';
|
2001
|
+
const {
|
2002
|
+
implementation,
|
2003
|
+
createNodeIterator,
|
2004
|
+
createDocumentFragment,
|
2005
|
+
getElementsByTagName
|
2006
|
+
} = document;
|
2007
|
+
const {
|
2008
|
+
importNode
|
2009
|
+
} = originalDocument;
|
2010
|
+
let hooks = _createHooksMap();
|
2011
|
+
/**
|
2012
|
+
* Expose whether this browser supports running the full DOMPurify.
|
2013
|
+
*/
|
2014
|
+
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
2015
|
+
const {
|
2016
|
+
MUSTACHE_EXPR,
|
2017
|
+
ERB_EXPR,
|
2018
|
+
TMPLIT_EXPR,
|
2019
|
+
DATA_ATTR,
|
2020
|
+
ARIA_ATTR,
|
2021
|
+
IS_SCRIPT_OR_DATA,
|
2022
|
+
ATTR_WHITESPACE,
|
2023
|
+
CUSTOM_ELEMENT
|
2024
|
+
} = EXPRESSIONS;
|
2025
|
+
let {
|
2026
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
2027
|
+
} = EXPRESSIONS;
|
2028
|
+
/**
|
2029
|
+
* We consider the elements and attributes below to be safe. Ideally
|
2030
|
+
* don't add any new ones but feel free to remove unwanted ones.
|
2031
|
+
*/
|
2032
|
+
/* allowed element names */
|
2033
|
+
let ALLOWED_TAGS = null;
|
2034
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...purify_es_text]);
|
2035
|
+
/* Allowed attribute names */
|
2036
|
+
let ALLOWED_ATTR = null;
|
2037
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
2038
|
+
/*
|
2039
|
+
* Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
|
2040
|
+
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
2041
|
+
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
2042
|
+
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
2043
|
+
*/
|
2044
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
2045
|
+
tagNameCheck: {
|
2046
|
+
writable: true,
|
2047
|
+
configurable: false,
|
2048
|
+
enumerable: true,
|
2049
|
+
value: null
|
2050
|
+
},
|
2051
|
+
attributeNameCheck: {
|
2052
|
+
writable: true,
|
2053
|
+
configurable: false,
|
2054
|
+
enumerable: true,
|
2055
|
+
value: null
|
2056
|
+
},
|
2057
|
+
allowCustomizedBuiltInElements: {
|
2058
|
+
writable: true,
|
2059
|
+
configurable: false,
|
2060
|
+
enumerable: true,
|
2061
|
+
value: false
|
2062
|
+
}
|
2063
|
+
}));
|
2064
|
+
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
2065
|
+
let FORBID_TAGS = null;
|
2066
|
+
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
2067
|
+
let FORBID_ATTR = null;
|
2068
|
+
/* Decide if ARIA attributes are okay */
|
2069
|
+
let ALLOW_ARIA_ATTR = true;
|
2070
|
+
/* Decide if custom data attributes are okay */
|
2071
|
+
let ALLOW_DATA_ATTR = true;
|
2072
|
+
/* Decide if unknown protocols are okay */
|
2073
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
2074
|
+
/* Decide if self-closing tags in attributes are allowed.
|
2075
|
+
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
2076
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
2077
|
+
/* Output should be safe for common template engines.
|
2078
|
+
* This means, DOMPurify removes data attributes, mustaches and ERB
|
2079
|
+
*/
|
2080
|
+
let SAFE_FOR_TEMPLATES = false;
|
2081
|
+
/* Output should be safe even for XML used within HTML and alike.
|
2082
|
+
* This means, DOMPurify removes comments when containing risky content.
|
2083
|
+
*/
|
2084
|
+
let SAFE_FOR_XML = true;
|
2085
|
+
/* Decide if document with <html>... should be returned */
|
2086
|
+
let WHOLE_DOCUMENT = false;
|
2087
|
+
/* Track whether config is already set on this instance of DOMPurify. */
|
2088
|
+
let SET_CONFIG = false;
|
2089
|
+
/* Decide if all elements (e.g. style, script) must be children of
|
2090
|
+
* document.body. By default, browsers might move them to document.head */
|
2091
|
+
let FORCE_BODY = false;
|
2092
|
+
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
2093
|
+
* string (or a TrustedHTML object if Trusted Types are supported).
|
2094
|
+
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
2095
|
+
*/
|
2096
|
+
let RETURN_DOM = false;
|
2097
|
+
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
2098
|
+
* string (or a TrustedHTML object if Trusted Types are supported) */
|
2099
|
+
let RETURN_DOM_FRAGMENT = false;
|
2100
|
+
/* Try to return a Trusted Type object instead of a string, return a string in
|
2101
|
+
* case Trusted Types are not supported */
|
2102
|
+
let RETURN_TRUSTED_TYPE = false;
|
2103
|
+
/* Output should be free from DOM clobbering attacks?
|
2104
|
+
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
2105
|
+
*/
|
2106
|
+
let SANITIZE_DOM = true;
|
2107
|
+
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
2108
|
+
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
2109
|
+
*
|
2110
|
+
* HTML/DOM spec rules that enable DOM Clobbering:
|
2111
|
+
* - Named Access on Window (§7.3.3)
|
2112
|
+
* - DOM Tree Accessors (§3.1.5)
|
2113
|
+
* - Form Element Parent-Child Relations (§4.10.3)
|
2114
|
+
* - Iframe srcdoc / Nested WindowProxies (§4.8.5)
|
2115
|
+
* - HTMLCollection (§4.2.10.2)
|
2116
|
+
*
|
2117
|
+
* Namespace isolation is implemented by prefixing `id` and `name` attributes
|
2118
|
+
* with a constant string, i.e., `user-content-`
|
2119
|
+
*/
|
2120
|
+
let SANITIZE_NAMED_PROPS = false;
|
2121
|
+
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
2122
|
+
/* Keep element content when removing element? */
|
2123
|
+
let KEEP_CONTENT = true;
|
2124
|
+
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
2125
|
+
* of importing it into a new Document and returning a sanitized copy */
|
2126
|
+
let IN_PLACE = false;
|
2127
|
+
/* Allow usage of profiles like html, svg and mathMl */
|
2128
|
+
let USE_PROFILES = {};
|
2129
|
+
/* Tags to ignore content of when KEEP_CONTENT is true */
|
2130
|
+
let FORBID_CONTENTS = null;
|
2131
|
+
const DEFAULT_FORBID_CONTENTS = addToSet({}, ['annotation-xml', 'audio', 'colgroup', 'desc', 'foreignobject', 'head', 'iframe', 'math', 'mi', 'mn', 'mo', 'ms', 'mtext', 'noembed', 'noframes', 'noscript', 'plaintext', 'script', 'style', 'svg', 'template', 'thead', 'title', 'video', 'xmp']);
|
2132
|
+
/* Tags that are safe for data: URIs */
|
2133
|
+
let DATA_URI_TAGS = null;
|
2134
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
2135
|
+
/* Attributes safe for values like "javascript:" */
|
2136
|
+
let URI_SAFE_ATTRIBUTES = null;
|
2137
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
2138
|
+
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
2139
|
+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
2140
|
+
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
2141
|
+
/* Document namespace */
|
2142
|
+
let NAMESPACE = HTML_NAMESPACE;
|
2143
|
+
let IS_EMPTY_INPUT = false;
|
2144
|
+
/* Allowed XHTML+XML namespaces */
|
2145
|
+
let ALLOWED_NAMESPACES = null;
|
2146
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
2147
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
2148
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
2149
|
+
// Certain elements are allowed in both SVG and HTML
|
2150
|
+
// namespace. We need to specify them explicitly
|
2151
|
+
// so that they don't get erroneously deleted from
|
2152
|
+
// HTML namespace.
|
2153
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
2154
|
+
/* Parsing of strict XHTML documents */
|
2155
|
+
let PARSER_MEDIA_TYPE = null;
|
2156
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
2157
|
+
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
2158
|
+
let transformCaseFunc = null;
|
2159
|
+
/* Keep a reference to config to pass to hooks */
|
2160
|
+
let CONFIG = null;
|
2161
|
+
/* Ideally, do not touch anything below this line */
|
2162
|
+
/* ______________________________________________ */
|
2163
|
+
const formElement = document.createElement('form');
|
2164
|
+
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
2165
|
+
return testValue instanceof RegExp || testValue instanceof Function;
|
2166
|
+
};
|
2167
|
+
/**
|
2168
|
+
* _parseConfig
|
2169
|
+
*
|
2170
|
+
* @param cfg optional config literal
|
2171
|
+
*/
|
2172
|
+
// eslint-disable-next-line complexity
|
2173
|
+
const _parseConfig = function _parseConfig() {
|
2174
|
+
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
2175
|
+
if (CONFIG && CONFIG === cfg) {
|
2176
|
+
return;
|
2177
|
+
}
|
2178
|
+
/* Shield configuration object from tampering */
|
2179
|
+
if (!cfg || typeof cfg !== 'object') {
|
2180
|
+
cfg = {};
|
2181
|
+
}
|
2182
|
+
/* Shield configuration object from prototype pollution */
|
2183
|
+
cfg = clone(cfg);
|
2184
|
+
PARSER_MEDIA_TYPE =
|
2185
|
+
// eslint-disable-next-line unicorn/prefer-includes
|
2186
|
+
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
2187
|
+
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
2188
|
+
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
2189
|
+
/* Set configuration parameters */
|
2190
|
+
ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
2191
|
+
ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
2192
|
+
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
2193
|
+
URI_SAFE_ATTRIBUTES = objectHasOwnProperty(cfg, 'ADD_URI_SAFE_ATTR') ? addToSet(clone(DEFAULT_URI_SAFE_ATTRIBUTES), cfg.ADD_URI_SAFE_ATTR, transformCaseFunc) : DEFAULT_URI_SAFE_ATTRIBUTES;
|
2194
|
+
DATA_URI_TAGS = objectHasOwnProperty(cfg, 'ADD_DATA_URI_TAGS') ? addToSet(clone(DEFAULT_DATA_URI_TAGS), cfg.ADD_DATA_URI_TAGS, transformCaseFunc) : DEFAULT_DATA_URI_TAGS;
|
2195
|
+
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
2196
|
+
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
|
2197
|
+
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
|
2198
|
+
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
|
2199
|
+
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
2200
|
+
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
2201
|
+
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
2202
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
|
2203
|
+
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
2204
|
+
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
|
2205
|
+
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
2206
|
+
RETURN_DOM = cfg.RETURN_DOM || false; // Default false
|
2207
|
+
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
|
2208
|
+
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
|
2209
|
+
FORCE_BODY = cfg.FORCE_BODY || false; // Default false
|
2210
|
+
SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
|
2211
|
+
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
|
2212
|
+
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
2213
|
+
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
2214
|
+
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
2215
|
+
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
2216
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
2217
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
2218
|
+
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
2219
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
2220
|
+
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
2221
|
+
}
|
2222
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
|
2223
|
+
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
2224
|
+
}
|
2225
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
|
2226
|
+
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
2227
|
+
}
|
2228
|
+
if (SAFE_FOR_TEMPLATES) {
|
2229
|
+
ALLOW_DATA_ATTR = false;
|
2230
|
+
}
|
2231
|
+
if (RETURN_DOM_FRAGMENT) {
|
2232
|
+
RETURN_DOM = true;
|
2233
|
+
}
|
2234
|
+
/* Parse profile info */
|
2235
|
+
if (USE_PROFILES) {
|
2236
|
+
ALLOWED_TAGS = addToSet({}, purify_es_text);
|
2237
|
+
ALLOWED_ATTR = [];
|
2238
|
+
if (USE_PROFILES.html === true) {
|
2239
|
+
addToSet(ALLOWED_TAGS, html$1);
|
2240
|
+
addToSet(ALLOWED_ATTR, html);
|
2241
|
+
}
|
2242
|
+
if (USE_PROFILES.svg === true) {
|
2243
|
+
addToSet(ALLOWED_TAGS, svg$1);
|
2244
|
+
addToSet(ALLOWED_ATTR, svg);
|
2245
|
+
addToSet(ALLOWED_ATTR, xml);
|
2246
|
+
}
|
2247
|
+
if (USE_PROFILES.svgFilters === true) {
|
2248
|
+
addToSet(ALLOWED_TAGS, svgFilters);
|
2249
|
+
addToSet(ALLOWED_ATTR, svg);
|
2250
|
+
addToSet(ALLOWED_ATTR, xml);
|
2251
|
+
}
|
2252
|
+
if (USE_PROFILES.mathMl === true) {
|
2253
|
+
addToSet(ALLOWED_TAGS, mathMl$1);
|
2254
|
+
addToSet(ALLOWED_ATTR, mathMl);
|
2255
|
+
addToSet(ALLOWED_ATTR, xml);
|
2256
|
+
}
|
2257
|
+
}
|
2258
|
+
/* Merge configuration parameters */
|
2259
|
+
if (cfg.ADD_TAGS) {
|
2260
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
2261
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
2262
|
+
}
|
2263
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
2264
|
+
}
|
2265
|
+
if (cfg.ADD_ATTR) {
|
2266
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
2267
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
2268
|
+
}
|
2269
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
2270
|
+
}
|
2271
|
+
if (cfg.ADD_URI_SAFE_ATTR) {
|
2272
|
+
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
2273
|
+
}
|
2274
|
+
if (cfg.FORBID_CONTENTS) {
|
2275
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
2276
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
2277
|
+
}
|
2278
|
+
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
2279
|
+
}
|
2280
|
+
/* Add #text in case KEEP_CONTENT is set to true */
|
2281
|
+
if (KEEP_CONTENT) {
|
2282
|
+
ALLOWED_TAGS['#text'] = true;
|
2283
|
+
}
|
2284
|
+
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
2285
|
+
if (WHOLE_DOCUMENT) {
|
2286
|
+
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
2287
|
+
}
|
2288
|
+
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
2289
|
+
if (ALLOWED_TAGS.table) {
|
2290
|
+
addToSet(ALLOWED_TAGS, ['tbody']);
|
2291
|
+
delete FORBID_TAGS.tbody;
|
2292
|
+
}
|
2293
|
+
if (cfg.TRUSTED_TYPES_POLICY) {
|
2294
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
2295
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
2296
|
+
}
|
2297
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
2298
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
2299
|
+
}
|
2300
|
+
// Overwrite existing TrustedTypes policy.
|
2301
|
+
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
2302
|
+
// Sign local variables required by `sanitize`.
|
2303
|
+
emptyHTML = trustedTypesPolicy.createHTML('');
|
2304
|
+
} else {
|
2305
|
+
// Uninitialized policy, attempt to initialize the internal dompurify policy.
|
2306
|
+
if (trustedTypesPolicy === undefined) {
|
2307
|
+
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
2308
|
+
}
|
2309
|
+
// If creating the internal policy succeeded sign internal variables.
|
2310
|
+
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
2311
|
+
emptyHTML = trustedTypesPolicy.createHTML('');
|
2312
|
+
}
|
2313
|
+
}
|
2314
|
+
// Prevent further manipulation of configuration.
|
2315
|
+
// Not available in IE8, Safari 5, etc.
|
2316
|
+
if (freeze) {
|
2317
|
+
freeze(cfg);
|
2318
|
+
}
|
2319
|
+
CONFIG = cfg;
|
2320
|
+
};
|
2321
|
+
/* Keep track of all possible SVG and MathML tags
|
2322
|
+
* so that we can perform the namespace checks
|
2323
|
+
* correctly. */
|
2324
|
+
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
2325
|
+
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
2326
|
+
/**
|
2327
|
+
* @param element a DOM element whose namespace is being checked
|
2328
|
+
* @returns Return false if the element has a
|
2329
|
+
* namespace that a spec-compliant parser would never
|
2330
|
+
* return. Return true otherwise.
|
2331
|
+
*/
|
2332
|
+
const _checkValidNamespace = function _checkValidNamespace(element) {
|
2333
|
+
let parent = getParentNode(element);
|
2334
|
+
// In JSDOM, if we're inside shadow DOM, then parentNode
|
2335
|
+
// can be null. We just simulate parent in this case.
|
2336
|
+
if (!parent || !parent.tagName) {
|
2337
|
+
parent = {
|
2338
|
+
namespaceURI: NAMESPACE,
|
2339
|
+
tagName: 'template'
|
2340
|
+
};
|
2341
|
+
}
|
2342
|
+
const tagName = stringToLowerCase(element.tagName);
|
2343
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
2344
|
+
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
2345
|
+
return false;
|
2346
|
+
}
|
2347
|
+
if (element.namespaceURI === SVG_NAMESPACE) {
|
2348
|
+
// The only way to switch from HTML namespace to SVG
|
2349
|
+
// is via <svg>. If it happens via any other tag, then
|
2350
|
+
// it should be killed.
|
2351
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
2352
|
+
return tagName === 'svg';
|
2353
|
+
}
|
2354
|
+
// The only way to switch from MathML to SVG is via`
|
2355
|
+
// svg if parent is either <annotation-xml> or MathML
|
2356
|
+
// text integration points.
|
2357
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
2358
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
2359
|
+
}
|
2360
|
+
// We only allow elements that are defined in SVG
|
2361
|
+
// spec. All others are disallowed in SVG namespace.
|
2362
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
2363
|
+
}
|
2364
|
+
if (element.namespaceURI === MATHML_NAMESPACE) {
|
2365
|
+
// The only way to switch from HTML namespace to MathML
|
2366
|
+
// is via <math>. If it happens via any other tag, then
|
2367
|
+
// it should be killed.
|
2368
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
2369
|
+
return tagName === 'math';
|
2370
|
+
}
|
2371
|
+
// The only way to switch from SVG to MathML is via
|
2372
|
+
// <math> and HTML integration points
|
2373
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
2374
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
2375
|
+
}
|
2376
|
+
// We only allow elements that are defined in MathML
|
2377
|
+
// spec. All others are disallowed in MathML namespace.
|
2378
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
2379
|
+
}
|
2380
|
+
if (element.namespaceURI === HTML_NAMESPACE) {
|
2381
|
+
// The only way to switch from SVG to HTML is via
|
2382
|
+
// HTML integration points, and from MathML to HTML
|
2383
|
+
// is via MathML text integration points
|
2384
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
2385
|
+
return false;
|
2386
|
+
}
|
2387
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
2388
|
+
return false;
|
2389
|
+
}
|
2390
|
+
// We disallow tags that are specific for MathML
|
2391
|
+
// or SVG and should never appear in HTML namespace
|
2392
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
2393
|
+
}
|
2394
|
+
// For XHTML and XML documents that support custom namespaces
|
2395
|
+
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
2396
|
+
return true;
|
2397
|
+
}
|
2398
|
+
// The code should never reach this place (this means
|
2399
|
+
// that the element somehow got namespace that is not
|
2400
|
+
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
2401
|
+
// Return false just in case.
|
2402
|
+
return false;
|
2403
|
+
};
|
2404
|
+
/**
|
2405
|
+
* _forceRemove
|
2406
|
+
*
|
2407
|
+
* @param node a DOM node
|
2408
|
+
*/
|
2409
|
+
const _forceRemove = function _forceRemove(node) {
|
2410
|
+
arrayPush(DOMPurify.removed, {
|
2411
|
+
element: node
|
2412
|
+
});
|
2413
|
+
try {
|
2414
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
2415
|
+
getParentNode(node).removeChild(node);
|
2416
|
+
} catch (_) {
|
2417
|
+
remove(node);
|
2418
|
+
}
|
2419
|
+
};
|
2420
|
+
/**
|
2421
|
+
* _removeAttribute
|
2422
|
+
*
|
2423
|
+
* @param name an Attribute name
|
2424
|
+
* @param element a DOM node
|
2425
|
+
*/
|
2426
|
+
const _removeAttribute = function _removeAttribute(name, element) {
|
2427
|
+
try {
|
2428
|
+
arrayPush(DOMPurify.removed, {
|
2429
|
+
attribute: element.getAttributeNode(name),
|
2430
|
+
from: element
|
2431
|
+
});
|
2432
|
+
} catch (_) {
|
2433
|
+
arrayPush(DOMPurify.removed, {
|
2434
|
+
attribute: null,
|
2435
|
+
from: element
|
2436
|
+
});
|
2437
|
+
}
|
2438
|
+
element.removeAttribute(name);
|
2439
|
+
// We void attribute values for unremovable "is" attributes
|
2440
|
+
if (name === 'is') {
|
2441
|
+
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
2442
|
+
try {
|
2443
|
+
_forceRemove(element);
|
2444
|
+
} catch (_) {}
|
2445
|
+
} else {
|
2446
|
+
try {
|
2447
|
+
element.setAttribute(name, '');
|
2448
|
+
} catch (_) {}
|
2449
|
+
}
|
2450
|
+
}
|
2451
|
+
};
|
2452
|
+
/**
|
2453
|
+
* _initDocument
|
2454
|
+
*
|
2455
|
+
* @param dirty - a string of dirty markup
|
2456
|
+
* @return a DOM, filled with the dirty markup
|
2457
|
+
*/
|
2458
|
+
const _initDocument = function _initDocument(dirty) {
|
2459
|
+
/* Create a HTML document */
|
2460
|
+
let doc = null;
|
2461
|
+
let leadingWhitespace = null;
|
2462
|
+
if (FORCE_BODY) {
|
2463
|
+
dirty = '<remove></remove>' + dirty;
|
2464
|
+
} else {
|
2465
|
+
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
2466
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
2467
|
+
leadingWhitespace = matches && matches[0];
|
2468
|
+
}
|
2469
|
+
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
|
2470
|
+
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
2471
|
+
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
2472
|
+
}
|
2473
|
+
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
2474
|
+
/*
|
2475
|
+
* Use the DOMParser API by default, fallback later if needs be
|
2476
|
+
* DOMParser not work for svg when has multiple root element.
|
2477
|
+
*/
|
2478
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
2479
|
+
try {
|
2480
|
+
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
2481
|
+
} catch (_) {}
|
2482
|
+
}
|
2483
|
+
/* Use createHTMLDocument in case DOMParser is not available */
|
2484
|
+
if (!doc || !doc.documentElement) {
|
2485
|
+
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
2486
|
+
try {
|
2487
|
+
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
2488
|
+
} catch (_) {
|
2489
|
+
// Syntax error if dirtyPayload is invalid xml
|
2490
|
+
}
|
2491
|
+
}
|
2492
|
+
const body = doc.body || doc.documentElement;
|
2493
|
+
if (dirty && leadingWhitespace) {
|
2494
|
+
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
2495
|
+
}
|
2496
|
+
/* Work on whole document or just its body */
|
2497
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
2498
|
+
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
2499
|
+
}
|
2500
|
+
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
2501
|
+
};
|
2502
|
+
/**
|
2503
|
+
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
2504
|
+
*
|
2505
|
+
* @param root The root element or node to start traversing on.
|
2506
|
+
* @return The created NodeIterator
|
2507
|
+
*/
|
2508
|
+
const _createNodeIterator = function _createNodeIterator(root) {
|
2509
|
+
return createNodeIterator.call(root.ownerDocument || root, root,
|
2510
|
+
// eslint-disable-next-line no-bitwise
|
2511
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
2512
|
+
};
|
2513
|
+
/**
|
2514
|
+
* _isClobbered
|
2515
|
+
*
|
2516
|
+
* @param element element to check for clobbering attacks
|
2517
|
+
* @return true if clobbered, false if safe
|
2518
|
+
*/
|
2519
|
+
const _isClobbered = function _isClobbered(element) {
|
2520
|
+
return element instanceof HTMLFormElement && (typeof element.nodeName !== 'string' || typeof element.textContent !== 'string' || typeof element.removeChild !== 'function' || !(element.attributes instanceof NamedNodeMap) || typeof element.removeAttribute !== 'function' || typeof element.setAttribute !== 'function' || typeof element.namespaceURI !== 'string' || typeof element.insertBefore !== 'function' || typeof element.hasChildNodes !== 'function');
|
2521
|
+
};
|
2522
|
+
/**
|
2523
|
+
* Checks whether the given object is a DOM node.
|
2524
|
+
*
|
2525
|
+
* @param value object to check whether it's a DOM node
|
2526
|
+
* @return true is object is a DOM node
|
2527
|
+
*/
|
2528
|
+
const _isNode = function _isNode(value) {
|
2529
|
+
return typeof Node === 'function' && value instanceof Node;
|
2530
|
+
};
|
2531
|
+
function _executeHooks(hooks, currentNode, data) {
|
2532
|
+
arrayForEach(hooks, hook => {
|
2533
|
+
hook.call(DOMPurify, currentNode, data, CONFIG);
|
2534
|
+
});
|
2535
|
+
}
|
2536
|
+
/**
|
2537
|
+
* _sanitizeElements
|
2538
|
+
*
|
2539
|
+
* @protect nodeName
|
2540
|
+
* @protect textContent
|
2541
|
+
* @protect removeChild
|
2542
|
+
* @param currentNode to check for permission to exist
|
2543
|
+
* @return true if node was killed, false if left alive
|
2544
|
+
*/
|
2545
|
+
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
2546
|
+
let content = null;
|
2547
|
+
/* Execute a hook if present */
|
2548
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
2549
|
+
/* Check if element is clobbered or can clobber */
|
2550
|
+
if (_isClobbered(currentNode)) {
|
2551
|
+
_forceRemove(currentNode);
|
2552
|
+
return true;
|
2553
|
+
}
|
2554
|
+
/* Now let's check the element's type and name */
|
2555
|
+
const tagName = transformCaseFunc(currentNode.nodeName);
|
2556
|
+
/* Execute a hook if present */
|
2557
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
2558
|
+
tagName,
|
2559
|
+
allowedTags: ALLOWED_TAGS
|
2560
|
+
});
|
2561
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
2562
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
2563
|
+
_forceRemove(currentNode);
|
2564
|
+
return true;
|
2565
|
+
}
|
2566
|
+
/* Remove any occurrence of processing instructions */
|
2567
|
+
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
2568
|
+
_forceRemove(currentNode);
|
2569
|
+
return true;
|
2570
|
+
}
|
2571
|
+
/* Remove any kind of possibly harmful comments */
|
2572
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
2573
|
+
_forceRemove(currentNode);
|
2574
|
+
return true;
|
2575
|
+
}
|
2576
|
+
/* Remove element if anything forbids its presence */
|
2577
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
2578
|
+
/* Check if we have a custom element to handle */
|
2579
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
2580
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
2581
|
+
return false;
|
2582
|
+
}
|
2583
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
2584
|
+
return false;
|
2585
|
+
}
|
2586
|
+
}
|
2587
|
+
/* Keep content except for bad-listed elements */
|
2588
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
2589
|
+
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
2590
|
+
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
2591
|
+
if (childNodes && parentNode) {
|
2592
|
+
const childCount = childNodes.length;
|
2593
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
2594
|
+
const childClone = cloneNode(childNodes[i], true);
|
2595
|
+
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
2596
|
+
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
2597
|
+
}
|
2598
|
+
}
|
2599
|
+
}
|
2600
|
+
_forceRemove(currentNode);
|
2601
|
+
return true;
|
2602
|
+
}
|
2603
|
+
/* Check whether element has a valid namespace */
|
2604
|
+
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
2605
|
+
_forceRemove(currentNode);
|
2606
|
+
return true;
|
2607
|
+
}
|
2608
|
+
/* Make sure that older browsers don't get fallback-tag mXSS */
|
2609
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
2610
|
+
_forceRemove(currentNode);
|
2611
|
+
return true;
|
2612
|
+
}
|
2613
|
+
/* Sanitize element content to be template-safe */
|
2614
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
2615
|
+
/* Get the element's text content */
|
2616
|
+
content = currentNode.textContent;
|
2617
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
2618
|
+
content = stringReplace(content, expr, ' ');
|
2619
|
+
});
|
2620
|
+
if (currentNode.textContent !== content) {
|
2621
|
+
arrayPush(DOMPurify.removed, {
|
2622
|
+
element: currentNode.cloneNode()
|
2623
|
+
});
|
2624
|
+
currentNode.textContent = content;
|
2625
|
+
}
|
2626
|
+
}
|
2627
|
+
/* Execute a hook if present */
|
2628
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
2629
|
+
return false;
|
2630
|
+
};
|
2631
|
+
/**
|
2632
|
+
* _isValidAttribute
|
2633
|
+
*
|
2634
|
+
* @param lcTag Lowercase tag name of containing element.
|
2635
|
+
* @param lcName Lowercase attribute name.
|
2636
|
+
* @param value Attribute value.
|
2637
|
+
* @return Returns true if `value` is valid, otherwise false.
|
2638
|
+
*/
|
2639
|
+
// eslint-disable-next-line complexity
|
2640
|
+
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
2641
|
+
/* Make sure attribute cannot clobber */
|
2642
|
+
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
2643
|
+
return false;
|
2644
|
+
}
|
2645
|
+
/* Allow valid data-* attributes: At least one character after "-"
|
2646
|
+
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
2647
|
+
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
2648
|
+
We don't need to check the value; it's always URI safe. */
|
2649
|
+
if (ALLOW_DATA_ATTR && !FORBID_ATTR[lcName] && regExpTest(DATA_ATTR, lcName)) ; else if (ALLOW_ARIA_ATTR && regExpTest(ARIA_ATTR, lcName)) ; else if (!ALLOWED_ATTR[lcName] || FORBID_ATTR[lcName]) {
|
2650
|
+
if (
|
2651
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
2652
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
2653
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
2654
|
+
_isBasicCustomElement(lcTag) && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, lcTag) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(lcTag)) && (CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.attributeNameCheck, lcName) || CUSTOM_ELEMENT_HANDLING.attributeNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.attributeNameCheck(lcName)) ||
|
2655
|
+
// Alternative, second condition checks if it's an `is`-attribute, AND
|
2656
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
2657
|
+
lcName === 'is' && CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements && (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, value) || CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(value))) ; else {
|
2658
|
+
return false;
|
2659
|
+
}
|
2660
|
+
/* Check value is safe. First, is attr inert? If so, is safe */
|
2661
|
+
} else if (URI_SAFE_ATTRIBUTES[lcName]) ; else if (regExpTest(IS_ALLOWED_URI$1, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if ((lcName === 'src' || lcName === 'xlink:href' || lcName === 'href') && lcTag !== 'script' && stringIndexOf(value, 'data:') === 0 && DATA_URI_TAGS[lcTag]) ; else if (ALLOW_UNKNOWN_PROTOCOLS && !regExpTest(IS_SCRIPT_OR_DATA, stringReplace(value, ATTR_WHITESPACE, ''))) ; else if (value) {
|
2662
|
+
return false;
|
2663
|
+
} else ;
|
2664
|
+
return true;
|
2665
|
+
};
|
2666
|
+
/**
|
2667
|
+
* _isBasicCustomElement
|
2668
|
+
* checks if at least one dash is included in tagName, and it's not the first char
|
2669
|
+
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
2670
|
+
*
|
2671
|
+
* @param tagName name of the tag of the node to sanitize
|
2672
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
2673
|
+
*/
|
2674
|
+
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
2675
|
+
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
2676
|
+
};
|
2677
|
+
/**
|
2678
|
+
* _sanitizeAttributes
|
2679
|
+
*
|
2680
|
+
* @protect attributes
|
2681
|
+
* @protect nodeName
|
2682
|
+
* @protect removeAttribute
|
2683
|
+
* @protect setAttribute
|
2684
|
+
*
|
2685
|
+
* @param currentNode to sanitize
|
2686
|
+
*/
|
2687
|
+
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
2688
|
+
/* Execute a hook if present */
|
2689
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
2690
|
+
const {
|
2691
|
+
attributes
|
2692
|
+
} = currentNode;
|
2693
|
+
/* Check if we have attributes; if not we might have a text node */
|
2694
|
+
if (!attributes || _isClobbered(currentNode)) {
|
2695
|
+
return;
|
2696
|
+
}
|
2697
|
+
const hookEvent = {
|
2698
|
+
attrName: '',
|
2699
|
+
attrValue: '',
|
2700
|
+
keepAttr: true,
|
2701
|
+
allowedAttributes: ALLOWED_ATTR,
|
2702
|
+
forceKeepAttr: undefined
|
2703
|
+
};
|
2704
|
+
let l = attributes.length;
|
2705
|
+
/* Go backwards over all attributes; safely remove bad ones */
|
2706
|
+
while (l--) {
|
2707
|
+
const attr = attributes[l];
|
2708
|
+
const {
|
2709
|
+
name,
|
2710
|
+
namespaceURI,
|
2711
|
+
value: attrValue
|
2712
|
+
} = attr;
|
2713
|
+
const lcName = transformCaseFunc(name);
|
2714
|
+
const initValue = attrValue;
|
2715
|
+
let value = name === 'value' ? initValue : stringTrim(initValue);
|
2716
|
+
/* Execute a hook if present */
|
2717
|
+
hookEvent.attrName = lcName;
|
2718
|
+
hookEvent.attrValue = value;
|
2719
|
+
hookEvent.keepAttr = true;
|
2720
|
+
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
2721
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
2722
|
+
value = hookEvent.attrValue;
|
2723
|
+
/* Full DOM Clobbering protection via namespace isolation,
|
2724
|
+
* Prefix id and name attributes with `user-content-`
|
2725
|
+
*/
|
2726
|
+
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
2727
|
+
// Remove the attribute with this value
|
2728
|
+
_removeAttribute(name, currentNode);
|
2729
|
+
// Prefix the value and later re-create the attribute with the sanitized value
|
2730
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
2731
|
+
}
|
2732
|
+
/* Work around a security issue with comments inside attributes */
|
2733
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
2734
|
+
_removeAttribute(name, currentNode);
|
2735
|
+
continue;
|
2736
|
+
}
|
2737
|
+
/* Did the hooks approve of the attribute? */
|
2738
|
+
if (hookEvent.forceKeepAttr) {
|
2739
|
+
continue;
|
2740
|
+
}
|
2741
|
+
/* Did the hooks approve of the attribute? */
|
2742
|
+
if (!hookEvent.keepAttr) {
|
2743
|
+
_removeAttribute(name, currentNode);
|
2744
|
+
continue;
|
2745
|
+
}
|
2746
|
+
/* Work around a security issue in jQuery 3.0 */
|
2747
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
2748
|
+
_removeAttribute(name, currentNode);
|
2749
|
+
continue;
|
2750
|
+
}
|
2751
|
+
/* Sanitize attribute content to be template-safe */
|
2752
|
+
if (SAFE_FOR_TEMPLATES) {
|
2753
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
2754
|
+
value = stringReplace(value, expr, ' ');
|
2755
|
+
});
|
2756
|
+
}
|
2757
|
+
/* Is `value` valid for this attribute? */
|
2758
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
2759
|
+
if (!_isValidAttribute(lcTag, lcName, value)) {
|
2760
|
+
_removeAttribute(name, currentNode);
|
2761
|
+
continue;
|
2762
|
+
}
|
2763
|
+
/* Handle attributes that require Trusted Types */
|
2764
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
2765
|
+
if (namespaceURI) ; else {
|
2766
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
2767
|
+
case 'TrustedHTML':
|
2768
|
+
{
|
2769
|
+
value = trustedTypesPolicy.createHTML(value);
|
2770
|
+
break;
|
2771
|
+
}
|
2772
|
+
case 'TrustedScriptURL':
|
2773
|
+
{
|
2774
|
+
value = trustedTypesPolicy.createScriptURL(value);
|
2775
|
+
break;
|
2776
|
+
}
|
2777
|
+
}
|
2778
|
+
}
|
2779
|
+
}
|
2780
|
+
/* Handle invalid data-* attribute set by try-catching it */
|
2781
|
+
if (value !== initValue) {
|
2782
|
+
try {
|
2783
|
+
if (namespaceURI) {
|
2784
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
2785
|
+
} else {
|
2786
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
2787
|
+
currentNode.setAttribute(name, value);
|
2788
|
+
}
|
2789
|
+
if (_isClobbered(currentNode)) {
|
2790
|
+
_forceRemove(currentNode);
|
2791
|
+
} else {
|
2792
|
+
arrayPop(DOMPurify.removed);
|
2793
|
+
}
|
2794
|
+
} catch (_) {
|
2795
|
+
_removeAttribute(name, currentNode);
|
2796
|
+
}
|
2797
|
+
}
|
2798
|
+
}
|
2799
|
+
/* Execute a hook if present */
|
2800
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
2801
|
+
};
|
2802
|
+
/**
|
2803
|
+
* _sanitizeShadowDOM
|
2804
|
+
*
|
2805
|
+
* @param fragment to iterate over recursively
|
2806
|
+
*/
|
2807
|
+
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
2808
|
+
let shadowNode = null;
|
2809
|
+
const shadowIterator = _createNodeIterator(fragment);
|
2810
|
+
/* Execute a hook if present */
|
2811
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
2812
|
+
while (shadowNode = shadowIterator.nextNode()) {
|
2813
|
+
/* Execute a hook if present */
|
2814
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
2815
|
+
/* Sanitize tags and elements */
|
2816
|
+
_sanitizeElements(shadowNode);
|
2817
|
+
/* Check attributes next */
|
2818
|
+
_sanitizeAttributes(shadowNode);
|
2819
|
+
/* Deep shadow DOM detected */
|
2820
|
+
if (shadowNode.content instanceof DocumentFragment) {
|
2821
|
+
_sanitizeShadowDOM(shadowNode.content);
|
1510
2822
|
}
|
1511
|
-
}
|
1512
|
-
|
1513
|
-
|
1514
|
-
|
2823
|
+
}
|
2824
|
+
/* Execute a hook if present */
|
2825
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
2826
|
+
};
|
2827
|
+
// eslint-disable-next-line complexity
|
2828
|
+
DOMPurify.sanitize = function (dirty) {
|
2829
|
+
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
2830
|
+
let body = null;
|
2831
|
+
let importedNode = null;
|
2832
|
+
let currentNode = null;
|
2833
|
+
let returnNode = null;
|
2834
|
+
/* Make sure we have a string to sanitize.
|
2835
|
+
DO NOT return early, as this will return the wrong type if
|
2836
|
+
the user has requested a DOM object rather than a string */
|
2837
|
+
IS_EMPTY_INPUT = !dirty;
|
2838
|
+
if (IS_EMPTY_INPUT) {
|
2839
|
+
dirty = '<!-->';
|
2840
|
+
}
|
2841
|
+
/* Stringify, in case dirty is an object */
|
2842
|
+
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
2843
|
+
if (typeof dirty.toString === 'function') {
|
2844
|
+
dirty = dirty.toString();
|
2845
|
+
if (typeof dirty !== 'string') {
|
2846
|
+
throw typeErrorCreate('dirty is not a string, aborting');
|
2847
|
+
}
|
2848
|
+
} else {
|
2849
|
+
throw typeErrorCreate('toString is not a function');
|
1515
2850
|
}
|
1516
|
-
}
|
1517
|
-
|
1518
|
-
|
1519
|
-
|
1520
|
-
|
1521
|
-
|
1522
|
-
|
1523
|
-
|
1524
|
-
|
1525
|
-
|
1526
|
-
|
1527
|
-
|
1528
|
-
|
2851
|
+
}
|
2852
|
+
/* Return dirty HTML if DOMPurify cannot run */
|
2853
|
+
if (!DOMPurify.isSupported) {
|
2854
|
+
return dirty;
|
2855
|
+
}
|
2856
|
+
/* Assign config vars */
|
2857
|
+
if (!SET_CONFIG) {
|
2858
|
+
_parseConfig(cfg);
|
2859
|
+
}
|
2860
|
+
/* Clean up removed elements */
|
2861
|
+
DOMPurify.removed = [];
|
2862
|
+
/* Check if dirty is correctly typed for IN_PLACE */
|
2863
|
+
if (typeof dirty === 'string') {
|
2864
|
+
IN_PLACE = false;
|
2865
|
+
}
|
2866
|
+
if (IN_PLACE) {
|
2867
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes */
|
2868
|
+
if (dirty.nodeName) {
|
2869
|
+
const tagName = transformCaseFunc(dirty.nodeName);
|
2870
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
2871
|
+
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
2872
|
+
}
|
2873
|
+
}
|
2874
|
+
} else if (dirty instanceof Node) {
|
2875
|
+
/* If dirty is a DOM element, append to an empty document to avoid
|
2876
|
+
elements being stripped by the parser */
|
2877
|
+
body = _initDocument('<!---->');
|
2878
|
+
importedNode = body.ownerDocument.importNode(dirty, true);
|
2879
|
+
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
|
2880
|
+
/* Node is already a body, use as is */
|
2881
|
+
body = importedNode;
|
2882
|
+
} else if (importedNode.nodeName === 'HTML') {
|
2883
|
+
body = importedNode;
|
2884
|
+
} else {
|
2885
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
2886
|
+
body.appendChild(importedNode);
|
2887
|
+
}
|
2888
|
+
} else {
|
2889
|
+
/* Exit directly if we have nothing to do */
|
2890
|
+
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
2891
|
+
// eslint-disable-next-line unicorn/prefer-includes
|
2892
|
+
dirty.indexOf('<') === -1) {
|
2893
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
2894
|
+
}
|
2895
|
+
/* Initialize the document to work on */
|
2896
|
+
body = _initDocument(dirty);
|
2897
|
+
/* Check we have a DOM node from the data */
|
2898
|
+
if (!body) {
|
2899
|
+
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
1529
2900
|
}
|
1530
|
-
}] : []))
|
1531
|
-
});
|
1532
|
-
return popperInstance;
|
1533
|
-
}
|
1534
|
-
/**
|
1535
|
-
* 显示
|
1536
|
-
* @param el
|
1537
|
-
*/
|
1538
|
-
function show(el) {
|
1539
|
-
var _nodeList$get2 = tooltips_nodeList.get(el),
|
1540
|
-
popper = _nodeList$get2.popper,
|
1541
|
-
opts = _nodeList$get2.opts;
|
1542
|
-
var disabled = opts.disabled,
|
1543
|
-
content = opts.content,
|
1544
|
-
hasArrow = opts.arrow,
|
1545
|
-
onShow = opts.onShow,
|
1546
|
-
boundary = opts.boundary,
|
1547
|
-
_opts$modifiers = opts.modifiers,
|
1548
|
-
modifiers = _opts$modifiers === void 0 ? [] : _opts$modifiers;
|
1549
|
-
if (disabled) return;
|
1550
|
-
renderContext(content, popper);
|
1551
|
-
if (hasArrow) {
|
1552
|
-
var arrow = renderArrow();
|
1553
|
-
popper.appendChild(arrow);
|
1554
|
-
}
|
1555
|
-
var container = document.body;
|
1556
|
-
if (boundary) {
|
1557
|
-
if (boundary === 'parent') {
|
1558
|
-
container = el.parentElement;
|
1559
|
-
} else if (boundary instanceof HTMLElement) {
|
1560
|
-
container = boundary;
|
1561
2901
|
}
|
1562
|
-
|
1563
|
-
|
1564
|
-
|
1565
|
-
|
1566
|
-
|
1567
|
-
|
1568
|
-
|
1569
|
-
|
1570
|
-
|
1571
|
-
|
1572
|
-
|
1573
|
-
|
1574
|
-
|
1575
|
-
|
1576
|
-
|
1577
|
-
|
1578
|
-
|
1579
|
-
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1585
|
-
|
1586
|
-
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1592
|
-
|
1593
|
-
|
1594
|
-
|
1595
|
-
|
1596
|
-
|
1597
|
-
|
1598
|
-
|
2902
|
+
/* Remove first element node (ours) if FORCE_BODY is set */
|
2903
|
+
if (body && FORCE_BODY) {
|
2904
|
+
_forceRemove(body.firstChild);
|
2905
|
+
}
|
2906
|
+
/* Get node iterator */
|
2907
|
+
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
2908
|
+
/* Now start iterating over the created document */
|
2909
|
+
while (currentNode = nodeIterator.nextNode()) {
|
2910
|
+
/* Sanitize tags and elements */
|
2911
|
+
_sanitizeElements(currentNode);
|
2912
|
+
/* Check attributes next */
|
2913
|
+
_sanitizeAttributes(currentNode);
|
2914
|
+
/* Shadow DOM detected, sanitize it */
|
2915
|
+
if (currentNode.content instanceof DocumentFragment) {
|
2916
|
+
_sanitizeShadowDOM(currentNode.content);
|
2917
|
+
}
|
2918
|
+
}
|
2919
|
+
/* If we sanitized `dirty` in-place, return it. */
|
2920
|
+
if (IN_PLACE) {
|
2921
|
+
return dirty;
|
2922
|
+
}
|
2923
|
+
/* Return sanitized string or DOM */
|
2924
|
+
if (RETURN_DOM) {
|
2925
|
+
if (RETURN_DOM_FRAGMENT) {
|
2926
|
+
returnNode = createDocumentFragment.call(body.ownerDocument);
|
2927
|
+
while (body.firstChild) {
|
2928
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
2929
|
+
returnNode.appendChild(body.firstChild);
|
2930
|
+
}
|
2931
|
+
} else {
|
2932
|
+
returnNode = body;
|
2933
|
+
}
|
2934
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
|
2935
|
+
/*
|
2936
|
+
AdoptNode() is not used because internal state is not reset
|
2937
|
+
(e.g. the past names map of a HTMLFormElement), this is safe
|
2938
|
+
in theory but we would rather not risk another attack vector.
|
2939
|
+
The state that is cloned by importNode() is explicitly defined
|
2940
|
+
by the specs.
|
2941
|
+
*/
|
2942
|
+
returnNode = importNode.call(originalDocument, returnNode, true);
|
2943
|
+
}
|
2944
|
+
return returnNode;
|
2945
|
+
}
|
2946
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
2947
|
+
/* Serialize doctype if allowed */
|
2948
|
+
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
2949
|
+
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
2950
|
+
}
|
2951
|
+
/* Sanitize final string template-safe */
|
2952
|
+
if (SAFE_FOR_TEMPLATES) {
|
2953
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
2954
|
+
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
2955
|
+
});
|
2956
|
+
}
|
2957
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
2958
|
+
};
|
2959
|
+
DOMPurify.setConfig = function () {
|
2960
|
+
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
2961
|
+
_parseConfig(cfg);
|
2962
|
+
SET_CONFIG = true;
|
2963
|
+
};
|
2964
|
+
DOMPurify.clearConfig = function () {
|
2965
|
+
CONFIG = null;
|
2966
|
+
SET_CONFIG = false;
|
2967
|
+
};
|
2968
|
+
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
2969
|
+
/* Initialize shared config vars if necessary. */
|
2970
|
+
if (!CONFIG) {
|
2971
|
+
_parseConfig({});
|
2972
|
+
}
|
2973
|
+
const lcTag = transformCaseFunc(tag);
|
2974
|
+
const lcName = transformCaseFunc(attr);
|
2975
|
+
return _isValidAttribute(lcTag, lcName, value);
|
2976
|
+
};
|
2977
|
+
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
2978
|
+
if (typeof hookFunction !== 'function') {
|
2979
|
+
return;
|
2980
|
+
}
|
2981
|
+
arrayPush(hooks[entryPoint], hookFunction);
|
2982
|
+
};
|
2983
|
+
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
2984
|
+
if (hookFunction !== undefined) {
|
2985
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
2986
|
+
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
2987
|
+
}
|
2988
|
+
return arrayPop(hooks[entryPoint]);
|
2989
|
+
};
|
2990
|
+
DOMPurify.removeHooks = function (entryPoint) {
|
2991
|
+
hooks[entryPoint] = [];
|
2992
|
+
};
|
2993
|
+
DOMPurify.removeAllHooks = function () {
|
2994
|
+
hooks = _createHooksMap();
|
2995
|
+
};
|
2996
|
+
return DOMPurify;
|
1599
2997
|
}
|
1600
|
-
|
1601
|
-
;// external "../loading"
|
1602
|
-
var external_loading_x = (y) => {
|
1603
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1604
|
-
}
|
1605
|
-
var external_loading_y = (x) => (() => (x))
|
1606
|
-
const external_loading_namespaceObject = external_loading_x({ });
|
1607
|
-
;// external "../overflow-title"
|
1608
|
-
var external_overflow_title_x = (y) => {
|
1609
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1610
|
-
}
|
1611
|
-
var external_overflow_title_y = (x) => (() => (x))
|
1612
|
-
const external_overflow_title_namespaceObject = external_overflow_title_x({ });
|
1613
|
-
;// ../../packages/directives/src/index.ts
|
1614
|
-
/*
|
1615
|
-
* Tencent is pleased to support the open source community by making
|
1616
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1617
|
-
*
|
1618
|
-
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1619
|
-
*
|
1620
|
-
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1621
|
-
*
|
1622
|
-
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1623
|
-
*
|
1624
|
-
* ---------------------------------------------------
|
1625
|
-
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1626
|
-
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1627
|
-
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1628
|
-
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1629
|
-
*
|
1630
|
-
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1631
|
-
* the Software.
|
1632
|
-
*
|
1633
|
-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1634
|
-
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1635
|
-
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1636
|
-
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1637
|
-
* IN THE SOFTWARE.
|
1638
|
-
*/
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
2998
|
+
var purify = createDOMPurify();
|
1642
2999
|
|
1643
3000
|
|
3001
|
+
//# sourceMappingURL=purify.es.mjs.map
|
1644
3002
|
|
1645
|
-
|
1646
|
-
;// external "../icon"
|
1647
|
-
var icon_x = (y) => {
|
1648
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1649
|
-
}
|
1650
|
-
var icon_y = (x) => (() => (x))
|
1651
|
-
const icon_namespaceObject = icon_x({ ["Close"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close), ["Error"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error) });
|
1652
|
-
;// external "../loading"
|
1653
|
-
var loading_x = (y) => {
|
1654
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1655
|
-
}
|
1656
|
-
var loading_y = (x) => (() => (x))
|
1657
|
-
const loading_namespaceObject = loading_x({ ["BkLoadingSize"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__.BkLoadingSize), ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_loading_dcf0e69a__["default"]) });
|
1658
|
-
;// external "../loading/loading.less"
|
1659
|
-
var loading_less_x = (y) => {
|
1660
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1661
|
-
}
|
1662
|
-
var loading_less_y = (x) => (() => (x))
|
1663
|
-
const loading_less_namespaceObject = loading_less_x({ });
|
1664
|
-
;// external "../popover/popover.less"
|
1665
|
-
var popover_less_x = (y) => {
|
1666
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1667
|
-
}
|
1668
|
-
var popover_less_y = (x) => (() => (x))
|
1669
|
-
const popover_less_namespaceObject = popover_less_x({ });
|
1670
|
-
;// external "lodash/debounce"
|
1671
|
-
var debounce_x = (y) => {
|
1672
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1673
|
-
}
|
1674
|
-
var debounce_y = (x) => (() => (x))
|
1675
|
-
const debounce_namespaceObject = debounce_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"]) });
|
1676
|
-
;// external "lodash/trim"
|
1677
|
-
var trim_x = (y) => {
|
1678
|
-
var x = {}; __webpack_require__.d(x, y); return x
|
1679
|
-
}
|
1680
|
-
var trim_y = (x) => (() => (x))
|
1681
|
-
const trim_namespaceObject = trim_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_trim_5cdad98c__["default"]) });
|
1682
|
-
;// ../../packages/tag-input/src/list-tag-render.tsx
|
3003
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/list-tag-render.tsx
|
1683
3004
|
|
1684
3005
|
/*
|
1685
3006
|
* Tencent is pleased to support the open source community by making
|
1686
3007
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1687
3008
|
*
|
1688
|
-
* Copyright (C)
|
3009
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1689
3010
|
*
|
1690
3011
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1691
3012
|
*
|
@@ -1709,6 +3030,7 @@ const trim_namespaceObject = trim_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MOD
|
|
1709
3030
|
|
1710
3031
|
|
1711
3032
|
|
3033
|
+
|
1712
3034
|
/* harmony default export */ const list_tag_render = ((0,external_vue_namespaceObject.defineComponent)({
|
1713
3035
|
name: 'ListTagRender',
|
1714
3036
|
props: {
|
@@ -1728,9 +3050,9 @@ const trim_namespaceObject = trim_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MOD
|
|
1728
3050
|
var highlightKeyword = function highlightKeyword(value) {
|
1729
3051
|
if (_this.searchKeyword && !_this.disabled) {
|
1730
3052
|
var keywordReg = new RegExp("(".concat(_this.searchKeyword, ")"), 'i');
|
1731
|
-
return value.replace(keywordReg, '<strong class="highlight-text">$1</strong>');
|
3053
|
+
return purify.sanitize(value.replace(keywordReg, '<strong class="highlight-text">$1</strong>'));
|
1732
3054
|
}
|
1733
|
-
return value;
|
3055
|
+
return purify.sanitize(value);
|
1734
3056
|
};
|
1735
3057
|
if (this.tpl) {
|
1736
3058
|
return this.tpl(this.node, highlightKeyword, external_vue_namespaceObject.h, this);
|
@@ -1741,21 +3063,19 @@ const trim_namespaceObject = trim_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MOD
|
|
1741
3063
|
}, [(0,external_vue_namespaceObject.createVNode)("span", {
|
1742
3064
|
"class": "text",
|
1743
3065
|
"innerHTML": highlightKeyword(displayText)
|
1744
|
-
},
|
3066
|
+
}, null)]);
|
1745
3067
|
}
|
1746
3068
|
}));
|
1747
|
-
;// external "vue-types"
|
1748
|
-
var external_vue_types_x = (y)
|
1749
|
-
|
1750
|
-
}
|
1751
|
-
|
1752
|
-
const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => (__WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType) });
|
1753
|
-
;// ../../packages/tag-input/src/tag-props.ts
|
3069
|
+
;// CONCATENATED MODULE: external "vue-types"
|
3070
|
+
var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
3071
|
+
var external_vue_types_y = x => () => x
|
3072
|
+
const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
|
3073
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-props.ts
|
1754
3074
|
/*
|
1755
3075
|
* Tencent is pleased to support the open source community by making
|
1756
3076
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1757
3077
|
*
|
1758
|
-
* Copyright (C)
|
3078
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1759
3079
|
*
|
1760
3080
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1761
3081
|
*
|
@@ -1847,13 +3167,11 @@ var tagProps = function tagProps() {
|
|
1847
3167
|
};
|
1848
3168
|
};
|
1849
3169
|
/* harmony default export */ const tag_props = (tagProps);
|
1850
|
-
;// external "lodash/has"
|
1851
|
-
var has_x = (y)
|
1852
|
-
|
1853
|
-
}
|
1854
|
-
|
1855
|
-
const has_namespaceObject = has_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MODULE_lodash_has_e9e453be__["default"]) });
|
1856
|
-
;// ../../packages/tag-input/src/tag-render.tsx
|
3170
|
+
;// CONCATENATED MODULE: external "lodash/has"
|
3171
|
+
var has_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
3172
|
+
var has_y = x => () => x
|
3173
|
+
const has_namespaceObject = has_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_has_e9e453be__["default"] });
|
3174
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-render.tsx
|
1857
3175
|
|
1858
3176
|
|
1859
3177
|
function tag_render_ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
@@ -1862,7 +3180,7 @@ function tag_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
1862
3180
|
* Tencent is pleased to support the open source community by making
|
1863
3181
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1864
3182
|
*
|
1865
|
-
* Copyright (C)
|
3183
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1866
3184
|
*
|
1867
3185
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1868
3186
|
*
|
@@ -1942,7 +3260,7 @@ function tag_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
1942
3260
|
}, [this.node[this.displayKey]])]), [[(0,external_vue_namespaceObject.resolveDirective)("bk-tooltips"), this.overflowTips]]);
|
1943
3261
|
}
|
1944
3262
|
}));
|
1945
|
-
;// ../../packages/tag-input/src/tag-input.tsx
|
3263
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-input.tsx
|
1946
3264
|
|
1947
3265
|
|
1948
3266
|
|
@@ -1954,7 +3272,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
1954
3272
|
* Tencent is pleased to support the open source community by making
|
1955
3273
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1956
3274
|
*
|
1957
|
-
* Copyright (C)
|
3275
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
1958
3276
|
*
|
1959
3277
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1960
3278
|
*
|
@@ -2348,6 +3666,27 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
2348
3666
|
}
|
2349
3667
|
referenceNode.parentNode.insertBefore(newNode, swap);
|
2350
3668
|
};
|
3669
|
+
// 计算输入框的实际宽度,包括输入拼音时的正确宽度
|
3670
|
+
var updateInputWidth = function updateInputWidth(value) {
|
3671
|
+
var charLen = getCharLength(value);
|
3672
|
+
if (!charLen) {
|
3673
|
+
tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
|
3674
|
+
return;
|
3675
|
+
}
|
3676
|
+
var span = document.createElement('span');
|
3677
|
+
span.style.visibility = 'hidden';
|
3678
|
+
span.style.position = 'absolute';
|
3679
|
+
span.style.whiteSpace = 'pre';
|
3680
|
+
span.style.font = window.getComputedStyle(tagInputRef.value).font;
|
3681
|
+
span.textContent = value;
|
3682
|
+
document.body.appendChild(span);
|
3683
|
+
var width = span.offsetWidth;
|
3684
|
+
document.body.removeChild(span);
|
3685
|
+
tagInputRef.value.style.width = "".concat(Math.max(width + 10, INPUT_MIN_WIDTH), "px");
|
3686
|
+
};
|
3687
|
+
var handleCompositionEnd = function handleCompositionEnd() {
|
3688
|
+
updateInputWidth(curInputValue.value);
|
3689
|
+
};
|
2351
3690
|
var handleInput = function handleInput(e) {
|
2352
3691
|
var maxData = props.maxData,
|
2353
3692
|
trigger = props.trigger,
|
@@ -2355,18 +3694,14 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
2355
3694
|
if (maxData === -1 || maxData > tagList.value.length) {
|
2356
3695
|
var _ref5 = e !== null && e !== void 0 && e.target ? e.target : curInputValue,
|
2357
3696
|
value = _ref5.value;
|
2358
|
-
|
2359
|
-
if (charLen) {
|
3697
|
+
if (value) {
|
2360
3698
|
filterData(value);
|
2361
|
-
(
|
2362
|
-
// getBoundingClientRect获取宽度在中文输入法输入的时候会存在为0的情况,导致不显示输入的内容,按回车以后光标在最前面,所以需要提供默认值
|
2363
|
-
var tagInputWidth = inputValueRef.value.getBoundingClientRect().width || charLen * INPUT_MIN_WIDTH;
|
2364
|
-
tagInputRef.value.style.width = "".concat(tagInputWidth, "px");
|
2365
|
-
});
|
3699
|
+
updateInputWidth(value);
|
2366
3700
|
} else {
|
2367
3701
|
if (trigger === 'focus') {
|
2368
3702
|
filterData();
|
2369
3703
|
}
|
3704
|
+
tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
|
2370
3705
|
}
|
2371
3706
|
} else {
|
2372
3707
|
handleBlur();
|
@@ -2816,6 +4151,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
2816
4151
|
focusInputTrigger: focusInputTrigger,
|
2817
4152
|
activeClass: activeClass,
|
2818
4153
|
handleInput: handleInput,
|
4154
|
+
handleCompositionEnd: handleCompositionEnd,
|
2819
4155
|
handleFocus: handleFocus,
|
2820
4156
|
handleBlur: handleBlur,
|
2821
4157
|
handleTagSelected: handleTagSelected,
|
@@ -2842,9 +4178,9 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
2842
4178
|
}, [(0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
|
2843
4179
|
"arrow": false,
|
2844
4180
|
"placement": "bottom-start",
|
4181
|
+
"referenceCls": this.resolveClassName('tag-input-popover-reference'),
|
2845
4182
|
"theme": "light ".concat(this.resolveClassName('tag-input-popover-content')),
|
2846
|
-
"trigger": "manual"
|
2847
|
-
"referenceCls": this.resolveClassName('tag-input-popover-reference')
|
4183
|
+
"trigger": "manual"
|
2848
4184
|
}, this.popoverProps), {
|
2849
4185
|
"default": function _default() {
|
2850
4186
|
var _this$$slots$suffix, _this$$slots, _this$$slots$suffix2;
|
@@ -2888,6 +4224,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
2888
4224
|
"spellcheck": "false",
|
2889
4225
|
"type": "text",
|
2890
4226
|
"onBlur": _this.handleBlur,
|
4227
|
+
"onCompositionend": _this.handleCompositionEnd,
|
2891
4228
|
"onFocus": _this.handleFocus,
|
2892
4229
|
"onInput": _this.handleInput,
|
2893
4230
|
"onKeydown": _this.handleKeydown,
|
@@ -2962,12 +4299,12 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
2962
4299
|
})]);
|
2963
4300
|
}
|
2964
4301
|
}));
|
2965
|
-
;// ../../packages/tag-input/src/index.ts
|
4302
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/index.ts
|
2966
4303
|
/*
|
2967
4304
|
* Tencent is pleased to support the open source community by making
|
2968
4305
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
2969
4306
|
*
|
2970
|
-
* Copyright (C)
|
4307
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
2971
4308
|
*
|
2972
4309
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2973
4310
|
*
|
@@ -2994,6 +4331,8 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
2994
4331
|
var TagInput = (0,shared_namespaceObject.withInstall)(tag_input);
|
2995
4332
|
/* harmony default export */ const src = (TagInput);
|
2996
4333
|
|
4334
|
+
})();
|
4335
|
+
|
2997
4336
|
var __webpack_exports__TagInput = __webpack_exports__.TagInput;
|
2998
4337
|
var __webpack_exports__default = __webpack_exports__["default"];
|
2999
4338
|
var __webpack_exports__useTagsOverflow = __webpack_exports__.useTagsOverflow;
|