bkui-vue 0.0.1-beta.39 → 0.0.1-beta.390
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 +14 -0
- package/dist/index.cjs.js +161 -36
- package/dist/index.esm.js +32306 -13036
- package/dist/index.umd.js +161 -36
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -0
- package/lib/affix/affix.css +3 -0
- package/lib/affix/affix.d.ts +47 -0
- package/lib/affix/affix.less +5 -0
- package/lib/affix/affix.variable.css +123 -0
- package/lib/affix/index.d.ts +143 -0
- package/lib/affix/index.js +285 -0
- package/lib/alert/alert.css +81 -0
- package/lib/alert/alert.d.ts +62 -0
- package/lib/alert/alert.less +119 -0
- package/lib/alert/alert.variable.css +201 -0
- package/lib/alert/index.d.ts +180 -0
- package/lib/alert/index.js +183 -0
- package/lib/animate-number/animate-number.d.ts +27 -0
- package/lib/animate-number/index.d.ts +97 -0
- package/lib/animate-number/index.js +162 -0
- package/lib/backtop/backtop.css +50 -0
- package/lib/backtop/backtop.d.ts +60 -0
- package/lib/backtop/backtop.less +26 -0
- package/lib/backtop/backtop.variable.css +170 -0
- package/lib/backtop/index.d.ts +166 -0
- package/lib/backtop/index.js +188 -0
- package/lib/badge/badge.css +120 -0
- package/lib/badge/badge.d.ts +112 -0
- package/lib/badge/badge.less +135 -0
- package/lib/badge/badge.variable.css +240 -0
- package/lib/badge/index.d.ts +267 -0
- package/lib/badge/index.js +210 -0
- package/lib/breadcrumb/breadcrumb-item.d.ts +38 -0
- package/lib/breadcrumb/breadcrumb.css +119 -0
- package/lib/breadcrumb/breadcrumb.d.ts +54 -0
- package/lib/breadcrumb/breadcrumb.less +65 -0
- package/lib/breadcrumb/breadcrumb.variable.css +239 -0
- package/lib/breadcrumb/index.d.ts +196 -0
- package/lib/breadcrumb/index.js +263 -0
- package/lib/breadcrumb/props.d.ts +4 -0
- package/lib/button/button-group.d.ts +6 -0
- package/lib/button/button.css +300 -0
- package/lib/button/button.d.ts +163 -0
- package/lib/button/button.less +225 -0
- package/lib/button/button.variable.css +420 -0
- package/lib/button/index.d.ts +256 -0
- package/lib/button/index.js +292 -0
- package/lib/card/card.css +158 -0
- package/lib/card/card.d.ts +110 -0
- package/lib/card/card.less +92 -0
- package/lib/card/card.variable.css +278 -0
- package/lib/card/index.d.ts +283 -0
- package/lib/card/index.js +241 -0
- package/lib/cascader/cascader-panel.d.ts +100 -0
- package/lib/cascader/cascader.css +173 -0
- package/lib/cascader/cascader.d.ts +303 -0
- package/lib/cascader/cascader.less +196 -0
- package/lib/cascader/cascader.variable.css +293 -0
- package/lib/cascader/index.d.ts +868 -0
- package/lib/cascader/index.js +2094 -0
- package/lib/cascader/interface.d.ts +51 -0
- package/lib/cascader/node.d.ts +31 -0
- package/lib/cascader/store.d.ts +23 -0
- package/lib/checkbox/checkbox-group.d.ts +64 -0
- package/lib/checkbox/checkbox.css +100 -0
- package/lib/checkbox/checkbox.d.ts +126 -0
- package/lib/checkbox/checkbox.less +128 -0
- package/lib/checkbox/checkbox.variable.css +220 -0
- package/lib/checkbox/common.d.ts +14 -0
- package/lib/checkbox/index.d.ts +293 -0
- package/lib/checkbox/index.js +509 -0
- package/lib/checkbox/type.d.ts +15 -0
- package/lib/code-diff/code-diff.css +206 -0
- package/lib/code-diff/code-diff.d.ts +80 -0
- package/lib/code-diff/code-diff.less +273 -0
- package/lib/code-diff/code-diff.variable.css +326 -0
- package/lib/code-diff/index.d.ts +154 -0
- package/lib/code-diff/index.js +5478 -0
- package/lib/collapse/collapse-panel.d.ts +67 -0
- package/lib/collapse/collapse.css +46 -0
- package/lib/collapse/collapse.d.ts +65 -0
- package/lib/collapse/collapse.less +62 -0
- package/lib/collapse/collapse.variable.css +166 -0
- package/lib/collapse/index.d.ts +258 -0
- package/lib/collapse/index.js +632 -0
- package/lib/collapse/props.d.ts +79 -0
- package/lib/collapse/utils.d.ts +11 -0
- package/lib/color-picker/color-picker.css +275 -0
- package/lib/color-picker/color-picker.d.ts +144 -0
- package/lib/color-picker/color-picker.less +325 -0
- package/lib/color-picker/color-picker.variable.css +395 -0
- package/lib/color-picker/components/color-input.d.ts +42 -0
- package/lib/color-picker/components/hue-slider.d.ts +41 -0
- package/lib/color-picker/components/input-container.d.ts +42 -0
- package/lib/color-picker/components/recommend-colors.d.ts +51 -0
- package/lib/color-picker/components/saturation-panel.d.ts +41 -0
- package/lib/color-picker/index.d.ts +254 -0
- package/lib/color-picker/index.js +2764 -0
- package/lib/color-picker/utils.d.ts +37 -0
- package/lib/components.d.ts +59 -0
- package/lib/components.js +522 -0
- package/lib/container/col.d.ts +51 -0
- package/lib/container/container.css +91 -0
- package/lib/container/container.d.ts +83 -0
- package/lib/container/container.less +20 -0
- package/lib/container/container.variable.css +211 -0
- package/lib/container/index.d.ts +223 -0
- package/lib/container/index.js +308 -0
- package/lib/container/row.d.ts +4 -0
- package/lib/date-picker/base/confirm.d.ts +74 -0
- package/lib/date-picker/base/date-table.d.ts +96 -0
- package/lib/date-picker/base/picker-dropdown.d.ts +74 -0
- package/lib/date-picker/base/time-spinner.d.ts +151 -0
- package/lib/date-picker/date-picker.css +434 -0
- package/lib/date-picker/date-picker.d.ts +323 -0
- package/lib/date-picker/date-picker.less +558 -0
- package/lib/date-picker/date-picker.variable.css +554 -0
- package/lib/date-picker/fecha.d.ts +6 -0
- package/lib/date-picker/index.d.ts +780 -0
- package/lib/date-picker/index.js +5500 -0
- package/lib/date-picker/interface.d.ts +32 -0
- package/lib/date-picker/panel/date-range.d.ts +309 -0
- package/lib/date-picker/panel/date.d.ts +206 -0
- package/lib/date-picker/panel/time-range.d.ts +489 -0
- package/lib/date-picker/panel/time.d.ts +448 -0
- package/lib/date-picker/props.d.ts +161 -0
- package/lib/date-picker/time-picker.d.ts +381 -0
- package/lib/date-picker/utils.d.ts +117 -0
- package/lib/dialog/dialog.css +190 -0
- package/lib/dialog/dialog.d.ts +311 -0
- package/lib/dialog/dialog.less +153 -0
- package/lib/dialog/dialog.variable.css +310 -0
- package/lib/dialog/index.d.ts +722 -0
- package/lib/dialog/index.js +455 -0
- package/lib/dialog/props.d.ts +130 -0
- package/lib/directives/clickoutside.d.ts +3 -0
- package/lib/directives/ellipsis.d.ts +7 -0
- package/lib/directives/index.d.ts +4 -0
- package/lib/directives/index.js +1374 -0
- package/lib/directives/mousewheel.d.ts +3 -0
- package/lib/directives/tooltips.d.ts +18 -0
- package/lib/dist.index.js +81 -0
- package/lib/divider/divider.css +38 -0
- package/lib/divider/divider.d.ts +48 -0
- package/lib/divider/divider.less +53 -0
- package/lib/divider/divider.variable.css +158 -0
- package/lib/divider/index.d.ts +142 -0
- package/lib/divider/index.js +444 -0
- package/lib/divider/props.d.ts +21 -0
- package/lib/dropdown/dropdown-item.d.ts +19 -0
- package/lib/dropdown/dropdown-menu.d.ts +16 -0
- package/lib/dropdown/dropdown.css +49 -0
- package/lib/dropdown/dropdown.d.ts +93 -0
- package/lib/dropdown/dropdown.less +67 -0
- package/lib/dropdown/dropdown.variable.css +169 -0
- package/lib/dropdown/index.d.ts +256 -0
- package/lib/dropdown/index.js +332 -0
- package/lib/exception/exception.css +58 -0
- package/lib/exception/exception.d.ts +33 -0
- package/lib/exception/exception.less +76 -0
- package/lib/exception/exception.variable.css +178 -0
- package/lib/exception/index.d.ts +111 -0
- package/lib/exception/index.js +357 -0
- package/lib/exception/typings/index.d.ts +4 -0
- package/lib/fixed-navbar/fixed-navbar.css +42 -0
- package/lib/fixed-navbar/fixed-navbar.d.ts +48 -0
- package/lib/fixed-navbar/fixed-navbar.less +53 -0
- package/lib/fixed-navbar/fixed-navbar.variable.css +162 -0
- package/lib/fixed-navbar/index.d.ts +147 -0
- package/lib/fixed-navbar/index.js +150 -0
- package/lib/form/compose-form-item.d.ts +16 -0
- package/lib/form/form-item.d.ts +160 -0
- package/lib/form/form.css +137 -0
- package/lib/form/form.d.ts +88 -0
- package/lib/form/form.less +170 -0
- package/lib/form/form.variable.css +257 -0
- package/lib/form/index.d.ts +319 -0
- package/lib/form/index.js +900 -0
- package/lib/form/type.d.ts +22 -0
- package/lib/form/utils.d.ts +2 -0
- package/lib/form/validator.d.ts +9 -0
- package/lib/icon/angle-double-down-line.d.ts +4 -0
- package/lib/icon/angle-double-down-line.js +366 -0
- package/lib/icon/angle-double-left-line.d.ts +4 -0
- package/lib/icon/angle-double-left-line.js +366 -0
- package/lib/icon/angle-double-left.d.ts +4 -0
- package/lib/icon/angle-double-left.js +366 -0
- package/lib/icon/angle-double-right-line.d.ts +4 -0
- package/lib/icon/angle-double-right-line.js +366 -0
- package/lib/icon/angle-double-right.d.ts +4 -0
- package/lib/icon/angle-double-right.js +366 -0
- package/lib/icon/angle-double-up-line.d.ts +4 -0
- package/lib/icon/angle-double-up-line.js +366 -0
- package/lib/icon/angle-down-fill.d.ts +4 -0
- package/lib/icon/angle-down-fill.js +366 -0
- package/lib/icon/angle-down-line.d.ts +4 -0
- package/lib/icon/angle-down-line.js +366 -0
- package/lib/icon/angle-down.d.ts +4 -0
- package/lib/icon/angle-down.js +366 -0
- package/lib/icon/angle-left.d.ts +4 -0
- package/lib/icon/angle-left.js +366 -0
- package/lib/icon/angle-right.d.ts +4 -0
- package/lib/icon/angle-right.js +366 -0
- package/lib/icon/angle-up-fill.d.ts +4 -0
- package/lib/icon/angle-up-fill.js +366 -0
- package/lib/icon/angle-up.d.ts +4 -0
- package/lib/icon/angle-up.js +366 -0
- package/lib/icon/archive-fill.d.ts +4 -0
- package/lib/icon/archive-fill.js +366 -0
- package/lib/icon/arrows-left.d.ts +4 -0
- package/lib/icon/arrows-left.js +366 -0
- package/lib/icon/arrows-right.d.ts +4 -0
- package/lib/icon/arrows-right.js +366 -0
- package/lib/icon/audio-fill.d.ts +4 -0
- package/lib/icon/audio-fill.js +366 -0
- package/lib/icon/bk.d.ts +4 -0
- package/lib/icon/bk.js +366 -0
- package/lib/icon/circle.d.ts +4 -0
- package/lib/icon/circle.js +366 -0
- package/lib/icon/close-line.d.ts +4 -0
- package/lib/icon/close-line.js +366 -0
- package/lib/icon/close.d.ts +4 -0
- package/lib/icon/close.js +366 -0
- package/lib/icon/code.d.ts +4 -0
- package/lib/icon/code.js +366 -0
- package/lib/icon/cog-shape.d.ts +4 -0
- package/lib/icon/cog-shape.js +366 -0
- package/lib/icon/collapse-left.d.ts +4 -0
- package/lib/icon/collapse-left.js +366 -0
- package/lib/icon/copy.d.ts +4 -0
- package/lib/icon/copy.js +366 -0
- package/lib/icon/data-shape.d.ts +4 -0
- package/lib/icon/data-shape.js +366 -0
- package/lib/icon/del.d.ts +4 -0
- package/lib/icon/del.js +366 -0
- package/lib/icon/doc-fill.d.ts +4 -0
- package/lib/icon/doc-fill.js +366 -0
- package/lib/icon/done.d.ts +4 -0
- package/lib/icon/done.js +366 -0
- package/lib/icon/down-shape.d.ts +4 -0
- package/lib/icon/down-shape.js +366 -0
- package/lib/icon/down-small.d.ts +4 -0
- package/lib/icon/down-small.js +366 -0
- package/lib/icon/edit-line.d.ts +4 -0
- package/lib/icon/edit-line.js +366 -0
- package/lib/icon/ellipsis.d.ts +4 -0
- package/lib/icon/ellipsis.js +366 -0
- package/lib/icon/enlarge-line.d.ts +4 -0
- package/lib/icon/enlarge-line.js +366 -0
- package/lib/icon/error.d.ts +4 -0
- package/lib/icon/error.js +366 -0
- package/lib/icon/excel-fill.d.ts +4 -0
- package/lib/icon/excel-fill.js +366 -0
- package/lib/icon/exclamation-circle-shape.d.ts +4 -0
- package/lib/icon/exclamation-circle-shape.js +366 -0
- package/lib/icon/eye.d.ts +4 -0
- package/lib/icon/eye.js +366 -0
- package/lib/icon/filliscreen-line.d.ts +4 -0
- package/lib/icon/filliscreen-line.js +366 -0
- package/lib/icon/folder-open.d.ts +4 -0
- package/lib/icon/folder-open.js +366 -0
- package/lib/icon/folder-shape-open.d.ts +4 -0
- package/lib/icon/folder-shape-open.js +366 -0
- package/lib/icon/folder-shape.d.ts +4 -0
- package/lib/icon/folder-shape.js +366 -0
- package/lib/icon/folder.d.ts +4 -0
- package/lib/icon/folder.js +366 -0
- package/lib/icon/funnel.d.ts +4 -0
- package/lib/icon/funnel.js +366 -0
- package/lib/icon/help-document-fill.d.ts +4 -0
- package/lib/icon/help-document-fill.js +366 -0
- package/lib/icon/help-fill.d.ts +4 -0
- package/lib/icon/help-fill.js +366 -0
- package/lib/icon/help.d.ts +4 -0
- package/lib/icon/help.js +366 -0
- package/lib/icon/icon.d.ts +12 -0
- package/lib/icon/image-fill.d.ts +4 -0
- package/lib/icon/image-fill.js +366 -0
- package/lib/icon/img-error.d.ts +4 -0
- package/lib/icon/img-placehoulder.d.ts +4 -0
- package/lib/icon/img-placehoulder.js +412 -0
- package/lib/icon/index.d.ts +79 -0
- package/lib/icon/index.js +2287 -0
- package/lib/icon/info-line.d.ts +4 -0
- package/lib/icon/info-line.js +412 -0
- package/lib/icon/info.d.ts +4 -0
- package/lib/icon/info.js +412 -0
- package/lib/icon/left-shape.d.ts +4 -0
- package/lib/icon/left-shape.js +412 -0
- package/lib/icon/left-turn-line.d.ts +4 -0
- package/lib/icon/left-turn-line.js +412 -0
- package/lib/icon/narrow-line.d.ts +4 -0
- package/lib/icon/narrow-line.js +412 -0
- package/lib/icon/original.d.ts +4 -0
- package/lib/icon/original.js +412 -0
- package/lib/icon/pdf-fill.d.ts +4 -0
- package/lib/icon/pdf-fill.js +412 -0
- package/lib/icon/play-shape.d.ts +4 -0
- package/lib/icon/play-shape.js +412 -0
- package/lib/icon/plus.d.ts +4 -0
- package/lib/icon/plus.js +412 -0
- package/lib/icon/ppt-fill.d.ts +4 -0
- package/lib/icon/ppt-fill.js +412 -0
- package/lib/icon/qq.d.ts +4 -0
- package/lib/icon/qq.js +412 -0
- package/lib/icon/right-shape.d.ts +4 -0
- package/lib/icon/right-shape.js +412 -0
- package/lib/icon/right-turn-line.d.ts +4 -0
- package/lib/icon/right-turn-line.js +412 -0
- package/lib/icon/search.d.ts +4 -0
- package/lib/icon/search.js +412 -0
- package/lib/icon/share.d.ts +4 -0
- package/lib/icon/share.js +412 -0
- package/lib/icon/spinner.d.ts +4 -0
- package/lib/icon/spinner.js +412 -0
- package/lib/icon/success.d.ts +4 -0
- package/lib/icon/success.js +412 -0
- package/lib/icon/switcher-loading.d.ts +4 -0
- package/lib/icon/switcher-loading.js +412 -0
- package/lib/icon/text-file.d.ts +4 -0
- package/lib/icon/text-file.js +412 -0
- package/lib/icon/text-fill.d.ts +4 -0
- package/lib/icon/text-fill.js +412 -0
- package/lib/icon/transfer.d.ts +4 -0
- package/lib/icon/transfer.js +412 -0
- package/lib/icon/tree-application-shape.d.ts +4 -0
- package/lib/icon/tree-application-shape.js +412 -0
- package/lib/icon/unfull-screen.d.ts +4 -0
- package/lib/icon/unfull-screen.js +412 -0
- package/lib/icon/unvisible.d.ts +4 -0
- package/lib/icon/unvisible.js +412 -0
- package/lib/icon/up-shape.d.ts +4 -0
- package/lib/icon/up-shape.js +412 -0
- package/lib/icon/upload.d.ts +4 -0
- package/lib/icon/upload.js +412 -0
- package/lib/icon/video-fill.d.ts +4 -0
- package/lib/icon/video-fill.js +412 -0
- package/lib/icon/warn.d.ts +4 -0
- package/lib/icon/warn.js +412 -0
- package/lib/icon/weixin.d.ts +4 -0
- package/lib/icon/weixin.js +412 -0
- package/lib/image/image-viewer.css +142 -0
- package/lib/image/image-viewer.d.ts +73 -0
- package/lib/image/image-viewer.less +168 -0
- package/lib/image/image-viewer.variable.css +142 -0
- package/lib/image/image.css +37 -0
- package/lib/image/image.d.ts +93 -0
- package/lib/image/image.less +44 -0
- package/lib/image/image.variable.css +37 -0
- package/lib/image/index.d.ts +246 -0
- package/lib/image/index.js +824 -0
- package/lib/image/props.d.ts +71 -0
- package/lib/index.d.ts +4 -0
- package/lib/index.js +85 -0
- package/lib/info-box/index.d.ts +6 -0
- package/lib/info-box/index.js +1730 -0
- package/lib/info-box/info-box.css +37 -0
- package/lib/info-box/info-box.d.ts +26 -0
- package/lib/info-box/info-box.less +51 -0
- package/lib/info-box/info-box.variable.css +157 -0
- package/lib/input/index.d.ts +528 -0
- package/lib/input/index.js +778 -0
- package/lib/input/input.css +351 -0
- package/lib/input/input.d.ts +337 -0
- package/lib/input/input.less +306 -0
- package/lib/input/input.variable.css +471 -0
- package/lib/link/index.d.ts +172 -0
- package/lib/link/index.js +158 -0
- package/lib/link/link.css +55 -0
- package/lib/link/link.d.ts +60 -0
- package/lib/link/link.less +76 -0
- package/lib/link/link.variable.css +175 -0
- package/lib/loading/index.d.ts +257 -0
- package/lib/loading/index.js +249 -0
- package/lib/loading/loading.css +305 -0
- package/lib/loading/loading.d.ts +160 -0
- package/lib/loading/loading.less +193 -0
- package/lib/loading/loading.variable.css +425 -0
- package/lib/menu/index.d.ts +180 -0
- package/lib/menu/index.js +732 -0
- package/lib/menu/menu-group.d.ts +14 -0
- package/lib/menu/menu-item.d.ts +16 -0
- package/lib/menu/menu.css +233 -0
- package/lib/menu/menu.d.ts +55 -0
- package/lib/menu/menu.less +180 -0
- package/lib/menu/menu.variable.css +353 -0
- package/lib/menu/submenu.css +3 -0
- package/lib/menu/submenu.d.ts +22 -0
- package/lib/menu/submenu.less +5 -0
- package/lib/menu/submenu.variable.css +123 -0
- package/lib/menu/utils.d.ts +41 -0
- package/lib/message/index.d.ts +2 -0
- package/lib/message/index.js +329 -0
- package/lib/message/message.css +74 -0
- package/lib/message/message.less +87 -0
- package/lib/message/message.variable.css +194 -0
- package/lib/message/messageConstructor.d.ts +109 -0
- package/lib/modal/index.d.ts +592 -0
- package/lib/modal/index.js +329 -0
- package/lib/modal/modal.css +73 -0
- package/lib/modal/modal.d.ts +209 -0
- package/lib/modal/modal.less +48 -0
- package/lib/modal/modal.variable.css +193 -0
- package/lib/modal/props.mixin.d.ts +87 -0
- package/lib/navigation/index.d.ts +311 -0
- package/lib/navigation/index.js +363 -0
- package/lib/navigation/navigation-title.d.ts +25 -0
- package/lib/navigation/navigation.css +184 -0
- package/lib/navigation/navigation.d.ts +120 -0
- package/lib/navigation/navigation.less +210 -0
- package/lib/navigation/navigation.variable.css +304 -0
- package/lib/notify/index.d.ts +2 -0
- package/lib/notify/index.js +358 -0
- package/lib/notify/notify.css +69 -0
- package/lib/notify/notify.less +81 -0
- package/lib/notify/notify.variable.css +189 -0
- package/lib/notify/notifyConstructor.d.ts +132 -0
- package/lib/overflow-title/components/OverflowTitle.d.ts +38 -0
- package/lib/overflow-title/directive/overflowTitle.d.ts +3 -0
- package/lib/overflow-title/index.d.ts +129 -0
- package/lib/overflow-title/index.js +476 -0
- package/lib/overflow-title/overflow.css +11 -0
- package/lib/overflow-title/overflow.less +13 -0
- package/lib/overflow-title/overflow.variable.css +11 -0
- package/lib/overflow-title/props.d.ts +16 -0
- package/lib/overflow-title/utils/getActualWidthByCanvas.d.ts +3 -0
- package/lib/overflow-title/utils/getActualWidthByDom.d.ts +3 -0
- package/lib/pagination/index.d.ts +410 -0
- package/lib/pagination/index.js +937 -0
- package/lib/pagination/pagination.css +205 -0
- package/lib/pagination/pagination.d.ts +230 -0
- package/lib/pagination/pagination.less +230 -0
- package/lib/pagination/pagination.variable.css +325 -0
- package/lib/pagination/type.d.ts +6 -0
- package/lib/pagination/use-limit.d.ts +8 -0
- package/lib/pagination/use-list.d.ts +8 -0
- package/lib/pagination/use-small-list.d.ts +5 -0
- package/lib/pagination/use-total.d.ts +5 -0
- package/lib/plugin-popover/index.d.ts +27 -0
- package/lib/plugin-popover/index.js +2400 -0
- package/lib/plugins/index.d.ts +1 -0
- package/lib/plugins/index.js +63 -0
- package/lib/popover/arrow.d.ts +2 -0
- package/lib/popover/const.d.ts +16 -0
- package/lib/popover/content.d.ts +32 -0
- package/lib/popover/index.d.ts +653 -0
- package/lib/popover/index.js +2408 -0
- package/lib/popover/plugin-popover.d.ts +12 -0
- package/lib/popover/popover.css +25 -0
- package/lib/popover/popover.d.ts +277 -0
- package/lib/popover/popover.less +35 -0
- package/lib/popover/popover.variable.css +145 -0
- package/lib/popover/props.d.ts +146 -0
- package/lib/popover/reference.d.ts +2 -0
- package/lib/popover/root.d.ts +16 -0
- package/lib/popover/use-floating.d.ts +34 -0
- package/lib/popover/use-platform.d.ts +30 -0
- package/lib/popover/use-popover-init.d.ts +23 -0
- package/lib/popover/use-popper-id.d.ts +6 -0
- package/lib/popover/utils.d.ts +2 -0
- package/lib/popover2/index.d.ts +44 -0
- package/lib/popover2/index.js +108 -0
- package/lib/popover2/popover.d.ts +2 -0
- package/lib/preset.d.ts +7 -0
- package/lib/preset.js +62 -0
- package/lib/process/index.d.ts +205 -0
- package/lib/process/index.js +1375 -0
- package/lib/process/process.css +151 -0
- package/lib/process/process.d.ts +131 -0
- package/lib/process/process.less +195 -0
- package/lib/process/process.variable.css +271 -0
- package/lib/progress/circle.d.ts +6 -0
- package/lib/progress/index.d.ts +398 -0
- package/lib/progress/index.js +415 -0
- package/lib/progress/line.d.ts +6 -0
- package/lib/progress/progress.css +145 -0
- package/lib/progress/progress.d.ts +171 -0
- package/lib/progress/progress.less +90 -0
- package/lib/progress/progress.variable.css +265 -0
- package/lib/radio/common.d.ts +13 -0
- package/lib/radio/index.d.ts +288 -0
- package/lib/radio/index.js +588 -0
- package/lib/radio/radio-button.d.ts +90 -0
- package/lib/radio/radio-group.d.ts +57 -0
- package/lib/radio/radio.css +139 -0
- package/lib/radio/radio.d.ts +87 -0
- package/lib/radio/radio.less +177 -0
- package/lib/radio/radio.variable.css +259 -0
- package/lib/radio/type.d.ts +14 -0
- package/lib/rate/index.d.ts +136 -0
- package/lib/rate/index.js +294 -0
- package/lib/rate/rate.css +10 -0
- package/lib/rate/rate.d.ts +43 -0
- package/lib/rate/rate.less +11 -0
- package/lib/rate/rate.variable.css +10 -0
- package/lib/rate/star.css +24 -0
- package/lib/rate/star.d.ts +74 -0
- package/lib/rate/star.less +29 -0
- package/lib/rate/star.variable.css +24 -0
- package/lib/resize-layout/index.d.ts +336 -0
- package/lib/resize-layout/index.js +427 -0
- package/lib/resize-layout/resize-layout.css +177 -0
- package/lib/resize-layout/resize-layout.d.ts +127 -0
- package/lib/resize-layout/resize-layout.less +217 -0
- package/lib/resize-layout/resize-layout.variable.css +297 -0
- package/lib/search-select/index.d.ts +823 -0
- package/lib/search-select/index.js +3336 -0
- package/lib/search-select/input.d.ts +89 -0
- package/lib/search-select/menu.d.ts +83 -0
- package/lib/search-select/search-select.css +424 -0
- package/lib/search-select/search-select.d.ts +342 -0
- package/lib/search-select/search-select.less +380 -0
- package/lib/search-select/search-select.variable.css +544 -0
- package/lib/search-select/selected.d.ts +143 -0
- package/lib/search-select/utils.d.ts +88 -0
- package/lib/select/common.d.ts +26 -0
- package/lib/select/index.d.ts +2039 -0
- package/lib/select/index.js +2740 -0
- package/lib/select/option.d.ts +37 -0
- package/lib/select/optionGroup.d.ts +54 -0
- package/lib/select/select.css +399 -0
- package/lib/select/select.d.ts +753 -0
- package/lib/select/select.less +443 -0
- package/lib/select/select.variable.css +519 -0
- package/lib/select/selectTagInput.d.ts +93 -0
- package/lib/select/type.d.ts +39 -0
- package/lib/shared/dom.d.ts +3 -0
- package/lib/shared/helper.d.ts +101 -0
- package/lib/shared/hooks/use-form-item.d.ts +2 -0
- package/lib/shared/hooks/use-form.d.ts +2 -0
- package/lib/shared/index.d.ts +74 -0
- package/lib/shared/index.js +2838 -0
- package/lib/shared/mask-manager.d.ts +80 -0
- package/lib/shared/pop-manager.d.ts +38 -0
- package/lib/shared/popover.d.ts +131 -0
- package/lib/shared/scrollbar-width.d.ts +1 -0
- package/lib/shared/token.d.ts +4 -0
- package/lib/shared/utils.d.ts +25 -0
- package/lib/shared/vue-types.d.ts +213 -0
- package/lib/shared/z-index-manager.d.ts +93 -0
- package/lib/sideslider/index.d.ts +477 -0
- package/lib/sideslider/index.js +1313 -0
- package/lib/sideslider/sideslider.css +114 -0
- package/lib/sideslider/sideslider.d.ts +203 -0
- package/lib/sideslider/sideslider.less +145 -0
- package/lib/sideslider/sideslider.variable.css +234 -0
- package/lib/slider/index.d.ts +440 -0
- package/lib/slider/index.js +2011 -0
- package/lib/slider/slider-button.d.ts +81 -0
- package/lib/slider/slider.css +149 -0
- package/lib/slider/slider.d.ts +201 -0
- package/lib/slider/slider.less +179 -0
- package/lib/slider/slider.variable.css +269 -0
- package/lib/steps/index.d.ts +250 -0
- package/lib/steps/index.js +1457 -0
- package/lib/steps/steps.css +300 -0
- package/lib/steps/steps.d.ts +161 -0
- package/lib/steps/steps.less +345 -0
- package/lib/steps/steps.variable.css +420 -0
- package/lib/styles/index.d.ts +53 -0
- package/lib/styles/mixins/animate.css +21 -0
- package/lib/styles/mixins/animate.less +27 -0
- package/lib/styles/mixins/animate.variable.css +21 -0
- package/lib/styles/mixins/clearfix.css +8 -0
- package/lib/styles/mixins/clearfix.less +10 -0
- package/lib/styles/mixins/clearfix.variable.css +8 -0
- package/lib/styles/mixins/ellipsis.less +8 -0
- package/lib/styles/mixins/mixins.css +72 -0
- package/lib/styles/mixins/mixins.less +5 -0
- package/lib/styles/mixins/mixins.variable.css +72 -0
- package/lib/styles/mixins/popper.css +43 -0
- package/lib/styles/mixins/popper.less +53 -0
- package/lib/styles/mixins/popper.variable.css +163 -0
- package/lib/styles/mixins/scroll.css +17 -0
- package/lib/styles/mixins/scroll.less +22 -0
- package/lib/styles/mixins/scroll.variable.css +137 -0
- package/lib/styles/mixins/size.less +13 -0
- package/lib/styles/reset.css +309 -0
- package/lib/styles/reset.less +337 -0
- package/lib/styles/reset.variable.css +309 -0
- package/lib/styles/themes/themes.less +162 -0
- package/lib/swiper/index.d.ts +181 -0
- package/lib/swiper/index.js +310 -0
- package/lib/swiper/swiper.css +91 -0
- package/lib/swiper/swiper.d.ts +65 -0
- package/lib/swiper/swiper.less +107 -0
- package/lib/swiper/swiper.variable.css +91 -0
- package/lib/switcher/index.d.ts +298 -0
- package/lib/switcher/index.js +240 -0
- package/lib/switcher/switcher.css +323 -0
- package/lib/switcher/switcher.d.ts +119 -0
- package/lib/switcher/switcher.less +337 -0
- package/lib/switcher/switcher.variable.css +443 -0
- package/lib/tab/index.d.ts +435 -0
- package/lib/tab/index.js +849 -0
- package/lib/tab/props.d.ts +207 -0
- package/lib/tab/tab-nav.d.ts +169 -0
- package/lib/tab/tab-panel.d.ts +68 -0
- package/lib/tab/tab.css +223 -0
- package/lib/tab/tab.d.ts +139 -0
- package/lib/tab/tab.less +285 -0
- package/lib/tab/tab.variable.css +343 -0
- package/lib/table/components/index.d.ts +3 -0
- package/lib/table/components/table-cell.d.ts +38 -0
- package/lib/table/components/table-column.d.ts +137 -0
- package/lib/table/components/table-row.d.ts +2 -0
- package/lib/table/const.d.ts +122 -0
- package/lib/table/index.d.ts +1141 -0
- package/lib/table/index.js +6520 -0
- package/lib/table/plugins/body-empty.d.ts +40 -0
- package/lib/table/plugins/col-group.d.ts +38 -0
- package/lib/table/plugins/common.d.ts +6 -0
- package/lib/table/plugins/head-filter.css +84 -0
- package/lib/table/plugins/head-filter.d.ts +26 -0
- package/lib/table/plugins/head-filter.less +110 -0
- package/lib/table/plugins/head-filter.variable.css +204 -0
- package/lib/table/plugins/head-sort.css +25 -0
- package/lib/table/plugins/head-sort.d.ts +22 -0
- package/lib/table/plugins/head-sort.less +31 -0
- package/lib/table/plugins/head-sort.variable.css +145 -0
- package/lib/table/plugins/index.d.ts +5 -0
- package/lib/table/plugins/settings.css +145 -0
- package/lib/table/plugins/settings.d.ts +37 -0
- package/lib/table/plugins/settings.less +179 -0
- package/lib/table/plugins/settings.variable.css +265 -0
- package/lib/table/plugins/use-active-columns.d.ts +16 -0
- package/lib/table/plugins/use-column-resize.d.ts +15 -0
- package/lib/table/plugins/use-fixed-column.d.ts +12 -0
- package/lib/table/plugins/use-pagination.d.ts +16 -0
- package/lib/table/plugins/use-scroll-loading.d.ts +5 -0
- package/lib/table/props.d.ts +434 -0
- package/lib/table/render.d.ts +125 -0
- package/lib/table/table.css +1272 -0
- package/lib/table/table.d.ts +350 -0
- package/lib/table/table.less +365 -0
- package/lib/table/table.variable.css +1392 -0
- package/lib/table/use-column.d.ts +11 -0
- package/lib/table/use-common.d.ts +98 -0
- package/lib/table/utils.d.ts +129 -0
- package/lib/table-column/index.d.ts +325 -0
- package/lib/table-column/index.js +669 -0
- package/lib/tag/index.d.ts +229 -0
- package/lib/tag/index.js +206 -0
- package/lib/tag/tag.css +130 -0
- package/lib/tag/tag.d.ts +84 -0
- package/lib/tag/tag.less +149 -0
- package/lib/tag/tag.variable.css +250 -0
- package/lib/tag-input/common.d.ts +36 -0
- package/lib/tag-input/index.d.ts +1349 -0
- package/lib/tag-input/index.js +1795 -0
- package/lib/tag-input/list-tag-render.d.ts +44 -0
- package/lib/tag-input/tag-input.css +205 -0
- package/lib/tag-input/tag-input.d.ts +631 -0
- package/lib/tag-input/tag-input.less +248 -0
- package/lib/tag-input/tag-input.variable.css +325 -0
- package/lib/tag-input/tag-props.d.ts +252 -0
- package/lib/tag-input/tag-render.d.ts +64 -0
- package/lib/time-picker/index.d.ts +904 -0
- package/lib/time-picker/index.js +71 -0
- package/lib/time-picker/time-picker.css +215 -0
- package/lib/time-picker/time-picker.less +260 -0
- package/lib/time-picker/time-picker.variable.css +335 -0
- package/lib/timeline/index.d.ts +129 -0
- package/lib/timeline/index.js +251 -0
- package/lib/timeline/timeline.css +242 -0
- package/lib/timeline/timeline.d.ts +81 -0
- package/lib/timeline/timeline.less +252 -0
- package/lib/timeline/timeline.variable.css +362 -0
- package/lib/transfer/const.d.ts +5 -0
- package/lib/transfer/index.d.ts +365 -0
- package/lib/transfer/index.js +573 -0
- package/lib/transfer/props.d.ts +54 -0
- package/lib/transfer/transfer.css +161 -0
- package/lib/transfer/transfer.d.ts +160 -0
- package/lib/transfer/transfer.less +151 -0
- package/lib/transfer/transfer.variable.css +281 -0
- package/lib/tree/constant.d.ts +62 -0
- package/lib/tree/index.d.ts +647 -0
- package/lib/tree/index.js +2840 -0
- package/lib/tree/props.d.ts +213 -0
- package/lib/tree/tree.css +218 -0
- package/lib/tree/tree.d.ts +283 -0
- package/lib/tree/tree.less +114 -0
- package/lib/tree/tree.variable.css +338 -0
- package/lib/tree/use-empty.d.ts +6 -0
- package/lib/tree/use-node-action.d.ts +12 -0
- package/lib/tree/use-node-async.d.ts +5 -0
- package/lib/tree/use-node-attribute.d.ts +33 -0
- package/lib/tree/use-node-drag.d.ts +3 -0
- package/lib/tree/use-search.d.ts +11 -0
- package/lib/tree/use-tree-init.d.ts +15 -0
- package/lib/tree/util.d.ts +68 -0
- package/lib/upload/index.d.ts +566 -0
- package/lib/upload/index.js +3681 -0
- package/lib/upload/props.d.ts +111 -0
- package/lib/upload/upload-list.d.ts +47 -0
- package/lib/upload/upload-trigger.d.ts +51 -0
- package/lib/upload/upload.css +425 -0
- package/lib/upload/upload.d.ts +246 -0
- package/lib/upload/upload.less +464 -0
- package/lib/upload/upload.type.d.ts +78 -0
- package/lib/upload/upload.variable.css +545 -0
- package/lib/upload/use-ajax-upload.d.ts +3 -0
- package/lib/upload/use-file-handler.d.ts +44 -0
- package/lib/use-message.d.ts +2 -0
- package/lib/virtual-render/index.d.ts +602 -0
- package/lib/virtual-render/index.js +757 -0
- package/lib/virtual-render/props.d.ts +172 -0
- package/lib/virtual-render/use-tag-render.d.ts +7 -0
- package/lib/virtual-render/v-virtual-render.d.ts +6 -0
- package/lib/virtual-render/virtual-render.css +33 -0
- package/lib/virtual-render/virtual-render.d.ts +266 -0
- package/lib/virtual-render/virtual-render.less +22 -0
- package/lib/virtual-render/virtual-render.variable.css +153 -0
- package/lib/volar.components.d.ts +101 -0
- package/package.json +58 -28
- package/LICENSE.txt +0 -22
@@ -0,0 +1,3336 @@
|
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__ from "../directives";
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__ from "../popover";
|
6
|
+
/******/ var __webpack_modules__ = ({
|
7
|
+
|
8
|
+
/***/ 7162:
|
9
|
+
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {
|
10
|
+
|
11
|
+
module.exports = __webpack_require__(5047);
|
12
|
+
|
13
|
+
|
14
|
+
/***/ }),
|
15
|
+
|
16
|
+
/***/ 5047:
|
17
|
+
/***/ ((module) => {
|
18
|
+
|
19
|
+
/**
|
20
|
+
* Copyright (c) 2014-present, Facebook, Inc.
|
21
|
+
*
|
22
|
+
* This source code is licensed under the MIT license found in the
|
23
|
+
* LICENSE file in the root directory of this source tree.
|
24
|
+
*/
|
25
|
+
|
26
|
+
var runtime = (function (exports) {
|
27
|
+
"use strict";
|
28
|
+
|
29
|
+
var Op = Object.prototype;
|
30
|
+
var hasOwn = Op.hasOwnProperty;
|
31
|
+
var undefined; // More compressible than void 0.
|
32
|
+
var $Symbol = typeof Symbol === "function" ? Symbol : {};
|
33
|
+
var iteratorSymbol = $Symbol.iterator || "@@iterator";
|
34
|
+
var asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator";
|
35
|
+
var toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag";
|
36
|
+
|
37
|
+
function define(obj, key, value) {
|
38
|
+
Object.defineProperty(obj, key, {
|
39
|
+
value: value,
|
40
|
+
enumerable: true,
|
41
|
+
configurable: true,
|
42
|
+
writable: true
|
43
|
+
});
|
44
|
+
return obj[key];
|
45
|
+
}
|
46
|
+
try {
|
47
|
+
// IE 8 has a broken Object.defineProperty that only works on DOM objects.
|
48
|
+
define({}, "");
|
49
|
+
} catch (err) {
|
50
|
+
define = function(obj, key, value) {
|
51
|
+
return obj[key] = value;
|
52
|
+
};
|
53
|
+
}
|
54
|
+
|
55
|
+
function wrap(innerFn, outerFn, self, tryLocsList) {
|
56
|
+
// If outerFn provided and outerFn.prototype is a Generator, then outerFn.prototype instanceof Generator.
|
57
|
+
var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator;
|
58
|
+
var generator = Object.create(protoGenerator.prototype);
|
59
|
+
var context = new Context(tryLocsList || []);
|
60
|
+
|
61
|
+
// The ._invoke method unifies the implementations of the .next,
|
62
|
+
// .throw, and .return methods.
|
63
|
+
generator._invoke = makeInvokeMethod(innerFn, self, context);
|
64
|
+
|
65
|
+
return generator;
|
66
|
+
}
|
67
|
+
exports.wrap = wrap;
|
68
|
+
|
69
|
+
// Try/catch helper to minimize deoptimizations. Returns a completion
|
70
|
+
// record like context.tryEntries[i].completion. This interface could
|
71
|
+
// have been (and was previously) designed to take a closure to be
|
72
|
+
// invoked without arguments, but in all the cases we care about we
|
73
|
+
// already have an existing method we want to call, so there's no need
|
74
|
+
// to create a new function object. We can even get away with assuming
|
75
|
+
// the method takes exactly one argument, since that happens to be true
|
76
|
+
// in every case, so we don't have to touch the arguments object. The
|
77
|
+
// only additional allocation required is the completion record, which
|
78
|
+
// has a stable shape and so hopefully should be cheap to allocate.
|
79
|
+
function tryCatch(fn, obj, arg) {
|
80
|
+
try {
|
81
|
+
return { type: "normal", arg: fn.call(obj, arg) };
|
82
|
+
} catch (err) {
|
83
|
+
return { type: "throw", arg: err };
|
84
|
+
}
|
85
|
+
}
|
86
|
+
|
87
|
+
var GenStateSuspendedStart = "suspendedStart";
|
88
|
+
var GenStateSuspendedYield = "suspendedYield";
|
89
|
+
var GenStateExecuting = "executing";
|
90
|
+
var GenStateCompleted = "completed";
|
91
|
+
|
92
|
+
// Returning this object from the innerFn has the same effect as
|
93
|
+
// breaking out of the dispatch switch statement.
|
94
|
+
var ContinueSentinel = {};
|
95
|
+
|
96
|
+
// Dummy constructor functions that we use as the .constructor and
|
97
|
+
// .constructor.prototype properties for functions that return Generator
|
98
|
+
// objects. For full spec compliance, you may wish to configure your
|
99
|
+
// minifier not to mangle the names of these two functions.
|
100
|
+
function Generator() {}
|
101
|
+
function GeneratorFunction() {}
|
102
|
+
function GeneratorFunctionPrototype() {}
|
103
|
+
|
104
|
+
// This is a polyfill for %IteratorPrototype% for environments that
|
105
|
+
// don't natively support it.
|
106
|
+
var IteratorPrototype = {};
|
107
|
+
define(IteratorPrototype, iteratorSymbol, function () {
|
108
|
+
return this;
|
109
|
+
});
|
110
|
+
|
111
|
+
var getProto = Object.getPrototypeOf;
|
112
|
+
var NativeIteratorPrototype = getProto && getProto(getProto(values([])));
|
113
|
+
if (NativeIteratorPrototype &&
|
114
|
+
NativeIteratorPrototype !== Op &&
|
115
|
+
hasOwn.call(NativeIteratorPrototype, iteratorSymbol)) {
|
116
|
+
// This environment has a native %IteratorPrototype%; use it instead
|
117
|
+
// of the polyfill.
|
118
|
+
IteratorPrototype = NativeIteratorPrototype;
|
119
|
+
}
|
120
|
+
|
121
|
+
var Gp = GeneratorFunctionPrototype.prototype =
|
122
|
+
Generator.prototype = Object.create(IteratorPrototype);
|
123
|
+
GeneratorFunction.prototype = GeneratorFunctionPrototype;
|
124
|
+
define(Gp, "constructor", GeneratorFunctionPrototype);
|
125
|
+
define(GeneratorFunctionPrototype, "constructor", GeneratorFunction);
|
126
|
+
GeneratorFunction.displayName = define(
|
127
|
+
GeneratorFunctionPrototype,
|
128
|
+
toStringTagSymbol,
|
129
|
+
"GeneratorFunction"
|
130
|
+
);
|
131
|
+
|
132
|
+
// Helper for defining the .next, .throw, and .return methods of the
|
133
|
+
// Iterator interface in terms of a single ._invoke method.
|
134
|
+
function defineIteratorMethods(prototype) {
|
135
|
+
["next", "throw", "return"].forEach(function(method) {
|
136
|
+
define(prototype, method, function(arg) {
|
137
|
+
return this._invoke(method, arg);
|
138
|
+
});
|
139
|
+
});
|
140
|
+
}
|
141
|
+
|
142
|
+
exports.isGeneratorFunction = function(genFun) {
|
143
|
+
var ctor = typeof genFun === "function" && genFun.constructor;
|
144
|
+
return ctor
|
145
|
+
? ctor === GeneratorFunction ||
|
146
|
+
// For the native GeneratorFunction constructor, the best we can
|
147
|
+
// do is to check its .name property.
|
148
|
+
(ctor.displayName || ctor.name) === "GeneratorFunction"
|
149
|
+
: false;
|
150
|
+
};
|
151
|
+
|
152
|
+
exports.mark = function(genFun) {
|
153
|
+
if (Object.setPrototypeOf) {
|
154
|
+
Object.setPrototypeOf(genFun, GeneratorFunctionPrototype);
|
155
|
+
} else {
|
156
|
+
genFun.__proto__ = GeneratorFunctionPrototype;
|
157
|
+
define(genFun, toStringTagSymbol, "GeneratorFunction");
|
158
|
+
}
|
159
|
+
genFun.prototype = Object.create(Gp);
|
160
|
+
return genFun;
|
161
|
+
};
|
162
|
+
|
163
|
+
// Within the body of any async function, `await x` is transformed to
|
164
|
+
// `yield regeneratorRuntime.awrap(x)`, so that the runtime can test
|
165
|
+
// `hasOwn.call(value, "__await")` to determine if the yielded value is
|
166
|
+
// meant to be awaited.
|
167
|
+
exports.awrap = function(arg) {
|
168
|
+
return { __await: arg };
|
169
|
+
};
|
170
|
+
|
171
|
+
function AsyncIterator(generator, PromiseImpl) {
|
172
|
+
function invoke(method, arg, resolve, reject) {
|
173
|
+
var record = tryCatch(generator[method], generator, arg);
|
174
|
+
if (record.type === "throw") {
|
175
|
+
reject(record.arg);
|
176
|
+
} else {
|
177
|
+
var result = record.arg;
|
178
|
+
var value = result.value;
|
179
|
+
if (value &&
|
180
|
+
typeof value === "object" &&
|
181
|
+
hasOwn.call(value, "__await")) {
|
182
|
+
return PromiseImpl.resolve(value.__await).then(function(value) {
|
183
|
+
invoke("next", value, resolve, reject);
|
184
|
+
}, function(err) {
|
185
|
+
invoke("throw", err, resolve, reject);
|
186
|
+
});
|
187
|
+
}
|
188
|
+
|
189
|
+
return PromiseImpl.resolve(value).then(function(unwrapped) {
|
190
|
+
// When a yielded Promise is resolved, its final value becomes
|
191
|
+
// the .value of the Promise<{value,done}> result for the
|
192
|
+
// current iteration.
|
193
|
+
result.value = unwrapped;
|
194
|
+
resolve(result);
|
195
|
+
}, function(error) {
|
196
|
+
// If a rejected Promise was yielded, throw the rejection back
|
197
|
+
// into the async generator function so it can be handled there.
|
198
|
+
return invoke("throw", error, resolve, reject);
|
199
|
+
});
|
200
|
+
}
|
201
|
+
}
|
202
|
+
|
203
|
+
var previousPromise;
|
204
|
+
|
205
|
+
function enqueue(method, arg) {
|
206
|
+
function callInvokeWithMethodAndArg() {
|
207
|
+
return new PromiseImpl(function(resolve, reject) {
|
208
|
+
invoke(method, arg, resolve, reject);
|
209
|
+
});
|
210
|
+
}
|
211
|
+
|
212
|
+
return previousPromise =
|
213
|
+
// If enqueue has been called before, then we want to wait until
|
214
|
+
// all previous Promises have been resolved before calling invoke,
|
215
|
+
// so that results are always delivered in the correct order. If
|
216
|
+
// enqueue has not been called before, then it is important to
|
217
|
+
// call invoke immediately, without waiting on a callback to fire,
|
218
|
+
// so that the async generator function has the opportunity to do
|
219
|
+
// any necessary setup in a predictable way. This predictability
|
220
|
+
// is why the Promise constructor synchronously invokes its
|
221
|
+
// executor callback, and why async functions synchronously
|
222
|
+
// execute code before the first await. Since we implement simple
|
223
|
+
// async functions in terms of async generators, it is especially
|
224
|
+
// important to get this right, even though it requires care.
|
225
|
+
previousPromise ? previousPromise.then(
|
226
|
+
callInvokeWithMethodAndArg,
|
227
|
+
// Avoid propagating failures to Promises returned by later
|
228
|
+
// invocations of the iterator.
|
229
|
+
callInvokeWithMethodAndArg
|
230
|
+
) : callInvokeWithMethodAndArg();
|
231
|
+
}
|
232
|
+
|
233
|
+
// Define the unified helper method that is used to implement .next,
|
234
|
+
// .throw, and .return (see defineIteratorMethods).
|
235
|
+
this._invoke = enqueue;
|
236
|
+
}
|
237
|
+
|
238
|
+
defineIteratorMethods(AsyncIterator.prototype);
|
239
|
+
define(AsyncIterator.prototype, asyncIteratorSymbol, function () {
|
240
|
+
return this;
|
241
|
+
});
|
242
|
+
exports.AsyncIterator = AsyncIterator;
|
243
|
+
|
244
|
+
// Note that simple async functions are implemented on top of
|
245
|
+
// AsyncIterator objects; they just return a Promise for the value of
|
246
|
+
// the final result produced by the iterator.
|
247
|
+
exports.async = function(innerFn, outerFn, self, tryLocsList, PromiseImpl) {
|
248
|
+
if (PromiseImpl === void 0) PromiseImpl = Promise;
|
249
|
+
|
250
|
+
var iter = new AsyncIterator(
|
251
|
+
wrap(innerFn, outerFn, self, tryLocsList),
|
252
|
+
PromiseImpl
|
253
|
+
);
|
254
|
+
|
255
|
+
return exports.isGeneratorFunction(outerFn)
|
256
|
+
? iter // If outerFn is a generator, return the full iterator.
|
257
|
+
: iter.next().then(function(result) {
|
258
|
+
return result.done ? result.value : iter.next();
|
259
|
+
});
|
260
|
+
};
|
261
|
+
|
262
|
+
function makeInvokeMethod(innerFn, self, context) {
|
263
|
+
var state = GenStateSuspendedStart;
|
264
|
+
|
265
|
+
return function invoke(method, arg) {
|
266
|
+
if (state === GenStateExecuting) {
|
267
|
+
throw new Error("Generator is already running");
|
268
|
+
}
|
269
|
+
|
270
|
+
if (state === GenStateCompleted) {
|
271
|
+
if (method === "throw") {
|
272
|
+
throw arg;
|
273
|
+
}
|
274
|
+
|
275
|
+
// Be forgiving, per 25.3.3.3.3 of the spec:
|
276
|
+
// https://people.mozilla.org/~jorendorff/es6-draft.html#sec-generatorresume
|
277
|
+
return doneResult();
|
278
|
+
}
|
279
|
+
|
280
|
+
context.method = method;
|
281
|
+
context.arg = arg;
|
282
|
+
|
283
|
+
while (true) {
|
284
|
+
var delegate = context.delegate;
|
285
|
+
if (delegate) {
|
286
|
+
var delegateResult = maybeInvokeDelegate(delegate, context);
|
287
|
+
if (delegateResult) {
|
288
|
+
if (delegateResult === ContinueSentinel) continue;
|
289
|
+
return delegateResult;
|
290
|
+
}
|
291
|
+
}
|
292
|
+
|
293
|
+
if (context.method === "next") {
|
294
|
+
// Setting context._sent for legacy support of Babel's
|
295
|
+
// function.sent implementation.
|
296
|
+
context.sent = context._sent = context.arg;
|
297
|
+
|
298
|
+
} else if (context.method === "throw") {
|
299
|
+
if (state === GenStateSuspendedStart) {
|
300
|
+
state = GenStateCompleted;
|
301
|
+
throw context.arg;
|
302
|
+
}
|
303
|
+
|
304
|
+
context.dispatchException(context.arg);
|
305
|
+
|
306
|
+
} else if (context.method === "return") {
|
307
|
+
context.abrupt("return", context.arg);
|
308
|
+
}
|
309
|
+
|
310
|
+
state = GenStateExecuting;
|
311
|
+
|
312
|
+
var record = tryCatch(innerFn, self, context);
|
313
|
+
if (record.type === "normal") {
|
314
|
+
// If an exception is thrown from innerFn, we leave state ===
|
315
|
+
// GenStateExecuting and loop back for another invocation.
|
316
|
+
state = context.done
|
317
|
+
? GenStateCompleted
|
318
|
+
: GenStateSuspendedYield;
|
319
|
+
|
320
|
+
if (record.arg === ContinueSentinel) {
|
321
|
+
continue;
|
322
|
+
}
|
323
|
+
|
324
|
+
return {
|
325
|
+
value: record.arg,
|
326
|
+
done: context.done
|
327
|
+
};
|
328
|
+
|
329
|
+
} else if (record.type === "throw") {
|
330
|
+
state = GenStateCompleted;
|
331
|
+
// Dispatch the exception by looping back around to the
|
332
|
+
// context.dispatchException(context.arg) call above.
|
333
|
+
context.method = "throw";
|
334
|
+
context.arg = record.arg;
|
335
|
+
}
|
336
|
+
}
|
337
|
+
};
|
338
|
+
}
|
339
|
+
|
340
|
+
// Call delegate.iterator[context.method](context.arg) and handle the
|
341
|
+
// result, either by returning a { value, done } result from the
|
342
|
+
// delegate iterator, or by modifying context.method and context.arg,
|
343
|
+
// setting context.delegate to null, and returning the ContinueSentinel.
|
344
|
+
function maybeInvokeDelegate(delegate, context) {
|
345
|
+
var method = delegate.iterator[context.method];
|
346
|
+
if (method === undefined) {
|
347
|
+
// A .throw or .return when the delegate iterator has no .throw
|
348
|
+
// method always terminates the yield* loop.
|
349
|
+
context.delegate = null;
|
350
|
+
|
351
|
+
if (context.method === "throw") {
|
352
|
+
// Note: ["return"] must be used for ES3 parsing compatibility.
|
353
|
+
if (delegate.iterator["return"]) {
|
354
|
+
// If the delegate iterator has a return method, give it a
|
355
|
+
// chance to clean up.
|
356
|
+
context.method = "return";
|
357
|
+
context.arg = undefined;
|
358
|
+
maybeInvokeDelegate(delegate, context);
|
359
|
+
|
360
|
+
if (context.method === "throw") {
|
361
|
+
// If maybeInvokeDelegate(context) changed context.method from
|
362
|
+
// "return" to "throw", let that override the TypeError below.
|
363
|
+
return ContinueSentinel;
|
364
|
+
}
|
365
|
+
}
|
366
|
+
|
367
|
+
context.method = "throw";
|
368
|
+
context.arg = new TypeError(
|
369
|
+
"The iterator does not provide a 'throw' method");
|
370
|
+
}
|
371
|
+
|
372
|
+
return ContinueSentinel;
|
373
|
+
}
|
374
|
+
|
375
|
+
var record = tryCatch(method, delegate.iterator, context.arg);
|
376
|
+
|
377
|
+
if (record.type === "throw") {
|
378
|
+
context.method = "throw";
|
379
|
+
context.arg = record.arg;
|
380
|
+
context.delegate = null;
|
381
|
+
return ContinueSentinel;
|
382
|
+
}
|
383
|
+
|
384
|
+
var info = record.arg;
|
385
|
+
|
386
|
+
if (! info) {
|
387
|
+
context.method = "throw";
|
388
|
+
context.arg = new TypeError("iterator result is not an object");
|
389
|
+
context.delegate = null;
|
390
|
+
return ContinueSentinel;
|
391
|
+
}
|
392
|
+
|
393
|
+
if (info.done) {
|
394
|
+
// Assign the result of the finished delegate to the temporary
|
395
|
+
// variable specified by delegate.resultName (see delegateYield).
|
396
|
+
context[delegate.resultName] = info.value;
|
397
|
+
|
398
|
+
// Resume execution at the desired location (see delegateYield).
|
399
|
+
context.next = delegate.nextLoc;
|
400
|
+
|
401
|
+
// If context.method was "throw" but the delegate handled the
|
402
|
+
// exception, let the outer generator proceed normally. If
|
403
|
+
// context.method was "next", forget context.arg since it has been
|
404
|
+
// "consumed" by the delegate iterator. If context.method was
|
405
|
+
// "return", allow the original .return call to continue in the
|
406
|
+
// outer generator.
|
407
|
+
if (context.method !== "return") {
|
408
|
+
context.method = "next";
|
409
|
+
context.arg = undefined;
|
410
|
+
}
|
411
|
+
|
412
|
+
} else {
|
413
|
+
// Re-yield the result returned by the delegate method.
|
414
|
+
return info;
|
415
|
+
}
|
416
|
+
|
417
|
+
// The delegate iterator is finished, so forget it and continue with
|
418
|
+
// the outer generator.
|
419
|
+
context.delegate = null;
|
420
|
+
return ContinueSentinel;
|
421
|
+
}
|
422
|
+
|
423
|
+
// Define Generator.prototype.{next,throw,return} in terms of the
|
424
|
+
// unified ._invoke helper method.
|
425
|
+
defineIteratorMethods(Gp);
|
426
|
+
|
427
|
+
define(Gp, toStringTagSymbol, "Generator");
|
428
|
+
|
429
|
+
// A Generator should always return itself as the iterator object when the
|
430
|
+
// @@iterator function is called on it. Some browsers' implementations of the
|
431
|
+
// iterator prototype chain incorrectly implement this, causing the Generator
|
432
|
+
// object to not be returned from this call. This ensures that doesn't happen.
|
433
|
+
// See https://github.com/facebook/regenerator/issues/274 for more details.
|
434
|
+
define(Gp, iteratorSymbol, function() {
|
435
|
+
return this;
|
436
|
+
});
|
437
|
+
|
438
|
+
define(Gp, "toString", function() {
|
439
|
+
return "[object Generator]";
|
440
|
+
});
|
441
|
+
|
442
|
+
function pushTryEntry(locs) {
|
443
|
+
var entry = { tryLoc: locs[0] };
|
444
|
+
|
445
|
+
if (1 in locs) {
|
446
|
+
entry.catchLoc = locs[1];
|
447
|
+
}
|
448
|
+
|
449
|
+
if (2 in locs) {
|
450
|
+
entry.finallyLoc = locs[2];
|
451
|
+
entry.afterLoc = locs[3];
|
452
|
+
}
|
453
|
+
|
454
|
+
this.tryEntries.push(entry);
|
455
|
+
}
|
456
|
+
|
457
|
+
function resetTryEntry(entry) {
|
458
|
+
var record = entry.completion || {};
|
459
|
+
record.type = "normal";
|
460
|
+
delete record.arg;
|
461
|
+
entry.completion = record;
|
462
|
+
}
|
463
|
+
|
464
|
+
function Context(tryLocsList) {
|
465
|
+
// The root entry object (effectively a try statement without a catch
|
466
|
+
// or a finally block) gives us a place to store values thrown from
|
467
|
+
// locations where there is no enclosing try statement.
|
468
|
+
this.tryEntries = [{ tryLoc: "root" }];
|
469
|
+
tryLocsList.forEach(pushTryEntry, this);
|
470
|
+
this.reset(true);
|
471
|
+
}
|
472
|
+
|
473
|
+
exports.keys = function(object) {
|
474
|
+
var keys = [];
|
475
|
+
for (var key in object) {
|
476
|
+
keys.push(key);
|
477
|
+
}
|
478
|
+
keys.reverse();
|
479
|
+
|
480
|
+
// Rather than returning an object with a next method, we keep
|
481
|
+
// things simple and return the next function itself.
|
482
|
+
return function next() {
|
483
|
+
while (keys.length) {
|
484
|
+
var key = keys.pop();
|
485
|
+
if (key in object) {
|
486
|
+
next.value = key;
|
487
|
+
next.done = false;
|
488
|
+
return next;
|
489
|
+
}
|
490
|
+
}
|
491
|
+
|
492
|
+
// To avoid creating an additional object, we just hang the .value
|
493
|
+
// and .done properties off the next function object itself. This
|
494
|
+
// also ensures that the minifier will not anonymize the function.
|
495
|
+
next.done = true;
|
496
|
+
return next;
|
497
|
+
};
|
498
|
+
};
|
499
|
+
|
500
|
+
function values(iterable) {
|
501
|
+
if (iterable) {
|
502
|
+
var iteratorMethod = iterable[iteratorSymbol];
|
503
|
+
if (iteratorMethod) {
|
504
|
+
return iteratorMethod.call(iterable);
|
505
|
+
}
|
506
|
+
|
507
|
+
if (typeof iterable.next === "function") {
|
508
|
+
return iterable;
|
509
|
+
}
|
510
|
+
|
511
|
+
if (!isNaN(iterable.length)) {
|
512
|
+
var i = -1, next = function next() {
|
513
|
+
while (++i < iterable.length) {
|
514
|
+
if (hasOwn.call(iterable, i)) {
|
515
|
+
next.value = iterable[i];
|
516
|
+
next.done = false;
|
517
|
+
return next;
|
518
|
+
}
|
519
|
+
}
|
520
|
+
|
521
|
+
next.value = undefined;
|
522
|
+
next.done = true;
|
523
|
+
|
524
|
+
return next;
|
525
|
+
};
|
526
|
+
|
527
|
+
return next.next = next;
|
528
|
+
}
|
529
|
+
}
|
530
|
+
|
531
|
+
// Return an iterator with no values.
|
532
|
+
return { next: doneResult };
|
533
|
+
}
|
534
|
+
exports.values = values;
|
535
|
+
|
536
|
+
function doneResult() {
|
537
|
+
return { value: undefined, done: true };
|
538
|
+
}
|
539
|
+
|
540
|
+
Context.prototype = {
|
541
|
+
constructor: Context,
|
542
|
+
|
543
|
+
reset: function(skipTempReset) {
|
544
|
+
this.prev = 0;
|
545
|
+
this.next = 0;
|
546
|
+
// Resetting context._sent for legacy support of Babel's
|
547
|
+
// function.sent implementation.
|
548
|
+
this.sent = this._sent = undefined;
|
549
|
+
this.done = false;
|
550
|
+
this.delegate = null;
|
551
|
+
|
552
|
+
this.method = "next";
|
553
|
+
this.arg = undefined;
|
554
|
+
|
555
|
+
this.tryEntries.forEach(resetTryEntry);
|
556
|
+
|
557
|
+
if (!skipTempReset) {
|
558
|
+
for (var name in this) {
|
559
|
+
// Not sure about the optimal order of these conditions:
|
560
|
+
if (name.charAt(0) === "t" &&
|
561
|
+
hasOwn.call(this, name) &&
|
562
|
+
!isNaN(+name.slice(1))) {
|
563
|
+
this[name] = undefined;
|
564
|
+
}
|
565
|
+
}
|
566
|
+
}
|
567
|
+
},
|
568
|
+
|
569
|
+
stop: function() {
|
570
|
+
this.done = true;
|
571
|
+
|
572
|
+
var rootEntry = this.tryEntries[0];
|
573
|
+
var rootRecord = rootEntry.completion;
|
574
|
+
if (rootRecord.type === "throw") {
|
575
|
+
throw rootRecord.arg;
|
576
|
+
}
|
577
|
+
|
578
|
+
return this.rval;
|
579
|
+
},
|
580
|
+
|
581
|
+
dispatchException: function(exception) {
|
582
|
+
if (this.done) {
|
583
|
+
throw exception;
|
584
|
+
}
|
585
|
+
|
586
|
+
var context = this;
|
587
|
+
function handle(loc, caught) {
|
588
|
+
record.type = "throw";
|
589
|
+
record.arg = exception;
|
590
|
+
context.next = loc;
|
591
|
+
|
592
|
+
if (caught) {
|
593
|
+
// If the dispatched exception was caught by a catch block,
|
594
|
+
// then let that catch block handle the exception normally.
|
595
|
+
context.method = "next";
|
596
|
+
context.arg = undefined;
|
597
|
+
}
|
598
|
+
|
599
|
+
return !! caught;
|
600
|
+
}
|
601
|
+
|
602
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
603
|
+
var entry = this.tryEntries[i];
|
604
|
+
var record = entry.completion;
|
605
|
+
|
606
|
+
if (entry.tryLoc === "root") {
|
607
|
+
// Exception thrown outside of any try block that could handle
|
608
|
+
// it, so set the completion value of the entire function to
|
609
|
+
// throw the exception.
|
610
|
+
return handle("end");
|
611
|
+
}
|
612
|
+
|
613
|
+
if (entry.tryLoc <= this.prev) {
|
614
|
+
var hasCatch = hasOwn.call(entry, "catchLoc");
|
615
|
+
var hasFinally = hasOwn.call(entry, "finallyLoc");
|
616
|
+
|
617
|
+
if (hasCatch && hasFinally) {
|
618
|
+
if (this.prev < entry.catchLoc) {
|
619
|
+
return handle(entry.catchLoc, true);
|
620
|
+
} else if (this.prev < entry.finallyLoc) {
|
621
|
+
return handle(entry.finallyLoc);
|
622
|
+
}
|
623
|
+
|
624
|
+
} else if (hasCatch) {
|
625
|
+
if (this.prev < entry.catchLoc) {
|
626
|
+
return handle(entry.catchLoc, true);
|
627
|
+
}
|
628
|
+
|
629
|
+
} else if (hasFinally) {
|
630
|
+
if (this.prev < entry.finallyLoc) {
|
631
|
+
return handle(entry.finallyLoc);
|
632
|
+
}
|
633
|
+
|
634
|
+
} else {
|
635
|
+
throw new Error("try statement without catch or finally");
|
636
|
+
}
|
637
|
+
}
|
638
|
+
}
|
639
|
+
},
|
640
|
+
|
641
|
+
abrupt: function(type, arg) {
|
642
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
643
|
+
var entry = this.tryEntries[i];
|
644
|
+
if (entry.tryLoc <= this.prev &&
|
645
|
+
hasOwn.call(entry, "finallyLoc") &&
|
646
|
+
this.prev < entry.finallyLoc) {
|
647
|
+
var finallyEntry = entry;
|
648
|
+
break;
|
649
|
+
}
|
650
|
+
}
|
651
|
+
|
652
|
+
if (finallyEntry &&
|
653
|
+
(type === "break" ||
|
654
|
+
type === "continue") &&
|
655
|
+
finallyEntry.tryLoc <= arg &&
|
656
|
+
arg <= finallyEntry.finallyLoc) {
|
657
|
+
// Ignore the finally entry if control is not jumping to a
|
658
|
+
// location outside the try/catch block.
|
659
|
+
finallyEntry = null;
|
660
|
+
}
|
661
|
+
|
662
|
+
var record = finallyEntry ? finallyEntry.completion : {};
|
663
|
+
record.type = type;
|
664
|
+
record.arg = arg;
|
665
|
+
|
666
|
+
if (finallyEntry) {
|
667
|
+
this.method = "next";
|
668
|
+
this.next = finallyEntry.finallyLoc;
|
669
|
+
return ContinueSentinel;
|
670
|
+
}
|
671
|
+
|
672
|
+
return this.complete(record);
|
673
|
+
},
|
674
|
+
|
675
|
+
complete: function(record, afterLoc) {
|
676
|
+
if (record.type === "throw") {
|
677
|
+
throw record.arg;
|
678
|
+
}
|
679
|
+
|
680
|
+
if (record.type === "break" ||
|
681
|
+
record.type === "continue") {
|
682
|
+
this.next = record.arg;
|
683
|
+
} else if (record.type === "return") {
|
684
|
+
this.rval = this.arg = record.arg;
|
685
|
+
this.method = "return";
|
686
|
+
this.next = "end";
|
687
|
+
} else if (record.type === "normal" && afterLoc) {
|
688
|
+
this.next = afterLoc;
|
689
|
+
}
|
690
|
+
|
691
|
+
return ContinueSentinel;
|
692
|
+
},
|
693
|
+
|
694
|
+
finish: function(finallyLoc) {
|
695
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
696
|
+
var entry = this.tryEntries[i];
|
697
|
+
if (entry.finallyLoc === finallyLoc) {
|
698
|
+
this.complete(entry.completion, entry.afterLoc);
|
699
|
+
resetTryEntry(entry);
|
700
|
+
return ContinueSentinel;
|
701
|
+
}
|
702
|
+
}
|
703
|
+
},
|
704
|
+
|
705
|
+
"catch": function(tryLoc) {
|
706
|
+
for (var i = this.tryEntries.length - 1; i >= 0; --i) {
|
707
|
+
var entry = this.tryEntries[i];
|
708
|
+
if (entry.tryLoc === tryLoc) {
|
709
|
+
var record = entry.completion;
|
710
|
+
if (record.type === "throw") {
|
711
|
+
var thrown = record.arg;
|
712
|
+
resetTryEntry(entry);
|
713
|
+
}
|
714
|
+
return thrown;
|
715
|
+
}
|
716
|
+
}
|
717
|
+
|
718
|
+
// The context.catch method must only be called with a location
|
719
|
+
// argument that corresponds to a known catch block.
|
720
|
+
throw new Error("illegal catch attempt");
|
721
|
+
},
|
722
|
+
|
723
|
+
delegateYield: function(iterable, resultName, nextLoc) {
|
724
|
+
this.delegate = {
|
725
|
+
iterator: values(iterable),
|
726
|
+
resultName: resultName,
|
727
|
+
nextLoc: nextLoc
|
728
|
+
};
|
729
|
+
|
730
|
+
if (this.method === "next") {
|
731
|
+
// Deliberately forget the last sent value so that we don't
|
732
|
+
// accidentally pass it on to the delegate.
|
733
|
+
this.arg = undefined;
|
734
|
+
}
|
735
|
+
|
736
|
+
return ContinueSentinel;
|
737
|
+
}
|
738
|
+
};
|
739
|
+
|
740
|
+
// Regardless of whether this script is executing as a CommonJS module
|
741
|
+
// or not, return the runtime object so that we can declare the variable
|
742
|
+
// regeneratorRuntime in the outer scope, which allows this module to be
|
743
|
+
// injected easily by `bin/regenerator --include-runtime script.js`.
|
744
|
+
return exports;
|
745
|
+
|
746
|
+
}(
|
747
|
+
// If this script is executing as a CommonJS module, use module.exports
|
748
|
+
// as the regeneratorRuntime namespace. Otherwise create a new empty
|
749
|
+
// object. Either way, the resulting object will be used to initialize
|
750
|
+
// the regeneratorRuntime variable at the top of this file.
|
751
|
+
true ? module.exports : 0
|
752
|
+
));
|
753
|
+
|
754
|
+
try {
|
755
|
+
regeneratorRuntime = runtime;
|
756
|
+
} catch (accidentalStrictMode) {
|
757
|
+
// This module should not be running in strict mode, so the above
|
758
|
+
// assignment should always work unless something is misconfigured. Just
|
759
|
+
// in case runtime.js accidentally runs in strict mode, in modern engines
|
760
|
+
// we can explicitly access globalThis. In older engines we can escape
|
761
|
+
// strict mode using a global Function call. This could conceivably fail
|
762
|
+
// if a Content Security Policy forbids using Function, but in that case
|
763
|
+
// the proper solution is to fix the accidental strict mode problem. If
|
764
|
+
// you've misconfigured your bundler to force strict mode and applied a
|
765
|
+
// CSP to forbid Function, and you're not willing to fix either of those
|
766
|
+
// problems, please detail your unique predicament in a GitHub issue.
|
767
|
+
if (typeof globalThis === "object") {
|
768
|
+
globalThis.regeneratorRuntime = runtime;
|
769
|
+
} else {
|
770
|
+
Function("r", "regeneratorRuntime = r")(runtime);
|
771
|
+
}
|
772
|
+
}
|
773
|
+
|
774
|
+
|
775
|
+
/***/ })
|
776
|
+
|
777
|
+
/******/ });
|
778
|
+
/************************************************************************/
|
779
|
+
/******/ // The module cache
|
780
|
+
/******/ var __webpack_module_cache__ = {};
|
781
|
+
/******/
|
782
|
+
/******/ // The require function
|
783
|
+
/******/ function __webpack_require__(moduleId) {
|
784
|
+
/******/ // Check if module is in cache
|
785
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
786
|
+
/******/ if (cachedModule !== undefined) {
|
787
|
+
/******/ return cachedModule.exports;
|
788
|
+
/******/ }
|
789
|
+
/******/ // Create a new module (and put it into the cache)
|
790
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
791
|
+
/******/ // no module.id needed
|
792
|
+
/******/ // no module.loaded needed
|
793
|
+
/******/ exports: {}
|
794
|
+
/******/ };
|
795
|
+
/******/
|
796
|
+
/******/ // Execute the module function
|
797
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
798
|
+
/******/
|
799
|
+
/******/ // Return the exports of the module
|
800
|
+
/******/ return module.exports;
|
801
|
+
/******/ }
|
802
|
+
/******/
|
803
|
+
/************************************************************************/
|
804
|
+
/******/ /* webpack/runtime/compat get default export */
|
805
|
+
/******/ (() => {
|
806
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
807
|
+
/******/ __webpack_require__.n = (module) => {
|
808
|
+
/******/ var getter = module && module.__esModule ?
|
809
|
+
/******/ () => (module['default']) :
|
810
|
+
/******/ () => (module);
|
811
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
812
|
+
/******/ return getter;
|
813
|
+
/******/ };
|
814
|
+
/******/ })();
|
815
|
+
/******/
|
816
|
+
/******/ /* webpack/runtime/define property getters */
|
817
|
+
/******/ (() => {
|
818
|
+
/******/ // define getter functions for harmony exports
|
819
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
820
|
+
/******/ for(var key in definition) {
|
821
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
822
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
823
|
+
/******/ }
|
824
|
+
/******/ }
|
825
|
+
/******/ };
|
826
|
+
/******/ })();
|
827
|
+
/******/
|
828
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
829
|
+
/******/ (() => {
|
830
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
831
|
+
/******/ })();
|
832
|
+
/******/
|
833
|
+
/************************************************************************/
|
834
|
+
var __webpack_exports__ = {};
|
835
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
836
|
+
(() => {
|
837
|
+
|
838
|
+
// EXPORTS
|
839
|
+
__webpack_require__.d(__webpack_exports__, {
|
840
|
+
"r": () => (/* binding */ BkSearchSelect),
|
841
|
+
"Z": () => (/* binding */ src)
|
842
|
+
});
|
843
|
+
|
844
|
+
;// CONCATENATED MODULE: external "../shared"
|
845
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
846
|
+
var y = x => () => x
|
847
|
+
const external_shared_namespaceObject = x({ ["debounce"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.debounce, ["random"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.random, ["withInstall"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.withInstall });
|
848
|
+
;// CONCATENATED MODULE: external "vue"
|
849
|
+
var external_vue_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
850
|
+
var external_vue_y = x => () => x
|
851
|
+
const external_vue_namespaceObject = external_vue_x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createTextVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createTextVNode, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["inject"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.inject, ["nextTick"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.nextTick, ["onBeforeUnmount"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onBeforeUnmount, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["provide"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.provide, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["resolveDirective"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.resolveDirective, ["shallowRef"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.shallowRef, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["watchEffect"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watchEffect, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
852
|
+
;// CONCATENATED MODULE: ../../node_modules/resize-detector/esm/index.js
|
853
|
+
var raf = null;
|
854
|
+
function requestAnimationFrame (callback) {
|
855
|
+
if (!raf) {
|
856
|
+
raf = (
|
857
|
+
window.requestAnimationFrame ||
|
858
|
+
window.webkitRequestAnimationFrame ||
|
859
|
+
window.mozRequestAnimationFrame ||
|
860
|
+
function (callback) {
|
861
|
+
return setTimeout(callback, 16)
|
862
|
+
}
|
863
|
+
).bind(window);
|
864
|
+
}
|
865
|
+
return raf(callback)
|
866
|
+
}
|
867
|
+
|
868
|
+
var caf = null;
|
869
|
+
function cancelAnimationFrame (id) {
|
870
|
+
if (!caf) {
|
871
|
+
caf = (
|
872
|
+
window.cancelAnimationFrame ||
|
873
|
+
window.webkitCancelAnimationFrame ||
|
874
|
+
window.mozCancelAnimationFrame ||
|
875
|
+
function (id) {
|
876
|
+
clearTimeout(id);
|
877
|
+
}
|
878
|
+
).bind(window);
|
879
|
+
}
|
880
|
+
|
881
|
+
caf(id);
|
882
|
+
}
|
883
|
+
|
884
|
+
function createStyles (styleText) {
|
885
|
+
var style = document.createElement('style');
|
886
|
+
|
887
|
+
if (style.styleSheet) {
|
888
|
+
style.styleSheet.cssText = styleText;
|
889
|
+
} else {
|
890
|
+
style.appendChild(document.createTextNode(styleText));
|
891
|
+
}
|
892
|
+
(document.querySelector('head') || document.body).appendChild(style);
|
893
|
+
return style
|
894
|
+
}
|
895
|
+
|
896
|
+
function createElement (tagName, props) {
|
897
|
+
if ( props === void 0 ) props = {};
|
898
|
+
|
899
|
+
var elem = document.createElement(tagName);
|
900
|
+
Object.keys(props).forEach(function (key) {
|
901
|
+
elem[key] = props[key];
|
902
|
+
});
|
903
|
+
return elem
|
904
|
+
}
|
905
|
+
|
906
|
+
function getComputedStyle (elem, prop, pseudo) {
|
907
|
+
// for older versions of Firefox, `getComputedStyle` required
|
908
|
+
// the second argument and may return `null` for some elements
|
909
|
+
// when `display: none`
|
910
|
+
var computedStyle = window.getComputedStyle(elem, pseudo || null) || {
|
911
|
+
display: 'none'
|
912
|
+
};
|
913
|
+
|
914
|
+
return computedStyle[prop]
|
915
|
+
}
|
916
|
+
|
917
|
+
function getRenderInfo (elem) {
|
918
|
+
if (!document.documentElement.contains(elem)) {
|
919
|
+
return {
|
920
|
+
detached: true,
|
921
|
+
rendered: false
|
922
|
+
}
|
923
|
+
}
|
924
|
+
|
925
|
+
var current = elem;
|
926
|
+
while (current !== document) {
|
927
|
+
if (getComputedStyle(current, 'display') === 'none') {
|
928
|
+
return {
|
929
|
+
detached: false,
|
930
|
+
rendered: false
|
931
|
+
}
|
932
|
+
}
|
933
|
+
current = current.parentNode;
|
934
|
+
}
|
935
|
+
|
936
|
+
return {
|
937
|
+
detached: false,
|
938
|
+
rendered: true
|
939
|
+
}
|
940
|
+
}
|
941
|
+
|
942
|
+
var css_248z = ".resize-triggers{visibility:hidden;opacity:0;pointer-events:none}.resize-contract-trigger,.resize-contract-trigger:before,.resize-expand-trigger,.resize-triggers{content:\"\";position:absolute;top:0;left:0;height:100%;width:100%;overflow:hidden}.resize-contract-trigger,.resize-expand-trigger{background:#eee;overflow:auto}.resize-contract-trigger:before{width:200%;height:200%}";
|
943
|
+
|
944
|
+
var total = 0;
|
945
|
+
var style = null;
|
946
|
+
|
947
|
+
function addListener (elem, callback) {
|
948
|
+
if (!elem.__resize_mutation_handler__) {
|
949
|
+
elem.__resize_mutation_handler__ = handleMutation.bind(elem);
|
950
|
+
}
|
951
|
+
|
952
|
+
var listeners = elem.__resize_listeners__;
|
953
|
+
|
954
|
+
if (!listeners) {
|
955
|
+
elem.__resize_listeners__ = [];
|
956
|
+
if (window.ResizeObserver) {
|
957
|
+
var offsetWidth = elem.offsetWidth;
|
958
|
+
var offsetHeight = elem.offsetHeight;
|
959
|
+
var ro = new ResizeObserver(function () {
|
960
|
+
if (!elem.__resize_observer_triggered__) {
|
961
|
+
elem.__resize_observer_triggered__ = true;
|
962
|
+
if (elem.offsetWidth === offsetWidth && elem.offsetHeight === offsetHeight) {
|
963
|
+
return
|
964
|
+
}
|
965
|
+
}
|
966
|
+
runCallbacks(elem);
|
967
|
+
});
|
968
|
+
|
969
|
+
// initially display none won't trigger ResizeObserver callback
|
970
|
+
var ref = getRenderInfo(elem);
|
971
|
+
var detached = ref.detached;
|
972
|
+
var rendered = ref.rendered;
|
973
|
+
elem.__resize_observer_triggered__ = detached === false && rendered === false;
|
974
|
+
elem.__resize_observer__ = ro;
|
975
|
+
ro.observe(elem);
|
976
|
+
} else if (elem.attachEvent && elem.addEventListener) {
|
977
|
+
// targeting IE9/10
|
978
|
+
elem.__resize_legacy_resize_handler__ = function handleLegacyResize () {
|
979
|
+
runCallbacks(elem);
|
980
|
+
};
|
981
|
+
elem.attachEvent('onresize', elem.__resize_legacy_resize_handler__);
|
982
|
+
document.addEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
|
983
|
+
} else {
|
984
|
+
if (!total) {
|
985
|
+
style = createStyles(css_248z);
|
986
|
+
}
|
987
|
+
initTriggers(elem);
|
988
|
+
|
989
|
+
elem.__resize_rendered__ = getRenderInfo(elem).rendered;
|
990
|
+
if (window.MutationObserver) {
|
991
|
+
var mo = new MutationObserver(elem.__resize_mutation_handler__);
|
992
|
+
mo.observe(document, {
|
993
|
+
attributes: true,
|
994
|
+
childList: true,
|
995
|
+
characterData: true,
|
996
|
+
subtree: true
|
997
|
+
});
|
998
|
+
elem.__resize_mutation_observer__ = mo;
|
999
|
+
}
|
1000
|
+
}
|
1001
|
+
}
|
1002
|
+
|
1003
|
+
elem.__resize_listeners__.push(callback);
|
1004
|
+
total++;
|
1005
|
+
}
|
1006
|
+
|
1007
|
+
function removeListener (elem, callback) {
|
1008
|
+
var listeners = elem.__resize_listeners__;
|
1009
|
+
if (!listeners) {
|
1010
|
+
return
|
1011
|
+
}
|
1012
|
+
|
1013
|
+
if (callback) {
|
1014
|
+
listeners.splice(listeners.indexOf(callback), 1);
|
1015
|
+
}
|
1016
|
+
|
1017
|
+
// no listeners exist, or removing all listeners
|
1018
|
+
if (!listeners.length || !callback) {
|
1019
|
+
// targeting IE9/10
|
1020
|
+
if (elem.detachEvent && elem.removeEventListener) {
|
1021
|
+
elem.detachEvent('onresize', elem.__resize_legacy_resize_handler__);
|
1022
|
+
document.removeEventListener('DOMSubtreeModified', elem.__resize_mutation_handler__);
|
1023
|
+
return
|
1024
|
+
}
|
1025
|
+
|
1026
|
+
if (elem.__resize_observer__) {
|
1027
|
+
elem.__resize_observer__.unobserve(elem);
|
1028
|
+
elem.__resize_observer__.disconnect();
|
1029
|
+
elem.__resize_observer__ = null;
|
1030
|
+
} else {
|
1031
|
+
if (elem.__resize_mutation_observer__) {
|
1032
|
+
elem.__resize_mutation_observer__.disconnect();
|
1033
|
+
elem.__resize_mutation_observer__ = null;
|
1034
|
+
}
|
1035
|
+
elem.removeEventListener('scroll', handleScroll);
|
1036
|
+
elem.removeChild(elem.__resize_triggers__.triggers);
|
1037
|
+
elem.__resize_triggers__ = null;
|
1038
|
+
}
|
1039
|
+
elem.__resize_listeners__ = null;
|
1040
|
+
}
|
1041
|
+
|
1042
|
+
if (!--total && style) {
|
1043
|
+
style.parentNode.removeChild(style);
|
1044
|
+
}
|
1045
|
+
}
|
1046
|
+
|
1047
|
+
function getUpdatedSize (elem) {
|
1048
|
+
var ref = elem.__resize_last__;
|
1049
|
+
var width = ref.width;
|
1050
|
+
var height = ref.height;
|
1051
|
+
var offsetWidth = elem.offsetWidth;
|
1052
|
+
var offsetHeight = elem.offsetHeight;
|
1053
|
+
if (offsetWidth !== width || offsetHeight !== height) {
|
1054
|
+
return {
|
1055
|
+
width: offsetWidth,
|
1056
|
+
height: offsetHeight
|
1057
|
+
}
|
1058
|
+
}
|
1059
|
+
return null
|
1060
|
+
}
|
1061
|
+
|
1062
|
+
function handleMutation () {
|
1063
|
+
// `this` denotes the scrolling element
|
1064
|
+
var ref = getRenderInfo(this);
|
1065
|
+
var rendered = ref.rendered;
|
1066
|
+
var detached = ref.detached;
|
1067
|
+
if (rendered !== this.__resize_rendered__) {
|
1068
|
+
if (!detached && this.__resize_triggers__) {
|
1069
|
+
resetTriggers(this);
|
1070
|
+
this.addEventListener('scroll', handleScroll, true);
|
1071
|
+
}
|
1072
|
+
this.__resize_rendered__ = rendered;
|
1073
|
+
runCallbacks(this);
|
1074
|
+
}
|
1075
|
+
}
|
1076
|
+
|
1077
|
+
function handleScroll () {
|
1078
|
+
var this$1 = this;
|
1079
|
+
|
1080
|
+
// `this` denotes the scrolling element
|
1081
|
+
resetTriggers(this);
|
1082
|
+
if (this.__resize_raf__) {
|
1083
|
+
cancelAnimationFrame(this.__resize_raf__);
|
1084
|
+
}
|
1085
|
+
this.__resize_raf__ = requestAnimationFrame(function () {
|
1086
|
+
var updated = getUpdatedSize(this$1);
|
1087
|
+
if (updated) {
|
1088
|
+
this$1.__resize_last__ = updated;
|
1089
|
+
runCallbacks(this$1);
|
1090
|
+
}
|
1091
|
+
});
|
1092
|
+
}
|
1093
|
+
|
1094
|
+
function runCallbacks (elem) {
|
1095
|
+
if (!elem || !elem.__resize_listeners__) {
|
1096
|
+
return
|
1097
|
+
}
|
1098
|
+
elem.__resize_listeners__.forEach(function (callback) {
|
1099
|
+
callback.call(elem, elem);
|
1100
|
+
});
|
1101
|
+
}
|
1102
|
+
|
1103
|
+
function initTriggers (elem) {
|
1104
|
+
var position = getComputedStyle(elem, 'position');
|
1105
|
+
if (!position || position === 'static') {
|
1106
|
+
elem.style.position = 'relative';
|
1107
|
+
}
|
1108
|
+
|
1109
|
+
elem.__resize_old_position__ = position;
|
1110
|
+
elem.__resize_last__ = {};
|
1111
|
+
|
1112
|
+
var triggers = createElement('div', {
|
1113
|
+
className: 'resize-triggers'
|
1114
|
+
});
|
1115
|
+
var expand = createElement('div', {
|
1116
|
+
className: 'resize-expand-trigger'
|
1117
|
+
});
|
1118
|
+
var expandChild = createElement('div');
|
1119
|
+
var contract = createElement('div', {
|
1120
|
+
className: 'resize-contract-trigger'
|
1121
|
+
});
|
1122
|
+
expand.appendChild(expandChild);
|
1123
|
+
triggers.appendChild(expand);
|
1124
|
+
triggers.appendChild(contract);
|
1125
|
+
elem.appendChild(triggers);
|
1126
|
+
|
1127
|
+
elem.__resize_triggers__ = {
|
1128
|
+
triggers: triggers,
|
1129
|
+
expand: expand,
|
1130
|
+
expandChild: expandChild,
|
1131
|
+
contract: contract
|
1132
|
+
};
|
1133
|
+
|
1134
|
+
resetTriggers(elem);
|
1135
|
+
elem.addEventListener('scroll', handleScroll, true);
|
1136
|
+
|
1137
|
+
elem.__resize_last__ = {
|
1138
|
+
width: elem.offsetWidth,
|
1139
|
+
height: elem.offsetHeight
|
1140
|
+
};
|
1141
|
+
}
|
1142
|
+
|
1143
|
+
function resetTriggers (elem) {
|
1144
|
+
var ref = elem.__resize_triggers__;
|
1145
|
+
var expand = ref.expand;
|
1146
|
+
var expandChild = ref.expandChild;
|
1147
|
+
var contract = ref.contract;
|
1148
|
+
|
1149
|
+
// batch read
|
1150
|
+
var csw = contract.scrollWidth;
|
1151
|
+
var csh = contract.scrollHeight;
|
1152
|
+
var eow = expand.offsetWidth;
|
1153
|
+
var eoh = expand.offsetHeight;
|
1154
|
+
var esw = expand.scrollWidth;
|
1155
|
+
var esh = expand.scrollHeight;
|
1156
|
+
|
1157
|
+
// batch write
|
1158
|
+
contract.scrollLeft = csw;
|
1159
|
+
contract.scrollTop = csh;
|
1160
|
+
expandChild.style.width = eow + 1 + 'px';
|
1161
|
+
expandChild.style.height = eoh + 1 + 'px';
|
1162
|
+
expand.scrollLeft = esw;
|
1163
|
+
expand.scrollTop = esh;
|
1164
|
+
}
|
1165
|
+
|
1166
|
+
|
1167
|
+
|
1168
|
+
;// CONCATENATED MODULE: external "../directives"
|
1169
|
+
var external_directives_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1170
|
+
var external_directives_y = x => () => x
|
1171
|
+
const external_directives_namespaceObject = external_directives_x({ ["clickoutside"]: () => __WEBPACK_EXTERNAL_MODULE__directives_9cc9ba10__.clickoutside });
|
1172
|
+
;// CONCATENATED MODULE: external "../icon"
|
1173
|
+
var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1174
|
+
var external_icon_y = x => () => x
|
1175
|
+
const external_icon_namespaceObject = external_icon_x({ ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["Done"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Done, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Error, ["ExclamationCircleShape"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.ExclamationCircleShape, ["Search"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Search });
|
1176
|
+
// EXTERNAL MODULE: ../../node_modules/@babel/runtime/regenerator/index.js
|
1177
|
+
var regenerator = __webpack_require__(7162);
|
1178
|
+
var regenerator_default = /*#__PURE__*/__webpack_require__.n(regenerator);
|
1179
|
+
;// CONCATENATED MODULE: ../../node_modules/tslib/tslib.es6.js
|
1180
|
+
/******************************************************************************
|
1181
|
+
Copyright (c) Microsoft Corporation.
|
1182
|
+
|
1183
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
1184
|
+
purpose with or without fee is hereby granted.
|
1185
|
+
|
1186
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
1187
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
1188
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
1189
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
1190
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
1191
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
1192
|
+
PERFORMANCE OF THIS SOFTWARE.
|
1193
|
+
***************************************************************************** */
|
1194
|
+
/* global Reflect, Promise */
|
1195
|
+
|
1196
|
+
var extendStatics = function(d, b) {
|
1197
|
+
extendStatics = Object.setPrototypeOf ||
|
1198
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
1199
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
1200
|
+
return extendStatics(d, b);
|
1201
|
+
};
|
1202
|
+
|
1203
|
+
function __extends(d, b) {
|
1204
|
+
if (typeof b !== "function" && b !== null)
|
1205
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
1206
|
+
extendStatics(d, b);
|
1207
|
+
function __() { this.constructor = d; }
|
1208
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
1209
|
+
}
|
1210
|
+
|
1211
|
+
var __assign = function() {
|
1212
|
+
__assign = Object.assign || function __assign(t) {
|
1213
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
1214
|
+
s = arguments[i];
|
1215
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
1216
|
+
}
|
1217
|
+
return t;
|
1218
|
+
}
|
1219
|
+
return __assign.apply(this, arguments);
|
1220
|
+
}
|
1221
|
+
|
1222
|
+
function __rest(s, e) {
|
1223
|
+
var t = {};
|
1224
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
1225
|
+
t[p] = s[p];
|
1226
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
1227
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
1228
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
1229
|
+
t[p[i]] = s[p[i]];
|
1230
|
+
}
|
1231
|
+
return t;
|
1232
|
+
}
|
1233
|
+
|
1234
|
+
function __decorate(decorators, target, key, desc) {
|
1235
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
1236
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
1237
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
1238
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
1239
|
+
}
|
1240
|
+
|
1241
|
+
function __param(paramIndex, decorator) {
|
1242
|
+
return function (target, key) { decorator(target, key, paramIndex); }
|
1243
|
+
}
|
1244
|
+
|
1245
|
+
function __metadata(metadataKey, metadataValue) {
|
1246
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(metadataKey, metadataValue);
|
1247
|
+
}
|
1248
|
+
|
1249
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
1250
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
1251
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
1252
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
1253
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
1254
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
1255
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
1256
|
+
});
|
1257
|
+
}
|
1258
|
+
|
1259
|
+
function __generator(thisArg, body) {
|
1260
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
1261
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
1262
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
1263
|
+
function step(op) {
|
1264
|
+
if (f) throw new TypeError("Generator is already executing.");
|
1265
|
+
while (_) try {
|
1266
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
1267
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
1268
|
+
switch (op[0]) {
|
1269
|
+
case 0: case 1: t = op; break;
|
1270
|
+
case 4: _.label++; return { value: op[1], done: false };
|
1271
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
1272
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
1273
|
+
default:
|
1274
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
1275
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
1276
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
1277
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
1278
|
+
if (t[2]) _.ops.pop();
|
1279
|
+
_.trys.pop(); continue;
|
1280
|
+
}
|
1281
|
+
op = body.call(thisArg, _);
|
1282
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
1283
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
1284
|
+
}
|
1285
|
+
}
|
1286
|
+
|
1287
|
+
var __createBinding = Object.create ? (function(o, m, k, k2) {
|
1288
|
+
if (k2 === undefined) k2 = k;
|
1289
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
1290
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
1291
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
1292
|
+
}
|
1293
|
+
Object.defineProperty(o, k2, desc);
|
1294
|
+
}) : (function(o, m, k, k2) {
|
1295
|
+
if (k2 === undefined) k2 = k;
|
1296
|
+
o[k2] = m[k];
|
1297
|
+
});
|
1298
|
+
|
1299
|
+
function __exportStar(m, o) {
|
1300
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);
|
1301
|
+
}
|
1302
|
+
|
1303
|
+
function __values(o) {
|
1304
|
+
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
1305
|
+
if (m) return m.call(o);
|
1306
|
+
if (o && typeof o.length === "number") return {
|
1307
|
+
next: function () {
|
1308
|
+
if (o && i >= o.length) o = void 0;
|
1309
|
+
return { value: o && o[i++], done: !o };
|
1310
|
+
}
|
1311
|
+
};
|
1312
|
+
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
1313
|
+
}
|
1314
|
+
|
1315
|
+
function __read(o, n) {
|
1316
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
1317
|
+
if (!m) return o;
|
1318
|
+
var i = m.call(o), r, ar = [], e;
|
1319
|
+
try {
|
1320
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
1321
|
+
}
|
1322
|
+
catch (error) { e = { error: error }; }
|
1323
|
+
finally {
|
1324
|
+
try {
|
1325
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
1326
|
+
}
|
1327
|
+
finally { if (e) throw e.error; }
|
1328
|
+
}
|
1329
|
+
return ar;
|
1330
|
+
}
|
1331
|
+
|
1332
|
+
/** @deprecated */
|
1333
|
+
function __spread() {
|
1334
|
+
for (var ar = [], i = 0; i < arguments.length; i++)
|
1335
|
+
ar = ar.concat(__read(arguments[i]));
|
1336
|
+
return ar;
|
1337
|
+
}
|
1338
|
+
|
1339
|
+
/** @deprecated */
|
1340
|
+
function __spreadArrays() {
|
1341
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
1342
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
1343
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
1344
|
+
r[k] = a[j];
|
1345
|
+
return r;
|
1346
|
+
}
|
1347
|
+
|
1348
|
+
function __spreadArray(to, from, pack) {
|
1349
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
1350
|
+
if (ar || !(i in from)) {
|
1351
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
1352
|
+
ar[i] = from[i];
|
1353
|
+
}
|
1354
|
+
}
|
1355
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
1356
|
+
}
|
1357
|
+
|
1358
|
+
function __await(v) {
|
1359
|
+
return this instanceof __await ? (this.v = v, this) : new __await(v);
|
1360
|
+
}
|
1361
|
+
|
1362
|
+
function __asyncGenerator(thisArg, _arguments, generator) {
|
1363
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
1364
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
1365
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
1366
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
1367
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
1368
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
1369
|
+
function fulfill(value) { resume("next", value); }
|
1370
|
+
function reject(value) { resume("throw", value); }
|
1371
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
1372
|
+
}
|
1373
|
+
|
1374
|
+
function __asyncDelegator(o) {
|
1375
|
+
var i, p;
|
1376
|
+
return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
|
1377
|
+
function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
|
1378
|
+
}
|
1379
|
+
|
1380
|
+
function __asyncValues(o) {
|
1381
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
1382
|
+
var m = o[Symbol.asyncIterator], i;
|
1383
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
1384
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
1385
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
1386
|
+
}
|
1387
|
+
|
1388
|
+
function __makeTemplateObject(cooked, raw) {
|
1389
|
+
if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
|
1390
|
+
return cooked;
|
1391
|
+
};
|
1392
|
+
|
1393
|
+
var __setModuleDefault = Object.create ? (function(o, v) {
|
1394
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
1395
|
+
}) : function(o, v) {
|
1396
|
+
o["default"] = v;
|
1397
|
+
};
|
1398
|
+
|
1399
|
+
function __importStar(mod) {
|
1400
|
+
if (mod && mod.__esModule) return mod;
|
1401
|
+
var result = {};
|
1402
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
1403
|
+
__setModuleDefault(result, mod);
|
1404
|
+
return result;
|
1405
|
+
}
|
1406
|
+
|
1407
|
+
function __importDefault(mod) {
|
1408
|
+
return (mod && mod.__esModule) ? mod : { default: mod };
|
1409
|
+
}
|
1410
|
+
|
1411
|
+
function __classPrivateFieldGet(receiver, state, kind, f) {
|
1412
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
1413
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
1414
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
1415
|
+
}
|
1416
|
+
|
1417
|
+
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
1418
|
+
if (kind === "m") throw new TypeError("Private method is not writable");
|
1419
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
1420
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
1421
|
+
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
1422
|
+
}
|
1423
|
+
|
1424
|
+
function __classPrivateFieldIn(state, receiver) {
|
1425
|
+
if (receiver === null || (typeof receiver !== "object" && typeof receiver !== "function")) throw new TypeError("Cannot use 'in' operator on non-object");
|
1426
|
+
return typeof state === "function" ? receiver === state : state.has(receiver);
|
1427
|
+
}
|
1428
|
+
|
1429
|
+
;// CONCATENATED MODULE: external "../popover"
|
1430
|
+
var external_popover_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1431
|
+
var external_popover_y = x => () => x
|
1432
|
+
const external_popover_namespaceObject = external_popover_x({ ["default"]: () => __WEBPACK_EXTERNAL_MODULE__popover_cf5f8dce__["default"] });
|
1433
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/menu.tsx
|
1434
|
+
|
1435
|
+
|
1436
|
+
/*
|
1437
|
+
* Tencent is pleased to support the open source community by making
|
1438
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1439
|
+
*
|
1440
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1441
|
+
*
|
1442
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1443
|
+
*
|
1444
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1445
|
+
*
|
1446
|
+
* ---------------------------------------------------
|
1447
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1448
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1449
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1450
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1451
|
+
*
|
1452
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1453
|
+
* the Software.
|
1454
|
+
*
|
1455
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1456
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1457
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1458
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1459
|
+
* IN THE SOFTWARE.
|
1460
|
+
*/
|
1461
|
+
|
1462
|
+
|
1463
|
+
;
|
1464
|
+
/* harmony default export */ const menu = ((0,external_vue_namespaceObject.defineComponent)({
|
1465
|
+
name: 'SearchSelectMenu',
|
1466
|
+
props: {
|
1467
|
+
list: {
|
1468
|
+
type: Array
|
1469
|
+
},
|
1470
|
+
hoverId: String,
|
1471
|
+
keyword: {
|
1472
|
+
type: String,
|
1473
|
+
"default": ''
|
1474
|
+
},
|
1475
|
+
multiple: {
|
1476
|
+
type: Boolean,
|
1477
|
+
"default": false
|
1478
|
+
},
|
1479
|
+
selected: {
|
1480
|
+
type: Array,
|
1481
|
+
"default": function _default() {
|
1482
|
+
return [];
|
1483
|
+
}
|
1484
|
+
},
|
1485
|
+
conditions: {
|
1486
|
+
type: Array
|
1487
|
+
},
|
1488
|
+
footerBtns: {
|
1489
|
+
type: Array,
|
1490
|
+
"default": function _default() {
|
1491
|
+
return [{
|
1492
|
+
id: 'confirm',
|
1493
|
+
name: '确认'
|
1494
|
+
}, {
|
1495
|
+
id: 'cancel',
|
1496
|
+
name: '取消',
|
1497
|
+
disabled: false
|
1498
|
+
}];
|
1499
|
+
}
|
1500
|
+
}
|
1501
|
+
},
|
1502
|
+
emits: ['selectItem', 'selectCondition', 'footerClick'],
|
1503
|
+
setup: function setup(props, _ref) {
|
1504
|
+
var emit = _ref.emit;
|
1505
|
+
|
1506
|
+
// events
|
1507
|
+
function handleClick(item) {
|
1508
|
+
emit('selectItem', item);
|
1509
|
+
}
|
1510
|
+
|
1511
|
+
function handleClickCondition(item) {
|
1512
|
+
emit('selectCondition', item);
|
1513
|
+
}
|
1514
|
+
|
1515
|
+
function handleClickFooterBtn(item) {
|
1516
|
+
emit('footerClick', item);
|
1517
|
+
}
|
1518
|
+
|
1519
|
+
var filterList = (0,external_vue_namespaceObject.computed)(function () {
|
1520
|
+
var _a, _b;
|
1521
|
+
|
1522
|
+
if (!((_a = props.list) === null || _a === void 0 ? void 0 : _a.length)) return [];
|
1523
|
+
if (!((_b = props.keyword) === null || _b === void 0 ? void 0 : _b.length)) return props.list;
|
1524
|
+
return props.list.filter(function (item) {
|
1525
|
+
return item.name.toLocaleLowerCase().includes(props.keyword.toLocaleLowerCase());
|
1526
|
+
});
|
1527
|
+
});
|
1528
|
+
|
1529
|
+
function transformNode(str) {
|
1530
|
+
if (!str) return str;
|
1531
|
+
var keyword = props.keyword;
|
1532
|
+
var len = keyword.length;
|
1533
|
+
if (!(keyword === null || keyword === void 0 ? void 0 : keyword.trim().length) || !str.toLocaleLowerCase().includes(keyword.toLocaleLowerCase())) return str;
|
1534
|
+
var list = [];
|
1535
|
+
var lastIndex = -1;
|
1536
|
+
keyword = keyword.replace(/([.*/]{1})/gmi, '\\$1');
|
1537
|
+
str.replace(new RegExp("".concat(keyword), 'igm'), function (key, index) {
|
1538
|
+
if (list.length === 0 && index !== 0) {
|
1539
|
+
list.push(str.slice(0, index));
|
1540
|
+
} else if (lastIndex >= 0) {
|
1541
|
+
list.push(str.slice(lastIndex + key.length, index));
|
1542
|
+
}
|
1543
|
+
|
1544
|
+
list.push((0,external_vue_namespaceObject.createVNode)("span", {
|
1545
|
+
"class": 'is-keyword'
|
1546
|
+
}, [key]));
|
1547
|
+
lastIndex = index;
|
1548
|
+
return key;
|
1549
|
+
});
|
1550
|
+
|
1551
|
+
if (lastIndex >= 0) {
|
1552
|
+
list.push(str.slice(lastIndex + len));
|
1553
|
+
}
|
1554
|
+
|
1555
|
+
return list.length ? list : str;
|
1556
|
+
}
|
1557
|
+
|
1558
|
+
function getSearchNode(item) {
|
1559
|
+
var _a;
|
1560
|
+
|
1561
|
+
if (!((_a = item.value) === null || _a === void 0 ? void 0 : _a.name)) return transformNode(item.name);
|
1562
|
+
return [(0,external_vue_namespaceObject.createVNode)("span", {
|
1563
|
+
"class": "menu-name"
|
1564
|
+
}, [item.name, (0,external_vue_namespaceObject.createTextVNode)(":")]), item.value.name];
|
1565
|
+
}
|
1566
|
+
|
1567
|
+
;
|
1568
|
+
return {
|
1569
|
+
handleClick: handleClick,
|
1570
|
+
handleClickCondition: handleClickCondition,
|
1571
|
+
handleClickFooterBtn: handleClickFooterBtn,
|
1572
|
+
filterList: filterList,
|
1573
|
+
getSearchNode: getSearchNode
|
1574
|
+
};
|
1575
|
+
},
|
1576
|
+
render: function render() {
|
1577
|
+
var _this = this;
|
1578
|
+
|
1579
|
+
var _a, _b, _c;
|
1580
|
+
|
1581
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1582
|
+
"class": 'bk-search-select-menu'
|
1583
|
+
}, [!!((_a = this.conditions) === null || _a === void 0 ? void 0 : _a.length) && (0,external_vue_namespaceObject.createVNode)("ul", {
|
1584
|
+
"class": "menu-header"
|
1585
|
+
}, [this.conditions.map(function (item) {
|
1586
|
+
return (0,external_vue_namespaceObject.createVNode)("li", {
|
1587
|
+
"key": item.id,
|
1588
|
+
"class": "menu-header-item ".concat(item.disabled ? 'is-disabled' : ''),
|
1589
|
+
"onClick": function onClick() {
|
1590
|
+
return !item.disabled && _this.handleClickCondition(item);
|
1591
|
+
}
|
1592
|
+
}, [item.name]);
|
1593
|
+
})]), (0,external_vue_namespaceObject.createVNode)("ul", {
|
1594
|
+
"class": 'menu-content'
|
1595
|
+
}, [(_b = this.list) === null || _b === void 0 ? void 0 : _b.map(function (item) {
|
1596
|
+
return (0,external_vue_namespaceObject.createVNode)("li", {
|
1597
|
+
"class": "menu-item ".concat(item.disabled ? 'is-disabled' : '', " ").concat(_this.hoverId === item.id && !item.disabled ? 'is-hover' : ''),
|
1598
|
+
"key": item.id,
|
1599
|
+
"id": item.id,
|
1600
|
+
"tabindex": '-1',
|
1601
|
+
"onClick": function onClick() {
|
1602
|
+
return !item.disabled && _this.handleClick(item);
|
1603
|
+
}
|
1604
|
+
}, [_this.$slots["default"] ? _this.$slots["default"]({
|
1605
|
+
item: item,
|
1606
|
+
list: _this.list,
|
1607
|
+
multiple: !!_this.multiple,
|
1608
|
+
hoverId: _this.hoverId,
|
1609
|
+
getSearchNode: _this.getSearchNode
|
1610
|
+
}) : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [_this.getSearchNode(item), _this.multiple && _this.selected.includes(item.id) && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Done, {
|
1611
|
+
"class": "is-selected"
|
1612
|
+
}, null)])]);
|
1613
|
+
})]), this.multiple && ((_c = this.footerBtns) === null || _c === void 0 ? void 0 : _c.length) && (0,external_vue_namespaceObject.createVNode)("div", {
|
1614
|
+
"class": "menu-footer"
|
1615
|
+
}, [this.footerBtns.map(function (item) {
|
1616
|
+
return (0,external_vue_namespaceObject.createVNode)("span", {
|
1617
|
+
"class": "menu-footer-btn ".concat(item.disabled ? 'is-disabled' : ''),
|
1618
|
+
"key": item.id,
|
1619
|
+
"onClick": function onClick() {
|
1620
|
+
return !item.disabled && _this.handleClickFooterBtn(item);
|
1621
|
+
}
|
1622
|
+
}, [item.name]);
|
1623
|
+
})])]);
|
1624
|
+
}
|
1625
|
+
}));
|
1626
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js
|
1627
|
+
function _classCallCheck(instance, Constructor) {
|
1628
|
+
if (!(instance instanceof Constructor)) {
|
1629
|
+
throw new TypeError("Cannot call a class as a function");
|
1630
|
+
}
|
1631
|
+
}
|
1632
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/createClass.js
|
1633
|
+
function _defineProperties(target, props) {
|
1634
|
+
for (var i = 0; i < props.length; i++) {
|
1635
|
+
var descriptor = props[i];
|
1636
|
+
descriptor.enumerable = descriptor.enumerable || false;
|
1637
|
+
descriptor.configurable = true;
|
1638
|
+
if ("value" in descriptor) descriptor.writable = true;
|
1639
|
+
Object.defineProperty(target, descriptor.key, descriptor);
|
1640
|
+
}
|
1641
|
+
}
|
1642
|
+
|
1643
|
+
function _createClass(Constructor, protoProps, staticProps) {
|
1644
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
1645
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
1646
|
+
Object.defineProperty(Constructor, "prototype", {
|
1647
|
+
writable: false
|
1648
|
+
});
|
1649
|
+
return Constructor;
|
1650
|
+
}
|
1651
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/utils.ts
|
1652
|
+
|
1653
|
+
|
1654
|
+
|
1655
|
+
/*
|
1656
|
+
* Tencent is pleased to support the open source community by making
|
1657
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1658
|
+
*
|
1659
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1660
|
+
*
|
1661
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1662
|
+
*
|
1663
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1664
|
+
*
|
1665
|
+
* ---------------------------------------------------
|
1666
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1667
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1668
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1669
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1670
|
+
*
|
1671
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1672
|
+
* the Software.
|
1673
|
+
*
|
1674
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1675
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1676
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1677
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1678
|
+
* IN THE SOFTWARE.
|
1679
|
+
*/
|
1680
|
+
|
1681
|
+
/**
|
1682
|
+
* @description: 获取menu list方法
|
1683
|
+
* @param {ISearchItem} item 已选择的key字段 为空则代表当前并未选择key字段
|
1684
|
+
* @param {string} keyword 已输入的文本
|
1685
|
+
* @return {*} menu list用于渲染选择弹层列表
|
1686
|
+
*/
|
1687
|
+
|
1688
|
+
var ValueBehavior;
|
1689
|
+
|
1690
|
+
(function (ValueBehavior) {
|
1691
|
+
ValueBehavior["ALL"] = "all";
|
1692
|
+
ValueBehavior["NEEDKEY"] = "need-key";
|
1693
|
+
})(ValueBehavior || (ValueBehavior = {}));
|
1694
|
+
|
1695
|
+
var SEARCH_SLECT_PROVIDER_KEY = Symbol('SEARCH_SLECT_PROVIDER_KEY');
|
1696
|
+
var useSearchSelectProvider = function useSearchSelectProvider(data) {
|
1697
|
+
(0,external_vue_namespaceObject.provide)(SEARCH_SLECT_PROVIDER_KEY, data);
|
1698
|
+
};
|
1699
|
+
var useSearchSelectInject = function useSearchSelectInject() {
|
1700
|
+
return (0,external_vue_namespaceObject.inject)(SEARCH_SLECT_PROVIDER_KEY);
|
1701
|
+
};
|
1702
|
+
var SearchInputMode;
|
1703
|
+
|
1704
|
+
(function (SearchInputMode) {
|
1705
|
+
SearchInputMode["DEFAULT"] = "default";
|
1706
|
+
SearchInputMode["EDIT"] = "edit";
|
1707
|
+
})(SearchInputMode || (SearchInputMode = {}));
|
1708
|
+
|
1709
|
+
var SelectedItem = /*#__PURE__*/function () {
|
1710
|
+
function SelectedItem(searchItem) {
|
1711
|
+
var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'default';
|
1712
|
+
var splitCode = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '|';
|
1713
|
+
|
1714
|
+
_classCallCheck(this, SelectedItem);
|
1715
|
+
|
1716
|
+
this.searchItem = searchItem;
|
1717
|
+
this.type = type;
|
1718
|
+
this.splitCode = splitCode;
|
1719
|
+
this.values = [];
|
1720
|
+
this.id = searchItem.id;
|
1721
|
+
this.name = searchItem.name;
|
1722
|
+
}
|
1723
|
+
|
1724
|
+
_createClass(SelectedItem, [{
|
1725
|
+
key: "multiple",
|
1726
|
+
get: function get() {
|
1727
|
+
return !!this.searchItem.multiple;
|
1728
|
+
}
|
1729
|
+
}, {
|
1730
|
+
key: "placeholder",
|
1731
|
+
get: function get() {
|
1732
|
+
return this.searchItem.placeholder || '';
|
1733
|
+
}
|
1734
|
+
}, {
|
1735
|
+
key: "children",
|
1736
|
+
get: function get() {
|
1737
|
+
return this.searchItem.children || [];
|
1738
|
+
}
|
1739
|
+
}, {
|
1740
|
+
key: "validate",
|
1741
|
+
get: function get() {
|
1742
|
+
return !this.searchItem.noValidate;
|
1743
|
+
}
|
1744
|
+
}, {
|
1745
|
+
key: "inputInnerHtml",
|
1746
|
+
get: function get() {
|
1747
|
+
var _a;
|
1748
|
+
|
1749
|
+
if (this.isSpecialType()) return this.name;
|
1750
|
+
return "".concat(this.keyInnerHtml).concat(((_a = this.values) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
1751
|
+
return item.name;
|
1752
|
+
}).join(this.splitCode)) || '');
|
1753
|
+
}
|
1754
|
+
}, {
|
1755
|
+
key: "inputInnerText",
|
1756
|
+
get: function get() {
|
1757
|
+
var _a;
|
1758
|
+
|
1759
|
+
if (this.isSpecialType()) return this.name;
|
1760
|
+
return "".concat(this.keyInnerText).concat(((_a = this.values) === null || _a === void 0 ? void 0 : _a.map(function (item) {
|
1761
|
+
return item.name;
|
1762
|
+
}).join(this.splitCode)) || '');
|
1763
|
+
}
|
1764
|
+
}, {
|
1765
|
+
key: "keyInnerHtml",
|
1766
|
+
get: function get() {
|
1767
|
+
if (this.isSpecialType()) return this.name;
|
1768
|
+
return this.name ? "".concat(this.name, ":\xA0") : '';
|
1769
|
+
}
|
1770
|
+
}, {
|
1771
|
+
key: "keyInnerText",
|
1772
|
+
get: function get() {
|
1773
|
+
if (this.isSpecialType()) return this.name;
|
1774
|
+
return this.name ? "".concat(this.name, ": ") : '';
|
1775
|
+
}
|
1776
|
+
}, {
|
1777
|
+
key: "isSpecialType",
|
1778
|
+
value: function isSpecialType() {
|
1779
|
+
return ['text', 'condition'].includes(this.type);
|
1780
|
+
}
|
1781
|
+
}, {
|
1782
|
+
key: "addValue",
|
1783
|
+
value: function addValue(item) {
|
1784
|
+
if (this.multiple) {
|
1785
|
+
var index = this.values.findIndex(function (val) {
|
1786
|
+
return val.id === item.id;
|
1787
|
+
});
|
1788
|
+
|
1789
|
+
if (index > -1) {
|
1790
|
+
this.values.splice(index, 1);
|
1791
|
+
return;
|
1792
|
+
}
|
1793
|
+
|
1794
|
+
this.values.push(item);
|
1795
|
+
return;
|
1796
|
+
}
|
1797
|
+
|
1798
|
+
this.values = [item];
|
1799
|
+
}
|
1800
|
+
}, {
|
1801
|
+
key: "toValue",
|
1802
|
+
value: function toValue() {
|
1803
|
+
var _a;
|
1804
|
+
|
1805
|
+
var value = {
|
1806
|
+
id: this.id,
|
1807
|
+
name: this.name
|
1808
|
+
};
|
1809
|
+
|
1810
|
+
if ((_a = this.values) === null || _a === void 0 ? void 0 : _a.length) {
|
1811
|
+
value.values = this.values.map(function (item) {
|
1812
|
+
return {
|
1813
|
+
id: item.id,
|
1814
|
+
name: item.name
|
1815
|
+
};
|
1816
|
+
});
|
1817
|
+
}
|
1818
|
+
|
1819
|
+
if (this.type && this.type !== 'default') {
|
1820
|
+
value.type = this.type;
|
1821
|
+
}
|
1822
|
+
|
1823
|
+
return value;
|
1824
|
+
}
|
1825
|
+
}, {
|
1826
|
+
key: "toValueKey",
|
1827
|
+
value: function toValueKey() {
|
1828
|
+
return JSON.stringify(this.toValue());
|
1829
|
+
}
|
1830
|
+
}, {
|
1831
|
+
key: "isInValueList",
|
1832
|
+
value: function isInValueList(item) {
|
1833
|
+
return this.children.some(function (v) {
|
1834
|
+
return v.id === (item === null || item === void 0 ? void 0 : item.id);
|
1835
|
+
});
|
1836
|
+
}
|
1837
|
+
}]);
|
1838
|
+
|
1839
|
+
return SelectedItem;
|
1840
|
+
}();
|
1841
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/input.tsx
|
1842
|
+
|
1843
|
+
|
1844
|
+
|
1845
|
+
/*
|
1846
|
+
* Tencent is pleased to support the open source community by making
|
1847
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1848
|
+
*
|
1849
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1850
|
+
*
|
1851
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1852
|
+
*
|
1853
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1854
|
+
*
|
1855
|
+
* ---------------------------------------------------
|
1856
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1857
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1858
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1859
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1860
|
+
*
|
1861
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1862
|
+
* the Software.
|
1863
|
+
*
|
1864
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1865
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1866
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1867
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1868
|
+
* IN THE SOFTWARE.
|
1869
|
+
*/
|
1870
|
+
|
1871
|
+
|
1872
|
+
|
1873
|
+
|
1874
|
+
|
1875
|
+
|
1876
|
+
|
1877
|
+
/* harmony default export */ const input = ((0,external_vue_namespaceObject.defineComponent)({
|
1878
|
+
name: 'SearchSelectInput',
|
1879
|
+
directives: {
|
1880
|
+
clickoutside: external_directives_namespaceObject.clickoutside
|
1881
|
+
},
|
1882
|
+
props: {
|
1883
|
+
data: {
|
1884
|
+
type: Array,
|
1885
|
+
required: true
|
1886
|
+
},
|
1887
|
+
showInputBefore: Boolean,
|
1888
|
+
showCondition: Boolean,
|
1889
|
+
clickOutside: Function,
|
1890
|
+
conditions: {
|
1891
|
+
type: Array,
|
1892
|
+
"default": function _default() {
|
1893
|
+
return [];
|
1894
|
+
}
|
1895
|
+
},
|
1896
|
+
defautUsingItem: Object,
|
1897
|
+
mode: {
|
1898
|
+
type: String,
|
1899
|
+
"default": SearchInputMode.DEFAULT
|
1900
|
+
},
|
1901
|
+
getMenuList: Function,
|
1902
|
+
validateValues: Function,
|
1903
|
+
valueBehavior: String
|
1904
|
+
},
|
1905
|
+
emits: ['focus', 'add', 'delete'],
|
1906
|
+
setup: function setup(props, _ref) {
|
1907
|
+
var emit = _ref.emit,
|
1908
|
+
expose = _ref.expose;
|
1909
|
+
var inputRef = (0,external_vue_namespaceObject.ref)(null);
|
1910
|
+
var popoverRef = (0,external_vue_namespaceObject.ref)(null);
|
1911
|
+
var keyword = (0,external_vue_namespaceObject.ref)('');
|
1912
|
+
var showNoSelectValueError = (0,external_vue_namespaceObject.ref)(false);
|
1913
|
+
var isFocus = (0,external_vue_namespaceObject.ref)(false);
|
1914
|
+
var showPopover = (0,external_vue_namespaceObject.ref)(false);
|
1915
|
+
var usingItem = (0,external_vue_namespaceObject.ref)(props.defautUsingItem);
|
1916
|
+
var menuHoverId = (0,external_vue_namespaceObject.ref)('');
|
1917
|
+
var loading = (0,external_vue_namespaceObject.ref)(false);
|
1918
|
+
var debounceSetMenuList = (0,external_shared_namespaceObject.debounce)(300, setMenuList); // const selectMenuList = ref<ICommonItem[]>([]);
|
1919
|
+
|
1920
|
+
var isBindEvent = false;
|
1921
|
+
var remoteMenuList = (0,external_vue_namespaceObject.ref)([]);
|
1922
|
+
var menuList = (0,external_vue_namespaceObject.ref)([]);
|
1923
|
+
|
1924
|
+
var _useSearchSelectInjec = useSearchSelectInject(),
|
1925
|
+
editKey = _useSearchSelectInjec.editKey,
|
1926
|
+
onValidate = _useSearchSelectInjec.onValidate,
|
1927
|
+
valueSplitCode = _useSearchSelectInjec.valueSplitCode;
|
1928
|
+
|
1929
|
+
(0,external_vue_namespaceObject.watch)(editKey, function () {
|
1930
|
+
if (props.mode === SearchInputMode.DEFAULT && editKey.value) {
|
1931
|
+
showPopover.value = false;
|
1932
|
+
}
|
1933
|
+
}); // effects
|
1934
|
+
|
1935
|
+
(0,external_vue_namespaceObject.watchEffect)(function () {
|
1936
|
+
if (!keyword.value) {
|
1937
|
+
setInputText();
|
1938
|
+
}
|
1939
|
+
}, {
|
1940
|
+
flush: 'pre'
|
1941
|
+
});
|
1942
|
+
(0,external_vue_namespaceObject.watch)([menuList, showPopover], function () {
|
1943
|
+
var _a;
|
1944
|
+
|
1945
|
+
if (((_a = menuList.value) === null || _a === void 0 ? void 0 : _a.some(function (item) {
|
1946
|
+
return !item.disabled;
|
1947
|
+
})) && showPopover.value) {
|
1948
|
+
if (!isBindEvent) {
|
1949
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY) {
|
1950
|
+
menuHoverId.value = menuList.value.find(function (item) {
|
1951
|
+
return !item.disabled;
|
1952
|
+
}).id;
|
1953
|
+
} else {
|
1954
|
+
menuHoverId.value = '';
|
1955
|
+
}
|
1956
|
+
|
1957
|
+
isBindEvent = true;
|
1958
|
+
document.addEventListener('keydown', handleDocumentKeydown);
|
1959
|
+
}
|
1960
|
+
} else {
|
1961
|
+
document.removeEventListener('keydown', handleDocumentKeydown);
|
1962
|
+
isBindEvent = false;
|
1963
|
+
|
1964
|
+
if (props.valueBehavior !== ValueBehavior.NEEDKEY) {
|
1965
|
+
menuHoverId.value = '';
|
1966
|
+
}
|
1967
|
+
}
|
1968
|
+
}); // events
|
1969
|
+
|
1970
|
+
function handleDocumentKeydown(e) {
|
1971
|
+
switch (e.code) {
|
1972
|
+
case 'ArrowDown':
|
1973
|
+
case 'ArrowUp':
|
1974
|
+
documentArrowEvent(e);
|
1975
|
+
break;
|
1976
|
+
|
1977
|
+
case 'Enter':
|
1978
|
+
case 'NumpadEnter':
|
1979
|
+
documentEnterEvent(e);
|
1980
|
+
break;
|
1981
|
+
}
|
1982
|
+
}
|
1983
|
+
|
1984
|
+
function documentArrowEvent(e) {
|
1985
|
+
var _a;
|
1986
|
+
|
1987
|
+
e.preventDefault();
|
1988
|
+
(_a = inputRef.value) === null || _a === void 0 ? void 0 : _a.blur();
|
1989
|
+
var len = menuList.value.length;
|
1990
|
+
var i = len;
|
1991
|
+
var index = menuList.value.findIndex(function (set) {
|
1992
|
+
return set.id === menuHoverId.value;
|
1993
|
+
});
|
1994
|
+
|
1995
|
+
while (i >= 0) {
|
1996
|
+
index = e.code === 'ArrowDown' ? index + 1 : index - 1; // eslint-disable-next-line no-nested-ternary
|
1997
|
+
|
1998
|
+
index = index > len - 1 ? 0 : index < 0 ? len - 1 : index;
|
1999
|
+
var item = menuList.value[index];
|
2000
|
+
|
2001
|
+
if (item && !item.disabled) {
|
2002
|
+
i = -1;
|
2003
|
+
var dom = document.getElementById(item.id);
|
2004
|
+
dom === null || dom === void 0 ? void 0 : dom.focus();
|
2005
|
+
menuHoverId.value = item.id;
|
2006
|
+
return;
|
2007
|
+
}
|
2008
|
+
|
2009
|
+
i -= 1;
|
2010
|
+
}
|
2011
|
+
}
|
2012
|
+
|
2013
|
+
function documentEnterEvent(e) {
|
2014
|
+
if (isBindEvent) {
|
2015
|
+
e.preventDefault();
|
2016
|
+
var item = menuList.value.find(function (item) {
|
2017
|
+
return item.id === menuHoverId.value;
|
2018
|
+
});
|
2019
|
+
item && handleSelectItem(item);
|
2020
|
+
}
|
2021
|
+
}
|
2022
|
+
|
2023
|
+
function handleClickOutside(e) {
|
2024
|
+
var _a, _b;
|
2025
|
+
|
2026
|
+
if (!((_a = popoverRef.value) === null || _a === void 0 ? void 0 : _a.contains(e.target)) && ((_b = props.clickOutside) === null || _b === void 0 ? void 0 : _b.call(props, e.target, popoverRef.value))) {
|
2027
|
+
showPopover.value = false;
|
2028
|
+
isFocus.value = false;
|
2029
|
+
emit('focus', isFocus.value);
|
2030
|
+
}
|
2031
|
+
}
|
2032
|
+
|
2033
|
+
function handleInputFocus(e) {
|
2034
|
+
setInputFocus();
|
2035
|
+
e && setMenuList();
|
2036
|
+
}
|
2037
|
+
|
2038
|
+
function handleInputChange(event) {
|
2039
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
2040
|
+
|
2041
|
+
clearInput();
|
2042
|
+
var text = event.target.innerText;
|
2043
|
+
|
2044
|
+
if (/(\r|\n)/gm.test(text) || /\s{2}/gm.test(text)) {
|
2045
|
+
event.preventDefault();
|
2046
|
+
text = text.replace(/(\r|\n)/gm, valueSplitCode.value).replace(/\s{2}/gm, '');
|
2047
|
+
inputRef.value.innerText = text;
|
2048
|
+
setInputFocus();
|
2049
|
+
keyword.value = text.replace(((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.keyInnerText) || '', '').trim();
|
2050
|
+
debounceSetMenuList();
|
2051
|
+
} else if (!keyword.value && text.length < (((_c = (_b = usingItem.value) === null || _b === void 0 ? void 0 : _b.inputInnerText) === null || _c === void 0 ? void 0 : _c.length) || 1)) {
|
2052
|
+
var outerText = text.replace("\xA0", " ").replace(((_d = usingItem.value) === null || _d === void 0 ? void 0 : _d.keyInnerText.replace("\xA0", " ").trim()) || '', '').trim();
|
2053
|
+
|
2054
|
+
if (outerText || !(text === null || text === void 0 ? void 0 : text.length)) {
|
2055
|
+
usingItem.value = null;
|
2056
|
+
}
|
2057
|
+
|
2058
|
+
keyword.value = outerText ? text : '';
|
2059
|
+
debounceSetMenuList();
|
2060
|
+
} else if (!((_f = (_e = usingItem.value) === null || _e === void 0 ? void 0 : _e.values) === null || _f === void 0 ? void 0 : _f.length)) {
|
2061
|
+
keyword.value = text.replace("\xA0", " ").replace(((_g = usingItem.value) === null || _g === void 0 ? void 0 : _g.keyInnerText.replace("\xA0", " ")) || '', '').trim();
|
2062
|
+
setInputFocus();
|
2063
|
+
debounceSetMenuList();
|
2064
|
+
}
|
2065
|
+
}
|
2066
|
+
|
2067
|
+
function handleInputKeyup(event) {
|
2068
|
+
switch (event.code) {
|
2069
|
+
case 'Enter':
|
2070
|
+
case 'NumpadEnter':
|
2071
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY && menuList.value.some(function (item) {
|
2072
|
+
return item.id === menuHoverId.value;
|
2073
|
+
})) return;
|
2074
|
+
handleKeyEnter(event);
|
2075
|
+
break;
|
2076
|
+
|
2077
|
+
case 'Backspace':
|
2078
|
+
handleKeyBackspace();
|
2079
|
+
|
2080
|
+
default:
|
2081
|
+
showNoSelectValueError.value = false;
|
2082
|
+
break;
|
2083
|
+
}
|
2084
|
+
}
|
2085
|
+
|
2086
|
+
function handleKeyEnter(event) {
|
2087
|
+
var _a;
|
2088
|
+
|
2089
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee() {
|
2090
|
+
var value, _res, values, valueList, _res2, _value, _res3, res;
|
2091
|
+
|
2092
|
+
return regenerator_default().wrap(function _callee$(_context) {
|
2093
|
+
while (1) {
|
2094
|
+
switch (_context.prev = _context.next) {
|
2095
|
+
case 0:
|
2096
|
+
event === null || event === void 0 ? void 0 : event.preventDefault(); // resolve 中文输入时直接按下enter的错误表现
|
2097
|
+
|
2098
|
+
_context.next = 3;
|
2099
|
+
return new Promise(function (r) {
|
2100
|
+
return setTimeout(r, 0);
|
2101
|
+
});
|
2102
|
+
|
2103
|
+
case 3:
|
2104
|
+
if (usingItem.value) {
|
2105
|
+
_context.next = 16;
|
2106
|
+
break;
|
2107
|
+
}
|
2108
|
+
|
2109
|
+
if (!(!keyword.value || props.valueBehavior === ValueBehavior.NEEDKEY)) {
|
2110
|
+
_context.next = 6;
|
2111
|
+
break;
|
2112
|
+
}
|
2113
|
+
|
2114
|
+
return _context.abrupt("return");
|
2115
|
+
|
2116
|
+
case 6:
|
2117
|
+
value = {
|
2118
|
+
id: keyword.value,
|
2119
|
+
name: keyword.value
|
2120
|
+
};
|
2121
|
+
_context.next = 9;
|
2122
|
+
return validateUsingItemValues(value);
|
2123
|
+
|
2124
|
+
case 9:
|
2125
|
+
_res = _context.sent;
|
2126
|
+
|
2127
|
+
if (_res) {
|
2128
|
+
_context.next = 12;
|
2129
|
+
break;
|
2130
|
+
}
|
2131
|
+
|
2132
|
+
return _context.abrupt("return");
|
2133
|
+
|
2134
|
+
case 12:
|
2135
|
+
emit('add', new SelectedItem(value, 'text', valueSplitCode.value));
|
2136
|
+
keyword.value = '';
|
2137
|
+
setMenuList();
|
2138
|
+
return _context.abrupt("return");
|
2139
|
+
|
2140
|
+
case 16:
|
2141
|
+
values = usingItem.value.values;
|
2142
|
+
|
2143
|
+
if (values === null || values === void 0 ? void 0 : values.length) {
|
2144
|
+
_context.next = 43;
|
2145
|
+
break;
|
2146
|
+
}
|
2147
|
+
|
2148
|
+
if (!((_a = keyword.value) === null || _a === void 0 ? void 0 : _a.length)) {
|
2149
|
+
_context.next = 41;
|
2150
|
+
break;
|
2151
|
+
}
|
2152
|
+
|
2153
|
+
if (!keyword.value.includes(valueSplitCode.value)) {
|
2154
|
+
_context.next = 29;
|
2155
|
+
break;
|
2156
|
+
}
|
2157
|
+
|
2158
|
+
valueList = keyword.value.split(valueSplitCode.value);
|
2159
|
+
_context.next = 23;
|
2160
|
+
return validateUsingItemValues({
|
2161
|
+
id: keyword.value,
|
2162
|
+
name: keyword.value
|
2163
|
+
});
|
2164
|
+
|
2165
|
+
case 23:
|
2166
|
+
_res2 = _context.sent;
|
2167
|
+
|
2168
|
+
if (_res2) {
|
2169
|
+
_context.next = 26;
|
2170
|
+
break;
|
2171
|
+
}
|
2172
|
+
|
2173
|
+
return _context.abrupt("return");
|
2174
|
+
|
2175
|
+
case 26:
|
2176
|
+
valueList.forEach(function (v) {
|
2177
|
+
return usingItem.value.addValue({
|
2178
|
+
id: v,
|
2179
|
+
name: v
|
2180
|
+
});
|
2181
|
+
});
|
2182
|
+
_context.next = 36;
|
2183
|
+
break;
|
2184
|
+
|
2185
|
+
case 29:
|
2186
|
+
_value = {
|
2187
|
+
id: keyword.value,
|
2188
|
+
name: keyword.value
|
2189
|
+
};
|
2190
|
+
_context.next = 32;
|
2191
|
+
return validateUsingItemValues(_value);
|
2192
|
+
|
2193
|
+
case 32:
|
2194
|
+
_res3 = _context.sent;
|
2195
|
+
|
2196
|
+
if (_res3) {
|
2197
|
+
_context.next = 35;
|
2198
|
+
break;
|
2199
|
+
}
|
2200
|
+
|
2201
|
+
return _context.abrupt("return");
|
2202
|
+
|
2203
|
+
case 35:
|
2204
|
+
usingItem.value.addValue(_value);
|
2205
|
+
|
2206
|
+
case 36:
|
2207
|
+
emit('add', usingItem.value);
|
2208
|
+
keyword.value = '';
|
2209
|
+
usingItem.value = null;
|
2210
|
+
setInputFocus(true);
|
2211
|
+
return _context.abrupt("return");
|
2212
|
+
|
2213
|
+
case 41:
|
2214
|
+
showNoSelectValueError.value = true;
|
2215
|
+
return _context.abrupt("return");
|
2216
|
+
|
2217
|
+
case 43:
|
2218
|
+
_context.next = 45;
|
2219
|
+
return validateUsingItemValues();
|
2220
|
+
|
2221
|
+
case 45:
|
2222
|
+
res = _context.sent;
|
2223
|
+
|
2224
|
+
if (res) {
|
2225
|
+
_context.next = 48;
|
2226
|
+
break;
|
2227
|
+
}
|
2228
|
+
|
2229
|
+
return _context.abrupt("return");
|
2230
|
+
|
2231
|
+
case 48:
|
2232
|
+
setSelectedItem();
|
2233
|
+
|
2234
|
+
case 49:
|
2235
|
+
case "end":
|
2236
|
+
return _context.stop();
|
2237
|
+
}
|
2238
|
+
}
|
2239
|
+
}, _callee);
|
2240
|
+
}));
|
2241
|
+
}
|
2242
|
+
|
2243
|
+
function handleKeyBackspace() {
|
2244
|
+
var _a, _b; // 删除已选择项
|
2245
|
+
|
2246
|
+
|
2247
|
+
if (!usingItem.value && !keyword.value) {
|
2248
|
+
emit('delete'); // eslint-disable-next-line @typescript-eslint/no-misused-promises
|
2249
|
+
|
2250
|
+
(0,external_vue_namespaceObject.nextTick)(setMenuList);
|
2251
|
+
return;
|
2252
|
+
}
|
2253
|
+
|
2254
|
+
if ((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.values.length) {
|
2255
|
+
// 删除选项
|
2256
|
+
if (((_b = usingItem.value) === null || _b === void 0 ? void 0 : _b.multiple) || usingItem.value.isInValueList(usingItem.value.values[0])) {
|
2257
|
+
usingItem.value.values.splice(-1, 1);
|
2258
|
+
keyword.value = '';
|
2259
|
+
setInputFocus();
|
2260
|
+
return;
|
2261
|
+
}
|
2262
|
+
} else if (!keyword.value) {
|
2263
|
+
usingItem.value = null;
|
2264
|
+
keyword.value = '';
|
2265
|
+
setMenuList();
|
2266
|
+
}
|
2267
|
+
|
2268
|
+
onValidate('');
|
2269
|
+
}
|
2270
|
+
|
2271
|
+
function handleSelectItem(item, type) {
|
2272
|
+
var _a, _b, _c, _d;
|
2273
|
+
|
2274
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee2() {
|
2275
|
+
var seleted, isCondition, res;
|
2276
|
+
return regenerator_default().wrap(function _callee2$(_context2) {
|
2277
|
+
while (1) {
|
2278
|
+
switch (_context2.prev = _context2.next) {
|
2279
|
+
case 0:
|
2280
|
+
if (!((_a = item.value) === null || _a === void 0 ? void 0 : _a.id)) {
|
2281
|
+
_context2.next = 8;
|
2282
|
+
break;
|
2283
|
+
}
|
2284
|
+
|
2285
|
+
if (!(props.valueBehavior === ValueBehavior.NEEDKEY && item.value || !props.validateValues)) {
|
2286
|
+
_context2.next = 8;
|
2287
|
+
break;
|
2288
|
+
}
|
2289
|
+
|
2290
|
+
seleted = new SelectedItem(Object.assign(Object.assign({}, item), {
|
2291
|
+
id: (_b = item.realId) !== null && _b !== void 0 ? _b : item.id
|
2292
|
+
}), type, valueSplitCode.value);
|
2293
|
+
seleted.addValue(item.value);
|
2294
|
+
setSelectedItem(seleted);
|
2295
|
+
|
2296
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY && menuHoverId.value) {
|
2297
|
+
setInputFocus(true);
|
2298
|
+
}
|
2299
|
+
|
2300
|
+
menuHoverId.value = '';
|
2301
|
+
return _context2.abrupt("return");
|
2302
|
+
|
2303
|
+
case 8:
|
2304
|
+
if (!(!usingItem.value || !((_c = inputRef === null || inputRef === void 0 ? void 0 : inputRef.value) === null || _c === void 0 ? void 0 : _c.innerText))) {
|
2305
|
+
_context2.next = 16;
|
2306
|
+
break;
|
2307
|
+
}
|
2308
|
+
|
2309
|
+
usingItem.value = new SelectedItem(item, type, valueSplitCode.value);
|
2310
|
+
keyword.value = '';
|
2311
|
+
isCondition = type === 'condition';
|
2312
|
+
isCondition && setSelectedItem();
|
2313
|
+
showPopover.value = isCondition || !!usingItem.value.children.length;
|
2314
|
+
setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY && !!menuHoverId.value);
|
2315
|
+
return _context2.abrupt("return");
|
2316
|
+
|
2317
|
+
case 16:
|
2318
|
+
if (!(((_d = usingItem.value) === null || _d === void 0 ? void 0 : _d.type) === 'condition')) {
|
2319
|
+
_context2.next = 20;
|
2320
|
+
break;
|
2321
|
+
}
|
2322
|
+
|
2323
|
+
usingItem.value = new SelectedItem(item, type, valueSplitCode.value);
|
2324
|
+
setSelectedItem();
|
2325
|
+
return _context2.abrupt("return");
|
2326
|
+
|
2327
|
+
case 20:
|
2328
|
+
usingItem.value.addValue(item);
|
2329
|
+
_context2.next = 23;
|
2330
|
+
return validateUsingItemValues(item);
|
2331
|
+
|
2332
|
+
case 23:
|
2333
|
+
res = _context2.sent;
|
2334
|
+
|
2335
|
+
if (res) {
|
2336
|
+
_context2.next = 26;
|
2337
|
+
break;
|
2338
|
+
}
|
2339
|
+
|
2340
|
+
return _context2.abrupt("return");
|
2341
|
+
|
2342
|
+
case 26:
|
2343
|
+
if (!usingItem.value.multiple) setSelectedItem();
|
2344
|
+
|
2345
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY && usingItem.value.multiple) {
|
2346
|
+
setInputFocus();
|
2347
|
+
}
|
2348
|
+
|
2349
|
+
case 28:
|
2350
|
+
case "end":
|
2351
|
+
return _context2.stop();
|
2352
|
+
}
|
2353
|
+
}
|
2354
|
+
}, _callee2);
|
2355
|
+
}));
|
2356
|
+
}
|
2357
|
+
|
2358
|
+
function handleSelectCondtionItem(item) {
|
2359
|
+
handleSelectItem(item, 'condition');
|
2360
|
+
}
|
2361
|
+
|
2362
|
+
function handleMenuFooterClick(item) {
|
2363
|
+
switch (item.id) {
|
2364
|
+
case 'confirm':
|
2365
|
+
handleKeyEnter();
|
2366
|
+
break;
|
2367
|
+
|
2368
|
+
case 'cancel':
|
2369
|
+
usingItem.value.values = [];
|
2370
|
+
showPopover.value = false;
|
2371
|
+
break;
|
2372
|
+
}
|
2373
|
+
} // functions
|
2374
|
+
|
2375
|
+
|
2376
|
+
function validateUsingItemValues(value) {
|
2377
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee3() {
|
2378
|
+
var _usingItem$value, searchItem, validate, values;
|
2379
|
+
|
2380
|
+
return regenerator_default().wrap(function _callee3$(_context3) {
|
2381
|
+
while (1) {
|
2382
|
+
switch (_context3.prev = _context3.next) {
|
2383
|
+
case 0:
|
2384
|
+
if (usingItem.value) {
|
2385
|
+
_context3.next = 4;
|
2386
|
+
break;
|
2387
|
+
}
|
2388
|
+
|
2389
|
+
_context3.next = 3;
|
2390
|
+
return validateValues(null, [value]);
|
2391
|
+
|
2392
|
+
case 3:
|
2393
|
+
return _context3.abrupt("return", _context3.sent);
|
2394
|
+
|
2395
|
+
case 4:
|
2396
|
+
_usingItem$value = usingItem.value, searchItem = _usingItem$value.searchItem, validate = _usingItem$value.validate, values = _usingItem$value.values;
|
2397
|
+
|
2398
|
+
if (!(validate && typeof props.validateValues === 'function')) {
|
2399
|
+
_context3.next = 9;
|
2400
|
+
break;
|
2401
|
+
}
|
2402
|
+
|
2403
|
+
_context3.next = 8;
|
2404
|
+
return validateValues(searchItem, value ? [value] : values);
|
2405
|
+
|
2406
|
+
case 8:
|
2407
|
+
return _context3.abrupt("return", _context3.sent);
|
2408
|
+
|
2409
|
+
case 9:
|
2410
|
+
onValidate('');
|
2411
|
+
return _context3.abrupt("return", true);
|
2412
|
+
|
2413
|
+
case 11:
|
2414
|
+
case "end":
|
2415
|
+
return _context3.stop();
|
2416
|
+
}
|
2417
|
+
}
|
2418
|
+
}, _callee3);
|
2419
|
+
}));
|
2420
|
+
}
|
2421
|
+
|
2422
|
+
function validateValues(searchItem, value) {
|
2423
|
+
var _a;
|
2424
|
+
|
2425
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee4() {
|
2426
|
+
var validateStr;
|
2427
|
+
return regenerator_default().wrap(function _callee4$(_context4) {
|
2428
|
+
while (1) {
|
2429
|
+
switch (_context4.prev = _context4.next) {
|
2430
|
+
case 0:
|
2431
|
+
_context4.next = 2;
|
2432
|
+
return (_a = props.validateValues) === null || _a === void 0 ? void 0 : _a.call(props, searchItem !== null && searchItem !== void 0 ? searchItem : null, value)["catch"](function () {
|
2433
|
+
return false;
|
2434
|
+
});
|
2435
|
+
|
2436
|
+
case 2:
|
2437
|
+
validateStr = _context4.sent;
|
2438
|
+
|
2439
|
+
if (!(typeof validateStr === 'string' || validateStr === false)) {
|
2440
|
+
_context4.next = 6;
|
2441
|
+
break;
|
2442
|
+
}
|
2443
|
+
|
2444
|
+
onValidate(validateStr || '校验错误');
|
2445
|
+
return _context4.abrupt("return", false);
|
2446
|
+
|
2447
|
+
case 6:
|
2448
|
+
onValidate('');
|
2449
|
+
return _context4.abrupt("return", true);
|
2450
|
+
|
2451
|
+
case 8:
|
2452
|
+
case "end":
|
2453
|
+
return _context4.stop();
|
2454
|
+
}
|
2455
|
+
}
|
2456
|
+
}, _callee4);
|
2457
|
+
}));
|
2458
|
+
}
|
2459
|
+
|
2460
|
+
function setInputFocus() {
|
2461
|
+
var refleshMenuList = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
2462
|
+
|
2463
|
+
if (refleshMenuList) {
|
2464
|
+
(0,external_vue_namespaceObject.nextTick)().then(function () {
|
2465
|
+
setMenuList();
|
2466
|
+
});
|
2467
|
+
}
|
2468
|
+
|
2469
|
+
isFocus.value = true;
|
2470
|
+
showPopover.value = true;
|
2471
|
+
showNoSelectValueError.value = false;
|
2472
|
+
var timer = setTimeout(function () {
|
2473
|
+
if (inputRef.value) {
|
2474
|
+
inputRef.value.focus(); // 光标移至最后
|
2475
|
+
|
2476
|
+
var selection = window.getSelection();
|
2477
|
+
|
2478
|
+
if (selection.focusOffset === 0) {
|
2479
|
+
selection.selectAllChildren(inputRef.value);
|
2480
|
+
selection.collapseToEnd();
|
2481
|
+
}
|
2482
|
+
}
|
2483
|
+
|
2484
|
+
window.clearTimeout(timer);
|
2485
|
+
}, 0);
|
2486
|
+
emit('focus', isFocus.value);
|
2487
|
+
}
|
2488
|
+
|
2489
|
+
function setMenuList() {
|
2490
|
+
var _a, _b, _c, _d, _e;
|
2491
|
+
|
2492
|
+
return __awaiter(this, void 0, void 0, /*#__PURE__*/regenerator_default().mark(function _callee5() {
|
2493
|
+
var list, hoverItem;
|
2494
|
+
return regenerator_default().wrap(function _callee5$(_context5) {
|
2495
|
+
while (1) {
|
2496
|
+
switch (_context5.prev = _context5.next) {
|
2497
|
+
case 0:
|
2498
|
+
list = [];
|
2499
|
+
|
2500
|
+
if (!(typeof props.getMenuList === 'function' && (typeof ((_b = (_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.searchItem) === null || _b === void 0 ? void 0 : _b.async) === 'undefined' || usingItem.value.searchItem.async === true))) {
|
2501
|
+
_context5.next = 9;
|
2502
|
+
break;
|
2503
|
+
}
|
2504
|
+
|
2505
|
+
loading.value = true;
|
2506
|
+
_context5.next = 5;
|
2507
|
+
return props.getMenuList((_c = usingItem.value) === null || _c === void 0 ? void 0 : _c.searchItem, keyword.value)["catch"](function () {
|
2508
|
+
return [];
|
2509
|
+
});
|
2510
|
+
|
2511
|
+
case 5:
|
2512
|
+
list = _context5.sent;
|
2513
|
+
loading.value = false;
|
2514
|
+
_context5.next = 10;
|
2515
|
+
break;
|
2516
|
+
|
2517
|
+
case 9:
|
2518
|
+
if (!(usingItem === null || usingItem === void 0 ? void 0 : usingItem.value)) {
|
2519
|
+
if (!((_d = keyword.value) === null || _d === void 0 ? void 0 : _d.length)) {
|
2520
|
+
list = props.data.filter(function (item) {
|
2521
|
+
return !item.isSelected;
|
2522
|
+
}).slice();
|
2523
|
+
} else props.data.filter(function (item) {
|
2524
|
+
return !item.isSelected;
|
2525
|
+
}).forEach(function (item) {
|
2526
|
+
var _a, _b;
|
2527
|
+
|
2528
|
+
var isMatched = item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
|
2529
|
+
|
2530
|
+
if (isMatched) {
|
2531
|
+
list.push(item);
|
2532
|
+
(_a = item.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {
|
2533
|
+
list.push(Object.assign(Object.assign({}, item), {
|
2534
|
+
realId: item.id,
|
2535
|
+
id: (0,external_shared_namespaceObject.random)(10),
|
2536
|
+
value: child
|
2537
|
+
}));
|
2538
|
+
});
|
2539
|
+
list.push(Object.assign(Object.assign({}, item), {
|
2540
|
+
realId: item.id,
|
2541
|
+
id: (0,external_shared_namespaceObject.random)(10),
|
2542
|
+
value: {
|
2543
|
+
id: keyword.value,
|
2544
|
+
name: keyword.value
|
2545
|
+
}
|
2546
|
+
}));
|
2547
|
+
} else {
|
2548
|
+
(_b = item.children) === null || _b === void 0 ? void 0 : _b.forEach(function (child) {
|
2549
|
+
if (child.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase())) {
|
2550
|
+
list.push(Object.assign(Object.assign({}, item), {
|
2551
|
+
realId: item.id,
|
2552
|
+
id: (0,external_shared_namespaceObject.random)(10),
|
2553
|
+
value: child
|
2554
|
+
}));
|
2555
|
+
}
|
2556
|
+
});
|
2557
|
+
list.push(Object.assign(Object.assign({}, item), {
|
2558
|
+
value: {
|
2559
|
+
id: keyword.value,
|
2560
|
+
name: keyword.value
|
2561
|
+
}
|
2562
|
+
}));
|
2563
|
+
}
|
2564
|
+
});
|
2565
|
+
} else if (usingItem.value.type === 'condition') {
|
2566
|
+
list = props.conditions;
|
2567
|
+
} else if (!((_e = usingItem.value.values) === null || _e === void 0 ? void 0 : _e.length) || usingItem.value.multiple || props.mode === SearchInputMode.EDIT) {
|
2568
|
+
list = usingItem.value.children.filter(function (item) {
|
2569
|
+
return item.name.toLocaleLowerCase().includes(keyword.value.toLocaleLowerCase());
|
2570
|
+
});
|
2571
|
+
}
|
2572
|
+
|
2573
|
+
case 10:
|
2574
|
+
menuList.value = list;
|
2575
|
+
|
2576
|
+
if (props.valueBehavior === ValueBehavior.NEEDKEY) {
|
2577
|
+
hoverItem = list.find(function (item) {
|
2578
|
+
return !item.disabled;
|
2579
|
+
});
|
2580
|
+
|
2581
|
+
if (hoverItem && (!menuHoverId.value || menuHoverId.value && !list.some(function (item) {
|
2582
|
+
return item.id === menuHoverId.value;
|
2583
|
+
}))) {
|
2584
|
+
menuHoverId.value = hoverItem.id;
|
2585
|
+
}
|
2586
|
+
}
|
2587
|
+
|
2588
|
+
case 12:
|
2589
|
+
case "end":
|
2590
|
+
return _context5.stop();
|
2591
|
+
}
|
2592
|
+
}
|
2593
|
+
}, _callee5);
|
2594
|
+
}));
|
2595
|
+
}
|
2596
|
+
|
2597
|
+
function setSelectedItem(item) {
|
2598
|
+
emit('add', item !== null && item !== void 0 ? item : usingItem.value);
|
2599
|
+
usingItem.value = null;
|
2600
|
+
keyword.value = '';
|
2601
|
+
setInputFocus(props.valueBehavior === ValueBehavior.NEEDKEY);
|
2602
|
+
}
|
2603
|
+
|
2604
|
+
function clearInput() {
|
2605
|
+
var text = inputRef.value.innerText;
|
2606
|
+
|
2607
|
+
if (text[text.length - 1] === '\n' || text[0] === '\r') {
|
2608
|
+
setInputText(text.slice(0, -1));
|
2609
|
+
clearInput();
|
2610
|
+
} else if (text[0] === '\n' || text[0] === '\r') {
|
2611
|
+
setInputText(text.slice(1));
|
2612
|
+
clearInput();
|
2613
|
+
}
|
2614
|
+
}
|
2615
|
+
|
2616
|
+
function setInputText() {
|
2617
|
+
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
2618
|
+
|
2619
|
+
var _a;
|
2620
|
+
|
2621
|
+
if (inputRef.value) {
|
2622
|
+
inputRef.value.innerHTML = text || ((_a = usingItem.value) === null || _a === void 0 ? void 0 : _a.inputInnerHtml) || '';
|
2623
|
+
}
|
2624
|
+
} // expose
|
2625
|
+
|
2626
|
+
|
2627
|
+
expose({
|
2628
|
+
handleInputFocus: handleInputFocus,
|
2629
|
+
isFocus: isFocus
|
2630
|
+
});
|
2631
|
+
return {
|
2632
|
+
popoverRef: popoverRef,
|
2633
|
+
inputRef: inputRef,
|
2634
|
+
keyword: keyword,
|
2635
|
+
loading: loading,
|
2636
|
+
remoteMenuList: remoteMenuList,
|
2637
|
+
menuList: menuList,
|
2638
|
+
menuHoverId: menuHoverId,
|
2639
|
+
isFocus: isFocus,
|
2640
|
+
usingItem: usingItem,
|
2641
|
+
showPopover: showPopover,
|
2642
|
+
showNoSelectValueError: showNoSelectValueError,
|
2643
|
+
debounceSetMenuList: debounceSetMenuList,
|
2644
|
+
documentArrowEvent: documentArrowEvent,
|
2645
|
+
handleClickOutside: handleClickOutside,
|
2646
|
+
handleInputFocus: handleInputFocus,
|
2647
|
+
handleInputChange: handleInputChange,
|
2648
|
+
handleInputKeyup: handleInputKeyup,
|
2649
|
+
handleSelectItem: handleSelectItem,
|
2650
|
+
handleSelectCondtionItem: handleSelectCondtionItem,
|
2651
|
+
handleMenuFooterClick: handleMenuFooterClick
|
2652
|
+
};
|
2653
|
+
},
|
2654
|
+
render: function render() {
|
2655
|
+
var _this = this;
|
2656
|
+
|
2657
|
+
var _a, _b;
|
2658
|
+
|
2659
|
+
var _ref2 = this.usingItem || {},
|
2660
|
+
multiple = _ref2.multiple,
|
2661
|
+
values = _ref2.values,
|
2662
|
+
placeholder = _ref2.placeholder,
|
2663
|
+
inputInnerHtml = _ref2.inputInnerHtml;
|
2664
|
+
|
2665
|
+
var showInputAfter = !((_a = this.keyword) === null || _a === void 0 ? void 0 : _a.length) && !(values === null || values === void 0 ? void 0 : values.length) && placeholder;
|
2666
|
+
var showPopover = this.loading || this.showNoSelectValueError || this.showPopover && !!((_b = this.menuList) === null || _b === void 0 ? void 0 : _b.length);
|
2667
|
+
var showCondition = !this.usingItem && this.showCondition;
|
2668
|
+
var menuSlots = Object.assign({}, this.$slots.menu ? {
|
2669
|
+
"default": function _default(data) {
|
2670
|
+
var _a, _b;
|
2671
|
+
|
2672
|
+
return (_b = (_a = _this.$slots).menu) === null || _b === void 0 ? void 0 : _b.call(_a, data);
|
2673
|
+
}
|
2674
|
+
} : {});
|
2675
|
+
|
2676
|
+
var inputContent = function inputContent() {
|
2677
|
+
var _a;
|
2678
|
+
|
2679
|
+
return (0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
2680
|
+
"ref": "inputRef",
|
2681
|
+
"class": {
|
2682
|
+
'div-input': true,
|
2683
|
+
'input-before': _this.showInputBefore && !((_a = _this.keyword) === null || _a === void 0 ? void 0 : _a.length),
|
2684
|
+
'input-after': showInputAfter
|
2685
|
+
},
|
2686
|
+
"contenteditable": true,
|
2687
|
+
"data-placeholder": !inputInnerHtml && !_this.keyword ? '请选择' : '',
|
2688
|
+
"data-tips": placeholder || '',
|
2689
|
+
"spellcheck": "false",
|
2690
|
+
"onFocus": _this.handleInputFocus,
|
2691
|
+
"onInput": _this.handleInputChange,
|
2692
|
+
"onKeydown": _this.handleInputKeyup
|
2693
|
+
}, null), [[(0,external_vue_namespaceObject.resolveDirective)("clickoutside"), _this.handleClickOutside]]);
|
2694
|
+
};
|
2695
|
+
|
2696
|
+
var popoverContent = function popoverContent() {
|
2697
|
+
var _a;
|
2698
|
+
|
2699
|
+
if (_this.loading) {
|
2700
|
+
return (0,external_vue_namespaceObject.createVNode)("div", null, [(0,external_vue_namespaceObject.createTextVNode)("\u52A0\u8F7D\u4E2D...")]);
|
2701
|
+
}
|
2702
|
+
|
2703
|
+
if (_this.showNoSelectValueError) {
|
2704
|
+
return (0,external_vue_namespaceObject.createVNode)("div", null, [(0,external_vue_namespaceObject.createTextVNode)("\u5305\u542B\u952E\u503C\u7684\u8FC7\u6EE4\u67E5\u8BE2\u5FC5\u987B\u6709\u4E00\u4E2A\u503C")]);
|
2705
|
+
}
|
2706
|
+
|
2707
|
+
return ((_a = _this.menuList) === null || _a === void 0 ? void 0 : _a.length) ? (0,external_vue_namespaceObject.createVNode)("div", {
|
2708
|
+
"ref": "popoverRef",
|
2709
|
+
"class": "bk-search-select-popover"
|
2710
|
+
}, [(0,external_vue_namespaceObject.createVNode)(menu, {
|
2711
|
+
"list": _this.menuList,
|
2712
|
+
"keyword": _this.keyword,
|
2713
|
+
"multiple": !!multiple,
|
2714
|
+
"hoverId": _this.menuHoverId,
|
2715
|
+
"selected": (values === null || values === void 0 ? void 0 : values.map(function (item) {
|
2716
|
+
return item.id;
|
2717
|
+
})) || [],
|
2718
|
+
"conditions": showCondition ? _this.conditions : [],
|
2719
|
+
"onSelectItem": _this.handleSelectItem,
|
2720
|
+
"onSelectCondition": _this.handleSelectCondtionItem,
|
2721
|
+
"onFooterClick": _this.handleMenuFooterClick
|
2722
|
+
}, Object.assign({}, menuSlots))]) : undefined;
|
2723
|
+
};
|
2724
|
+
|
2725
|
+
return (0,external_vue_namespaceObject.createVNode)(external_popover_namespaceObject["default"], {
|
2726
|
+
"trigger": 'manual',
|
2727
|
+
"theme": 'light',
|
2728
|
+
"placement": 'bottom-start',
|
2729
|
+
"arrow": false,
|
2730
|
+
"disableOutsideClick": true,
|
2731
|
+
"isShow": showPopover
|
2732
|
+
}, {
|
2733
|
+
"default": inputContent,
|
2734
|
+
content: popoverContent
|
2735
|
+
});
|
2736
|
+
}
|
2737
|
+
}));
|
2738
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/selected.tsx
|
2739
|
+
|
2740
|
+
|
2741
|
+
/*
|
2742
|
+
* Tencent is pleased to support the open source community by making
|
2743
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
2744
|
+
*
|
2745
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
2746
|
+
*
|
2747
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2748
|
+
*
|
2749
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
2750
|
+
*
|
2751
|
+
* ---------------------------------------------------
|
2752
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
2753
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
2754
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
2755
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2756
|
+
*
|
2757
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
2758
|
+
* the Software.
|
2759
|
+
*
|
2760
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
2761
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
2762
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
2763
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2764
|
+
* IN THE SOFTWARE.
|
2765
|
+
*/
|
2766
|
+
|
2767
|
+
|
2768
|
+
|
2769
|
+
|
2770
|
+
;
|
2771
|
+
/* harmony default export */ const selected = ((0,external_vue_namespaceObject.defineComponent)({
|
2772
|
+
name: 'SearchSelected',
|
2773
|
+
props: {
|
2774
|
+
data: {
|
2775
|
+
type: Array,
|
2776
|
+
required: true
|
2777
|
+
},
|
2778
|
+
selectedList: {
|
2779
|
+
type: Array,
|
2780
|
+
required: true
|
2781
|
+
},
|
2782
|
+
overflowIndex: {
|
2783
|
+
type: Number,
|
2784
|
+
"default": -1
|
2785
|
+
},
|
2786
|
+
conditions: {
|
2787
|
+
type: Array,
|
2788
|
+
"default": function _default() {
|
2789
|
+
return [];
|
2790
|
+
}
|
2791
|
+
},
|
2792
|
+
getMenuList: Function,
|
2793
|
+
validateValues: Function,
|
2794
|
+
valueBehavior: String
|
2795
|
+
},
|
2796
|
+
emits: ['delete'],
|
2797
|
+
setup: function setup(_props, _ref) {
|
2798
|
+
var emit = _ref.emit;
|
2799
|
+
var inputRef = (0,external_vue_namespaceObject.ref)(null);
|
2800
|
+
|
2801
|
+
var _useSearchSelectInjec = useSearchSelectInject(),
|
2802
|
+
onEditClick = _useSearchSelectInjec.onEditClick,
|
2803
|
+
onEditEnter = _useSearchSelectInjec.onEditEnter,
|
2804
|
+
onEditBlur = _useSearchSelectInjec.onEditBlur,
|
2805
|
+
editKey = _useSearchSelectInjec.editKey,
|
2806
|
+
valueSplitCode = _useSearchSelectInjec.valueSplitCode;
|
2807
|
+
|
2808
|
+
function handleDeleteSelected(index) {
|
2809
|
+
emit('delete', index);
|
2810
|
+
}
|
2811
|
+
|
2812
|
+
function handleEditSeleted(e, item, index) {
|
2813
|
+
e.preventDefault();
|
2814
|
+
e.stopPropagation();
|
2815
|
+
onEditClick(item, index); // magic code
|
2816
|
+
|
2817
|
+
setTimeout(function () {
|
2818
|
+
return inputRef.value.handleInputFocus();
|
2819
|
+
}, 200);
|
2820
|
+
}
|
2821
|
+
|
2822
|
+
;
|
2823
|
+
|
2824
|
+
function handleAddSelected(item, index) {
|
2825
|
+
onEditEnter(item, index);
|
2826
|
+
}
|
2827
|
+
|
2828
|
+
function handleInputFocus(isFocus) {
|
2829
|
+
if (isFocus) return;
|
2830
|
+
onEditBlur();
|
2831
|
+
}
|
2832
|
+
|
2833
|
+
function handleInputOutside() {
|
2834
|
+
return true;
|
2835
|
+
}
|
2836
|
+
|
2837
|
+
function copySeletedItem(item) {
|
2838
|
+
var newItem = new SelectedItem(item.searchItem, item.type, valueSplitCode.value);
|
2839
|
+
newItem.values = item.values.slice();
|
2840
|
+
return newItem;
|
2841
|
+
}
|
2842
|
+
|
2843
|
+
return {
|
2844
|
+
inputRef: inputRef,
|
2845
|
+
editKey: editKey,
|
2846
|
+
copySeletedItem: copySeletedItem,
|
2847
|
+
handleDeleteSelected: handleDeleteSelected,
|
2848
|
+
handleEditSeleted: handleEditSeleted,
|
2849
|
+
handleInputOutside: handleInputOutside,
|
2850
|
+
handleAddSelected: handleAddSelected,
|
2851
|
+
handleInputFocus: handleInputFocus
|
2852
|
+
};
|
2853
|
+
},
|
2854
|
+
render: function render() {
|
2855
|
+
var _this = this;
|
2856
|
+
|
2857
|
+
var contentComponent = function contentComponent(item, index) {
|
2858
|
+
return _this.editKey === "".concat(item.id, "_").concat(index) ? (0,external_vue_namespaceObject.createVNode)("div", {
|
2859
|
+
"class": "selected-input",
|
2860
|
+
"key": _this.editKey.toString()
|
2861
|
+
}, [(0,external_vue_namespaceObject.createVNode)(input, {
|
2862
|
+
"ref": "inputRef",
|
2863
|
+
"key": _this.editKey.toString(),
|
2864
|
+
"mode": SearchInputMode.EDIT,
|
2865
|
+
"data": _this.data,
|
2866
|
+
"showCondition": false,
|
2867
|
+
"conditions": _this.conditions,
|
2868
|
+
"defautUsingItem": _this.copySeletedItem(item),
|
2869
|
+
"clickOutside": _this.handleInputOutside,
|
2870
|
+
"getMenuList": _this.getMenuList,
|
2871
|
+
"validateValues": _this.validateValues,
|
2872
|
+
"valueBehavior": _this.valueBehavior,
|
2873
|
+
"onAdd": function onAdd(v) {
|
2874
|
+
return _this.handleAddSelected(v, index);
|
2875
|
+
},
|
2876
|
+
"onFocus": _this.handleInputFocus
|
2877
|
+
}, null)]) : (0,external_vue_namespaceObject.createVNode)("li", {
|
2878
|
+
"class": "search-container-selected ".concat(!(_this.overflowIndex >= 0 ? index < _this.overflowIndex : index >= 0) ? 'hidden-selected' : ''),
|
2879
|
+
"key": "".concat(item.id, "_").concat(index)
|
2880
|
+
}, [(0,external_vue_namespaceObject.createVNode)("span", {
|
2881
|
+
"class": "selected-name",
|
2882
|
+
"onClick": function onClick(e) {
|
2883
|
+
return _this.handleEditSeleted(e, item, index);
|
2884
|
+
}
|
2885
|
+
}, [item.inputInnerText]), (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
|
2886
|
+
"class": "selected-clear",
|
2887
|
+
"onClick": function onClick() {
|
2888
|
+
return _this.handleDeleteSelected(index);
|
2889
|
+
}
|
2890
|
+
}, null)]);
|
2891
|
+
};
|
2892
|
+
|
2893
|
+
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [this.selectedList.map(function (item, index) {
|
2894
|
+
return [_this.overflowIndex >= 0 && index === _this.overflowIndex && (0,external_vue_namespaceObject.createVNode)("div", {
|
2895
|
+
"class": "search-container-selected overflow-selected"
|
2896
|
+
}, [(0,external_vue_namespaceObject.createTextVNode)("+"), _this.selectedList.length - _this.overflowIndex]), contentComponent(item, index)];
|
2897
|
+
})]);
|
2898
|
+
}
|
2899
|
+
}));
|
2900
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/search-select.tsx
|
2901
|
+
|
2902
|
+
|
2903
|
+
/*
|
2904
|
+
* Tencent is pleased to support the open source community by making
|
2905
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
2906
|
+
*
|
2907
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
2908
|
+
*
|
2909
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
2910
|
+
*
|
2911
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
2912
|
+
*
|
2913
|
+
* ---------------------------------------------------
|
2914
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
2915
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
2916
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
2917
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
2918
|
+
*
|
2919
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
2920
|
+
* the Software.
|
2921
|
+
*
|
2922
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
2923
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
2924
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
2925
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
2926
|
+
* IN THE SOFTWARE.
|
2927
|
+
*/
|
2928
|
+
|
2929
|
+
|
2930
|
+
|
2931
|
+
|
2932
|
+
|
2933
|
+
|
2934
|
+
|
2935
|
+
|
2936
|
+
var INPUT_PADDING_WIDTH = 40;
|
2937
|
+
var SELETED_MARGING_RIGHT = 6;
|
2938
|
+
var SearchSelectProps = {
|
2939
|
+
data: {
|
2940
|
+
type: Array,
|
2941
|
+
"default": function _default() {
|
2942
|
+
return [];
|
2943
|
+
}
|
2944
|
+
},
|
2945
|
+
modelValue: {
|
2946
|
+
type: Array,
|
2947
|
+
"default": function _default() {
|
2948
|
+
return [];
|
2949
|
+
}
|
2950
|
+
},
|
2951
|
+
shrink: {
|
2952
|
+
type: Boolean,
|
2953
|
+
"default": true
|
2954
|
+
},
|
2955
|
+
maxHeight: {
|
2956
|
+
type: Number,
|
2957
|
+
"default": 120
|
2958
|
+
},
|
2959
|
+
minHeight: {
|
2960
|
+
type: Number,
|
2961
|
+
"default": 26
|
2962
|
+
},
|
2963
|
+
conditions: {
|
2964
|
+
type: Array,
|
2965
|
+
"default": function _default() {
|
2966
|
+
return [{
|
2967
|
+
id: 'or',
|
2968
|
+
name: '或'
|
2969
|
+
}, {
|
2970
|
+
id: 'and',
|
2971
|
+
name: '且'
|
2972
|
+
}];
|
2973
|
+
}
|
2974
|
+
},
|
2975
|
+
clearable: {
|
2976
|
+
type: Boolean,
|
2977
|
+
"default": true
|
2978
|
+
},
|
2979
|
+
getMenuList: Function,
|
2980
|
+
validateValues: Function,
|
2981
|
+
valueSplitCode: {
|
2982
|
+
type: String,
|
2983
|
+
"default": '|'
|
2984
|
+
},
|
2985
|
+
uniqueSelect: {
|
2986
|
+
type: Boolean,
|
2987
|
+
"default": false
|
2988
|
+
},
|
2989
|
+
valueBehavior: {
|
2990
|
+
type: String,
|
2991
|
+
"default": ValueBehavior.ALL,
|
2992
|
+
validator: function validator(v) {
|
2993
|
+
return [ValueBehavior.ALL, ValueBehavior.NEEDKEY].includes(v);
|
2994
|
+
}
|
2995
|
+
}
|
2996
|
+
};
|
2997
|
+
/* harmony default export */ const search_select = ((0,external_vue_namespaceObject.defineComponent)({
|
2998
|
+
name: 'SearchSelect',
|
2999
|
+
directives: {
|
3000
|
+
clickoutside: external_directives_namespaceObject.clickoutside
|
3001
|
+
},
|
3002
|
+
props: SearchSelectProps,
|
3003
|
+
emits: ['update:modelValue'],
|
3004
|
+
setup: function setup(props, _ref) {
|
3005
|
+
var emit = _ref.emit;
|
3006
|
+
// refs
|
3007
|
+
var inputRef = (0,external_vue_namespaceObject.ref)(null);
|
3008
|
+
var wrapRef = (0,external_vue_namespaceObject.ref)(null); // vars
|
3009
|
+
|
3010
|
+
var isFocus = (0,external_vue_namespaceObject.ref)(false);
|
3011
|
+
var selectedList = (0,external_vue_namespaceObject.ref)([]);
|
3012
|
+
var overflowIndex = (0,external_vue_namespaceObject.ref)(-1);
|
3013
|
+
var debounceResize = (0,external_shared_namespaceObject.debounce)(32, handleResize);
|
3014
|
+
var editKey = (0,external_vue_namespaceObject.ref)('');
|
3015
|
+
var validateStr = (0,external_vue_namespaceObject.ref)('');
|
3016
|
+
var splitCode = (0,external_vue_namespaceObject.computed)(function () {
|
3017
|
+
return props.valueSplitCode;
|
3018
|
+
});
|
3019
|
+
var copyData = (0,external_vue_namespaceObject.shallowRef)([]);
|
3020
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
3021
|
+
return props.data;
|
3022
|
+
}, function () {
|
3023
|
+
var _a;
|
3024
|
+
|
3025
|
+
copyData.value = JSON.parse(JSON.stringify(props.data));
|
3026
|
+
(_a = copyData.value) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
|
3027
|
+
item.isSelected = props.uniqueSelect && !!props.modelValue.some(function (set) {
|
3028
|
+
return set.id === item.id;
|
3029
|
+
});
|
3030
|
+
});
|
3031
|
+
}, {
|
3032
|
+
immediate: true
|
3033
|
+
}); // effects
|
3034
|
+
|
3035
|
+
(0,external_vue_namespaceObject.watch)(function () {
|
3036
|
+
return props.modelValue;
|
3037
|
+
}, function (v) {
|
3038
|
+
var _a, _b;
|
3039
|
+
|
3040
|
+
if (!(v === null || v === void 0 ? void 0 : v.length)) {
|
3041
|
+
selectedList.value = [];
|
3042
|
+
(_a = copyData.value) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {
|
3043
|
+
item.isSelected = false;
|
3044
|
+
});
|
3045
|
+
return;
|
3046
|
+
}
|
3047
|
+
|
3048
|
+
var list = [];
|
3049
|
+
v.forEach(function (item) {
|
3050
|
+
var _a;
|
3051
|
+
|
3052
|
+
var seleted = selectedList.value.find(function (set) {
|
3053
|
+
return set.id === item.id && set.name === item.name;
|
3054
|
+
});
|
3055
|
+
|
3056
|
+
if ((seleted === null || seleted === void 0 ? void 0 : seleted.toValueKey()) === JSON.stringify(item)) {
|
3057
|
+
seleted.values = item.values || [];
|
3058
|
+
list.push(seleted);
|
3059
|
+
} else {
|
3060
|
+
var searchItem = props.data.find(function (set) {
|
3061
|
+
return set.id === item.id;
|
3062
|
+
});
|
3063
|
+
var searchType = 'default';
|
3064
|
+
|
3065
|
+
if (!searchItem) {
|
3066
|
+
searchItem = props.conditions.find(function (set) {
|
3067
|
+
return set.id === item.id;
|
3068
|
+
});
|
3069
|
+
searchItem && (searchType = 'condition');
|
3070
|
+
}
|
3071
|
+
|
3072
|
+
if (!searchItem && !((_a = item.values) === null || _a === void 0 ? void 0 : _a.length)) {
|
3073
|
+
searchType = 'text';
|
3074
|
+
}
|
3075
|
+
|
3076
|
+
var newSelected = new SelectedItem(searchItem || item, searchType, splitCode.value);
|
3077
|
+
newSelected.values = item.values || [];
|
3078
|
+
list.push(newSelected);
|
3079
|
+
}
|
3080
|
+
});
|
3081
|
+
selectedList.value = list;
|
3082
|
+
(_b = copyData.value) === null || _b === void 0 ? void 0 : _b.forEach(function (item) {
|
3083
|
+
item.isSelected = props.uniqueSelect && !!list.some(function (set) {
|
3084
|
+
return set.id === item.id;
|
3085
|
+
});
|
3086
|
+
});
|
3087
|
+
}, {
|
3088
|
+
immediate: true,
|
3089
|
+
deep: true
|
3090
|
+
}); // life hooks
|
3091
|
+
|
3092
|
+
(0,external_vue_namespaceObject.onMounted)(function () {
|
3093
|
+
addListener(wrapRef.value.querySelector('.bk-search-select-container'), debounceResize);
|
3094
|
+
});
|
3095
|
+
(0,external_vue_namespaceObject.onBeforeUnmount)(function () {
|
3096
|
+
removeListener(wrapRef.value.querySelector('.bk-search-select-container'), debounceResize);
|
3097
|
+
}); // edit item
|
3098
|
+
|
3099
|
+
useSearchSelectProvider({
|
3100
|
+
onEditClick: onEditClick,
|
3101
|
+
onEditEnter: onEditEnter,
|
3102
|
+
onEditBlur: onEditBlur,
|
3103
|
+
onValidate: onValidate,
|
3104
|
+
editKey: editKey,
|
3105
|
+
valueSplitCode: splitCode
|
3106
|
+
});
|
3107
|
+
|
3108
|
+
function onEditClick(item, index) {
|
3109
|
+
editKey.value = "".concat(item.id, "_").concat(index);
|
3110
|
+
}
|
3111
|
+
|
3112
|
+
function onEditEnter(item, index) {
|
3113
|
+
var list = selectedList.value.slice();
|
3114
|
+
list.splice(index, 1, item);
|
3115
|
+
emit('update:modelValue', list.map(function (item) {
|
3116
|
+
return item.toValue();
|
3117
|
+
}));
|
3118
|
+
editKey.value = '';
|
3119
|
+
}
|
3120
|
+
|
3121
|
+
function onEditBlur() {
|
3122
|
+
editKey.value = '';
|
3123
|
+
onValidate('');
|
3124
|
+
}
|
3125
|
+
|
3126
|
+
function onValidate(str) {
|
3127
|
+
validateStr.value = str || '';
|
3128
|
+
} // events
|
3129
|
+
|
3130
|
+
|
3131
|
+
function handleResize() {
|
3132
|
+
if (isFocus.value || selectedList.value.length < 1) {
|
3133
|
+
overflowIndex.value = -1;
|
3134
|
+
return;
|
3135
|
+
}
|
3136
|
+
|
3137
|
+
var inputEl = wrapRef.value.querySelector('.bk-search-select-container');
|
3138
|
+
var maxWidth = wrapRef.value.querySelector('.search-container').clientWidth - SELETED_MARGING_RIGHT - 2;
|
3139
|
+
var tagList = inputEl.querySelectorAll('.search-container-selected:not(.overflow-selected)');
|
3140
|
+
var width = 0;
|
3141
|
+
var index = 0;
|
3142
|
+
var i = 0;
|
3143
|
+
|
3144
|
+
while (index === 0 && width <= maxWidth - INPUT_PADDING_WIDTH && i <= tagList.length - 1) {
|
3145
|
+
var el = tagList[i];
|
3146
|
+
|
3147
|
+
if (el.clientHeight > props.minHeight) {
|
3148
|
+
overflowIndex.value = i;
|
3149
|
+
return;
|
3150
|
+
}
|
3151
|
+
|
3152
|
+
width += el ? el.clientWidth + SELETED_MARGING_RIGHT : 0;
|
3153
|
+
|
3154
|
+
if (width >= maxWidth - INPUT_PADDING_WIDTH) {
|
3155
|
+
index = i;
|
3156
|
+
}
|
3157
|
+
|
3158
|
+
;
|
3159
|
+
i += 1;
|
3160
|
+
}
|
3161
|
+
|
3162
|
+
if (index === tagList.length - 1 && width <= maxWidth) {
|
3163
|
+
overflowIndex.value = -1;
|
3164
|
+
return;
|
3165
|
+
}
|
3166
|
+
|
3167
|
+
overflowIndex.value = width >= maxWidth - INPUT_PADDING_WIDTH ? index : index - 1;
|
3168
|
+
}
|
3169
|
+
|
3170
|
+
function handleWrapClick() {
|
3171
|
+
if (!editKey.value) {
|
3172
|
+
inputRef.value.handleInputFocus();
|
3173
|
+
}
|
3174
|
+
}
|
3175
|
+
|
3176
|
+
function handleClearAll() {
|
3177
|
+
selectedList.value = [];
|
3178
|
+
overflowIndex.value = -1;
|
3179
|
+
emit('update:modelValue', []);
|
3180
|
+
}
|
3181
|
+
|
3182
|
+
function handleInputOutside(target) {
|
3183
|
+
var _a;
|
3184
|
+
|
3185
|
+
return !((_a = wrapRef.value) === null || _a === void 0 ? void 0 : _a.contains(target));
|
3186
|
+
}
|
3187
|
+
|
3188
|
+
function handleAddSelected(item) {
|
3189
|
+
var list = selectedList.value.slice();
|
3190
|
+
list.push(item);
|
3191
|
+
onValidate('');
|
3192
|
+
emit('update:modelValue', list.map(function (item) {
|
3193
|
+
return item.toValue();
|
3194
|
+
}));
|
3195
|
+
}
|
3196
|
+
|
3197
|
+
function handleDeleteSelected(index) {
|
3198
|
+
var list = selectedList.value.slice();
|
3199
|
+
list.splice(typeof index === 'number' ? index : selectedList.value.length - 1, 1);
|
3200
|
+
onValidate('');
|
3201
|
+
emit('update:modelValue', list.map(function (item) {
|
3202
|
+
return item.toValue();
|
3203
|
+
}));
|
3204
|
+
}
|
3205
|
+
|
3206
|
+
function handleInputFocus(v) {
|
3207
|
+
v && (overflowIndex.value = -1);
|
3208
|
+
isFocus.value = v;
|
3209
|
+
}
|
3210
|
+
|
3211
|
+
return {
|
3212
|
+
inputRef: inputRef,
|
3213
|
+
wrapRef: wrapRef,
|
3214
|
+
isFocus: isFocus,
|
3215
|
+
copyData: copyData,
|
3216
|
+
selectedList: selectedList,
|
3217
|
+
overflowIndex: overflowIndex,
|
3218
|
+
validateStr: validateStr,
|
3219
|
+
splitCode: splitCode,
|
3220
|
+
onEditClick: onEditClick,
|
3221
|
+
onEditEnter: onEditEnter,
|
3222
|
+
handleWrapClick: handleWrapClick,
|
3223
|
+
handleInputFocus: handleInputFocus,
|
3224
|
+
handleResize: handleResize,
|
3225
|
+
handleClearAll: handleClearAll,
|
3226
|
+
handleInputOutside: handleInputOutside,
|
3227
|
+
handleAddSelected: handleAddSelected,
|
3228
|
+
handleDeleteSelected: handleDeleteSelected
|
3229
|
+
};
|
3230
|
+
},
|
3231
|
+
render: function render() {
|
3232
|
+
var _this = this;
|
3233
|
+
|
3234
|
+
var _a, _b; // vars
|
3235
|
+
|
3236
|
+
|
3237
|
+
var maxHeight = "".concat(!this.shrink || this.isFocus ? this.maxHeight : this.minHeight, "px");
|
3238
|
+
var showCondition = !!this.selectedList.length && this.selectedList.slice(-1)[0].type !== 'condition';
|
3239
|
+
var menuSlots = Object.assign({}, this.$slots.menu ? {
|
3240
|
+
menu: function menu(data) {
|
3241
|
+
var _a, _b;
|
3242
|
+
|
3243
|
+
return (_b = (_a = _this.$slots).menu) === null || _b === void 0 ? void 0 : _b.call(_a, data);
|
3244
|
+
}
|
3245
|
+
} : {}); // render
|
3246
|
+
|
3247
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
3248
|
+
"class": "bk-search-select",
|
3249
|
+
"ref": "wrapRef"
|
3250
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
3251
|
+
"class": {
|
3252
|
+
'bk-search-select-container': true,
|
3253
|
+
'is-focus': this.isFocus
|
3254
|
+
},
|
3255
|
+
"onClick": this.handleWrapClick
|
3256
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
3257
|
+
"class": "search-prefix"
|
3258
|
+
}, [(_b = (_a = this.$slots).prepend) === null || _b === void 0 ? void 0 : _b.call(_a)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
3259
|
+
"class": "search-container",
|
3260
|
+
"style": {
|
3261
|
+
maxHeight: maxHeight
|
3262
|
+
}
|
3263
|
+
}, [(0,external_vue_namespaceObject.createVNode)(selected, {
|
3264
|
+
"data": this.copyData,
|
3265
|
+
"conditions": this.conditions,
|
3266
|
+
"selectedList": this.selectedList,
|
3267
|
+
"overflowIndex": this.overflowIndex,
|
3268
|
+
"getMenuList": this.getMenuList,
|
3269
|
+
"validateValues": this.validateValues,
|
3270
|
+
"valueBehavior": this.valueBehavior,
|
3271
|
+
"onDelete": this.handleDeleteSelected
|
3272
|
+
}, Object.assign({}, menuSlots)), (0,external_vue_namespaceObject.createVNode)("div", {
|
3273
|
+
"class": "search-container-input"
|
3274
|
+
}, [(0,external_vue_namespaceObject.createVNode)(input, {
|
3275
|
+
"ref": "inputRef",
|
3276
|
+
"data": this.copyData,
|
3277
|
+
"showInputBefore": !this.selectedList.length,
|
3278
|
+
"showCondition": showCondition,
|
3279
|
+
"conditions": this.conditions,
|
3280
|
+
"clickOutside": this.handleInputOutside,
|
3281
|
+
"getMenuList": this.getMenuList,
|
3282
|
+
"validateValues": this.validateValues,
|
3283
|
+
"valueBehavior": this.valueBehavior,
|
3284
|
+
"onAdd": this.handleAddSelected,
|
3285
|
+
"onDelete": this.handleDeleteSelected,
|
3286
|
+
"onFocus": this.handleInputFocus
|
3287
|
+
}, Object.assign({}, menuSlots))])]), (0,external_vue_namespaceObject.createVNode)("div", {
|
3288
|
+
"class": "search-nextfix"
|
3289
|
+
}, [this.clearable && !!this.selectedList.length && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, {
|
3290
|
+
"class": "search-clear",
|
3291
|
+
"onClick": this.handleClearAll
|
3292
|
+
}, null), this.$slots.append ? this.$slots.append() : (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Search, {
|
3293
|
+
"class": "search-nextfix-icon ".concat(this.isFocus ? 'is-focus' : '')
|
3294
|
+
}, null)])]), !!this.validateStr.length && (0,external_vue_namespaceObject.createVNode)("div", {
|
3295
|
+
"class": "bk-search-select-tips"
|
3296
|
+
}, [this.$slots.validate ? this.$slots.validate() : (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.ExclamationCircleShape, {
|
3297
|
+
"class": "select-tips"
|
3298
|
+
}, null), this.validateStr || ''])])]);
|
3299
|
+
}
|
3300
|
+
}));
|
3301
|
+
;// CONCATENATED MODULE: ../../packages/search-select/src/index.ts
|
3302
|
+
/*
|
3303
|
+
* Tencent is pleased to support the open source community by making
|
3304
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
3305
|
+
*
|
3306
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
3307
|
+
*
|
3308
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
3309
|
+
*
|
3310
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
3311
|
+
*
|
3312
|
+
* ---------------------------------------------------
|
3313
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
3314
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
3315
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
3316
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
3317
|
+
*
|
3318
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
3319
|
+
* the Software.
|
3320
|
+
*
|
3321
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
3322
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
3323
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
3324
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
3325
|
+
* IN THE SOFTWARE.
|
3326
|
+
*/
|
3327
|
+
|
3328
|
+
|
3329
|
+
var BkSearchSelect = (0,external_shared_namespaceObject.withInstall)(search_select);
|
3330
|
+
/* harmony default export */ const src = (BkSearchSelect);
|
3331
|
+
|
3332
|
+
})();
|
3333
|
+
|
3334
|
+
var __webpack_exports__BkSearchSelect = __webpack_exports__.r;
|
3335
|
+
var __webpack_exports__default = __webpack_exports__.Z;
|
3336
|
+
export { __webpack_exports__BkSearchSelect as BkSearchSelect, __webpack_exports__default as default };
|