bkui-vue 2.0.2-beta.8 → 2.0.2-beta.80
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 +166 -138
- package/dist/index.esm.js +24292 -18450
- package/dist/index.umd.js +166 -138
- 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 +2 -1
- package/lib/affix/index.js +24 -32
- package/lib/alert/alert.variable.css +2 -1
- package/lib/alert/index.js +38 -35
- package/lib/animate-number/index.js +12 -16
- package/lib/backtop/backtop.variable.css +2 -1
- package/lib/backtop/index.js +24 -34
- package/lib/badge/badge.variable.css +2 -1
- package/lib/badge/index.js +20 -26
- package/lib/breadcrumb/breadcrumb.variable.css +2 -1
- package/lib/breadcrumb/index.js +26 -34
- package/lib/button/button.d.ts +1 -1
- package/lib/button/button.variable.css +2 -1
- package/lib/button/index.js +29 -39
- package/lib/card/card.variable.css +2 -1
- package/lib/card/index.js +35 -49
- package/lib/cascader/cascader.css +26 -24
- package/lib/cascader/cascader.d.ts +315 -0
- package/lib/cascader/cascader.less +78 -76
- package/lib/cascader/cascader.variable.css +28 -25
- package/lib/cascader/index.d.ts +618 -0
- package/lib/cascader/index.js +749 -717
- package/lib/checkbox/checkbox.variable.css +2 -1
- package/lib/checkbox/index.js +39 -49
- package/lib/code-diff/code-diff.variable.css +2 -1
- package/lib/code-diff/index.js +81 -85
- package/lib/collapse/collapse.variable.css +2 -1
- package/lib/collapse/index.js +36 -42
- package/lib/collapse-transition/collapse-transition.variable.css +2 -1
- package/lib/collapse-transition/index.js +16 -22
- package/lib/color-picker/color-picker.variable.css +2 -1
- package/lib/color-picker/index.js +682 -689
- package/lib/components.js +1 -1
- package/lib/config-provider/config-provider.variable.css +2 -1
- package/lib/config-provider/index.d.ts +1 -1
- package/lib/config-provider/index.js +32 -40
- package/lib/container/container.variable.css +2 -1
- 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 +2 -1
- package/lib/date-picker/index.d.ts +6 -2
- package/lib/date-picker/index.js +717 -736
- 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 +22 -2
- package/lib/dialog/index.js +100 -137
- package/lib/directives/index.js +509 -518
- package/lib/dist.index.js +1 -1
- package/lib/divider/divider.variable.css +2 -1
- package/lib/divider/index.js +18 -24
- package/lib/dropdown/dropdown.d.ts +1 -0
- package/lib/dropdown/dropdown.variable.css +2 -1
- package/lib/dropdown/index.d.ts +3 -0
- package/lib/dropdown/index.js +45 -52
- package/lib/exception/exception.variable.css +2 -1
- package/lib/exception/index.js +51 -57
- package/lib/fixed-navbar/fixed-navbar.variable.css +2 -1
- 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 +18 -5
- package/lib/form/index.d.ts +13 -0
- package/lib/form/index.js +677 -708
- 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 +2 -1
- package/lib/image/image.variable.css +2 -1
- package/lib/image/index.js +335 -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 +23 -3
- package/lib/input/index.d.ts +39 -20
- package/lib/input/index.js +448 -444
- package/lib/input/input.css +6 -0
- package/lib/input/input.d.ts +33 -19
- package/lib/input/input.less +7 -0
- package/lib/input/input.variable.css +8 -1
- package/lib/link/index.js +20 -28
- package/lib/link/link.variable.css +2 -1
- package/lib/loading/index.js +34 -32
- package/lib/loading/loading.variable.css +2 -1
- 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.css +5 -4
- package/lib/menu/menu.less +1 -0
- package/lib/menu/menu.variable.css +7 -5
- package/lib/menu/submenu.variable.css +2 -1
- package/lib/message/index.js +102 -74
- package/lib/message/message.variable.css +2 -1
- package/lib/message/messageConstructor.d.ts +1 -1
- package/lib/modal/index.js +43 -45
- package/lib/modal/modal.css +20 -1
- package/lib/modal/modal.variable.css +22 -2
- package/lib/navigation/index.js +22 -30
- package/lib/navigation/navigation.css +29 -29
- package/lib/navigation/navigation.less +29 -29
- package/lib/navigation/navigation.variable.css +31 -30
- package/lib/notify/index.js +69 -60
- package/lib/notify/notify.variable.css +2 -1
- package/lib/overflow-title/components/overflow-title.d.ts +6 -2
- package/lib/overflow-title/index.d.ts +12 -4
- package/lib/overflow-title/index.js +32 -44
- package/lib/overflow-title/props.d.ts +3 -1
- 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 +3 -1
- package/lib/pop-confirm/index.d.ts +592 -0
- package/lib/pop-confirm/index.js +43 -55
- package/lib/pop-confirm/pop-confirm.d.ts +296 -0
- package/lib/pop-confirm/pop-confirm.variable.css +2 -1
- package/lib/pop-confirm/props.d.ts +148 -0
- package/lib/popover/index.d.ts +18 -10
- package/lib/popover/index.js +582 -459
- package/lib/popover/popover.d.ts +8 -4
- package/lib/popover/popover.variable.css +2 -1
- package/lib/popover/props.d.ts +3 -1
- package/lib/popover/use-floating.d.ts +2 -2
- package/lib/popover/use-popover-init.d.ts +2 -2
- package/lib/popover/use-popper-id.d.ts +3 -1
- 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 +2 -1
- package/lib/progress/index.js +24 -30
- package/lib/progress/progress.variable.css +2 -1
- package/lib/radio/index.js +36 -44
- package/lib/radio/radio.variable.css +2 -1
- package/lib/rate/index.js +22 -28
- package/lib/rate/rate.variable.css +2 -1
- package/lib/resize-layout/index.js +24 -32
- package/lib/resize-layout/resize-layout.css +1 -0
- package/lib/resize-layout/resize-layout.less +1 -0
- package/lib/resize-layout/resize-layout.variable.css +3 -1
- package/lib/scrollbar/css/scrollbar.variable.css +2 -1
- package/lib/scrollbar/index.js +31 -31
- package/lib/search-select/index.d.ts +39 -11
- package/lib/search-select/index.js +576 -547
- package/lib/search-select/input.d.ts +5 -1
- package/lib/search-select/search-select.d.ts +13 -4
- package/lib/search-select/search-select.variable.css +2 -1
- package/lib/search-select/selected.d.ts +10 -2
- package/lib/search-select/utils.d.ts +1 -0
- package/lib/select/common.d.ts +0 -1
- package/lib/select/index.d.ts +55 -11
- package/lib/select/index.js +570 -619
- package/lib/select/optionGroup.d.ts +12 -1
- package/lib/select/select.d.ts +20 -4
- package/lib/select/select.variable.css +2 -1
- package/lib/select/type.d.ts +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 +86 -94
- package/lib/sideslider/sideslider.variable.css +2 -1
- 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 +2 -1
- package/lib/steps/index.js +85 -92
- package/lib/steps/steps.css +24 -11
- package/lib/steps/steps.d.ts +1 -1
- package/lib/steps/steps.less +28 -10
- package/lib/steps/steps.variable.css +26 -12
- package/lib/styles/mixins/animate.variable.css +2 -1
- package/lib/styles/mixins/popper.variable.css +2 -1
- package/lib/styles/mixins/scroll.variable.css +2 -1
- package/lib/styles/reset.variable.css +2 -1
- package/lib/styles/themes/themes.less +4 -1
- package/lib/swiper/index.js +20 -26
- package/lib/swiper/swiper.variable.css +2 -1
- package/lib/switcher/index.js +24 -32
- package/lib/switcher/switcher.variable.css +2 -1
- package/lib/tab/index.d.ts +12 -0
- package/lib/tab/index.js +344 -353
- package/lib/tab/props.d.ts +3 -0
- package/lib/tab/tab.d.ts +6 -0
- package/lib/tab/tab.variable.css +2 -1
- package/lib/table/index.js +632 -691
- package/lib/table/plugins/head-filter.variable.css +2 -1
- package/lib/table/plugins/head-sort.variable.css +2 -1
- package/lib/table/plugins/settings.variable.css +2 -1
- package/lib/table/table.css +1 -0
- package/lib/table/table.variable.css +3 -1
- package/lib/table-column/index.js +10 -14
- package/lib/tag/index.js +28 -38
- package/lib/tag/tag.variable.css +2 -1
- package/lib/tag-input/index.d.ts +79 -6
- package/lib/tag-input/index.js +2341 -791
- package/lib/tag-input/tag-input.css +31 -0
- package/lib/tag-input/tag-input.d.ts +35 -3
- package/lib/tag-input/tag-input.less +36 -0
- package/lib/tag-input/tag-input.variable.css +33 -1
- package/lib/tag-input/tag-props.d.ts +13 -1
- package/lib/tag-input/tag-render.d.ts +24 -2
- package/lib/time-picker/index.js +10 -14
- package/lib/time-picker/time-picker.variable.css +2 -1
- package/lib/timeline/index.js +1368 -25
- package/lib/timeline/timeline.d.ts +1 -1
- package/lib/timeline/timeline.variable.css +2 -1
- 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 +28 -9
- package/lib/tree/constant.d.ts +2 -0
- package/lib/tree/index.d.ts +71 -11
- package/lib/tree/index.js +17743 -209
- package/lib/tree/props.d.ts +38 -3
- package/lib/tree/tree.css +46 -0
- package/lib/tree/tree.d.ts +33 -5
- package/lib/tree/tree.less +57 -2
- package/lib/tree/tree.variable.css +48 -1
- package/lib/tree/use-array-move.d.ts +6 -0
- package/lib/tree/use-node-action.d.ts +2 -2
- package/lib/tree/use-node-attribute.d.ts +3 -0
- package/lib/upload/index.js +570 -582
- package/lib/upload/upload.variable.css +2 -1
- package/lib/virtual-render/index.js +50 -62
- package/lib/virtual-render/virtual-render.variable.css +2 -1
- 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
|
});
|
|
@@ -1496,6 +1485,7 @@ function renderArrow() {
|
|
|
1496
1485
|
* @returns popper实例
|
|
1497
1486
|
*/
|
|
1498
1487
|
function createPopperInstance(el, popper) {
|
|
1488
|
+
if (!tooltips_nodeList.get(el)) return;
|
|
1499
1489
|
var _nodeList$get = tooltips_nodeList.get(el),
|
|
1500
1490
|
opts = _nodeList$get.opts;
|
|
1501
1491
|
var placement = opts.placement,
|
|
@@ -1508,184 +1498,1517 @@ function createPopperInstance(el, popper) {
|
|
|
1508
1498
|
options: {
|
|
1509
1499
|
offset: [0, distance]
|
|
1510
1500
|
}
|
|
1511
|
-
}, {
|
|
1512
|
-
name: 'arrow',
|
|
1513
|
-
options: {
|
|
1514
|
-
padding: 5
|
|
1501
|
+
}, {
|
|
1502
|
+
name: 'arrow',
|
|
1503
|
+
options: {
|
|
1504
|
+
padding: 5
|
|
1505
|
+
}
|
|
1506
|
+
}].concat(_toConsumableArray(sameWidth ? [{
|
|
1507
|
+
name: 'sameWidth',
|
|
1508
|
+
enabled: true,
|
|
1509
|
+
phase: 'beforeWrite',
|
|
1510
|
+
requires: ['computeStyles'],
|
|
1511
|
+
fn: function fn(_ref) {
|
|
1512
|
+
var state = _ref.state;
|
|
1513
|
+
state.styles.popper.width = "".concat(state.rects.reference.width, "px");
|
|
1514
|
+
},
|
|
1515
|
+
effect: function effect(_ref2) {
|
|
1516
|
+
var state = _ref2.state;
|
|
1517
|
+
state.elements.popper.style.overflowWrap = 'break-word';
|
|
1518
|
+
state.elements.popper.style.width = "".concat(state.elements.reference.offsetWidth, "px");
|
|
1519
|
+
}
|
|
1520
|
+
}] : []))
|
|
1521
|
+
});
|
|
1522
|
+
return popperInstance;
|
|
1523
|
+
}
|
|
1524
|
+
/**
|
|
1525
|
+
* 显示
|
|
1526
|
+
* @param el
|
|
1527
|
+
*/
|
|
1528
|
+
function show(el) {
|
|
1529
|
+
if (!tooltips_nodeList.get(el)) return;
|
|
1530
|
+
var _nodeList$get2 = tooltips_nodeList.get(el),
|
|
1531
|
+
popper = _nodeList$get2.popper,
|
|
1532
|
+
opts = _nodeList$get2.opts;
|
|
1533
|
+
var disabled = opts.disabled,
|
|
1534
|
+
content = opts.content,
|
|
1535
|
+
hasArrow = opts.arrow,
|
|
1536
|
+
onShow = opts.onShow,
|
|
1537
|
+
boundary = opts.boundary,
|
|
1538
|
+
_opts$modifiers = opts.modifiers,
|
|
1539
|
+
modifiers = _opts$modifiers === void 0 ? [] : _opts$modifiers;
|
|
1540
|
+
if (disabled) return;
|
|
1541
|
+
renderContext(content, popper);
|
|
1542
|
+
if (hasArrow) {
|
|
1543
|
+
var arrow = renderArrow();
|
|
1544
|
+
popper.appendChild(arrow);
|
|
1545
|
+
}
|
|
1546
|
+
var container = document.body;
|
|
1547
|
+
if (boundary) {
|
|
1548
|
+
if (boundary === 'parent') {
|
|
1549
|
+
container = el.parentElement;
|
|
1550
|
+
} else if (boundary instanceof HTMLElement) {
|
|
1551
|
+
container = boundary;
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
container.appendChild(popper);
|
|
1555
|
+
var popperInstance = createPopperInstance(el, popper);
|
|
1556
|
+
onShow();
|
|
1557
|
+
// Make the tooltip visible
|
|
1558
|
+
popper.setAttribute('data-show', '');
|
|
1559
|
+
// Enable the event listeners
|
|
1560
|
+
popperInstance.setOptions(function (options) {
|
|
1561
|
+
return tooltips_objectSpread(tooltips_objectSpread({}, options), {}, {
|
|
1562
|
+
modifiers: [].concat(_toConsumableArray(options.modifiers), _toConsumableArray(modifiers), [{
|
|
1563
|
+
name: 'eventListeners',
|
|
1564
|
+
enabled: true
|
|
1565
|
+
}])
|
|
1566
|
+
});
|
|
1567
|
+
});
|
|
1568
|
+
// Update its position
|
|
1569
|
+
popperInstance.forceUpdate();
|
|
1570
|
+
tooltips_nodeList.get(el).popperInstance = popperInstance;
|
|
1571
|
+
}
|
|
1572
|
+
/**
|
|
1573
|
+
* 隐藏
|
|
1574
|
+
* @param el
|
|
1575
|
+
*/
|
|
1576
|
+
function hide(el) {
|
|
1577
|
+
if (!tooltips_nodeList.get(el)) return;
|
|
1578
|
+
var _nodeList$get3 = tooltips_nodeList.get(el),
|
|
1579
|
+
popper = _nodeList$get3.popper,
|
|
1580
|
+
popperInstance = _nodeList$get3.popperInstance,
|
|
1581
|
+
opts = _nodeList$get3.opts;
|
|
1582
|
+
var onHide = opts.onHide;
|
|
1583
|
+
if (popper && document.body.contains(popper)) {
|
|
1584
|
+
var _popper$parentNode;
|
|
1585
|
+
popper.removeAttribute('data-show');
|
|
1586
|
+
popperInstance === null || popperInstance === void 0 || popperInstance.destroy();
|
|
1587
|
+
popper === null || popper === void 0 || (_popper$parentNode = popper.parentNode) === null || _popper$parentNode === void 0 || _popper$parentNode.removeChild(popper);
|
|
1588
|
+
onHide();
|
|
1589
|
+
}
|
|
1590
|
+
}
|
|
1591
|
+
/* harmony default export */ const src_tooltips = (tooltips);
|
|
1592
|
+
;// CONCATENATED MODULE: external "../loading"
|
|
1593
|
+
var external_loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1594
|
+
var external_loading_y = x => () => x
|
|
1595
|
+
const external_loading_namespaceObject = external_loading_x({ });
|
|
1596
|
+
;// CONCATENATED MODULE: external "../overflow-title"
|
|
1597
|
+
var external_overflow_title_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1598
|
+
var external_overflow_title_y = x => () => x
|
|
1599
|
+
const external_overflow_title_namespaceObject = external_overflow_title_x({ });
|
|
1600
|
+
;// CONCATENATED MODULE: ../../packages/directives/src/index.ts
|
|
1601
|
+
/*
|
|
1602
|
+
* Tencent is pleased to support the open source community by making
|
|
1603
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
1604
|
+
*
|
|
1605
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
|
1606
|
+
*
|
|
1607
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
1608
|
+
*
|
|
1609
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
|
1610
|
+
*
|
|
1611
|
+
* ---------------------------------------------------
|
|
1612
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
|
1613
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
|
1614
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
|
1615
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
1616
|
+
*
|
|
1617
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
|
1618
|
+
* the Software.
|
|
1619
|
+
*
|
|
1620
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
|
1621
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
1622
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
|
1623
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
|
1624
|
+
* IN THE SOFTWARE.
|
|
1625
|
+
*/
|
|
1626
|
+
|
|
1627
|
+
|
|
1628
|
+
|
|
1629
|
+
|
|
1630
|
+
|
|
1631
|
+
|
|
1632
|
+
// export { createInstance as bkEllipsisInstance } from './ellipsis';
|
|
1633
|
+
;// CONCATENATED MODULE: external "../icon"
|
|
1634
|
+
var icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1635
|
+
var icon_y = x => () => x
|
|
1636
|
+
const icon_namespaceObject = icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Close, ["Copy"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Copy, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE_bkui_vue_lib_icon_a97c79c3__.Error });
|
|
1637
|
+
;// CONCATENATED MODULE: external "../loading"
|
|
1638
|
+
var loading_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1639
|
+
var loading_y = x => () => x
|
|
1640
|
+
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"] });
|
|
1641
|
+
;// CONCATENATED MODULE: external "../loading/loading.less"
|
|
1642
|
+
var loading_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1643
|
+
var loading_less_y = x => () => x
|
|
1644
|
+
const loading_less_namespaceObject = loading_less_x({ });
|
|
1645
|
+
;// CONCATENATED MODULE: external "../popover/popover.less"
|
|
1646
|
+
var popover_less_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1647
|
+
var popover_less_y = x => () => x
|
|
1648
|
+
const popover_less_namespaceObject = popover_less_x({ });
|
|
1649
|
+
;// CONCATENATED MODULE: external "lodash/debounce"
|
|
1650
|
+
var debounce_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1651
|
+
var debounce_y = x => () => x
|
|
1652
|
+
const debounce_namespaceObject = debounce_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_debounce_3540babe__["default"] });
|
|
1653
|
+
;// CONCATENATED MODULE: external "lodash/trim"
|
|
1654
|
+
var trim_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
1655
|
+
var trim_y = x => () => x
|
|
1656
|
+
const trim_namespaceObject = trim_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_trim_5cdad98c__["default"] });
|
|
1657
|
+
;// CONCATENATED MODULE: ../../node_modules/dompurify/dist/purify.es.mjs
|
|
1658
|
+
/*! @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 */
|
|
1659
|
+
|
|
1660
|
+
const {
|
|
1661
|
+
entries,
|
|
1662
|
+
setPrototypeOf,
|
|
1663
|
+
isFrozen,
|
|
1664
|
+
getPrototypeOf,
|
|
1665
|
+
getOwnPropertyDescriptor
|
|
1666
|
+
} = Object;
|
|
1667
|
+
let {
|
|
1668
|
+
freeze,
|
|
1669
|
+
seal,
|
|
1670
|
+
create
|
|
1671
|
+
} = Object; // eslint-disable-line import/no-mutable-exports
|
|
1672
|
+
let {
|
|
1673
|
+
apply,
|
|
1674
|
+
construct
|
|
1675
|
+
} = typeof Reflect !== 'undefined' && Reflect;
|
|
1676
|
+
if (!freeze) {
|
|
1677
|
+
freeze = function freeze(x) {
|
|
1678
|
+
return x;
|
|
1679
|
+
};
|
|
1680
|
+
}
|
|
1681
|
+
if (!seal) {
|
|
1682
|
+
seal = function seal(x) {
|
|
1683
|
+
return x;
|
|
1684
|
+
};
|
|
1685
|
+
}
|
|
1686
|
+
if (!apply) {
|
|
1687
|
+
apply = function apply(fun, thisValue, args) {
|
|
1688
|
+
return fun.apply(thisValue, args);
|
|
1689
|
+
};
|
|
1690
|
+
}
|
|
1691
|
+
if (!construct) {
|
|
1692
|
+
construct = function construct(Func, args) {
|
|
1693
|
+
return new Func(...args);
|
|
1694
|
+
};
|
|
1695
|
+
}
|
|
1696
|
+
const arrayForEach = unapply(Array.prototype.forEach);
|
|
1697
|
+
const arrayLastIndexOf = unapply(Array.prototype.lastIndexOf);
|
|
1698
|
+
const arrayPop = unapply(Array.prototype.pop);
|
|
1699
|
+
const arrayPush = unapply(Array.prototype.push);
|
|
1700
|
+
const arraySplice = unapply(Array.prototype.splice);
|
|
1701
|
+
const stringToLowerCase = unapply(String.prototype.toLowerCase);
|
|
1702
|
+
const stringToString = unapply(String.prototype.toString);
|
|
1703
|
+
const stringMatch = unapply(String.prototype.match);
|
|
1704
|
+
const stringReplace = unapply(String.prototype.replace);
|
|
1705
|
+
const stringIndexOf = unapply(String.prototype.indexOf);
|
|
1706
|
+
const stringTrim = unapply(String.prototype.trim);
|
|
1707
|
+
const objectHasOwnProperty = unapply(Object.prototype.hasOwnProperty);
|
|
1708
|
+
const regExpTest = unapply(RegExp.prototype.test);
|
|
1709
|
+
const typeErrorCreate = unconstruct(TypeError);
|
|
1710
|
+
/**
|
|
1711
|
+
* Creates a new function that calls the given function with a specified thisArg and arguments.
|
|
1712
|
+
*
|
|
1713
|
+
* @param func - The function to be wrapped and called.
|
|
1714
|
+
* @returns A new function that calls the given function with a specified thisArg and arguments.
|
|
1715
|
+
*/
|
|
1716
|
+
function unapply(func) {
|
|
1717
|
+
return function (thisArg) {
|
|
1718
|
+
if (thisArg instanceof RegExp) {
|
|
1719
|
+
thisArg.lastIndex = 0;
|
|
1720
|
+
}
|
|
1721
|
+
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
|
|
1722
|
+
args[_key - 1] = arguments[_key];
|
|
1723
|
+
}
|
|
1724
|
+
return apply(func, thisArg, args);
|
|
1725
|
+
};
|
|
1726
|
+
}
|
|
1727
|
+
/**
|
|
1728
|
+
* Creates a new function that constructs an instance of the given constructor function with the provided arguments.
|
|
1729
|
+
*
|
|
1730
|
+
* @param func - The constructor function to be wrapped and called.
|
|
1731
|
+
* @returns A new function that constructs an instance of the given constructor function with the provided arguments.
|
|
1732
|
+
*/
|
|
1733
|
+
function unconstruct(func) {
|
|
1734
|
+
return function () {
|
|
1735
|
+
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
|
|
1736
|
+
args[_key2] = arguments[_key2];
|
|
1737
|
+
}
|
|
1738
|
+
return construct(func, args);
|
|
1739
|
+
};
|
|
1740
|
+
}
|
|
1741
|
+
/**
|
|
1742
|
+
* Add properties to a lookup table
|
|
1743
|
+
*
|
|
1744
|
+
* @param set - The set to which elements will be added.
|
|
1745
|
+
* @param array - The array containing elements to be added to the set.
|
|
1746
|
+
* @param transformCaseFunc - An optional function to transform the case of each element before adding to the set.
|
|
1747
|
+
* @returns The modified set with added elements.
|
|
1748
|
+
*/
|
|
1749
|
+
function addToSet(set, array) {
|
|
1750
|
+
let transformCaseFunc = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : stringToLowerCase;
|
|
1751
|
+
if (setPrototypeOf) {
|
|
1752
|
+
// Make 'in' and truthy checks like Boolean(set.constructor)
|
|
1753
|
+
// independent of any properties defined on Object.prototype.
|
|
1754
|
+
// Prevent prototype setters from intercepting set as a this value.
|
|
1755
|
+
setPrototypeOf(set, null);
|
|
1756
|
+
}
|
|
1757
|
+
let l = array.length;
|
|
1758
|
+
while (l--) {
|
|
1759
|
+
let element = array[l];
|
|
1760
|
+
if (typeof element === 'string') {
|
|
1761
|
+
const lcElement = transformCaseFunc(element);
|
|
1762
|
+
if (lcElement !== element) {
|
|
1763
|
+
// Config presets (e.g. tags.js, attrs.js) are immutable.
|
|
1764
|
+
if (!isFrozen(array)) {
|
|
1765
|
+
array[l] = lcElement;
|
|
1766
|
+
}
|
|
1767
|
+
element = lcElement;
|
|
1768
|
+
}
|
|
1769
|
+
}
|
|
1770
|
+
set[element] = true;
|
|
1771
|
+
}
|
|
1772
|
+
return set;
|
|
1773
|
+
}
|
|
1774
|
+
/**
|
|
1775
|
+
* Clean up an array to harden against CSPP
|
|
1776
|
+
*
|
|
1777
|
+
* @param array - The array to be cleaned.
|
|
1778
|
+
* @returns The cleaned version of the array
|
|
1779
|
+
*/
|
|
1780
|
+
function cleanArray(array) {
|
|
1781
|
+
for (let index = 0; index < array.length; index++) {
|
|
1782
|
+
const isPropertyExist = objectHasOwnProperty(array, index);
|
|
1783
|
+
if (!isPropertyExist) {
|
|
1784
|
+
array[index] = null;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
return array;
|
|
1788
|
+
}
|
|
1789
|
+
/**
|
|
1790
|
+
* Shallow clone an object
|
|
1791
|
+
*
|
|
1792
|
+
* @param object - The object to be cloned.
|
|
1793
|
+
* @returns A new object that copies the original.
|
|
1794
|
+
*/
|
|
1795
|
+
function clone(object) {
|
|
1796
|
+
const newObject = create(null);
|
|
1797
|
+
for (const [property, value] of entries(object)) {
|
|
1798
|
+
const isPropertyExist = objectHasOwnProperty(object, property);
|
|
1799
|
+
if (isPropertyExist) {
|
|
1800
|
+
if (Array.isArray(value)) {
|
|
1801
|
+
newObject[property] = cleanArray(value);
|
|
1802
|
+
} else if (value && typeof value === 'object' && value.constructor === Object) {
|
|
1803
|
+
newObject[property] = clone(value);
|
|
1804
|
+
} else {
|
|
1805
|
+
newObject[property] = value;
|
|
1806
|
+
}
|
|
1807
|
+
}
|
|
1808
|
+
}
|
|
1809
|
+
return newObject;
|
|
1810
|
+
}
|
|
1811
|
+
/**
|
|
1812
|
+
* This method automatically checks if the prop is function or getter and behaves accordingly.
|
|
1813
|
+
*
|
|
1814
|
+
* @param object - The object to look up the getter function in its prototype chain.
|
|
1815
|
+
* @param prop - The property name for which to find the getter function.
|
|
1816
|
+
* @returns The getter function found in the prototype chain or a fallback function.
|
|
1817
|
+
*/
|
|
1818
|
+
function lookupGetter(object, prop) {
|
|
1819
|
+
while (object !== null) {
|
|
1820
|
+
const desc = getOwnPropertyDescriptor(object, prop);
|
|
1821
|
+
if (desc) {
|
|
1822
|
+
if (desc.get) {
|
|
1823
|
+
return unapply(desc.get);
|
|
1824
|
+
}
|
|
1825
|
+
if (typeof desc.value === 'function') {
|
|
1826
|
+
return unapply(desc.value);
|
|
1827
|
+
}
|
|
1828
|
+
}
|
|
1829
|
+
object = getPrototypeOf(object);
|
|
1830
|
+
}
|
|
1831
|
+
function fallbackValue() {
|
|
1832
|
+
return null;
|
|
1833
|
+
}
|
|
1834
|
+
return fallbackValue;
|
|
1835
|
+
}
|
|
1836
|
+
|
|
1837
|
+
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']);
|
|
1838
|
+
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']);
|
|
1839
|
+
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']);
|
|
1840
|
+
// List of SVG elements that are disallowed by default.
|
|
1841
|
+
// We still need to know them so that we can do namespace
|
|
1842
|
+
// checks properly in case one wants to add them to
|
|
1843
|
+
// allow-list.
|
|
1844
|
+
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']);
|
|
1845
|
+
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']);
|
|
1846
|
+
// Similarly to SVG, we want to know all MathML elements,
|
|
1847
|
+
// even those that we disallow by default.
|
|
1848
|
+
const mathMlDisallowed = freeze(['maction', 'maligngroup', 'malignmark', 'mlongdiv', 'mscarries', 'mscarry', 'msgroup', 'mstack', 'msline', 'msrow', 'semantics', 'annotation', 'annotation-xml', 'mprescripts', 'none']);
|
|
1849
|
+
const purify_es_text = freeze(['#text']);
|
|
1850
|
+
|
|
1851
|
+
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']);
|
|
1852
|
+
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']);
|
|
1853
|
+
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']);
|
|
1854
|
+
const xml = freeze(['xlink:href', 'xml:id', 'xlink:title', 'xml:space', 'xmlns:xlink']);
|
|
1855
|
+
|
|
1856
|
+
// eslint-disable-next-line unicorn/better-regex
|
|
1857
|
+
const MUSTACHE_EXPR = seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm); // Specify template detection regex for SAFE_FOR_TEMPLATES mode
|
|
1858
|
+
const ERB_EXPR = seal(/<%[\w\W]*|[\w\W]*%>/gm);
|
|
1859
|
+
const TMPLIT_EXPR = seal(/\$\{[\w\W]*/gm); // eslint-disable-line unicorn/better-regex
|
|
1860
|
+
const DATA_ATTR = seal(/^data-[\-\w.\u00B7-\uFFFF]+$/); // eslint-disable-line no-useless-escape
|
|
1861
|
+
const ARIA_ATTR = seal(/^aria-[\-\w]+$/); // eslint-disable-line no-useless-escape
|
|
1862
|
+
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
|
|
1863
|
+
);
|
|
1864
|
+
const IS_SCRIPT_OR_DATA = seal(/^(?:\w+script|data):/i);
|
|
1865
|
+
const ATTR_WHITESPACE = seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g // eslint-disable-line no-control-regex
|
|
1866
|
+
);
|
|
1867
|
+
const DOCTYPE_NAME = seal(/^html$/i);
|
|
1868
|
+
const CUSTOM_ELEMENT = seal(/^[a-z][.\w]*(-[.\w]+)+$/i);
|
|
1869
|
+
|
|
1870
|
+
var EXPRESSIONS = /*#__PURE__*/Object.freeze({
|
|
1871
|
+
__proto__: null,
|
|
1872
|
+
ARIA_ATTR: ARIA_ATTR,
|
|
1873
|
+
ATTR_WHITESPACE: ATTR_WHITESPACE,
|
|
1874
|
+
CUSTOM_ELEMENT: CUSTOM_ELEMENT,
|
|
1875
|
+
DATA_ATTR: DATA_ATTR,
|
|
1876
|
+
DOCTYPE_NAME: DOCTYPE_NAME,
|
|
1877
|
+
ERB_EXPR: ERB_EXPR,
|
|
1878
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI,
|
|
1879
|
+
IS_SCRIPT_OR_DATA: IS_SCRIPT_OR_DATA,
|
|
1880
|
+
MUSTACHE_EXPR: MUSTACHE_EXPR,
|
|
1881
|
+
TMPLIT_EXPR: TMPLIT_EXPR
|
|
1882
|
+
});
|
|
1883
|
+
|
|
1884
|
+
/* eslint-disable @typescript-eslint/indent */
|
|
1885
|
+
// https://developer.mozilla.org/en-US/docs/Web/API/Node/nodeType
|
|
1886
|
+
const NODE_TYPE = {
|
|
1887
|
+
element: 1,
|
|
1888
|
+
attribute: 2,
|
|
1889
|
+
text: 3,
|
|
1890
|
+
cdataSection: 4,
|
|
1891
|
+
entityReference: 5,
|
|
1892
|
+
// Deprecated
|
|
1893
|
+
entityNode: 6,
|
|
1894
|
+
// Deprecated
|
|
1895
|
+
progressingInstruction: 7,
|
|
1896
|
+
comment: 8,
|
|
1897
|
+
document: 9,
|
|
1898
|
+
documentType: 10,
|
|
1899
|
+
documentFragment: 11,
|
|
1900
|
+
notation: 12 // Deprecated
|
|
1901
|
+
};
|
|
1902
|
+
const getGlobal = function getGlobal() {
|
|
1903
|
+
return typeof window === 'undefined' ? null : window;
|
|
1904
|
+
};
|
|
1905
|
+
/**
|
|
1906
|
+
* Creates a no-op policy for internal use only.
|
|
1907
|
+
* Don't export this function outside this module!
|
|
1908
|
+
* @param trustedTypes The policy factory.
|
|
1909
|
+
* @param purifyHostElement The Script element used to load DOMPurify (to determine policy name suffix).
|
|
1910
|
+
* @return The policy created (or null, if Trusted Types
|
|
1911
|
+
* are not supported or creating the policy failed).
|
|
1912
|
+
*/
|
|
1913
|
+
const _createTrustedTypesPolicy = function _createTrustedTypesPolicy(trustedTypes, purifyHostElement) {
|
|
1914
|
+
if (typeof trustedTypes !== 'object' || typeof trustedTypes.createPolicy !== 'function') {
|
|
1915
|
+
return null;
|
|
1916
|
+
}
|
|
1917
|
+
// Allow the callers to control the unique policy name
|
|
1918
|
+
// by adding a data-tt-policy-suffix to the script element with the DOMPurify.
|
|
1919
|
+
// Policy creation with duplicate names throws in Trusted Types.
|
|
1920
|
+
let suffix = null;
|
|
1921
|
+
const ATTR_NAME = 'data-tt-policy-suffix';
|
|
1922
|
+
if (purifyHostElement && purifyHostElement.hasAttribute(ATTR_NAME)) {
|
|
1923
|
+
suffix = purifyHostElement.getAttribute(ATTR_NAME);
|
|
1924
|
+
}
|
|
1925
|
+
const policyName = 'dompurify' + (suffix ? '#' + suffix : '');
|
|
1926
|
+
try {
|
|
1927
|
+
return trustedTypes.createPolicy(policyName, {
|
|
1928
|
+
createHTML(html) {
|
|
1929
|
+
return html;
|
|
1930
|
+
},
|
|
1931
|
+
createScriptURL(scriptUrl) {
|
|
1932
|
+
return scriptUrl;
|
|
1933
|
+
}
|
|
1934
|
+
});
|
|
1935
|
+
} catch (_) {
|
|
1936
|
+
// Policy creation failed (most likely another DOMPurify script has
|
|
1937
|
+
// already run). Skip creating the policy, as this will only cause errors
|
|
1938
|
+
// if TT are enforced.
|
|
1939
|
+
console.warn('TrustedTypes policy ' + policyName + ' could not be created.');
|
|
1940
|
+
return null;
|
|
1941
|
+
}
|
|
1942
|
+
};
|
|
1943
|
+
const _createHooksMap = function _createHooksMap() {
|
|
1944
|
+
return {
|
|
1945
|
+
afterSanitizeAttributes: [],
|
|
1946
|
+
afterSanitizeElements: [],
|
|
1947
|
+
afterSanitizeShadowDOM: [],
|
|
1948
|
+
beforeSanitizeAttributes: [],
|
|
1949
|
+
beforeSanitizeElements: [],
|
|
1950
|
+
beforeSanitizeShadowDOM: [],
|
|
1951
|
+
uponSanitizeAttribute: [],
|
|
1952
|
+
uponSanitizeElement: [],
|
|
1953
|
+
uponSanitizeShadowNode: []
|
|
1954
|
+
};
|
|
1955
|
+
};
|
|
1956
|
+
function createDOMPurify() {
|
|
1957
|
+
let window = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getGlobal();
|
|
1958
|
+
const DOMPurify = root => createDOMPurify(root);
|
|
1959
|
+
DOMPurify.version = '3.2.6';
|
|
1960
|
+
DOMPurify.removed = [];
|
|
1961
|
+
if (!window || !window.document || window.document.nodeType !== NODE_TYPE.document || !window.Element) {
|
|
1962
|
+
// Not running in a browser, provide a factory function
|
|
1963
|
+
// so that you can pass your own Window
|
|
1964
|
+
DOMPurify.isSupported = false;
|
|
1965
|
+
return DOMPurify;
|
|
1966
|
+
}
|
|
1967
|
+
let {
|
|
1968
|
+
document
|
|
1969
|
+
} = window;
|
|
1970
|
+
const originalDocument = document;
|
|
1971
|
+
const currentScript = originalDocument.currentScript;
|
|
1972
|
+
const {
|
|
1973
|
+
DocumentFragment,
|
|
1974
|
+
HTMLTemplateElement,
|
|
1975
|
+
Node,
|
|
1976
|
+
Element,
|
|
1977
|
+
NodeFilter,
|
|
1978
|
+
NamedNodeMap = window.NamedNodeMap || window.MozNamedAttrMap,
|
|
1979
|
+
HTMLFormElement,
|
|
1980
|
+
DOMParser,
|
|
1981
|
+
trustedTypes
|
|
1982
|
+
} = window;
|
|
1983
|
+
const ElementPrototype = Element.prototype;
|
|
1984
|
+
const cloneNode = lookupGetter(ElementPrototype, 'cloneNode');
|
|
1985
|
+
const remove = lookupGetter(ElementPrototype, 'remove');
|
|
1986
|
+
const getNextSibling = lookupGetter(ElementPrototype, 'nextSibling');
|
|
1987
|
+
const getChildNodes = lookupGetter(ElementPrototype, 'childNodes');
|
|
1988
|
+
const getParentNode = lookupGetter(ElementPrototype, 'parentNode');
|
|
1989
|
+
// As per issue #47, the web-components registry is inherited by a
|
|
1990
|
+
// new document created via createHTMLDocument. As per the spec
|
|
1991
|
+
// (http://w3c.github.io/webcomponents/spec/custom/#creating-and-passing-registries)
|
|
1992
|
+
// a new empty registry is used when creating a template contents owner
|
|
1993
|
+
// document, so we use that as our parent document to ensure nothing
|
|
1994
|
+
// is inherited.
|
|
1995
|
+
if (typeof HTMLTemplateElement === 'function') {
|
|
1996
|
+
const template = document.createElement('template');
|
|
1997
|
+
if (template.content && template.content.ownerDocument) {
|
|
1998
|
+
document = template.content.ownerDocument;
|
|
1999
|
+
}
|
|
2000
|
+
}
|
|
2001
|
+
let trustedTypesPolicy;
|
|
2002
|
+
let emptyHTML = '';
|
|
2003
|
+
const {
|
|
2004
|
+
implementation,
|
|
2005
|
+
createNodeIterator,
|
|
2006
|
+
createDocumentFragment,
|
|
2007
|
+
getElementsByTagName
|
|
2008
|
+
} = document;
|
|
2009
|
+
const {
|
|
2010
|
+
importNode
|
|
2011
|
+
} = originalDocument;
|
|
2012
|
+
let hooks = _createHooksMap();
|
|
2013
|
+
/**
|
|
2014
|
+
* Expose whether this browser supports running the full DOMPurify.
|
|
2015
|
+
*/
|
|
2016
|
+
DOMPurify.isSupported = typeof entries === 'function' && typeof getParentNode === 'function' && implementation && implementation.createHTMLDocument !== undefined;
|
|
2017
|
+
const {
|
|
2018
|
+
MUSTACHE_EXPR,
|
|
2019
|
+
ERB_EXPR,
|
|
2020
|
+
TMPLIT_EXPR,
|
|
2021
|
+
DATA_ATTR,
|
|
2022
|
+
ARIA_ATTR,
|
|
2023
|
+
IS_SCRIPT_OR_DATA,
|
|
2024
|
+
ATTR_WHITESPACE,
|
|
2025
|
+
CUSTOM_ELEMENT
|
|
2026
|
+
} = EXPRESSIONS;
|
|
2027
|
+
let {
|
|
2028
|
+
IS_ALLOWED_URI: IS_ALLOWED_URI$1
|
|
2029
|
+
} = EXPRESSIONS;
|
|
2030
|
+
/**
|
|
2031
|
+
* We consider the elements and attributes below to be safe. Ideally
|
|
2032
|
+
* don't add any new ones but feel free to remove unwanted ones.
|
|
2033
|
+
*/
|
|
2034
|
+
/* allowed element names */
|
|
2035
|
+
let ALLOWED_TAGS = null;
|
|
2036
|
+
const DEFAULT_ALLOWED_TAGS = addToSet({}, [...html$1, ...svg$1, ...svgFilters, ...mathMl$1, ...purify_es_text]);
|
|
2037
|
+
/* Allowed attribute names */
|
|
2038
|
+
let ALLOWED_ATTR = null;
|
|
2039
|
+
const DEFAULT_ALLOWED_ATTR = addToSet({}, [...html, ...svg, ...mathMl, ...xml]);
|
|
2040
|
+
/*
|
|
2041
|
+
* Configure how DOMPurify should handle custom elements and their attributes as well as customized built-in elements.
|
|
2042
|
+
* @property {RegExp|Function|null} tagNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any custom elements)
|
|
2043
|
+
* @property {RegExp|Function|null} attributeNameCheck one of [null, regexPattern, predicate]. Default: `null` (disallow any attributes not on the allow list)
|
|
2044
|
+
* @property {boolean} allowCustomizedBuiltInElements allow custom elements derived from built-ins if they pass CUSTOM_ELEMENT_HANDLING.tagNameCheck. Default: `false`.
|
|
2045
|
+
*/
|
|
2046
|
+
let CUSTOM_ELEMENT_HANDLING = Object.seal(create(null, {
|
|
2047
|
+
tagNameCheck: {
|
|
2048
|
+
writable: true,
|
|
2049
|
+
configurable: false,
|
|
2050
|
+
enumerable: true,
|
|
2051
|
+
value: null
|
|
2052
|
+
},
|
|
2053
|
+
attributeNameCheck: {
|
|
2054
|
+
writable: true,
|
|
2055
|
+
configurable: false,
|
|
2056
|
+
enumerable: true,
|
|
2057
|
+
value: null
|
|
2058
|
+
},
|
|
2059
|
+
allowCustomizedBuiltInElements: {
|
|
2060
|
+
writable: true,
|
|
2061
|
+
configurable: false,
|
|
2062
|
+
enumerable: true,
|
|
2063
|
+
value: false
|
|
2064
|
+
}
|
|
2065
|
+
}));
|
|
2066
|
+
/* Explicitly forbidden tags (overrides ALLOWED_TAGS/ADD_TAGS) */
|
|
2067
|
+
let FORBID_TAGS = null;
|
|
2068
|
+
/* Explicitly forbidden attributes (overrides ALLOWED_ATTR/ADD_ATTR) */
|
|
2069
|
+
let FORBID_ATTR = null;
|
|
2070
|
+
/* Decide if ARIA attributes are okay */
|
|
2071
|
+
let ALLOW_ARIA_ATTR = true;
|
|
2072
|
+
/* Decide if custom data attributes are okay */
|
|
2073
|
+
let ALLOW_DATA_ATTR = true;
|
|
2074
|
+
/* Decide if unknown protocols are okay */
|
|
2075
|
+
let ALLOW_UNKNOWN_PROTOCOLS = false;
|
|
2076
|
+
/* Decide if self-closing tags in attributes are allowed.
|
|
2077
|
+
* Usually removed due to a mXSS issue in jQuery 3.0 */
|
|
2078
|
+
let ALLOW_SELF_CLOSE_IN_ATTR = true;
|
|
2079
|
+
/* Output should be safe for common template engines.
|
|
2080
|
+
* This means, DOMPurify removes data attributes, mustaches and ERB
|
|
2081
|
+
*/
|
|
2082
|
+
let SAFE_FOR_TEMPLATES = false;
|
|
2083
|
+
/* Output should be safe even for XML used within HTML and alike.
|
|
2084
|
+
* This means, DOMPurify removes comments when containing risky content.
|
|
2085
|
+
*/
|
|
2086
|
+
let SAFE_FOR_XML = true;
|
|
2087
|
+
/* Decide if document with <html>... should be returned */
|
|
2088
|
+
let WHOLE_DOCUMENT = false;
|
|
2089
|
+
/* Track whether config is already set on this instance of DOMPurify. */
|
|
2090
|
+
let SET_CONFIG = false;
|
|
2091
|
+
/* Decide if all elements (e.g. style, script) must be children of
|
|
2092
|
+
* document.body. By default, browsers might move them to document.head */
|
|
2093
|
+
let FORCE_BODY = false;
|
|
2094
|
+
/* Decide if a DOM `HTMLBodyElement` should be returned, instead of a html
|
|
2095
|
+
* string (or a TrustedHTML object if Trusted Types are supported).
|
|
2096
|
+
* If `WHOLE_DOCUMENT` is enabled a `HTMLHtmlElement` will be returned instead
|
|
2097
|
+
*/
|
|
2098
|
+
let RETURN_DOM = false;
|
|
2099
|
+
/* Decide if a DOM `DocumentFragment` should be returned, instead of a html
|
|
2100
|
+
* string (or a TrustedHTML object if Trusted Types are supported) */
|
|
2101
|
+
let RETURN_DOM_FRAGMENT = false;
|
|
2102
|
+
/* Try to return a Trusted Type object instead of a string, return a string in
|
|
2103
|
+
* case Trusted Types are not supported */
|
|
2104
|
+
let RETURN_TRUSTED_TYPE = false;
|
|
2105
|
+
/* Output should be free from DOM clobbering attacks?
|
|
2106
|
+
* This sanitizes markups named with colliding, clobberable built-in DOM APIs.
|
|
2107
|
+
*/
|
|
2108
|
+
let SANITIZE_DOM = true;
|
|
2109
|
+
/* Achieve full DOM Clobbering protection by isolating the namespace of named
|
|
2110
|
+
* properties and JS variables, mitigating attacks that abuse the HTML/DOM spec rules.
|
|
2111
|
+
*
|
|
2112
|
+
* HTML/DOM spec rules that enable DOM Clobbering:
|
|
2113
|
+
* - Named Access on Window (§7.3.3)
|
|
2114
|
+
* - DOM Tree Accessors (§3.1.5)
|
|
2115
|
+
* - Form Element Parent-Child Relations (§4.10.3)
|
|
2116
|
+
* - Iframe srcdoc / Nested WindowProxies (§4.8.5)
|
|
2117
|
+
* - HTMLCollection (§4.2.10.2)
|
|
2118
|
+
*
|
|
2119
|
+
* Namespace isolation is implemented by prefixing `id` and `name` attributes
|
|
2120
|
+
* with a constant string, i.e., `user-content-`
|
|
2121
|
+
*/
|
|
2122
|
+
let SANITIZE_NAMED_PROPS = false;
|
|
2123
|
+
const SANITIZE_NAMED_PROPS_PREFIX = 'user-content-';
|
|
2124
|
+
/* Keep element content when removing element? */
|
|
2125
|
+
let KEEP_CONTENT = true;
|
|
2126
|
+
/* If a `Node` is passed to sanitize(), then performs sanitization in-place instead
|
|
2127
|
+
* of importing it into a new Document and returning a sanitized copy */
|
|
2128
|
+
let IN_PLACE = false;
|
|
2129
|
+
/* Allow usage of profiles like html, svg and mathMl */
|
|
2130
|
+
let USE_PROFILES = {};
|
|
2131
|
+
/* Tags to ignore content of when KEEP_CONTENT is true */
|
|
2132
|
+
let FORBID_CONTENTS = null;
|
|
2133
|
+
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']);
|
|
2134
|
+
/* Tags that are safe for data: URIs */
|
|
2135
|
+
let DATA_URI_TAGS = null;
|
|
2136
|
+
const DEFAULT_DATA_URI_TAGS = addToSet({}, ['audio', 'video', 'img', 'source', 'image', 'track']);
|
|
2137
|
+
/* Attributes safe for values like "javascript:" */
|
|
2138
|
+
let URI_SAFE_ATTRIBUTES = null;
|
|
2139
|
+
const DEFAULT_URI_SAFE_ATTRIBUTES = addToSet({}, ['alt', 'class', 'for', 'id', 'label', 'name', 'pattern', 'placeholder', 'role', 'summary', 'title', 'value', 'style', 'xmlns']);
|
|
2140
|
+
const MATHML_NAMESPACE = 'http://www.w3.org/1998/Math/MathML';
|
|
2141
|
+
const SVG_NAMESPACE = 'http://www.w3.org/2000/svg';
|
|
2142
|
+
const HTML_NAMESPACE = 'http://www.w3.org/1999/xhtml';
|
|
2143
|
+
/* Document namespace */
|
|
2144
|
+
let NAMESPACE = HTML_NAMESPACE;
|
|
2145
|
+
let IS_EMPTY_INPUT = false;
|
|
2146
|
+
/* Allowed XHTML+XML namespaces */
|
|
2147
|
+
let ALLOWED_NAMESPACES = null;
|
|
2148
|
+
const DEFAULT_ALLOWED_NAMESPACES = addToSet({}, [MATHML_NAMESPACE, SVG_NAMESPACE, HTML_NAMESPACE], stringToString);
|
|
2149
|
+
let MATHML_TEXT_INTEGRATION_POINTS = addToSet({}, ['mi', 'mo', 'mn', 'ms', 'mtext']);
|
|
2150
|
+
let HTML_INTEGRATION_POINTS = addToSet({}, ['annotation-xml']);
|
|
2151
|
+
// Certain elements are allowed in both SVG and HTML
|
|
2152
|
+
// namespace. We need to specify them explicitly
|
|
2153
|
+
// so that they don't get erroneously deleted from
|
|
2154
|
+
// HTML namespace.
|
|
2155
|
+
const COMMON_SVG_AND_HTML_ELEMENTS = addToSet({}, ['title', 'style', 'font', 'a', 'script']);
|
|
2156
|
+
/* Parsing of strict XHTML documents */
|
|
2157
|
+
let PARSER_MEDIA_TYPE = null;
|
|
2158
|
+
const SUPPORTED_PARSER_MEDIA_TYPES = ['application/xhtml+xml', 'text/html'];
|
|
2159
|
+
const DEFAULT_PARSER_MEDIA_TYPE = 'text/html';
|
|
2160
|
+
let transformCaseFunc = null;
|
|
2161
|
+
/* Keep a reference to config to pass to hooks */
|
|
2162
|
+
let CONFIG = null;
|
|
2163
|
+
/* Ideally, do not touch anything below this line */
|
|
2164
|
+
/* ______________________________________________ */
|
|
2165
|
+
const formElement = document.createElement('form');
|
|
2166
|
+
const isRegexOrFunction = function isRegexOrFunction(testValue) {
|
|
2167
|
+
return testValue instanceof RegExp || testValue instanceof Function;
|
|
2168
|
+
};
|
|
2169
|
+
/**
|
|
2170
|
+
* _parseConfig
|
|
2171
|
+
*
|
|
2172
|
+
* @param cfg optional config literal
|
|
2173
|
+
*/
|
|
2174
|
+
// eslint-disable-next-line complexity
|
|
2175
|
+
const _parseConfig = function _parseConfig() {
|
|
2176
|
+
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2177
|
+
if (CONFIG && CONFIG === cfg) {
|
|
2178
|
+
return;
|
|
2179
|
+
}
|
|
2180
|
+
/* Shield configuration object from tampering */
|
|
2181
|
+
if (!cfg || typeof cfg !== 'object') {
|
|
2182
|
+
cfg = {};
|
|
2183
|
+
}
|
|
2184
|
+
/* Shield configuration object from prototype pollution */
|
|
2185
|
+
cfg = clone(cfg);
|
|
2186
|
+
PARSER_MEDIA_TYPE =
|
|
2187
|
+
// eslint-disable-next-line unicorn/prefer-includes
|
|
2188
|
+
SUPPORTED_PARSER_MEDIA_TYPES.indexOf(cfg.PARSER_MEDIA_TYPE) === -1 ? DEFAULT_PARSER_MEDIA_TYPE : cfg.PARSER_MEDIA_TYPE;
|
|
2189
|
+
// HTML tags and attributes are not case-sensitive, converting to lowercase. Keeping XHTML as is.
|
|
2190
|
+
transformCaseFunc = PARSER_MEDIA_TYPE === 'application/xhtml+xml' ? stringToString : stringToLowerCase;
|
|
2191
|
+
/* Set configuration parameters */
|
|
2192
|
+
ALLOWED_TAGS = objectHasOwnProperty(cfg, 'ALLOWED_TAGS') ? addToSet({}, cfg.ALLOWED_TAGS, transformCaseFunc) : DEFAULT_ALLOWED_TAGS;
|
|
2193
|
+
ALLOWED_ATTR = objectHasOwnProperty(cfg, 'ALLOWED_ATTR') ? addToSet({}, cfg.ALLOWED_ATTR, transformCaseFunc) : DEFAULT_ALLOWED_ATTR;
|
|
2194
|
+
ALLOWED_NAMESPACES = objectHasOwnProperty(cfg, 'ALLOWED_NAMESPACES') ? addToSet({}, cfg.ALLOWED_NAMESPACES, stringToString) : DEFAULT_ALLOWED_NAMESPACES;
|
|
2195
|
+
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;
|
|
2196
|
+
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;
|
|
2197
|
+
FORBID_CONTENTS = objectHasOwnProperty(cfg, 'FORBID_CONTENTS') ? addToSet({}, cfg.FORBID_CONTENTS, transformCaseFunc) : DEFAULT_FORBID_CONTENTS;
|
|
2198
|
+
FORBID_TAGS = objectHasOwnProperty(cfg, 'FORBID_TAGS') ? addToSet({}, cfg.FORBID_TAGS, transformCaseFunc) : clone({});
|
|
2199
|
+
FORBID_ATTR = objectHasOwnProperty(cfg, 'FORBID_ATTR') ? addToSet({}, cfg.FORBID_ATTR, transformCaseFunc) : clone({});
|
|
2200
|
+
USE_PROFILES = objectHasOwnProperty(cfg, 'USE_PROFILES') ? cfg.USE_PROFILES : false;
|
|
2201
|
+
ALLOW_ARIA_ATTR = cfg.ALLOW_ARIA_ATTR !== false; // Default true
|
|
2202
|
+
ALLOW_DATA_ATTR = cfg.ALLOW_DATA_ATTR !== false; // Default true
|
|
2203
|
+
ALLOW_UNKNOWN_PROTOCOLS = cfg.ALLOW_UNKNOWN_PROTOCOLS || false; // Default false
|
|
2204
|
+
ALLOW_SELF_CLOSE_IN_ATTR = cfg.ALLOW_SELF_CLOSE_IN_ATTR !== false; // Default true
|
|
2205
|
+
SAFE_FOR_TEMPLATES = cfg.SAFE_FOR_TEMPLATES || false; // Default false
|
|
2206
|
+
SAFE_FOR_XML = cfg.SAFE_FOR_XML !== false; // Default true
|
|
2207
|
+
WHOLE_DOCUMENT = cfg.WHOLE_DOCUMENT || false; // Default false
|
|
2208
|
+
RETURN_DOM = cfg.RETURN_DOM || false; // Default false
|
|
2209
|
+
RETURN_DOM_FRAGMENT = cfg.RETURN_DOM_FRAGMENT || false; // Default false
|
|
2210
|
+
RETURN_TRUSTED_TYPE = cfg.RETURN_TRUSTED_TYPE || false; // Default false
|
|
2211
|
+
FORCE_BODY = cfg.FORCE_BODY || false; // Default false
|
|
2212
|
+
SANITIZE_DOM = cfg.SANITIZE_DOM !== false; // Default true
|
|
2213
|
+
SANITIZE_NAMED_PROPS = cfg.SANITIZE_NAMED_PROPS || false; // Default false
|
|
2214
|
+
KEEP_CONTENT = cfg.KEEP_CONTENT !== false; // Default true
|
|
2215
|
+
IN_PLACE = cfg.IN_PLACE || false; // Default false
|
|
2216
|
+
IS_ALLOWED_URI$1 = cfg.ALLOWED_URI_REGEXP || IS_ALLOWED_URI;
|
|
2217
|
+
NAMESPACE = cfg.NAMESPACE || HTML_NAMESPACE;
|
|
2218
|
+
MATHML_TEXT_INTEGRATION_POINTS = cfg.MATHML_TEXT_INTEGRATION_POINTS || MATHML_TEXT_INTEGRATION_POINTS;
|
|
2219
|
+
HTML_INTEGRATION_POINTS = cfg.HTML_INTEGRATION_POINTS || HTML_INTEGRATION_POINTS;
|
|
2220
|
+
CUSTOM_ELEMENT_HANDLING = cfg.CUSTOM_ELEMENT_HANDLING || {};
|
|
2221
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck)) {
|
|
2222
|
+
CUSTOM_ELEMENT_HANDLING.tagNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.tagNameCheck;
|
|
2223
|
+
}
|
|
2224
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && isRegexOrFunction(cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)) {
|
|
2225
|
+
CUSTOM_ELEMENT_HANDLING.attributeNameCheck = cfg.CUSTOM_ELEMENT_HANDLING.attributeNameCheck;
|
|
2226
|
+
}
|
|
2227
|
+
if (cfg.CUSTOM_ELEMENT_HANDLING && typeof cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements === 'boolean') {
|
|
2228
|
+
CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements = cfg.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements;
|
|
2229
|
+
}
|
|
2230
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2231
|
+
ALLOW_DATA_ATTR = false;
|
|
2232
|
+
}
|
|
2233
|
+
if (RETURN_DOM_FRAGMENT) {
|
|
2234
|
+
RETURN_DOM = true;
|
|
2235
|
+
}
|
|
2236
|
+
/* Parse profile info */
|
|
2237
|
+
if (USE_PROFILES) {
|
|
2238
|
+
ALLOWED_TAGS = addToSet({}, purify_es_text);
|
|
2239
|
+
ALLOWED_ATTR = [];
|
|
2240
|
+
if (USE_PROFILES.html === true) {
|
|
2241
|
+
addToSet(ALLOWED_TAGS, html$1);
|
|
2242
|
+
addToSet(ALLOWED_ATTR, html);
|
|
2243
|
+
}
|
|
2244
|
+
if (USE_PROFILES.svg === true) {
|
|
2245
|
+
addToSet(ALLOWED_TAGS, svg$1);
|
|
2246
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
2247
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
2248
|
+
}
|
|
2249
|
+
if (USE_PROFILES.svgFilters === true) {
|
|
2250
|
+
addToSet(ALLOWED_TAGS, svgFilters);
|
|
2251
|
+
addToSet(ALLOWED_ATTR, svg);
|
|
2252
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
2253
|
+
}
|
|
2254
|
+
if (USE_PROFILES.mathMl === true) {
|
|
2255
|
+
addToSet(ALLOWED_TAGS, mathMl$1);
|
|
2256
|
+
addToSet(ALLOWED_ATTR, mathMl);
|
|
2257
|
+
addToSet(ALLOWED_ATTR, xml);
|
|
2258
|
+
}
|
|
2259
|
+
}
|
|
2260
|
+
/* Merge configuration parameters */
|
|
2261
|
+
if (cfg.ADD_TAGS) {
|
|
2262
|
+
if (ALLOWED_TAGS === DEFAULT_ALLOWED_TAGS) {
|
|
2263
|
+
ALLOWED_TAGS = clone(ALLOWED_TAGS);
|
|
2264
|
+
}
|
|
2265
|
+
addToSet(ALLOWED_TAGS, cfg.ADD_TAGS, transformCaseFunc);
|
|
2266
|
+
}
|
|
2267
|
+
if (cfg.ADD_ATTR) {
|
|
2268
|
+
if (ALLOWED_ATTR === DEFAULT_ALLOWED_ATTR) {
|
|
2269
|
+
ALLOWED_ATTR = clone(ALLOWED_ATTR);
|
|
2270
|
+
}
|
|
2271
|
+
addToSet(ALLOWED_ATTR, cfg.ADD_ATTR, transformCaseFunc);
|
|
2272
|
+
}
|
|
2273
|
+
if (cfg.ADD_URI_SAFE_ATTR) {
|
|
2274
|
+
addToSet(URI_SAFE_ATTRIBUTES, cfg.ADD_URI_SAFE_ATTR, transformCaseFunc);
|
|
2275
|
+
}
|
|
2276
|
+
if (cfg.FORBID_CONTENTS) {
|
|
2277
|
+
if (FORBID_CONTENTS === DEFAULT_FORBID_CONTENTS) {
|
|
2278
|
+
FORBID_CONTENTS = clone(FORBID_CONTENTS);
|
|
2279
|
+
}
|
|
2280
|
+
addToSet(FORBID_CONTENTS, cfg.FORBID_CONTENTS, transformCaseFunc);
|
|
2281
|
+
}
|
|
2282
|
+
/* Add #text in case KEEP_CONTENT is set to true */
|
|
2283
|
+
if (KEEP_CONTENT) {
|
|
2284
|
+
ALLOWED_TAGS['#text'] = true;
|
|
2285
|
+
}
|
|
2286
|
+
/* Add html, head and body to ALLOWED_TAGS in case WHOLE_DOCUMENT is true */
|
|
2287
|
+
if (WHOLE_DOCUMENT) {
|
|
2288
|
+
addToSet(ALLOWED_TAGS, ['html', 'head', 'body']);
|
|
2289
|
+
}
|
|
2290
|
+
/* Add tbody to ALLOWED_TAGS in case tables are permitted, see #286, #365 */
|
|
2291
|
+
if (ALLOWED_TAGS.table) {
|
|
2292
|
+
addToSet(ALLOWED_TAGS, ['tbody']);
|
|
2293
|
+
delete FORBID_TAGS.tbody;
|
|
2294
|
+
}
|
|
2295
|
+
if (cfg.TRUSTED_TYPES_POLICY) {
|
|
2296
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createHTML !== 'function') {
|
|
2297
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
|
|
2298
|
+
}
|
|
2299
|
+
if (typeof cfg.TRUSTED_TYPES_POLICY.createScriptURL !== 'function') {
|
|
2300
|
+
throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
|
|
2301
|
+
}
|
|
2302
|
+
// Overwrite existing TrustedTypes policy.
|
|
2303
|
+
trustedTypesPolicy = cfg.TRUSTED_TYPES_POLICY;
|
|
2304
|
+
// Sign local variables required by `sanitize`.
|
|
2305
|
+
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
2306
|
+
} else {
|
|
2307
|
+
// Uninitialized policy, attempt to initialize the internal dompurify policy.
|
|
2308
|
+
if (trustedTypesPolicy === undefined) {
|
|
2309
|
+
trustedTypesPolicy = _createTrustedTypesPolicy(trustedTypes, currentScript);
|
|
2310
|
+
}
|
|
2311
|
+
// If creating the internal policy succeeded sign internal variables.
|
|
2312
|
+
if (trustedTypesPolicy !== null && typeof emptyHTML === 'string') {
|
|
2313
|
+
emptyHTML = trustedTypesPolicy.createHTML('');
|
|
2314
|
+
}
|
|
2315
|
+
}
|
|
2316
|
+
// Prevent further manipulation of configuration.
|
|
2317
|
+
// Not available in IE8, Safari 5, etc.
|
|
2318
|
+
if (freeze) {
|
|
2319
|
+
freeze(cfg);
|
|
2320
|
+
}
|
|
2321
|
+
CONFIG = cfg;
|
|
2322
|
+
};
|
|
2323
|
+
/* Keep track of all possible SVG and MathML tags
|
|
2324
|
+
* so that we can perform the namespace checks
|
|
2325
|
+
* correctly. */
|
|
2326
|
+
const ALL_SVG_TAGS = addToSet({}, [...svg$1, ...svgFilters, ...svgDisallowed]);
|
|
2327
|
+
const ALL_MATHML_TAGS = addToSet({}, [...mathMl$1, ...mathMlDisallowed]);
|
|
2328
|
+
/**
|
|
2329
|
+
* @param element a DOM element whose namespace is being checked
|
|
2330
|
+
* @returns Return false if the element has a
|
|
2331
|
+
* namespace that a spec-compliant parser would never
|
|
2332
|
+
* return. Return true otherwise.
|
|
2333
|
+
*/
|
|
2334
|
+
const _checkValidNamespace = function _checkValidNamespace(element) {
|
|
2335
|
+
let parent = getParentNode(element);
|
|
2336
|
+
// In JSDOM, if we're inside shadow DOM, then parentNode
|
|
2337
|
+
// can be null. We just simulate parent in this case.
|
|
2338
|
+
if (!parent || !parent.tagName) {
|
|
2339
|
+
parent = {
|
|
2340
|
+
namespaceURI: NAMESPACE,
|
|
2341
|
+
tagName: 'template'
|
|
2342
|
+
};
|
|
2343
|
+
}
|
|
2344
|
+
const tagName = stringToLowerCase(element.tagName);
|
|
2345
|
+
const parentTagName = stringToLowerCase(parent.tagName);
|
|
2346
|
+
if (!ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
2347
|
+
return false;
|
|
2348
|
+
}
|
|
2349
|
+
if (element.namespaceURI === SVG_NAMESPACE) {
|
|
2350
|
+
// The only way to switch from HTML namespace to SVG
|
|
2351
|
+
// is via <svg>. If it happens via any other tag, then
|
|
2352
|
+
// it should be killed.
|
|
2353
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
2354
|
+
return tagName === 'svg';
|
|
2355
|
+
}
|
|
2356
|
+
// The only way to switch from MathML to SVG is via`
|
|
2357
|
+
// svg if parent is either <annotation-xml> or MathML
|
|
2358
|
+
// text integration points.
|
|
2359
|
+
if (parent.namespaceURI === MATHML_NAMESPACE) {
|
|
2360
|
+
return tagName === 'svg' && (parentTagName === 'annotation-xml' || MATHML_TEXT_INTEGRATION_POINTS[parentTagName]);
|
|
2361
|
+
}
|
|
2362
|
+
// We only allow elements that are defined in SVG
|
|
2363
|
+
// spec. All others are disallowed in SVG namespace.
|
|
2364
|
+
return Boolean(ALL_SVG_TAGS[tagName]);
|
|
2365
|
+
}
|
|
2366
|
+
if (element.namespaceURI === MATHML_NAMESPACE) {
|
|
2367
|
+
// The only way to switch from HTML namespace to MathML
|
|
2368
|
+
// is via <math>. If it happens via any other tag, then
|
|
2369
|
+
// it should be killed.
|
|
2370
|
+
if (parent.namespaceURI === HTML_NAMESPACE) {
|
|
2371
|
+
return tagName === 'math';
|
|
2372
|
+
}
|
|
2373
|
+
// The only way to switch from SVG to MathML is via
|
|
2374
|
+
// <math> and HTML integration points
|
|
2375
|
+
if (parent.namespaceURI === SVG_NAMESPACE) {
|
|
2376
|
+
return tagName === 'math' && HTML_INTEGRATION_POINTS[parentTagName];
|
|
2377
|
+
}
|
|
2378
|
+
// We only allow elements that are defined in MathML
|
|
2379
|
+
// spec. All others are disallowed in MathML namespace.
|
|
2380
|
+
return Boolean(ALL_MATHML_TAGS[tagName]);
|
|
2381
|
+
}
|
|
2382
|
+
if (element.namespaceURI === HTML_NAMESPACE) {
|
|
2383
|
+
// The only way to switch from SVG to HTML is via
|
|
2384
|
+
// HTML integration points, and from MathML to HTML
|
|
2385
|
+
// is via MathML text integration points
|
|
2386
|
+
if (parent.namespaceURI === SVG_NAMESPACE && !HTML_INTEGRATION_POINTS[parentTagName]) {
|
|
2387
|
+
return false;
|
|
2388
|
+
}
|
|
2389
|
+
if (parent.namespaceURI === MATHML_NAMESPACE && !MATHML_TEXT_INTEGRATION_POINTS[parentTagName]) {
|
|
2390
|
+
return false;
|
|
2391
|
+
}
|
|
2392
|
+
// We disallow tags that are specific for MathML
|
|
2393
|
+
// or SVG and should never appear in HTML namespace
|
|
2394
|
+
return !ALL_MATHML_TAGS[tagName] && (COMMON_SVG_AND_HTML_ELEMENTS[tagName] || !ALL_SVG_TAGS[tagName]);
|
|
2395
|
+
}
|
|
2396
|
+
// For XHTML and XML documents that support custom namespaces
|
|
2397
|
+
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && ALLOWED_NAMESPACES[element.namespaceURI]) {
|
|
2398
|
+
return true;
|
|
2399
|
+
}
|
|
2400
|
+
// The code should never reach this place (this means
|
|
2401
|
+
// that the element somehow got namespace that is not
|
|
2402
|
+
// HTML, SVG, MathML or allowed via ALLOWED_NAMESPACES).
|
|
2403
|
+
// Return false just in case.
|
|
2404
|
+
return false;
|
|
2405
|
+
};
|
|
2406
|
+
/**
|
|
2407
|
+
* _forceRemove
|
|
2408
|
+
*
|
|
2409
|
+
* @param node a DOM node
|
|
2410
|
+
*/
|
|
2411
|
+
const _forceRemove = function _forceRemove(node) {
|
|
2412
|
+
arrayPush(DOMPurify.removed, {
|
|
2413
|
+
element: node
|
|
2414
|
+
});
|
|
2415
|
+
try {
|
|
2416
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-remove
|
|
2417
|
+
getParentNode(node).removeChild(node);
|
|
2418
|
+
} catch (_) {
|
|
2419
|
+
remove(node);
|
|
2420
|
+
}
|
|
2421
|
+
};
|
|
2422
|
+
/**
|
|
2423
|
+
* _removeAttribute
|
|
2424
|
+
*
|
|
2425
|
+
* @param name an Attribute name
|
|
2426
|
+
* @param element a DOM node
|
|
2427
|
+
*/
|
|
2428
|
+
const _removeAttribute = function _removeAttribute(name, element) {
|
|
2429
|
+
try {
|
|
2430
|
+
arrayPush(DOMPurify.removed, {
|
|
2431
|
+
attribute: element.getAttributeNode(name),
|
|
2432
|
+
from: element
|
|
2433
|
+
});
|
|
2434
|
+
} catch (_) {
|
|
2435
|
+
arrayPush(DOMPurify.removed, {
|
|
2436
|
+
attribute: null,
|
|
2437
|
+
from: element
|
|
2438
|
+
});
|
|
2439
|
+
}
|
|
2440
|
+
element.removeAttribute(name);
|
|
2441
|
+
// We void attribute values for unremovable "is" attributes
|
|
2442
|
+
if (name === 'is') {
|
|
2443
|
+
if (RETURN_DOM || RETURN_DOM_FRAGMENT) {
|
|
2444
|
+
try {
|
|
2445
|
+
_forceRemove(element);
|
|
2446
|
+
} catch (_) {}
|
|
2447
|
+
} else {
|
|
2448
|
+
try {
|
|
2449
|
+
element.setAttribute(name, '');
|
|
2450
|
+
} catch (_) {}
|
|
2451
|
+
}
|
|
2452
|
+
}
|
|
2453
|
+
};
|
|
2454
|
+
/**
|
|
2455
|
+
* _initDocument
|
|
2456
|
+
*
|
|
2457
|
+
* @param dirty - a string of dirty markup
|
|
2458
|
+
* @return a DOM, filled with the dirty markup
|
|
2459
|
+
*/
|
|
2460
|
+
const _initDocument = function _initDocument(dirty) {
|
|
2461
|
+
/* Create a HTML document */
|
|
2462
|
+
let doc = null;
|
|
2463
|
+
let leadingWhitespace = null;
|
|
2464
|
+
if (FORCE_BODY) {
|
|
2465
|
+
dirty = '<remove></remove>' + dirty;
|
|
2466
|
+
} else {
|
|
2467
|
+
/* If FORCE_BODY isn't used, leading whitespace needs to be preserved manually */
|
|
2468
|
+
const matches = stringMatch(dirty, /^[\r\n\t ]+/);
|
|
2469
|
+
leadingWhitespace = matches && matches[0];
|
|
2470
|
+
}
|
|
2471
|
+
if (PARSER_MEDIA_TYPE === 'application/xhtml+xml' && NAMESPACE === HTML_NAMESPACE) {
|
|
2472
|
+
// Root of XHTML doc must contain xmlns declaration (see https://www.w3.org/TR/xhtml1/normative.html#strict)
|
|
2473
|
+
dirty = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + dirty + '</body></html>';
|
|
2474
|
+
}
|
|
2475
|
+
const dirtyPayload = trustedTypesPolicy ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
2476
|
+
/*
|
|
2477
|
+
* Use the DOMParser API by default, fallback later if needs be
|
|
2478
|
+
* DOMParser not work for svg when has multiple root element.
|
|
2479
|
+
*/
|
|
2480
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
|
2481
|
+
try {
|
|
2482
|
+
doc = new DOMParser().parseFromString(dirtyPayload, PARSER_MEDIA_TYPE);
|
|
2483
|
+
} catch (_) {}
|
|
2484
|
+
}
|
|
2485
|
+
/* Use createHTMLDocument in case DOMParser is not available */
|
|
2486
|
+
if (!doc || !doc.documentElement) {
|
|
2487
|
+
doc = implementation.createDocument(NAMESPACE, 'template', null);
|
|
2488
|
+
try {
|
|
2489
|
+
doc.documentElement.innerHTML = IS_EMPTY_INPUT ? emptyHTML : dirtyPayload;
|
|
2490
|
+
} catch (_) {
|
|
2491
|
+
// Syntax error if dirtyPayload is invalid xml
|
|
2492
|
+
}
|
|
2493
|
+
}
|
|
2494
|
+
const body = doc.body || doc.documentElement;
|
|
2495
|
+
if (dirty && leadingWhitespace) {
|
|
2496
|
+
body.insertBefore(document.createTextNode(leadingWhitespace), body.childNodes[0] || null);
|
|
2497
|
+
}
|
|
2498
|
+
/* Work on whole document or just its body */
|
|
2499
|
+
if (NAMESPACE === HTML_NAMESPACE) {
|
|
2500
|
+
return getElementsByTagName.call(doc, WHOLE_DOCUMENT ? 'html' : 'body')[0];
|
|
2501
|
+
}
|
|
2502
|
+
return WHOLE_DOCUMENT ? doc.documentElement : body;
|
|
2503
|
+
};
|
|
2504
|
+
/**
|
|
2505
|
+
* Creates a NodeIterator object that you can use to traverse filtered lists of nodes or elements in a document.
|
|
2506
|
+
*
|
|
2507
|
+
* @param root The root element or node to start traversing on.
|
|
2508
|
+
* @return The created NodeIterator
|
|
2509
|
+
*/
|
|
2510
|
+
const _createNodeIterator = function _createNodeIterator(root) {
|
|
2511
|
+
return createNodeIterator.call(root.ownerDocument || root, root,
|
|
2512
|
+
// eslint-disable-next-line no-bitwise
|
|
2513
|
+
NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT | NodeFilter.SHOW_PROCESSING_INSTRUCTION | NodeFilter.SHOW_CDATA_SECTION, null);
|
|
2514
|
+
};
|
|
2515
|
+
/**
|
|
2516
|
+
* _isClobbered
|
|
2517
|
+
*
|
|
2518
|
+
* @param element element to check for clobbering attacks
|
|
2519
|
+
* @return true if clobbered, false if safe
|
|
2520
|
+
*/
|
|
2521
|
+
const _isClobbered = function _isClobbered(element) {
|
|
2522
|
+
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');
|
|
2523
|
+
};
|
|
2524
|
+
/**
|
|
2525
|
+
* Checks whether the given object is a DOM node.
|
|
2526
|
+
*
|
|
2527
|
+
* @param value object to check whether it's a DOM node
|
|
2528
|
+
* @return true is object is a DOM node
|
|
2529
|
+
*/
|
|
2530
|
+
const _isNode = function _isNode(value) {
|
|
2531
|
+
return typeof Node === 'function' && value instanceof Node;
|
|
2532
|
+
};
|
|
2533
|
+
function _executeHooks(hooks, currentNode, data) {
|
|
2534
|
+
arrayForEach(hooks, hook => {
|
|
2535
|
+
hook.call(DOMPurify, currentNode, data, CONFIG);
|
|
2536
|
+
});
|
|
2537
|
+
}
|
|
2538
|
+
/**
|
|
2539
|
+
* _sanitizeElements
|
|
2540
|
+
*
|
|
2541
|
+
* @protect nodeName
|
|
2542
|
+
* @protect textContent
|
|
2543
|
+
* @protect removeChild
|
|
2544
|
+
* @param currentNode to check for permission to exist
|
|
2545
|
+
* @return true if node was killed, false if left alive
|
|
2546
|
+
*/
|
|
2547
|
+
const _sanitizeElements = function _sanitizeElements(currentNode) {
|
|
2548
|
+
let content = null;
|
|
2549
|
+
/* Execute a hook if present */
|
|
2550
|
+
_executeHooks(hooks.beforeSanitizeElements, currentNode, null);
|
|
2551
|
+
/* Check if element is clobbered or can clobber */
|
|
2552
|
+
if (_isClobbered(currentNode)) {
|
|
2553
|
+
_forceRemove(currentNode);
|
|
2554
|
+
return true;
|
|
2555
|
+
}
|
|
2556
|
+
/* Now let's check the element's type and name */
|
|
2557
|
+
const tagName = transformCaseFunc(currentNode.nodeName);
|
|
2558
|
+
/* Execute a hook if present */
|
|
2559
|
+
_executeHooks(hooks.uponSanitizeElement, currentNode, {
|
|
2560
|
+
tagName,
|
|
2561
|
+
allowedTags: ALLOWED_TAGS
|
|
2562
|
+
});
|
|
2563
|
+
/* Detect mXSS attempts abusing namespace confusion */
|
|
2564
|
+
if (SAFE_FOR_XML && currentNode.hasChildNodes() && !_isNode(currentNode.firstElementChild) && regExpTest(/<[/\w!]/g, currentNode.innerHTML) && regExpTest(/<[/\w!]/g, currentNode.textContent)) {
|
|
2565
|
+
_forceRemove(currentNode);
|
|
2566
|
+
return true;
|
|
2567
|
+
}
|
|
2568
|
+
/* Remove any occurrence of processing instructions */
|
|
2569
|
+
if (currentNode.nodeType === NODE_TYPE.progressingInstruction) {
|
|
2570
|
+
_forceRemove(currentNode);
|
|
2571
|
+
return true;
|
|
2572
|
+
}
|
|
2573
|
+
/* Remove any kind of possibly harmful comments */
|
|
2574
|
+
if (SAFE_FOR_XML && currentNode.nodeType === NODE_TYPE.comment && regExpTest(/<[/\w]/g, currentNode.data)) {
|
|
2575
|
+
_forceRemove(currentNode);
|
|
2576
|
+
return true;
|
|
2577
|
+
}
|
|
2578
|
+
/* Remove element if anything forbids its presence */
|
|
2579
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
2580
|
+
/* Check if we have a custom element to handle */
|
|
2581
|
+
if (!FORBID_TAGS[tagName] && _isBasicCustomElement(tagName)) {
|
|
2582
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof RegExp && regExpTest(CUSTOM_ELEMENT_HANDLING.tagNameCheck, tagName)) {
|
|
2583
|
+
return false;
|
|
2584
|
+
}
|
|
2585
|
+
if (CUSTOM_ELEMENT_HANDLING.tagNameCheck instanceof Function && CUSTOM_ELEMENT_HANDLING.tagNameCheck(tagName)) {
|
|
2586
|
+
return false;
|
|
2587
|
+
}
|
|
2588
|
+
}
|
|
2589
|
+
/* Keep content except for bad-listed elements */
|
|
2590
|
+
if (KEEP_CONTENT && !FORBID_CONTENTS[tagName]) {
|
|
2591
|
+
const parentNode = getParentNode(currentNode) || currentNode.parentNode;
|
|
2592
|
+
const childNodes = getChildNodes(currentNode) || currentNode.childNodes;
|
|
2593
|
+
if (childNodes && parentNode) {
|
|
2594
|
+
const childCount = childNodes.length;
|
|
2595
|
+
for (let i = childCount - 1; i >= 0; --i) {
|
|
2596
|
+
const childClone = cloneNode(childNodes[i], true);
|
|
2597
|
+
childClone.__removalCount = (currentNode.__removalCount || 0) + 1;
|
|
2598
|
+
parentNode.insertBefore(childClone, getNextSibling(currentNode));
|
|
2599
|
+
}
|
|
2600
|
+
}
|
|
2601
|
+
}
|
|
2602
|
+
_forceRemove(currentNode);
|
|
2603
|
+
return true;
|
|
2604
|
+
}
|
|
2605
|
+
/* Check whether element has a valid namespace */
|
|
2606
|
+
if (currentNode instanceof Element && !_checkValidNamespace(currentNode)) {
|
|
2607
|
+
_forceRemove(currentNode);
|
|
2608
|
+
return true;
|
|
2609
|
+
}
|
|
2610
|
+
/* Make sure that older browsers don't get fallback-tag mXSS */
|
|
2611
|
+
if ((tagName === 'noscript' || tagName === 'noembed' || tagName === 'noframes') && regExpTest(/<\/no(script|embed|frames)/i, currentNode.innerHTML)) {
|
|
2612
|
+
_forceRemove(currentNode);
|
|
2613
|
+
return true;
|
|
2614
|
+
}
|
|
2615
|
+
/* Sanitize element content to be template-safe */
|
|
2616
|
+
if (SAFE_FOR_TEMPLATES && currentNode.nodeType === NODE_TYPE.text) {
|
|
2617
|
+
/* Get the element's text content */
|
|
2618
|
+
content = currentNode.textContent;
|
|
2619
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
2620
|
+
content = stringReplace(content, expr, ' ');
|
|
2621
|
+
});
|
|
2622
|
+
if (currentNode.textContent !== content) {
|
|
2623
|
+
arrayPush(DOMPurify.removed, {
|
|
2624
|
+
element: currentNode.cloneNode()
|
|
2625
|
+
});
|
|
2626
|
+
currentNode.textContent = content;
|
|
2627
|
+
}
|
|
2628
|
+
}
|
|
2629
|
+
/* Execute a hook if present */
|
|
2630
|
+
_executeHooks(hooks.afterSanitizeElements, currentNode, null);
|
|
2631
|
+
return false;
|
|
2632
|
+
};
|
|
2633
|
+
/**
|
|
2634
|
+
* _isValidAttribute
|
|
2635
|
+
*
|
|
2636
|
+
* @param lcTag Lowercase tag name of containing element.
|
|
2637
|
+
* @param lcName Lowercase attribute name.
|
|
2638
|
+
* @param value Attribute value.
|
|
2639
|
+
* @return Returns true if `value` is valid, otherwise false.
|
|
2640
|
+
*/
|
|
2641
|
+
// eslint-disable-next-line complexity
|
|
2642
|
+
const _isValidAttribute = function _isValidAttribute(lcTag, lcName, value) {
|
|
2643
|
+
/* Make sure attribute cannot clobber */
|
|
2644
|
+
if (SANITIZE_DOM && (lcName === 'id' || lcName === 'name') && (value in document || value in formElement)) {
|
|
2645
|
+
return false;
|
|
2646
|
+
}
|
|
2647
|
+
/* Allow valid data-* attributes: At least one character after "-"
|
|
2648
|
+
(https://html.spec.whatwg.org/multipage/dom.html#embedding-custom-non-visible-data-with-the-data-*-attributes)
|
|
2649
|
+
XML-compatible (https://html.spec.whatwg.org/multipage/infrastructure.html#xml-compatible and http://www.w3.org/TR/xml/#d0e804)
|
|
2650
|
+
We don't need to check the value; it's always URI safe. */
|
|
2651
|
+
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]) {
|
|
2652
|
+
if (
|
|
2653
|
+
// First condition does a very basic check if a) it's basically a valid custom element tagname AND
|
|
2654
|
+
// b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2655
|
+
// and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
|
|
2656
|
+
_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)) ||
|
|
2657
|
+
// Alternative, second condition checks if it's an `is`-attribute, AND
|
|
2658
|
+
// the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
|
|
2659
|
+
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 {
|
|
2660
|
+
return false;
|
|
2661
|
+
}
|
|
2662
|
+
/* Check value is safe. First, is attr inert? If so, is safe */
|
|
2663
|
+
} 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) {
|
|
2664
|
+
return false;
|
|
2665
|
+
} else ;
|
|
2666
|
+
return true;
|
|
2667
|
+
};
|
|
2668
|
+
/**
|
|
2669
|
+
* _isBasicCustomElement
|
|
2670
|
+
* checks if at least one dash is included in tagName, and it's not the first char
|
|
2671
|
+
* for more sophisticated checking see https://github.com/sindresorhus/validate-element-name
|
|
2672
|
+
*
|
|
2673
|
+
* @param tagName name of the tag of the node to sanitize
|
|
2674
|
+
* @returns Returns true if the tag name meets the basic criteria for a custom element, otherwise false.
|
|
2675
|
+
*/
|
|
2676
|
+
const _isBasicCustomElement = function _isBasicCustomElement(tagName) {
|
|
2677
|
+
return tagName !== 'annotation-xml' && stringMatch(tagName, CUSTOM_ELEMENT);
|
|
2678
|
+
};
|
|
2679
|
+
/**
|
|
2680
|
+
* _sanitizeAttributes
|
|
2681
|
+
*
|
|
2682
|
+
* @protect attributes
|
|
2683
|
+
* @protect nodeName
|
|
2684
|
+
* @protect removeAttribute
|
|
2685
|
+
* @protect setAttribute
|
|
2686
|
+
*
|
|
2687
|
+
* @param currentNode to sanitize
|
|
2688
|
+
*/
|
|
2689
|
+
const _sanitizeAttributes = function _sanitizeAttributes(currentNode) {
|
|
2690
|
+
/* Execute a hook if present */
|
|
2691
|
+
_executeHooks(hooks.beforeSanitizeAttributes, currentNode, null);
|
|
2692
|
+
const {
|
|
2693
|
+
attributes
|
|
2694
|
+
} = currentNode;
|
|
2695
|
+
/* Check if we have attributes; if not we might have a text node */
|
|
2696
|
+
if (!attributes || _isClobbered(currentNode)) {
|
|
2697
|
+
return;
|
|
2698
|
+
}
|
|
2699
|
+
const hookEvent = {
|
|
2700
|
+
attrName: '',
|
|
2701
|
+
attrValue: '',
|
|
2702
|
+
keepAttr: true,
|
|
2703
|
+
allowedAttributes: ALLOWED_ATTR,
|
|
2704
|
+
forceKeepAttr: undefined
|
|
2705
|
+
};
|
|
2706
|
+
let l = attributes.length;
|
|
2707
|
+
/* Go backwards over all attributes; safely remove bad ones */
|
|
2708
|
+
while (l--) {
|
|
2709
|
+
const attr = attributes[l];
|
|
2710
|
+
const {
|
|
2711
|
+
name,
|
|
2712
|
+
namespaceURI,
|
|
2713
|
+
value: attrValue
|
|
2714
|
+
} = attr;
|
|
2715
|
+
const lcName = transformCaseFunc(name);
|
|
2716
|
+
const initValue = attrValue;
|
|
2717
|
+
let value = name === 'value' ? initValue : stringTrim(initValue);
|
|
2718
|
+
/* Execute a hook if present */
|
|
2719
|
+
hookEvent.attrName = lcName;
|
|
2720
|
+
hookEvent.attrValue = value;
|
|
2721
|
+
hookEvent.keepAttr = true;
|
|
2722
|
+
hookEvent.forceKeepAttr = undefined; // Allows developers to see this is a property they can set
|
|
2723
|
+
_executeHooks(hooks.uponSanitizeAttribute, currentNode, hookEvent);
|
|
2724
|
+
value = hookEvent.attrValue;
|
|
2725
|
+
/* Full DOM Clobbering protection via namespace isolation,
|
|
2726
|
+
* Prefix id and name attributes with `user-content-`
|
|
2727
|
+
*/
|
|
2728
|
+
if (SANITIZE_NAMED_PROPS && (lcName === 'id' || lcName === 'name')) {
|
|
2729
|
+
// Remove the attribute with this value
|
|
2730
|
+
_removeAttribute(name, currentNode);
|
|
2731
|
+
// Prefix the value and later re-create the attribute with the sanitized value
|
|
2732
|
+
value = SANITIZE_NAMED_PROPS_PREFIX + value;
|
|
2733
|
+
}
|
|
2734
|
+
/* Work around a security issue with comments inside attributes */
|
|
2735
|
+
if (SAFE_FOR_XML && regExpTest(/((--!?|])>)|<\/(style|title)/i, value)) {
|
|
2736
|
+
_removeAttribute(name, currentNode);
|
|
2737
|
+
continue;
|
|
2738
|
+
}
|
|
2739
|
+
/* Did the hooks approve of the attribute? */
|
|
2740
|
+
if (hookEvent.forceKeepAttr) {
|
|
2741
|
+
continue;
|
|
2742
|
+
}
|
|
2743
|
+
/* Did the hooks approve of the attribute? */
|
|
2744
|
+
if (!hookEvent.keepAttr) {
|
|
2745
|
+
_removeAttribute(name, currentNode);
|
|
2746
|
+
continue;
|
|
2747
|
+
}
|
|
2748
|
+
/* Work around a security issue in jQuery 3.0 */
|
|
2749
|
+
if (!ALLOW_SELF_CLOSE_IN_ATTR && regExpTest(/\/>/i, value)) {
|
|
2750
|
+
_removeAttribute(name, currentNode);
|
|
2751
|
+
continue;
|
|
2752
|
+
}
|
|
2753
|
+
/* Sanitize attribute content to be template-safe */
|
|
2754
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2755
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
2756
|
+
value = stringReplace(value, expr, ' ');
|
|
2757
|
+
});
|
|
2758
|
+
}
|
|
2759
|
+
/* Is `value` valid for this attribute? */
|
|
2760
|
+
const lcTag = transformCaseFunc(currentNode.nodeName);
|
|
2761
|
+
if (!_isValidAttribute(lcTag, lcName, value)) {
|
|
2762
|
+
_removeAttribute(name, currentNode);
|
|
2763
|
+
continue;
|
|
2764
|
+
}
|
|
2765
|
+
/* Handle attributes that require Trusted Types */
|
|
2766
|
+
if (trustedTypesPolicy && typeof trustedTypes === 'object' && typeof trustedTypes.getAttributeType === 'function') {
|
|
2767
|
+
if (namespaceURI) ; else {
|
|
2768
|
+
switch (trustedTypes.getAttributeType(lcTag, lcName)) {
|
|
2769
|
+
case 'TrustedHTML':
|
|
2770
|
+
{
|
|
2771
|
+
value = trustedTypesPolicy.createHTML(value);
|
|
2772
|
+
break;
|
|
2773
|
+
}
|
|
2774
|
+
case 'TrustedScriptURL':
|
|
2775
|
+
{
|
|
2776
|
+
value = trustedTypesPolicy.createScriptURL(value);
|
|
2777
|
+
break;
|
|
2778
|
+
}
|
|
2779
|
+
}
|
|
2780
|
+
}
|
|
2781
|
+
}
|
|
2782
|
+
/* Handle invalid data-* attribute set by try-catching it */
|
|
2783
|
+
if (value !== initValue) {
|
|
2784
|
+
try {
|
|
2785
|
+
if (namespaceURI) {
|
|
2786
|
+
currentNode.setAttributeNS(namespaceURI, name, value);
|
|
2787
|
+
} else {
|
|
2788
|
+
/* Fallback to setAttribute() for browser-unrecognized namespaces e.g. "x-schema". */
|
|
2789
|
+
currentNode.setAttribute(name, value);
|
|
2790
|
+
}
|
|
2791
|
+
if (_isClobbered(currentNode)) {
|
|
2792
|
+
_forceRemove(currentNode);
|
|
2793
|
+
} else {
|
|
2794
|
+
arrayPop(DOMPurify.removed);
|
|
2795
|
+
}
|
|
2796
|
+
} catch (_) {
|
|
2797
|
+
_removeAttribute(name, currentNode);
|
|
2798
|
+
}
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
/* Execute a hook if present */
|
|
2802
|
+
_executeHooks(hooks.afterSanitizeAttributes, currentNode, null);
|
|
2803
|
+
};
|
|
2804
|
+
/**
|
|
2805
|
+
* _sanitizeShadowDOM
|
|
2806
|
+
*
|
|
2807
|
+
* @param fragment to iterate over recursively
|
|
2808
|
+
*/
|
|
2809
|
+
const _sanitizeShadowDOM = function _sanitizeShadowDOM(fragment) {
|
|
2810
|
+
let shadowNode = null;
|
|
2811
|
+
const shadowIterator = _createNodeIterator(fragment);
|
|
2812
|
+
/* Execute a hook if present */
|
|
2813
|
+
_executeHooks(hooks.beforeSanitizeShadowDOM, fragment, null);
|
|
2814
|
+
while (shadowNode = shadowIterator.nextNode()) {
|
|
2815
|
+
/* Execute a hook if present */
|
|
2816
|
+
_executeHooks(hooks.uponSanitizeShadowNode, shadowNode, null);
|
|
2817
|
+
/* Sanitize tags and elements */
|
|
2818
|
+
_sanitizeElements(shadowNode);
|
|
2819
|
+
/* Check attributes next */
|
|
2820
|
+
_sanitizeAttributes(shadowNode);
|
|
2821
|
+
/* Deep shadow DOM detected */
|
|
2822
|
+
if (shadowNode.content instanceof DocumentFragment) {
|
|
2823
|
+
_sanitizeShadowDOM(shadowNode.content);
|
|
1515
2824
|
}
|
|
1516
|
-
}
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
2825
|
+
}
|
|
2826
|
+
/* Execute a hook if present */
|
|
2827
|
+
_executeHooks(hooks.afterSanitizeShadowDOM, fragment, null);
|
|
2828
|
+
};
|
|
2829
|
+
// eslint-disable-next-line complexity
|
|
2830
|
+
DOMPurify.sanitize = function (dirty) {
|
|
2831
|
+
let cfg = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
|
|
2832
|
+
let body = null;
|
|
2833
|
+
let importedNode = null;
|
|
2834
|
+
let currentNode = null;
|
|
2835
|
+
let returnNode = null;
|
|
2836
|
+
/* Make sure we have a string to sanitize.
|
|
2837
|
+
DO NOT return early, as this will return the wrong type if
|
|
2838
|
+
the user has requested a DOM object rather than a string */
|
|
2839
|
+
IS_EMPTY_INPUT = !dirty;
|
|
2840
|
+
if (IS_EMPTY_INPUT) {
|
|
2841
|
+
dirty = '<!-->';
|
|
2842
|
+
}
|
|
2843
|
+
/* Stringify, in case dirty is an object */
|
|
2844
|
+
if (typeof dirty !== 'string' && !_isNode(dirty)) {
|
|
2845
|
+
if (typeof dirty.toString === 'function') {
|
|
2846
|
+
dirty = dirty.toString();
|
|
2847
|
+
if (typeof dirty !== 'string') {
|
|
2848
|
+
throw typeErrorCreate('dirty is not a string, aborting');
|
|
2849
|
+
}
|
|
2850
|
+
} else {
|
|
2851
|
+
throw typeErrorCreate('toString is not a function');
|
|
1529
2852
|
}
|
|
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
2853
|
}
|
|
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
|
-
|
|
2854
|
+
/* Return dirty HTML if DOMPurify cannot run */
|
|
2855
|
+
if (!DOMPurify.isSupported) {
|
|
2856
|
+
return dirty;
|
|
2857
|
+
}
|
|
2858
|
+
/* Assign config vars */
|
|
2859
|
+
if (!SET_CONFIG) {
|
|
2860
|
+
_parseConfig(cfg);
|
|
2861
|
+
}
|
|
2862
|
+
/* Clean up removed elements */
|
|
2863
|
+
DOMPurify.removed = [];
|
|
2864
|
+
/* Check if dirty is correctly typed for IN_PLACE */
|
|
2865
|
+
if (typeof dirty === 'string') {
|
|
2866
|
+
IN_PLACE = false;
|
|
2867
|
+
}
|
|
2868
|
+
if (IN_PLACE) {
|
|
2869
|
+
/* Do some early pre-sanitization to avoid unsafe root nodes */
|
|
2870
|
+
if (dirty.nodeName) {
|
|
2871
|
+
const tagName = transformCaseFunc(dirty.nodeName);
|
|
2872
|
+
if (!ALLOWED_TAGS[tagName] || FORBID_TAGS[tagName]) {
|
|
2873
|
+
throw typeErrorCreate('root node is forbidden and cannot be sanitized in-place');
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
} else if (dirty instanceof Node) {
|
|
2877
|
+
/* If dirty is a DOM element, append to an empty document to avoid
|
|
2878
|
+
elements being stripped by the parser */
|
|
2879
|
+
body = _initDocument('<!---->');
|
|
2880
|
+
importedNode = body.ownerDocument.importNode(dirty, true);
|
|
2881
|
+
if (importedNode.nodeType === NODE_TYPE.element && importedNode.nodeName === 'BODY') {
|
|
2882
|
+
/* Node is already a body, use as is */
|
|
2883
|
+
body = importedNode;
|
|
2884
|
+
} else if (importedNode.nodeName === 'HTML') {
|
|
2885
|
+
body = importedNode;
|
|
2886
|
+
} else {
|
|
2887
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
2888
|
+
body.appendChild(importedNode);
|
|
2889
|
+
}
|
|
2890
|
+
} else {
|
|
2891
|
+
/* Exit directly if we have nothing to do */
|
|
2892
|
+
if (!RETURN_DOM && !SAFE_FOR_TEMPLATES && !WHOLE_DOCUMENT &&
|
|
2893
|
+
// eslint-disable-next-line unicorn/prefer-includes
|
|
2894
|
+
dirty.indexOf('<') === -1) {
|
|
2895
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(dirty) : dirty;
|
|
2896
|
+
}
|
|
2897
|
+
/* Initialize the document to work on */
|
|
2898
|
+
body = _initDocument(dirty);
|
|
2899
|
+
/* Check we have a DOM node from the data */
|
|
2900
|
+
if (!body) {
|
|
2901
|
+
return RETURN_DOM ? null : RETURN_TRUSTED_TYPE ? emptyHTML : '';
|
|
2902
|
+
}
|
|
2903
|
+
}
|
|
2904
|
+
/* Remove first element node (ours) if FORCE_BODY is set */
|
|
2905
|
+
if (body && FORCE_BODY) {
|
|
2906
|
+
_forceRemove(body.firstChild);
|
|
2907
|
+
}
|
|
2908
|
+
/* Get node iterator */
|
|
2909
|
+
const nodeIterator = _createNodeIterator(IN_PLACE ? dirty : body);
|
|
2910
|
+
/* Now start iterating over the created document */
|
|
2911
|
+
while (currentNode = nodeIterator.nextNode()) {
|
|
2912
|
+
/* Sanitize tags and elements */
|
|
2913
|
+
_sanitizeElements(currentNode);
|
|
2914
|
+
/* Check attributes next */
|
|
2915
|
+
_sanitizeAttributes(currentNode);
|
|
2916
|
+
/* Shadow DOM detected, sanitize it */
|
|
2917
|
+
if (currentNode.content instanceof DocumentFragment) {
|
|
2918
|
+
_sanitizeShadowDOM(currentNode.content);
|
|
2919
|
+
}
|
|
2920
|
+
}
|
|
2921
|
+
/* If we sanitized `dirty` in-place, return it. */
|
|
2922
|
+
if (IN_PLACE) {
|
|
2923
|
+
return dirty;
|
|
2924
|
+
}
|
|
2925
|
+
/* Return sanitized string or DOM */
|
|
2926
|
+
if (RETURN_DOM) {
|
|
2927
|
+
if (RETURN_DOM_FRAGMENT) {
|
|
2928
|
+
returnNode = createDocumentFragment.call(body.ownerDocument);
|
|
2929
|
+
while (body.firstChild) {
|
|
2930
|
+
// eslint-disable-next-line unicorn/prefer-dom-node-append
|
|
2931
|
+
returnNode.appendChild(body.firstChild);
|
|
2932
|
+
}
|
|
2933
|
+
} else {
|
|
2934
|
+
returnNode = body;
|
|
2935
|
+
}
|
|
2936
|
+
if (ALLOWED_ATTR.shadowroot || ALLOWED_ATTR.shadowrootmode) {
|
|
2937
|
+
/*
|
|
2938
|
+
AdoptNode() is not used because internal state is not reset
|
|
2939
|
+
(e.g. the past names map of a HTMLFormElement), this is safe
|
|
2940
|
+
in theory but we would rather not risk another attack vector.
|
|
2941
|
+
The state that is cloned by importNode() is explicitly defined
|
|
2942
|
+
by the specs.
|
|
2943
|
+
*/
|
|
2944
|
+
returnNode = importNode.call(originalDocument, returnNode, true);
|
|
2945
|
+
}
|
|
2946
|
+
return returnNode;
|
|
2947
|
+
}
|
|
2948
|
+
let serializedHTML = WHOLE_DOCUMENT ? body.outerHTML : body.innerHTML;
|
|
2949
|
+
/* Serialize doctype if allowed */
|
|
2950
|
+
if (WHOLE_DOCUMENT && ALLOWED_TAGS['!doctype'] && body.ownerDocument && body.ownerDocument.doctype && body.ownerDocument.doctype.name && regExpTest(DOCTYPE_NAME, body.ownerDocument.doctype.name)) {
|
|
2951
|
+
serializedHTML = '<!DOCTYPE ' + body.ownerDocument.doctype.name + '>\n' + serializedHTML;
|
|
2952
|
+
}
|
|
2953
|
+
/* Sanitize final string template-safe */
|
|
2954
|
+
if (SAFE_FOR_TEMPLATES) {
|
|
2955
|
+
arrayForEach([MUSTACHE_EXPR, ERB_EXPR, TMPLIT_EXPR], expr => {
|
|
2956
|
+
serializedHTML = stringReplace(serializedHTML, expr, ' ');
|
|
2957
|
+
});
|
|
2958
|
+
}
|
|
2959
|
+
return trustedTypesPolicy && RETURN_TRUSTED_TYPE ? trustedTypesPolicy.createHTML(serializedHTML) : serializedHTML;
|
|
2960
|
+
};
|
|
2961
|
+
DOMPurify.setConfig = function () {
|
|
2962
|
+
let cfg = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
2963
|
+
_parseConfig(cfg);
|
|
2964
|
+
SET_CONFIG = true;
|
|
2965
|
+
};
|
|
2966
|
+
DOMPurify.clearConfig = function () {
|
|
2967
|
+
CONFIG = null;
|
|
2968
|
+
SET_CONFIG = false;
|
|
2969
|
+
};
|
|
2970
|
+
DOMPurify.isValidAttribute = function (tag, attr, value) {
|
|
2971
|
+
/* Initialize shared config vars if necessary. */
|
|
2972
|
+
if (!CONFIG) {
|
|
2973
|
+
_parseConfig({});
|
|
2974
|
+
}
|
|
2975
|
+
const lcTag = transformCaseFunc(tag);
|
|
2976
|
+
const lcName = transformCaseFunc(attr);
|
|
2977
|
+
return _isValidAttribute(lcTag, lcName, value);
|
|
2978
|
+
};
|
|
2979
|
+
DOMPurify.addHook = function (entryPoint, hookFunction) {
|
|
2980
|
+
if (typeof hookFunction !== 'function') {
|
|
2981
|
+
return;
|
|
2982
|
+
}
|
|
2983
|
+
arrayPush(hooks[entryPoint], hookFunction);
|
|
2984
|
+
};
|
|
2985
|
+
DOMPurify.removeHook = function (entryPoint, hookFunction) {
|
|
2986
|
+
if (hookFunction !== undefined) {
|
|
2987
|
+
const index = arrayLastIndexOf(hooks[entryPoint], hookFunction);
|
|
2988
|
+
return index === -1 ? undefined : arraySplice(hooks[entryPoint], index, 1)[0];
|
|
2989
|
+
}
|
|
2990
|
+
return arrayPop(hooks[entryPoint]);
|
|
2991
|
+
};
|
|
2992
|
+
DOMPurify.removeHooks = function (entryPoint) {
|
|
2993
|
+
hooks[entryPoint] = [];
|
|
2994
|
+
};
|
|
2995
|
+
DOMPurify.removeAllHooks = function () {
|
|
2996
|
+
hooks = _createHooksMap();
|
|
2997
|
+
};
|
|
2998
|
+
return DOMPurify;
|
|
1599
2999
|
}
|
|
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
|
-
|
|
3000
|
+
var purify = createDOMPurify();
|
|
1642
3001
|
|
|
1643
3002
|
|
|
3003
|
+
//# sourceMappingURL=purify.es.mjs.map
|
|
1644
3004
|
|
|
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
|
|
3005
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/list-tag-render.tsx
|
|
1683
3006
|
|
|
1684
3007
|
/*
|
|
1685
3008
|
* Tencent is pleased to support the open source community by making
|
|
1686
3009
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
1687
3010
|
*
|
|
1688
|
-
* Copyright (C)
|
|
3011
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
|
1689
3012
|
*
|
|
1690
3013
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
1691
3014
|
*
|
|
@@ -1709,6 +3032,7 @@ const trim_namespaceObject = trim_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MOD
|
|
|
1709
3032
|
|
|
1710
3033
|
|
|
1711
3034
|
|
|
3035
|
+
|
|
1712
3036
|
/* harmony default export */ const list_tag_render = ((0,external_vue_namespaceObject.defineComponent)({
|
|
1713
3037
|
name: 'ListTagRender',
|
|
1714
3038
|
props: {
|
|
@@ -1728,9 +3052,9 @@ const trim_namespaceObject = trim_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MOD
|
|
|
1728
3052
|
var highlightKeyword = function highlightKeyword(value) {
|
|
1729
3053
|
if (_this.searchKeyword && !_this.disabled) {
|
|
1730
3054
|
var keywordReg = new RegExp("(".concat(_this.searchKeyword, ")"), 'i');
|
|
1731
|
-
return value.replace(keywordReg, '<strong class="highlight-text">$1</strong>');
|
|
3055
|
+
return purify.sanitize(value.replace(keywordReg, '<strong class="highlight-text">$1</strong>'));
|
|
1732
3056
|
}
|
|
1733
|
-
return value;
|
|
3057
|
+
return purify.sanitize(value);
|
|
1734
3058
|
};
|
|
1735
3059
|
if (this.tpl) {
|
|
1736
3060
|
return this.tpl(this.node, highlightKeyword, external_vue_namespaceObject.h, this);
|
|
@@ -1741,21 +3065,19 @@ const trim_namespaceObject = trim_x({ ["default"]: () => (__WEBPACK_EXTERNAL_MOD
|
|
|
1741
3065
|
}, [(0,external_vue_namespaceObject.createVNode)("span", {
|
|
1742
3066
|
"class": "text",
|
|
1743
3067
|
"innerHTML": highlightKeyword(displayText)
|
|
1744
|
-
},
|
|
3068
|
+
}, null)]);
|
|
1745
3069
|
}
|
|
1746
3070
|
}));
|
|
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
|
|
3071
|
+
;// CONCATENATED MODULE: external "vue-types"
|
|
3072
|
+
var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
3073
|
+
var external_vue_types_y = x => () => x
|
|
3074
|
+
const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
|
|
3075
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-props.ts
|
|
1754
3076
|
/*
|
|
1755
3077
|
* Tencent is pleased to support the open source community by making
|
|
1756
3078
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
1757
3079
|
*
|
|
1758
|
-
* Copyright (C)
|
|
3080
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
|
1759
3081
|
*
|
|
1760
3082
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
1761
3083
|
*
|
|
@@ -1843,17 +3165,17 @@ var tagProps = function tagProps() {
|
|
|
1843
3165
|
"default": function _default() {
|
|
1844
3166
|
return {};
|
|
1845
3167
|
}
|
|
1846
|
-
}
|
|
3168
|
+
},
|
|
3169
|
+
copyable: shared_namespaceObject.PropTypes.bool.def(true),
|
|
3170
|
+
copySeparator: shared_namespaceObject.PropTypes.string.def('\n')
|
|
1847
3171
|
};
|
|
1848
3172
|
};
|
|
1849
3173
|
/* 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
|
|
3174
|
+
;// CONCATENATED MODULE: external "lodash/has"
|
|
3175
|
+
var has_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
|
3176
|
+
var has_y = x => () => x
|
|
3177
|
+
const has_namespaceObject = has_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE_lodash_has_e9e453be__["default"] });
|
|
3178
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-render.tsx
|
|
1857
3179
|
|
|
1858
3180
|
|
|
1859
3181
|
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 +3184,7 @@ function tag_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
1862
3184
|
* Tencent is pleased to support the open source community by making
|
|
1863
3185
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
1864
3186
|
*
|
|
1865
|
-
* Copyright (C)
|
|
3187
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
|
1866
3188
|
*
|
|
1867
3189
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
1868
3190
|
*
|
|
@@ -1908,9 +3230,15 @@ function tag_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
1908
3230
|
"default": function _default() {
|
|
1909
3231
|
return {};
|
|
1910
3232
|
}
|
|
3233
|
+
},
|
|
3234
|
+
allowCreate: {
|
|
3235
|
+
type: Boolean,
|
|
3236
|
+
"default": false
|
|
1911
3237
|
}
|
|
1912
3238
|
},
|
|
1913
|
-
|
|
3239
|
+
emits: ['dblclick', 'change'],
|
|
3240
|
+
setup: function setup(props, _ref) {
|
|
3241
|
+
var emit = _ref.emit;
|
|
1914
3242
|
var tagRef = (0,external_vue_namespaceObject.ref)();
|
|
1915
3243
|
var isOverflow = (0,external_vue_namespaceObject.ref)(false);
|
|
1916
3244
|
var overflowTips = (0,external_vue_namespaceObject.computed)(function () {
|
|
@@ -1922,12 +3250,82 @@ function tag_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
1922
3250
|
disabled: !(0,has_namespaceObject["default"])(props.node, props.tooltipKey) || !isOverflow.value
|
|
1923
3251
|
}, props.tagOverflowTips);
|
|
1924
3252
|
});
|
|
3253
|
+
var editRef = (0,external_vue_namespaceObject.ref)();
|
|
3254
|
+
var showEdit = (0,external_vue_namespaceObject.ref)(false);
|
|
3255
|
+
var clickTimer = (0,external_vue_namespaceObject.ref)(null);
|
|
3256
|
+
var handleClick = function handleClick() {
|
|
3257
|
+
if (clickTimer.value) {
|
|
3258
|
+
clearTimeout(clickTimer.value);
|
|
3259
|
+
}
|
|
3260
|
+
clickTimer.value = window.setTimeout(function () {
|
|
3261
|
+
// timer 为 null 说明是双击
|
|
3262
|
+
if (clickTimer.value === null) {
|
|
3263
|
+
return;
|
|
3264
|
+
}
|
|
3265
|
+
clickTimer.value = null;
|
|
3266
|
+
}, 200);
|
|
3267
|
+
};
|
|
3268
|
+
var handleDblclick = function handleDblclick(e) {
|
|
3269
|
+
e.preventDefault();
|
|
3270
|
+
e.stopPropagation();
|
|
3271
|
+
// 阻止单击事件执行
|
|
3272
|
+
if (clickTimer.value) {
|
|
3273
|
+
clearTimeout(clickTimer.value);
|
|
3274
|
+
clickTimer.value = null;
|
|
3275
|
+
}
|
|
3276
|
+
showEdit.value = true;
|
|
3277
|
+
emit('dblclick', true);
|
|
3278
|
+
setTimeout(function () {
|
|
3279
|
+
var _editRef$value;
|
|
3280
|
+
(_editRef$value = editRef.value) === null || _editRef$value === void 0 || _editRef$value.focus();
|
|
3281
|
+
}, 0);
|
|
3282
|
+
};
|
|
3283
|
+
var handleEditBlur = function handleEditBlur() {
|
|
3284
|
+
showEdit.value = false;
|
|
3285
|
+
emit('dblclick', false);
|
|
3286
|
+
};
|
|
3287
|
+
var handleEditFocus = function handleEditFocus() {
|
|
3288
|
+
showEdit.value = true;
|
|
3289
|
+
};
|
|
3290
|
+
var handleEditChange = function handleEditChange(e) {
|
|
3291
|
+
var val = e.target.value;
|
|
3292
|
+
emit('change', val);
|
|
3293
|
+
};
|
|
3294
|
+
var handleEditKeyDown = function handleEditKeyDown(e) {
|
|
3295
|
+
if ((e.code === 'Enter' || e.key === 'Enter' || e.keyCode === 13) && !e.isComposing) {
|
|
3296
|
+
var val = e.target.value;
|
|
3297
|
+
emit('change', val);
|
|
3298
|
+
setTimeout(function () {
|
|
3299
|
+
handleEditBlur();
|
|
3300
|
+
}, 100);
|
|
3301
|
+
}
|
|
3302
|
+
};
|
|
3303
|
+
var handleEditInput = function handleEditInput(e) {
|
|
3304
|
+
// console.error('handleEditInputhandleEditInputhandleEditInput', (e.target as HTMLInputElement).value, props.node);
|
|
3305
|
+
// emit('input', e.target.value);
|
|
3306
|
+
var val = e.target.value;
|
|
3307
|
+
editValue.value = val;
|
|
3308
|
+
};
|
|
3309
|
+
var editValue = (0,external_vue_namespaceObject.ref)(props.node[props.displayKey]);
|
|
3310
|
+
(0,external_vue_namespaceObject.watch)(props.node[props.displayKey], function (val) {
|
|
3311
|
+
editValue.value = val;
|
|
3312
|
+
});
|
|
1925
3313
|
(0,external_vue_namespaceObject.onMounted)(function () {
|
|
1926
3314
|
isOverflow.value = (0,shared_namespaceObject.checkOverflow)(tagRef.value);
|
|
1927
3315
|
});
|
|
1928
3316
|
return {
|
|
1929
3317
|
overflowTips: overflowTips,
|
|
1930
|
-
tagRef: tagRef
|
|
3318
|
+
tagRef: tagRef,
|
|
3319
|
+
editRef: editRef,
|
|
3320
|
+
handleClick: handleClick,
|
|
3321
|
+
handleDblclick: handleDblclick,
|
|
3322
|
+
showEdit: showEdit,
|
|
3323
|
+
handleEditBlur: handleEditBlur,
|
|
3324
|
+
handleEditFocus: handleEditFocus,
|
|
3325
|
+
handleEditChange: handleEditChange,
|
|
3326
|
+
handleEditKeyDown: handleEditKeyDown,
|
|
3327
|
+
handleEditInput: handleEditInput,
|
|
3328
|
+
editValue: editValue
|
|
1931
3329
|
};
|
|
1932
3330
|
},
|
|
1933
3331
|
render: function render() {
|
|
@@ -1937,12 +3335,24 @@ function tag_render_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
1937
3335
|
return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
|
1938
3336
|
"ref": "tagRef",
|
|
1939
3337
|
"class": "tag"
|
|
1940
|
-
}, [(0,external_vue_namespaceObject.createVNode)("
|
|
1941
|
-
"
|
|
1942
|
-
|
|
3338
|
+
}, [this.showEdit ? (0,external_vue_namespaceObject.createVNode)("input", {
|
|
3339
|
+
"ref": "editRef",
|
|
3340
|
+
"class": "dblclick-edit-input",
|
|
3341
|
+
"type": "text",
|
|
3342
|
+
"value": this.editValue,
|
|
3343
|
+
"onBlur": this.handleEditBlur,
|
|
3344
|
+
"onChange": this.handleEditChange,
|
|
3345
|
+
"onFocus": this.handleEditFocus,
|
|
3346
|
+
"onInput": this.handleEditInput,
|
|
3347
|
+
"onKeydown": this.handleEditKeyDown
|
|
3348
|
+
}, null) : null, (0,external_vue_namespaceObject.createVNode)("span", {
|
|
3349
|
+
"class": "text",
|
|
3350
|
+
"onClick": this.allowCreate ? this.handleClick : undefined,
|
|
3351
|
+
"onDblclick": this.allowCreate ? this.handleDblclick : undefined
|
|
3352
|
+
}, [this.editValue])]), [[(0,external_vue_namespaceObject.resolveDirective)("bk-tooltips"), this.overflowTips]]);
|
|
1943
3353
|
}
|
|
1944
3354
|
}));
|
|
1945
|
-
;// ../../packages/tag-input/src/tag-input.tsx
|
|
3355
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/tag-input.tsx
|
|
1946
3356
|
|
|
1947
3357
|
|
|
1948
3358
|
|
|
@@ -1954,7 +3364,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
1954
3364
|
* Tencent is pleased to support the open source community by making
|
|
1955
3365
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
1956
3366
|
*
|
|
1957
|
-
* Copyright (C)
|
|
3367
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
|
1958
3368
|
*
|
|
1959
3369
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
1960
3370
|
*
|
|
@@ -1997,7 +3407,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
1997
3407
|
bkTooltips: src_tooltips
|
|
1998
3408
|
},
|
|
1999
3409
|
props: tag_props(),
|
|
2000
|
-
emits: ['update:modelValue', 'change', 'select', 'focus', 'blur', 'remove', 'removeAll', 'input'],
|
|
3410
|
+
emits: ['update:modelValue', 'change', 'select', 'focus', 'blur', 'remove', 'removeAll', 'input', 'copy-success'],
|
|
2001
3411
|
setup: function setup(props, _ref) {
|
|
2002
3412
|
var emit = _ref.emit;
|
|
2003
3413
|
var formItem = (0,shared_namespaceObject.useFormItem)();
|
|
@@ -2033,6 +3443,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2033
3443
|
var selectorListRef = (0,external_vue_namespaceObject.ref)(null);
|
|
2034
3444
|
var inputValueRef = (0,external_vue_namespaceObject.ref)();
|
|
2035
3445
|
var timer = (0,external_vue_namespaceObject.ref)(null);
|
|
3446
|
+
var isShowDblclickEdit = (0,external_vue_namespaceObject.ref)(false);
|
|
2036
3447
|
// 是否展示tag close
|
|
2037
3448
|
var showTagClose = (0,external_vue_namespaceObject.computed)(function () {
|
|
2038
3449
|
return !props.disabled && props.hasDeleteIcon;
|
|
@@ -2059,6 +3470,9 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2059
3470
|
var isShowClear = (0,external_vue_namespaceObject.computed)(function () {
|
|
2060
3471
|
return props.clearable && !props.disabled && listState.selectedTagList.length !== 0 && (props.showClearOnlyHover ? state.isHover : true);
|
|
2061
3472
|
});
|
|
3473
|
+
var isShowCopy = (0,external_vue_namespaceObject.computed)(function () {
|
|
3474
|
+
return props.copyable && listState.selectedTagList.length !== 0 && (props.showClearOnlyHover ? state.isHover : true);
|
|
3475
|
+
});
|
|
2062
3476
|
var triggerClass = (0,external_vue_namespaceObject.computed)(function () {
|
|
2063
3477
|
return _defineProperty(_defineProperty(_defineProperty({}, "".concat(resolveClassName('tag-input-trigger')), true), "active", state.isEdit), "disabled", props.disabled);
|
|
2064
3478
|
});
|
|
@@ -2210,6 +3624,9 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2210
3624
|
state.isEdit = true;
|
|
2211
3625
|
setTimeout(function () {
|
|
2212
3626
|
var _tagInputRef$value;
|
|
3627
|
+
if (isShowDblclickEdit.value) {
|
|
3628
|
+
return;
|
|
3629
|
+
}
|
|
2213
3630
|
(_tagInputRef$value = tagInputRef.value) === null || _tagInputRef$value === void 0 || _tagInputRef$value.focus();
|
|
2214
3631
|
if (props.trigger === 'focus' && listState.localList.length !== 0) {
|
|
2215
3632
|
filterData();
|
|
@@ -2221,6 +3638,67 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2221
3638
|
}
|
|
2222
3639
|
}, 200);
|
|
2223
3640
|
};
|
|
3641
|
+
var handleTagDblclick = function handleTagDblclick(isDblclick) {
|
|
3642
|
+
isShowDblclickEdit.value = isDblclick;
|
|
3643
|
+
setTimeout(function () {
|
|
3644
|
+
state.isEdit = false;
|
|
3645
|
+
popoverProps.isShow = false;
|
|
3646
|
+
}, 10);
|
|
3647
|
+
};
|
|
3648
|
+
var handleTagDblclickChange = function handleTagDblclickChange(item, index, value) {
|
|
3649
|
+
setTimeout(function () {
|
|
3650
|
+
state.isEdit = false;
|
|
3651
|
+
popoverProps.isShow = false;
|
|
3652
|
+
}, 10);
|
|
3653
|
+
if (listState.selectedTagList.length >= props.maxData && props.maxData !== -1) {
|
|
3654
|
+
return;
|
|
3655
|
+
}
|
|
3656
|
+
var separator = props.separator,
|
|
3657
|
+
saveKey = props.saveKey,
|
|
3658
|
+
displayKey = props.displayKey,
|
|
3659
|
+
createTagValidator = props.createTagValidator,
|
|
3660
|
+
clearTextSpace = props.clearTextSpace;
|
|
3661
|
+
var validateTag = function validateTag(value) {
|
|
3662
|
+
if (typeof createTagValidator === 'function') {
|
|
3663
|
+
return createTagValidator(value);
|
|
3664
|
+
}
|
|
3665
|
+
return true;
|
|
3666
|
+
};
|
|
3667
|
+
var newValue;
|
|
3668
|
+
if (separator) {
|
|
3669
|
+
var tags = value.split(separator);
|
|
3670
|
+
tags = tags.filter(function (tag) {
|
|
3671
|
+
return (tag === null || tag === void 0 ? void 0 : tag.trim()) && !tagList.value.includes(tag) && validateTag(tag);
|
|
3672
|
+
});
|
|
3673
|
+
var localTags = tags.map(function (tag) {
|
|
3674
|
+
return saveKeyMap.value[tag] || _defineProperty(_defineProperty({}, saveKey, tag), displayKey, tag);
|
|
3675
|
+
});
|
|
3676
|
+
if (tags.length) {
|
|
3677
|
+
var _listState$selectedTa;
|
|
3678
|
+
(_listState$selectedTa = listState.selectedTagList).splice.apply(_listState$selectedTa, [index, 1].concat(_toConsumableArray(localTags)));
|
|
3679
|
+
}
|
|
3680
|
+
} else {
|
|
3681
|
+
var isObject = _typeof(value) === 'object';
|
|
3682
|
+
newValue = isObject ? value[saveKey] : value.trim();
|
|
3683
|
+
if (clearTextSpace) {
|
|
3684
|
+
newValue = newValue.replace(/\s+/g, '');
|
|
3685
|
+
}
|
|
3686
|
+
if (newValue !== undefined && !tagList.value.includes(newValue) && validateTag(newValue)) {
|
|
3687
|
+
var localItem = saveKeyMap.value[newValue] || (isObject ? value : _defineProperty(_defineProperty({}, saveKey, newValue), displayKey, newValue));
|
|
3688
|
+
listState.selectedTagList.splice(index, 1, localItem);
|
|
3689
|
+
}
|
|
3690
|
+
}
|
|
3691
|
+
var isExistInit = saveKeyMap.value[item[props.saveKey]];
|
|
3692
|
+
// 将删除的项加入加列表
|
|
3693
|
+
if ((props.allowCreate && isExistInit || !props.allowCreate) && !isSingleSelect.value) {
|
|
3694
|
+
listState.localList.push(item);
|
|
3695
|
+
}
|
|
3696
|
+
// console.error('listState.selectedTagListlistState.selectedTagList', listState.selectedTagList);
|
|
3697
|
+
// console.error('listState.localListlistState.localList', listState.localList);
|
|
3698
|
+
// console.error('tagList.valuetagList.value', tagList.value);
|
|
3699
|
+
emit('update:modelValue', tagList.value);
|
|
3700
|
+
emit('change', tagList.value);
|
|
3701
|
+
};
|
|
2224
3702
|
/**
|
|
2225
3703
|
* 初始化列表数据
|
|
2226
3704
|
*/
|
|
@@ -2330,8 +3808,8 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2330
3808
|
// 聚焦的时候会存在空节点,导致backspace需要点击多次才能删除tag
|
|
2331
3809
|
var index = childNodes.filter(function (item) {
|
|
2332
3810
|
return item.className !== '';
|
|
2333
|
-
}).findIndex(function (
|
|
2334
|
-
var id =
|
|
3811
|
+
}).findIndex(function (_ref6) {
|
|
3812
|
+
var id = _ref6.id;
|
|
2335
3813
|
return id === 'tagInputItem';
|
|
2336
3814
|
});
|
|
2337
3815
|
return index >= 0 ? index : 0;
|
|
@@ -2348,25 +3826,42 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2348
3826
|
}
|
|
2349
3827
|
referenceNode.parentNode.insertBefore(newNode, swap);
|
|
2350
3828
|
};
|
|
3829
|
+
// 计算输入框的实际宽度,包括输入拼音时的正确宽度
|
|
3830
|
+
var updateInputWidth = function updateInputWidth(value) {
|
|
3831
|
+
var charLen = getCharLength(value);
|
|
3832
|
+
if (!charLen) {
|
|
3833
|
+
tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
|
|
3834
|
+
return;
|
|
3835
|
+
}
|
|
3836
|
+
var span = document.createElement('span');
|
|
3837
|
+
span.style.visibility = 'hidden';
|
|
3838
|
+
span.style.position = 'absolute';
|
|
3839
|
+
span.style.whiteSpace = 'pre';
|
|
3840
|
+
span.style.font = window.getComputedStyle(tagInputRef.value).font;
|
|
3841
|
+
span.textContent = value;
|
|
3842
|
+
document.body.appendChild(span);
|
|
3843
|
+
var width = span.offsetWidth;
|
|
3844
|
+
document.body.removeChild(span);
|
|
3845
|
+
tagInputRef.value.style.width = "".concat(Math.max(width + 10, INPUT_MIN_WIDTH), "px");
|
|
3846
|
+
};
|
|
3847
|
+
var handleCompositionEnd = function handleCompositionEnd() {
|
|
3848
|
+
updateInputWidth(curInputValue.value);
|
|
3849
|
+
};
|
|
2351
3850
|
var handleInput = function handleInput(e) {
|
|
2352
3851
|
var maxData = props.maxData,
|
|
2353
3852
|
trigger = props.trigger,
|
|
2354
3853
|
allowCreate = props.allowCreate;
|
|
2355
3854
|
if (maxData === -1 || maxData > tagList.value.length) {
|
|
2356
|
-
var
|
|
2357
|
-
value =
|
|
2358
|
-
|
|
2359
|
-
if (charLen) {
|
|
3855
|
+
var _ref7 = e !== null && e !== void 0 && e.target ? e.target : curInputValue,
|
|
3856
|
+
value = _ref7.value;
|
|
3857
|
+
if (value) {
|
|
2360
3858
|
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
|
-
});
|
|
3859
|
+
updateInputWidth(value);
|
|
2366
3860
|
} else {
|
|
2367
3861
|
if (trigger === 'focus') {
|
|
2368
3862
|
filterData();
|
|
2369
3863
|
}
|
|
3864
|
+
tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
|
|
2370
3865
|
}
|
|
2371
3866
|
} else {
|
|
2372
3867
|
handleBlur();
|
|
@@ -2658,8 +4153,8 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2658
4153
|
return tags.includes(tag[saveKey]);
|
|
2659
4154
|
});
|
|
2660
4155
|
if (tags.length) {
|
|
2661
|
-
var _listState$
|
|
2662
|
-
(_listState$
|
|
4156
|
+
var _listState$selectedTa2;
|
|
4157
|
+
(_listState$selectedTa2 = listState.selectedTagList).splice.apply(_listState$selectedTa2, [index, 0].concat(_toConsumableArray(localTags)));
|
|
2663
4158
|
swapElementPositions(tagInputItemRef.value, nodes[index]);
|
|
2664
4159
|
tagInputRef.value.style.width = "".concat(INPUT_MIN_WIDTH, "px");
|
|
2665
4160
|
listState.localList = listState.localList.filter(function (val) {
|
|
@@ -2718,8 +4213,8 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2718
4213
|
return saveKeyMap.value[tag] || _defineProperty(_defineProperty({}, saveKey, tag), displayKey, tag);
|
|
2719
4214
|
});
|
|
2720
4215
|
if (tags.length) {
|
|
2721
|
-
var _listState$
|
|
2722
|
-
(_listState$
|
|
4216
|
+
var _listState$selectedTa3;
|
|
4217
|
+
(_listState$selectedTa3 = listState.selectedTagList).splice.apply(_listState$selectedTa3, [targetIndex, 0].concat(_toConsumableArray(localTags)));
|
|
2723
4218
|
moveCount = localTags.length;
|
|
2724
4219
|
isSelected = true;
|
|
2725
4220
|
}
|
|
@@ -2794,11 +4289,46 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2794
4289
|
return acc;
|
|
2795
4290
|
}, []);
|
|
2796
4291
|
});
|
|
4292
|
+
var handleCopy = function handleCopy(e) {
|
|
4293
|
+
var _navigator$clipboard;
|
|
4294
|
+
e.stopPropagation();
|
|
4295
|
+
// 获取选中的 tag 列表
|
|
4296
|
+
var selectedTags = listState.selectedTagList;
|
|
4297
|
+
if (selectedTags.length === 0) {
|
|
4298
|
+
return;
|
|
4299
|
+
}
|
|
4300
|
+
// 将选中的 tags 按换行分隔
|
|
4301
|
+
var copyText = selectedTags.map(function (tag) {
|
|
4302
|
+
return tag[props.displayKey];
|
|
4303
|
+
}).join(props.copySeparator);
|
|
4304
|
+
if ((_navigator$clipboard = navigator.clipboard) !== null && _navigator$clipboard !== void 0 && _navigator$clipboard.writeText) {
|
|
4305
|
+
navigator.clipboard.writeText(copyText)["catch"](function (err) {
|
|
4306
|
+
console.error('Failed to copy:', err);
|
|
4307
|
+
});
|
|
4308
|
+
} else {
|
|
4309
|
+
var textarea = document.createElement('textarea');
|
|
4310
|
+
textarea.value = copyText;
|
|
4311
|
+
textarea.style.position = 'fixed';
|
|
4312
|
+
textarea.style.opacity = '0';
|
|
4313
|
+
document.body.appendChild(textarea);
|
|
4314
|
+
textarea.select();
|
|
4315
|
+
try {
|
|
4316
|
+
document.execCommand('copy');
|
|
4317
|
+
} catch (err) {
|
|
4318
|
+
console.error('Failed to copy:', err);
|
|
4319
|
+
}
|
|
4320
|
+
document.body.removeChild(textarea);
|
|
4321
|
+
}
|
|
4322
|
+
setTimeout(function () {
|
|
4323
|
+
emit('copy-success', tagList.value);
|
|
4324
|
+
});
|
|
4325
|
+
};
|
|
2797
4326
|
return tag_input_objectSpread(tag_input_objectSpread(tag_input_objectSpread(tag_input_objectSpread({
|
|
2798
4327
|
popoverProps: popoverProps
|
|
2799
4328
|
}, (0,external_vue_namespaceObject.toRefs)(state)), (0,external_vue_namespaceObject.toRefs)(listState)), (0,external_vue_namespaceObject.toRefs)(pageState)), {}, {
|
|
2800
4329
|
isShowPlaceholder: isShowPlaceholder,
|
|
2801
4330
|
isShowClear: isShowClear,
|
|
4331
|
+
isShowCopy: isShowCopy,
|
|
2802
4332
|
placeholderText: placeholderText,
|
|
2803
4333
|
curInputValue: curInputValue,
|
|
2804
4334
|
renderList: renderList,
|
|
@@ -2816,6 +4346,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2816
4346
|
focusInputTrigger: focusInputTrigger,
|
|
2817
4347
|
activeClass: activeClass,
|
|
2818
4348
|
handleInput: handleInput,
|
|
4349
|
+
handleCompositionEnd: handleCompositionEnd,
|
|
2819
4350
|
handleFocus: handleFocus,
|
|
2820
4351
|
handleBlur: handleBlur,
|
|
2821
4352
|
handleTagSelected: handleTagSelected,
|
|
@@ -2824,7 +4355,10 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2824
4355
|
tagFocus: tagFocus,
|
|
2825
4356
|
handleKeydown: handleKeydown,
|
|
2826
4357
|
handlePaste: handlePaste,
|
|
2827
|
-
resolveClassName: resolveClassName
|
|
4358
|
+
resolveClassName: resolveClassName,
|
|
4359
|
+
handleTagDblclick: handleTagDblclick,
|
|
4360
|
+
handleTagDblclickChange: handleTagDblclickChange,
|
|
4361
|
+
handleCopy: handleCopy
|
|
2828
4362
|
});
|
|
2829
4363
|
},
|
|
2830
4364
|
render: function render() {
|
|
@@ -2842,9 +4376,9 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2842
4376
|
}, [(0,external_vue_namespaceObject.createVNode)(popover_namespaceObject["default"], (0,external_vue_namespaceObject.mergeProps)({
|
|
2843
4377
|
"arrow": false,
|
|
2844
4378
|
"placement": "bottom-start",
|
|
4379
|
+
"referenceCls": this.resolveClassName('tag-input-popover-reference'),
|
|
2845
4380
|
"theme": "light ".concat(this.resolveClassName('tag-input-popover-content')),
|
|
2846
|
-
"trigger": "manual"
|
|
2847
|
-
"referenceCls": this.resolveClassName('tag-input-popover-reference')
|
|
4381
|
+
"trigger": "manual"
|
|
2848
4382
|
}, this.popoverProps), {
|
|
2849
4383
|
"default": function _default() {
|
|
2850
4384
|
var _this$$slots$suffix, _this$$slots, _this$$slots$suffix2;
|
|
@@ -2865,11 +4399,18 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2865
4399
|
"class": "tag-item",
|
|
2866
4400
|
"onClick": _this.tagFocus
|
|
2867
4401
|
}, [(0,external_vue_namespaceObject.createVNode)(tag_render, {
|
|
4402
|
+
"allowCreate": _this.allowCreate,
|
|
2868
4403
|
"displayKey": _this.displayKey,
|
|
2869
4404
|
"node": item,
|
|
2870
4405
|
"tagOverflowTips": _this.tagOverflowTips,
|
|
2871
4406
|
"tooltipKey": _this.tooltipKey || _this.displayKey,
|
|
2872
|
-
"tpl": _this.tagTpl
|
|
4407
|
+
"tpl": _this.tagTpl,
|
|
4408
|
+
"onChange": _this.allowCreate ? function (val) {
|
|
4409
|
+
return _this.handleTagDblclickChange(item, index, val);
|
|
4410
|
+
} : undefined,
|
|
4411
|
+
"onDblclick": _this.allowCreate ? function (isDblclick) {
|
|
4412
|
+
return _this.handleTagDblclick(isDblclick);
|
|
4413
|
+
} : undefined
|
|
2873
4414
|
}, null), _this.showTagClose && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Error, {
|
|
2874
4415
|
"class": "remove-tag",
|
|
2875
4416
|
"onClick": _this.handleTagRemove.bind(_this, item, index)
|
|
@@ -2888,6 +4429,7 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2888
4429
|
"spellcheck": "false",
|
|
2889
4430
|
"type": "text",
|
|
2890
4431
|
"onBlur": _this.handleBlur,
|
|
4432
|
+
"onCompositionend": _this.handleCompositionEnd,
|
|
2891
4433
|
"onFocus": _this.handleFocus,
|
|
2892
4434
|
"onInput": _this.handleInput,
|
|
2893
4435
|
"onKeydown": _this.handleKeydown,
|
|
@@ -2904,10 +4446,16 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2904
4446
|
"style": "position: absolute; white-space: nowrap; border-box; visibility: hidden; z-index: 1"
|
|
2905
4447
|
}, [_this.curInputValue])]), (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("p", {
|
|
2906
4448
|
"class": "placeholder"
|
|
2907
|
-
}, [_this.placeholderText]), [[external_vue_namespaceObject.vShow, _this.isShowPlaceholder]]), (_this$$slots$suffix = (_this$$slots = _this.$slots) === null || _this$$slots === void 0 || (_this$$slots$suffix2 = _this$$slots.suffix) === null || _this$$slots$suffix2 === void 0 ? void 0 : _this$$slots$suffix2.call(_this$$slots)) !== null && _this$$slots$suffix !== void 0 ? _this$$slots$suffix :
|
|
4449
|
+
}, [_this.placeholderText]), [[external_vue_namespaceObject.vShow, _this.isShowPlaceholder]]), (_this$$slots$suffix = (_this$$slots = _this.$slots) === null || _this$$slots === void 0 || (_this$$slots$suffix2 = _this$$slots.suffix) === null || _this$$slots$suffix2 === void 0 ? void 0 : _this$$slots$suffix2.call(_this$$slots)) !== null && _this$$slots$suffix !== void 0 ? _this$$slots$suffix : (0,external_vue_namespaceObject.createVNode)("div", {
|
|
4450
|
+
"class": "icon-wrapper"
|
|
4451
|
+
}, [_this.isShowCopy && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Copy, {
|
|
4452
|
+
"class": "copy-icon",
|
|
4453
|
+
"title": "\u590D\u5236",
|
|
4454
|
+
"onClick": _this.handleCopy
|
|
4455
|
+
}, null), _this.isShowClear && (0,external_vue_namespaceObject.createVNode)(icon_namespaceObject.Close, {
|
|
2908
4456
|
"class": "clear-icon",
|
|
2909
4457
|
"onClick": _this.handleClear
|
|
2910
|
-
}, null)]);
|
|
4458
|
+
}, null)])]);
|
|
2911
4459
|
},
|
|
2912
4460
|
content: function content() {
|
|
2913
4461
|
return (0,external_vue_namespaceObject.createVNode)("div", {
|
|
@@ -2962,12 +4510,12 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2962
4510
|
})]);
|
|
2963
4511
|
}
|
|
2964
4512
|
}));
|
|
2965
|
-
;// ../../packages/tag-input/src/index.ts
|
|
4513
|
+
;// CONCATENATED MODULE: ../../packages/tag-input/src/index.ts
|
|
2966
4514
|
/*
|
|
2967
4515
|
* Tencent is pleased to support the open source community by making
|
|
2968
4516
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
|
2969
4517
|
*
|
|
2970
|
-
* Copyright (C)
|
|
4518
|
+
* Copyright (C) 2025 Tencent. All rights reserved.
|
|
2971
4519
|
*
|
|
2972
4520
|
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
|
2973
4521
|
*
|
|
@@ -2994,6 +4542,8 @@ function tag_input_objectSpread(e) { for (var r = 1; r < arguments.length; r++)
|
|
|
2994
4542
|
var TagInput = (0,shared_namespaceObject.withInstall)(tag_input);
|
|
2995
4543
|
/* harmony default export */ const src = (TagInput);
|
|
2996
4544
|
|
|
4545
|
+
})();
|
|
4546
|
+
|
|
2997
4547
|
var __webpack_exports__TagInput = __webpack_exports__.TagInput;
|
|
2998
4548
|
var __webpack_exports__default = __webpack_exports__["default"];
|
|
2999
4549
|
var __webpack_exports__useTagsOverflow = __webpack_exports__.useTagsOverflow;
|