bkui-vue 0.0.2-table-refactor.8 → 0.0.3-beta.1
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/dist/index.cjs.js +135 -161
- package/dist/index.esm.js +17059 -19431
- package/dist/index.umd.js +135 -161
- package/dist/locale/en.esm.js +1 -1
- package/dist/locale/en.esm.js.map +1 -1
- package/dist/locale/en.umd.js +1 -1
- package/dist/locale/en.umd.js.map +1 -1
- package/dist/locale/zh-cn.esm.js +1 -1
- package/dist/locale/zh-cn.esm.js.map +1 -1
- package/dist/locale/zh-cn.umd.js +1 -1
- package/dist/locale/zh-cn.umd.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/style.variable.css +1 -1
- package/lib/affix/affix.variable.css +6 -2
- package/lib/affix/index.js +321 -1
- package/lib/alert/alert.variable.css +6 -2
- package/lib/alert/index.js +214 -1
- package/lib/animate-number/index.js +155 -1
- package/lib/backtop/backtop.variable.css +6 -2
- package/lib/backtop/index.js +188 -1
- package/lib/badge/badge.css +8 -2
- package/lib/badge/badge.less +8 -4
- package/lib/badge/badge.variable.css +14 -4
- package/lib/badge/index.js +235 -1
- package/lib/breadcrumb/breadcrumb.variable.css +6 -2
- package/lib/breadcrumb/index.js +309 -1
- package/lib/button/button-group.d.ts +2 -2
- package/lib/button/button.css +10 -7
- package/lib/button/button.d.ts +1 -1
- package/lib/button/button.less +98 -93
- package/lib/button/button.variable.css +24 -17
- package/lib/button/index.d.ts +5 -5
- package/lib/button/index.js +321 -1
- package/lib/card/card.css +7 -7
- package/lib/card/card.less +7 -7
- package/lib/card/card.variable.css +13 -9
- package/lib/card/index.js +285 -1
- package/lib/cascader/cascader-panel.d.ts +1 -0
- package/lib/cascader/cascader.css +3 -3
- package/lib/cascader/cascader.d.ts +1 -0
- package/lib/cascader/cascader.less +4 -6
- package/lib/cascader/cascader.variable.css +9 -5
- package/lib/cascader/index.d.ts +4 -0
- package/lib/cascader/index.js +2053 -2
- package/lib/checkbox/checkbox.css +13 -1
- package/lib/checkbox/checkbox.d.ts +13 -10
- package/lib/checkbox/checkbox.less +15 -1
- package/lib/checkbox/checkbox.variable.css +19 -3
- package/lib/checkbox/common.d.ts +1 -0
- package/lib/checkbox/index.d.ts +28 -19
- package/lib/checkbox/index.js +569 -1
- package/lib/code-diff/code-diff.variable.css +6 -2
- package/lib/code-diff/index.js +5501 -1
- package/lib/collapse/collapse.variable.css +6 -2
- package/lib/collapse/index.js +570 -1
- package/lib/collapse-transition/collapse-transition.variable.css +6 -2
- package/lib/collapse-transition/index.js +177 -1
- package/lib/color-picker/color-picker.variable.css +6 -2
- package/lib/color-picker/index.js +2665 -1
- package/lib/components.js +530 -1
- package/lib/config-provider/config-provider.d.ts +18 -0
- package/lib/config-provider/config-provider.variable.css +6 -2
- package/lib/config-provider/index.d.ts +24 -0
- package/lib/config-provider/index.js +365 -1
- package/lib/config-provider/token.d.ts +6 -0
- package/lib/container/container.variable.css +6 -2
- package/lib/container/index.js +391 -1
- package/lib/date-picker/common.d.ts +2 -0
- package/lib/date-picker/date-picker.d.ts +3 -1
- package/lib/date-picker/date-picker.variable.css +6 -2
- package/lib/date-picker/index.d.ts +9 -3
- package/lib/date-picker/index.js +5629 -1
- package/lib/date-picker/panel/date.d.ts +2 -2
- package/lib/date-picker/panel/time-range.d.ts +17 -0
- package/lib/date-picker/panel/time.d.ts +17 -1
- package/lib/date-picker/time-picker.d.ts +3 -1
- package/lib/dialog/dialog.css +7 -6
- package/lib/dialog/dialog.less +7 -6
- package/lib/dialog/dialog.variable.css +13 -8
- package/lib/dialog/index.js +971 -2
- package/lib/directives/index.js +1387 -2
- package/lib/dist.index.js +87 -1
- package/lib/divider/divider.variable.css +6 -2
- package/lib/divider/index.js +169 -1
- package/lib/dropdown/dropdown.css +1 -1
- package/lib/dropdown/dropdown.variable.css +7 -3
- package/lib/dropdown/index.js +369 -1
- package/lib/exception/exception.variable.css +6 -2
- package/lib/exception/index.js +385 -1
- package/lib/fixed-navbar/fixed-navbar.variable.css +6 -2
- package/lib/fixed-navbar/index.js +154 -1
- package/lib/form/form.css +2 -1
- package/lib/form/form.less +3 -2
- package/lib/form/form.variable.css +8 -3
- package/lib/form/index.js +952 -1
- package/lib/hooks.js +73 -1
- package/lib/icon/angle-double-down-line.js +191 -1
- package/lib/icon/angle-double-left-line.js +191 -1
- package/lib/icon/angle-double-left.js +191 -1
- package/lib/icon/angle-double-right-line.js +191 -1
- package/lib/icon/angle-double-right.js +191 -1
- package/lib/icon/angle-double-up-line.js +191 -1
- package/lib/icon/angle-down-fill.js +191 -1
- package/lib/icon/angle-down-line.js +191 -1
- package/lib/icon/angle-down.js +191 -1
- package/lib/icon/angle-left.js +191 -1
- package/lib/icon/angle-right.js +191 -1
- package/lib/icon/angle-up-fill.js +191 -1
- package/lib/icon/angle-up.js +191 -1
- package/lib/icon/archive-fill.js +191 -1
- package/lib/icon/arrows-left.js +191 -1
- package/lib/icon/arrows-right.js +191 -1
- package/lib/icon/assistant.js +191 -1
- package/lib/icon/audio-fill.js +191 -1
- package/lib/icon/bk.js +191 -1
- package/lib/icon/circle.js +191 -1
- package/lib/icon/close-line.js +191 -1
- package/lib/icon/close.js +191 -1
- package/lib/icon/code.js +191 -1
- package/lib/icon/cog-shape.js +191 -1
- package/lib/icon/collapse-left.js +191 -1
- package/lib/icon/copy-shape.js +191 -1
- package/lib/icon/copy.js +191 -1
- package/lib/icon/data-shape.js +191 -1
- package/lib/icon/del.js +191 -1
- package/lib/icon/doc-fill.js +191 -1
- package/lib/icon/done.js +191 -1
- package/lib/icon/down-shape.js +191 -1
- package/lib/icon/down-small.js +191 -1
- package/lib/icon/edit-line.js +191 -1
- package/lib/icon/ellipsis.js +191 -1
- package/lib/icon/enlarge-line.js +191 -1
- package/lib/icon/error.js +191 -1
- package/lib/icon/excel-fill.js +191 -1
- package/lib/icon/exclamation-circle-shape.js +191 -1
- package/lib/icon/eye.js +191 -1
- package/lib/icon/filliscreen-line.js +191 -1
- package/lib/icon/fix-line.js +191 -1
- package/lib/icon/fix-shape.js +191 -1
- package/lib/icon/folder-open.js +191 -1
- package/lib/icon/folder-shape-open.js +191 -1
- package/lib/icon/folder-shape.js +191 -1
- package/lib/icon/folder.js +191 -1
- package/lib/icon/funnel.js +191 -1
- package/lib/icon/help-document-fill.js +191 -1
- package/lib/icon/help-fill.js +191 -1
- package/lib/icon/help.js +191 -1
- package/lib/icon/image-fill.js +276 -1
- package/lib/icon/img-error.js +276 -1
- package/lib/icon/img-placehoulder.js +276 -1
- package/lib/icon/index.d.ts +1 -0
- package/lib/icon/index.js +2432 -1
- package/lib/icon/info-line.js +276 -1
- package/lib/icon/info.js +276 -1
- package/lib/icon/left-shape.js +276 -1
- package/lib/icon/left-turn-line.js +276 -1
- package/lib/icon/loading.d.ts +4 -0
- package/lib/icon/loading.js +276 -0
- package/lib/icon/narrow-line.js +276 -1
- package/lib/icon/original.js +276 -1
- package/lib/icon/pdf-fill.js +276 -1
- package/lib/icon/play-shape.js +276 -1
- package/lib/icon/plus.js +276 -1
- package/lib/icon/ppt-fill.js +276 -1
- package/lib/icon/qq.js +276 -1
- package/lib/icon/right-shape.js +276 -1
- package/lib/icon/right-turn-line.js +276 -1
- package/lib/icon/search.js +276 -1
- package/lib/icon/share.js +276 -1
- package/lib/icon/spinner.js +276 -1
- package/lib/icon/success.js +276 -1
- package/lib/icon/switcher-loading.js +276 -1
- package/lib/icon/text-file.js +276 -1
- package/lib/icon/text-fill.js +276 -1
- package/lib/icon/transfer.js +276 -1
- package/lib/icon/tree-application-shape.js +276 -1
- package/lib/icon/unfull-screen.js +276 -1
- package/lib/icon/unvisible.js +276 -1
- package/lib/icon/up-shape.js +276 -1
- package/lib/icon/upload.js +276 -1
- package/lib/icon/video-fill.js +276 -1
- package/lib/icon/warn.js +276 -1
- package/lib/icon/weixin-pro.js +276 -1
- package/lib/icon/weixin.js +276 -1
- package/lib/image/image-viewer.variable.css +6 -2
- package/lib/image/image.variable.css +6 -2
- package/lib/image/index.js +641 -1
- package/lib/index.js +97 -1
- package/lib/info-box/index.js +1161 -2
- package/lib/info-box/info-box.d.ts +4 -0
- package/lib/info-box/info-box.variable.css +6 -2
- package/lib/input/index.d.ts +4 -4
- package/lib/input/index.js +1233 -2
- package/lib/input/input.css +21 -5
- package/lib/input/input.d.ts +3 -3
- package/lib/input/input.less +19 -0
- package/lib/input/input.variable.css +27 -7
- package/lib/link/index.js +160 -1
- package/lib/link/link.variable.css +6 -2
- package/lib/loading/index.d.ts +3 -3
- package/lib/loading/index.js +381 -1
- package/lib/loading/loading.css +9 -9
- package/lib/loading/loading.d.ts +1 -1
- package/lib/loading/loading.less +14 -9
- package/lib/loading/loading.variable.css +15 -11
- package/lib/locale/index.js +477 -1
- package/lib/locale/lang/en.d.ts +6 -0
- package/lib/menu/index.js +724 -1
- package/lib/menu/menu.variable.css +6 -2
- package/lib/menu/submenu.variable.css +6 -2
- package/lib/message/index.js +1795 -2
- package/lib/message/message.variable.css +6 -2
- package/lib/modal/index.js +396 -1
- package/lib/modal/modal.variable.css +6 -2
- package/lib/navigation/index.js +367 -1
- package/lib/navigation/navigation.variable.css +6 -2
- package/lib/notify/index.js +397 -1
- package/lib/notify/notify.css +6 -6
- package/lib/notify/notify.less +6 -6
- package/lib/notify/notify.variable.css +12 -8
- package/lib/overflow-title/components/overflow-title.d.ts +0 -1
- package/lib/overflow-title/index.js +285 -1
- package/lib/pagination/index.d.ts +4 -4
- package/lib/pagination/index.js +880 -1
- package/lib/pagination/pagination.css +1 -0
- package/lib/pagination/pagination.d.ts +3 -3
- package/lib/pagination/pagination.less +1 -0
- package/lib/pagination/pagination.variable.css +7 -2
- package/lib/plugin-popover/index.js +3833 -1
- package/lib/plugins/index.js +63 -1
- package/lib/pop-confirm/index.d.ts +42 -3
- package/lib/pop-confirm/index.js +281 -1
- package/lib/pop-confirm/pop-confirm.css +4 -4
- package/lib/pop-confirm/pop-confirm.d.ts +14 -1
- package/lib/pop-confirm/pop-confirm.less +4 -4
- package/lib/pop-confirm/pop-confirm.variable.css +10 -6
- package/lib/popover/index.js +3841 -1
- package/lib/popover/popover.css +1 -1
- package/lib/popover/popover.less +1 -1
- package/lib/popover/popover.variable.css +7 -3
- package/lib/popover2/index.js +107 -1
- package/lib/preset.d.ts +12 -0
- package/lib/preset.js +93 -1
- package/lib/process/index.js +759 -2
- package/lib/process/process.variable.css +6 -2
- package/lib/progress/index.d.ts +4 -4
- package/lib/progress/index.js +431 -1
- package/lib/progress/progress.css +7 -3
- package/lib/progress/progress.d.ts +3 -3
- package/lib/progress/progress.less +8 -3
- package/lib/progress/progress.variable.css +13 -5
- package/lib/radio/common.d.ts +1 -0
- package/lib/radio/index.d.ts +8 -2
- package/lib/radio/index.js +635 -1
- package/lib/radio/radio-button.d.ts +4 -3
- package/lib/radio/radio-group.d.ts +3 -0
- package/lib/radio/radio.css +26 -12
- package/lib/radio/radio.d.ts +1 -0
- package/lib/radio/radio.less +42 -8
- package/lib/radio/radio.variable.css +26 -8
- package/lib/rate/index.d.ts +4 -4
- package/lib/rate/index.js +354 -1
- package/lib/rate/rate.d.ts +2 -2
- package/lib/rate/rate.variable.css +6 -2
- package/lib/rate/star.css +3 -0
- package/lib/rate/star.less +3 -0
- package/lib/rate/star.variable.css +9 -2
- package/lib/resize-layout/index.js +429 -1
- package/lib/resize-layout/resize-layout.css +2 -2
- package/lib/resize-layout/resize-layout.less +2 -2
- package/lib/resize-layout/resize-layout.variable.css +8 -4
- package/lib/search-select/index.js +2729 -2
- package/lib/search-select/search-select.css +2 -4
- package/lib/search-select/search-select.less +10 -12
- package/lib/search-select/search-select.variable.css +8 -6
- package/lib/select/common.d.ts +3 -1
- package/lib/select/index.d.ts +96 -30
- package/lib/select/index.js +2384 -2
- package/lib/select/option.d.ts +1 -0
- package/lib/select/select.css +3 -0
- package/lib/select/select.d.ts +40 -14
- package/lib/select/select.less +3 -0
- package/lib/select/select.variable.css +9 -2
- package/lib/select/selectTagInput.d.ts +2 -0
- package/lib/select/type.d.ts +3 -0
- package/lib/shared/index.js +2690 -1
- package/lib/shared/vue-types.d.ts +1 -1
- package/lib/sideslider/index.js +704 -2
- package/lib/sideslider/sideslider.variable.css +6 -2
- package/lib/slider/index.js +1297 -2
- package/lib/slider/slider.css +2 -0
- package/lib/slider/slider.less +2 -0
- package/lib/slider/slider.variable.css +8 -2
- package/lib/steps/index.d.ts +4 -4
- package/lib/steps/index.js +825 -2
- package/lib/steps/steps.css +18 -6
- package/lib/steps/steps.d.ts +3 -3
- package/lib/steps/steps.less +26 -5
- package/lib/steps/steps.variable.css +24 -8
- package/lib/styles/index.d.ts +1 -0
- package/lib/styles/mixins/animate.variable.css +6 -2
- package/lib/styles/mixins/popper.variable.css +6 -2
- package/lib/styles/mixins/scroll.variable.css +6 -2
- package/lib/styles/reset.variable.css +6 -2
- package/lib/styles/themes/themes.less +7 -3
- package/lib/swiper/index.js +336 -1
- package/lib/swiper/swiper.variable.css +6 -2
- package/lib/switcher/index.d.ts +4 -4
- package/lib/switcher/index.js +277 -1
- package/lib/switcher/switcher.d.ts +3 -3
- package/lib/switcher/switcher.variable.css +6 -2
- package/lib/tab/index.js +914 -1
- package/lib/tab/tab.variable.css +6 -2
- package/lib/table/components/table-column.d.ts +6 -5
- package/lib/table/index.d.ts +57 -7
- package/lib/table/index.js +6510 -1
- package/lib/table/plugins/body-empty.d.ts +1 -1
- package/lib/table/plugins/head-filter.css +1 -28
- package/lib/table/plugins/head-filter.less +2 -34
- package/lib/table/plugins/head-filter.variable.css +7 -30
- package/lib/table/plugins/head-sort.variable.css +6 -2
- package/lib/table/plugins/settings.d.ts +0 -7
- package/lib/table/plugins/settings.variable.css +6 -2
- package/lib/table/plugins/use-column-resize.d.ts +1 -1
- package/lib/table/plugins/use-head-cell.d.ts +7 -0
- package/lib/table/plugins/use-pagination.d.ts +2 -1
- package/lib/table/props.d.ts +2 -1
- package/lib/table/table.css +51 -59
- package/lib/table/table.d.ts +1 -1
- package/lib/table/table.less +28 -22
- package/lib/table/table.variable.css +57 -61
- package/lib/table/use-attributes.d.ts +5 -1
- package/lib/table/use-column.d.ts +87 -0
- package/lib/table/use-common.d.ts +0 -1
- package/lib/table/use-render.d.ts +1 -1
- package/lib/table/utils.d.ts +6 -4
- package/lib/table-column/index.d.ts +160 -10
- package/lib/table-column/index.js +775 -1
- package/lib/tag/index.d.ts +4 -21
- package/lib/tag/index.js +229 -1
- package/lib/tag/tag.css +14 -10
- package/lib/tag/tag.d.ts +2 -12
- package/lib/tag/tag.less +31 -27
- package/lib/tag/tag.variable.css +20 -12
- package/lib/tag-input/index.d.ts +3 -0
- package/lib/tag-input/index.js +1674 -1
- package/lib/tag-input/list-tag-render.d.ts +11 -0
- package/lib/tag-input/tag-input.d.ts +1 -0
- package/lib/tag-input/tag-input.variable.css +6 -2
- package/lib/time-picker/index.d.ts +9 -3
- package/lib/time-picker/index.js +71 -1
- package/lib/time-picker/time-picker.css +4 -3
- package/lib/time-picker/time-picker.less +5 -9
- package/lib/time-picker/time-picker.variable.css +10 -5
- package/lib/timeline/index.js +241 -1
- package/lib/timeline/timeline.variable.css +6 -2
- package/lib/transfer/index.js +673 -1
- package/lib/transfer/transfer.css +2 -2
- package/lib/transfer/transfer.less +2 -2
- package/lib/transfer/transfer.variable.css +8 -4
- package/lib/tree/index.d.ts +21 -33
- package/lib/tree/index.js +2584 -1
- package/lib/tree/props.d.ts +4 -8
- package/lib/tree/tree.css +13 -1
- package/lib/tree/tree.d.ts +15 -19
- package/lib/tree/tree.variable.css +19 -3
- package/lib/tree/use-empty.d.ts +1 -3
- package/lib/tree/util.d.ts +1 -0
- package/lib/upload/index.js +2874 -2
- package/lib/upload/upload.type.d.ts +1 -1
- package/lib/upload/upload.variable.css +6 -2
- package/lib/upload/use-file-handler.d.ts +2 -2
- package/lib/virtual-render/index.js +901 -1
- package/lib/virtual-render/use-fix-top.d.ts +18 -0
- package/lib/virtual-render/v-virtual-render.d.ts +6 -1
- package/lib/virtual-render/virtual-render.variable.css +6 -2
- package/package.json +17 -4
- package/lib/cascader/index.js.LICENSE.txt +0 -1
- package/lib/dialog/index.js.LICENSE.txt +0 -1
- package/lib/directives/index.js.LICENSE.txt +0 -14
- package/lib/info-box/index.js.LICENSE.txt +0 -1
- package/lib/input/index.js.LICENSE.txt +0 -1
- package/lib/message/index.js.LICENSE.txt +0 -6
- package/lib/process/index.js.LICENSE.txt +0 -1
- package/lib/search-select/index.js.LICENSE.txt +0 -1
- package/lib/select/index.js.LICENSE.txt +0 -1
- package/lib/sideslider/index.js.LICENSE.txt +0 -1
- package/lib/slider/index.js.LICENSE.txt +0 -1
- package/lib/steps/index.js.LICENSE.txt +0 -1
- package/lib/table/render.d.ts +0 -130
- package/lib/upload/index.js.LICENSE.txt +0 -1
- /package/lib/overflow-title/{overflow.css → overflow-title.css} +0 -0
- /package/lib/overflow-title/{overflow.less → overflow-title.less} +0 -0
- /package/lib/overflow-title/{overflow.variable.css → overflow-title.variable.css} +0 -0
package/lib/message/index.js
CHANGED
@@ -1,2 +1,1795 @@
|
|
1
|
-
|
2
|
-
import*as e from"vue";import*as t from"../shared";import*as n from"vue-types";import*as r from"../config-provider";import*as o from"../icon";var i={7647:function(e){var t;t=function(){return function(){var e={686:function(e,t,n){n.d(t,{default:function(){return b}});var r=n(279),o=n.n(r),i=n(370),s=n.n(i),a=n(817),c=n.n(a);function l(e){try{return document.execCommand(e)}catch(e){return!1}}var u=function(e){var t=c()(e);return l("cut"),t},f=function(e,t){var n=function(e){var t="rtl"===document.documentElement.getAttribute("dir"),n=document.createElement("textarea");n.style.fontSize="12pt",n.style.border="0",n.style.padding="0",n.style.margin="0",n.style.position="absolute",n.style[t?"right":"left"]="-9999px";var r=window.pageYOffset||document.documentElement.scrollTop;return n.style.top="".concat(r,"px"),n.setAttribute("readonly",""),n.value=e,n}(e);t.container.appendChild(n);var r=c()(n);return l("copy"),n.remove(),r},d=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body},n="";return"string"==typeof e?n=f(e,t):e instanceof HTMLInputElement&&!["text","search","url","tel","password"].includes(null==e?void 0:e.type)?n=f(e.value,t):(n=c()(e),l("copy")),n};function p(e){return p="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},p(e)}function m(e){return m="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},m(e)}function y(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function h(e,t){return h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},h(e,t)}function v(e){return v=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},v(e)}function g(e,t){var n="data-clipboard-".concat(e);if(t.hasAttribute(n))return t.getAttribute(n)}var j=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(c,e);var t,n,r,o,i,a=(o=c,i=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}(),function(){var e,t,n=v(o);if(i){var r=v(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return!(t=e)||"object"!==m(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(this):t});function c(e,t){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,c),(n=a.call(this)).resolveOptions(t),n.listenClick(e),n}return t=c,n=[{key:"resolveOptions",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};this.action="function"==typeof e.action?e.action:this.defaultAction,this.target="function"==typeof e.target?e.target:this.defaultTarget,this.text="function"==typeof e.text?e.text:this.defaultText,this.container="object"===m(e.container)?e.container:document.body}},{key:"listenClick",value:function(e){var t=this;this.listener=s()(e,"click",(function(e){return t.onClick(e)}))}},{key:"onClick",value:function(e){var t=e.delegateTarget||e.currentTarget,n=this.action(t)||"copy",r=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.action,n=void 0===t?"copy":t,r=e.container,o=e.target,i=e.text;if("copy"!==n&&"cut"!==n)throw new Error('Invalid "action" value, use either "copy" or "cut"');if(void 0!==o){if(!o||"object"!==p(o)||1!==o.nodeType)throw new Error('Invalid "target" value, use a valid Element');if("copy"===n&&o.hasAttribute("disabled"))throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');if("cut"===n&&(o.hasAttribute("readonly")||o.hasAttribute("disabled")))throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes')}return i?d(i,{container:r}):o?"cut"===n?u(o):d(o,{container:r}):void 0}({action:n,container:this.container,target:this.target(t),text:this.text(t)});this.emit(r?"success":"error",{action:n,text:r,trigger:t,clearSelection:function(){t&&t.focus(),window.getSelection().removeAllRanges()}})}},{key:"defaultAction",value:function(e){return g("action",e)}},{key:"defaultTarget",value:function(e){var t=g("target",e);if(t)return document.querySelector(t)}},{key:"defaultText",value:function(e){return g("text",e)}},{key:"destroy",value:function(){this.listener.destroy()}}],r=[{key:"copy",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{container:document.body};return d(e,t)}},{key:"cut",value:function(e){return u(e)}},{key:"isSupported",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:["copy","cut"],t="string"==typeof e?[e]:e,n=!!document.queryCommandSupported;return t.forEach((function(e){n=n&&!!document.queryCommandSupported(e)})),n}}],n&&y(t.prototype,n),r&&y(t,r),c}(o()),b=j},828:function(e){if("undefined"!=typeof Element&&!Element.prototype.matches){var t=Element.prototype;t.matches=t.matchesSelector||t.mozMatchesSelector||t.msMatchesSelector||t.oMatchesSelector||t.webkitMatchesSelector}e.exports=function(e,t){for(;e&&9!==e.nodeType;){if("function"==typeof e.matches&&e.matches(t))return e;e=e.parentNode}}},438:function(e,t,n){var r=n(828);function o(e,t,n,r,o){var s=i.apply(this,arguments);return e.addEventListener(n,s,o),{destroy:function(){e.removeEventListener(n,s,o)}}}function i(e,t,n,o){return function(n){n.delegateTarget=r(n.target,t),n.delegateTarget&&o.call(e,n)}}e.exports=function(e,t,n,r,i){return"function"==typeof e.addEventListener?o.apply(null,arguments):"function"==typeof n?o.bind(null,document).apply(null,arguments):("string"==typeof e&&(e=document.querySelectorAll(e)),Array.prototype.map.call(e,(function(e){return o(e,t,n,r,i)})))}},879:function(e,t){t.node=function(e){return void 0!==e&&e instanceof HTMLElement&&1===e.nodeType},t.nodeList=function(e){var n=Object.prototype.toString.call(e);return void 0!==e&&("[object NodeList]"===n||"[object HTMLCollection]"===n)&&"length"in e&&(0===e.length||t.node(e[0]))},t.string=function(e){return"string"==typeof e||e instanceof String},t.fn=function(e){return"[object Function]"===Object.prototype.toString.call(e)}},370:function(e,t,n){var r=n(879),o=n(438);e.exports=function(e,t,n){if(!e&&!t&&!n)throw new Error("Missing required arguments");if(!r.string(t))throw new TypeError("Second argument must be a String");if(!r.fn(n))throw new TypeError("Third argument must be a Function");if(r.node(e))return function(e,t,n){return e.addEventListener(t,n),{destroy:function(){e.removeEventListener(t,n)}}}(e,t,n);if(r.nodeList(e))return function(e,t,n){return Array.prototype.forEach.call(e,(function(e){e.addEventListener(t,n)})),{destroy:function(){Array.prototype.forEach.call(e,(function(e){e.removeEventListener(t,n)}))}}}(e,t,n);if(r.string(e))return function(e,t,n){return o(document.body,e,t,n)}(e,t,n);throw new TypeError("First argument must be a String, HTMLElement, HTMLCollection, or NodeList")}},817:function(e){e.exports=function(e){var t;if("SELECT"===e.nodeName)e.focus(),t=e.value;else if("INPUT"===e.nodeName||"TEXTAREA"===e.nodeName){var n=e.hasAttribute("readonly");n||e.setAttribute("readonly",""),e.select(),e.setSelectionRange(0,e.value.length),n||e.removeAttribute("readonly"),t=e.value}else{e.hasAttribute("contenteditable")&&e.focus();var r=window.getSelection(),o=document.createRange();o.selectNodeContents(e),r.removeAllRanges(),r.addRange(o),t=r.toString()}return t}},279:function(e){function t(){}t.prototype={on:function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},once:function(e,t,n){var r=this;function o(){r.off(e,o),t.apply(n,arguments)}return o._=t,this.on(e,o,n)},emit:function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r<o;r++)n[r].fn.apply(n[r].ctx,t);return this},off:function(e,t){var n=this.e||(this.e={}),r=n[e],o=[];if(r&&t)for(var i=0,s=r.length;i<s;i++)r[i].fn!==t&&r[i].fn._!==t&&o.push(r[i]);return o.length?n[e]=o:delete n[e],this}},e.exports=t,e.exports.TinyEmitter=t}},t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={exports:{}};return e[r](o,o.exports,n),o.exports}return n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,{a:t}),t},n.d=function(e,t){for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n(686)}().default},e.exports=t()},4346:function(e){e.exports=function(){function e(e){return null===e?"null":typeof e}function t(e){return!!e&&"object"==typeof e}function n(e){if(void 0===e)return"";if(null===e)return"Object";if("object"==typeof e&&!e.constructor)return"Object";var t=/function ([^(]*)/.exec(e.constructor.toString());return t&&t.length>1?t[1]:""}function r(e,t,n){return"null"===e||"undefined"===e?e:("string"!==e&&"stringifiable"!==e||(n='"'+n.replace(/"/g,'\\"')+'"'),"function"===e?t.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":n)}function o(o){var i="";return t(o)?(i=n(o),Array.isArray(o)&&(i+="["+o.length+"]")):i=r(e(o),o,o),i}function i(e){return"json-formatter-"+e}function s(e,t,n){var r=document.createElement(e);return t&&r.classList.add(i(t)),void 0!==n&&(n instanceof Node?r.appendChild(n):r.appendChild(document.createTextNode(String(n)))),r}!function(e){if(e&&"undefined"!=typeof window){var t=document.createElement("style");t.setAttribute("media","screen"),t.innerHTML=e,document.head.appendChild(t)}}('.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-row,\n.json-formatter-row a,\n.json-formatter-row a:hover {\n color: black;\n text-decoration: none;\n}\n.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-row .json-formatter-string,\n.json-formatter-row .json-formatter-stringifiable {\n color: green;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-row .json-formatter-number {\n color: blue;\n}\n.json-formatter-row .json-formatter-boolean {\n color: red;\n}\n.json-formatter-row .json-formatter-null {\n color: #855A00;\n}\n.json-formatter-row .json-formatter-undefined {\n color: #ca0b69;\n}\n.json-formatter-row .json-formatter-function {\n color: #FF20ED;\n}\n.json-formatter-row .json-formatter-date {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: blue;\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-bracket {\n color: blue;\n}\n.json-formatter-row .json-formatter-key {\n color: #00008B;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n.json-formatter-dark.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-dark.json-formatter-row,\n.json-formatter-dark.json-formatter-row a,\n.json-formatter-dark.json-formatter-row a:hover {\n color: white;\n text-decoration: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-string,\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\n color: #31F031;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-number {\n color: #66C2FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\n color: #EC4242;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-null {\n color: #EEC97D;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\n color: #ef8fbe;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-function {\n color: #FD48CB;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-date {\n background-color: rgba(255, 255, 255, 0.05);\n}\n.json-formatter-dark.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: #027BFF;\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\n color: #9494FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-key {\n color: #23A0DB;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n');var a=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,c=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,l=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,u=window.requestAnimationFrame||function(e){return e(),0},f={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null};return function(){function d(e,t,n,r){void 0===t&&(t=1),void 0===n&&(n=f),this.json=e,this.open=t,this.config=n,this.key=r,this._isOpen=null,void 0===this.config.hoverPreviewEnabled&&(this.config.hoverPreviewEnabled=f.hoverPreviewEnabled),void 0===this.config.hoverPreviewArrayCount&&(this.config.hoverPreviewArrayCount=f.hoverPreviewArrayCount),void 0===this.config.hoverPreviewFieldCount&&(this.config.hoverPreviewFieldCount=f.hoverPreviewFieldCount),void 0===this.config.useToJSON&&(this.config.useToJSON=f.useToJSON),""===this.key&&(this.key='""')}return Object.defineProperty(d.prototype,"isOpen",{get:function(){return null!==this._isOpen?this._isOpen:this.open>0},set:function(e){this._isOpen=e},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isDate",{get:function(){return this.json instanceof Date||"string"===this.type&&(a.test(this.json)||l.test(this.json)||c.test(this.json))},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isUrl",{get:function(){return"string"===this.type&&0===this.json.indexOf("http")},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isObject",{get:function(){return t(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isEmptyObject",{get:function(){return!this.keys.length&&!this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&"stringifiable"===this.type},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"hasKey",{get:function(){return void 0!==this.key},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"constructorName",{get:function(){return n(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":e(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(d.prototype,"keys",{get:function(){if(this.isObject){var e=Object.keys(this.json);return!this.isArray&&this.config.sortPropertiesBy?e.sort(this.config.sortPropertiesBy):e}return[]},enumerable:!0,configurable:!0}),d.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(i("open")))},d.prototype.openAtDepth=function(e){void 0===e&&(e=1),e<0||(this.open=e,this.isOpen=0!==e,this.element&&(this.removeChildren(!1),0===e?this.element.classList.remove(i("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(i("open")))))},d.prototype.getInlinepreview=function(){var e=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array["+this.json.length+"]":"["+this.json.map(o).join(", ")+"]";var t=this.keys,n=t.slice(0,this.config.hoverPreviewFieldCount).map((function(t){return t+":"+o(e.json[t])})),r=t.length>=this.config.hoverPreviewFieldCount?"…":"";return"{"+n.join(", ")+r+"}"},d.prototype.render=function(){this.element=s("div","row");var e=this.isObject?s("a","toggler-link"):s("span");if(this.isObject&&!this.useToJSON&&e.appendChild(s("span","toggler")),this.hasKey&&e.appendChild(s("span","key",this.key+":")),this.isObject&&!this.useToJSON){var t=s("span","value"),n=s("span"),o=s("span","constructor-name",this.constructorName);if(n.appendChild(o),this.isArray){var a=s("span");a.appendChild(s("span","bracket","[")),a.appendChild(s("span","number",this.json.length)),a.appendChild(s("span","bracket","]")),n.appendChild(a)}t.appendChild(n),e.appendChild(t)}else{(t=this.isUrl?s("a"):s("span")).classList.add(i(this.type)),this.isDate&&t.classList.add(i("date")),this.isUrl&&(t.classList.add(i("url")),t.setAttribute("href",this.json));var c=r(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);t.appendChild(document.createTextNode(c)),e.appendChild(t)}if(this.isObject&&this.config.hoverPreviewEnabled){var l=s("span","preview-text");l.appendChild(document.createTextNode(this.getInlinepreview())),e.appendChild(l)}var u=s("div","children");return this.isObject&&u.classList.add(i("object")),this.isArray&&u.classList.add(i("array")),this.isEmpty&&u.classList.add(i("empty")),this.config&&this.config.theme&&this.element.classList.add(i(this.config.theme)),this.isOpen&&this.element.classList.add(i("open")),this.element.appendChild(e),this.element.appendChild(u),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&e.addEventListener("click",this.toggleOpen.bind(this)),this.element},d.prototype.appendChildren=function(e){var t=this;void 0===e&&(e=!1);var n=this.element.querySelector("div."+i("children"));if(n&&!this.isEmpty)if(e){var r=0,o=function(){var e=t.keys[r],i=new d(t.json[e],t.open-1,t.config,e);n.appendChild(i.render()),(r+=1)<t.keys.length&&(r>10?o():u(o))};u(o)}else this.keys.forEach((function(e){var r=new d(t.json[e],t.open-1,t.config,e);n.appendChild(r.render())}))},d.prototype.removeChildren=function(e){void 0===e&&(e=!1);var t=this.element.querySelector("div."+i("children"));if(e){var n=0,r=function(){t&&t.children.length&&(t.removeChild(t.children[0]),(n+=1)>10?r():u(r))};u(r)}else t&&(t.innerHTML="")},d}()}()}},s={};function a(e){var t=s[e];if(void 0!==t)return t.exports;var n=s[e]={exports:{}};return i[e].call(n.exports,n,n.exports,a),n.exports}a.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return a.d(t,{a:t}),t},a.d=(e,t)=>{for(var n in t)a.o(t,n)&&!a.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},a.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var c={};(()=>{a.d(c,{Z:()=>E});const i=(s={Fragment:()=>e.Fragment,Transition:()=>e.Transition,computed:()=>e.computed,createVNode:()=>e.createVNode,defineComponent:()=>e.defineComponent,isVNode:()=>e.isVNode,onMounted:()=>e.onMounted,onUnmounted:()=>e.onUnmounted,reactive:()=>e.reactive,ref:()=>e.ref,render:()=>e.render,vShow:()=>e.vShow,watch:()=>e.watch,withDirectives:()=>e.withDirectives},l={},a.d(l,s),l);var s,l;const u=(e=>{var t={};return a.d(t,e),t})({PropTypes:()=>t.PropTypes,bkZIndexManager:()=>t.bkZIndexManager,isElement:()=>t.isElement});var f={"top-left":[],"top-right":[],"bottom-left":[],"bottom-right":[]},d=1;function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function m(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(e){return y="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},y(e)}function h(e,t,n){return(t=function(e){var t=function(e,t){if("object"!==y(e)||null===e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,"string");if("object"!==y(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"===y(t)?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var v=a(7647),g=a.n(v),j=a(4346),b=a.n(j);const w=(e=>{var t={};return a.d(t,e),t})({toType:()=>n.toType}),S=(e=>{var t={};return a.d(t,e),t})({useLocale:()=>r.useLocale,usePrefix:()=>r.usePrefix}),C=(e=>{var t={};return a.d(t,e),t})({AngleDoubleDownLine:()=>o.AngleDoubleDownLine,AngleDoubleUpLine:()=>o.AngleDoubleUpLine,Assistant:()=>o.Assistant,Close:()=>o.Close,CopyShape:()=>o.CopyShape,Error:()=>o.Error,FixLine:()=>o.FixLine,FixShape:()=>o.FixShape,Info:()=>o.Info,Success:()=>o.Success,Warn:()=>o.Warn});var k,T,O;!function(e){e.PRIMARY="primary",e.WARNING="warning",e.SUCCESS="success",e.ERROR="error"}(k||(k={})),function(e){e.KEY_VALUE="key-value",e.JSON="json"}(T||(T={})),function(e){e.ASSISTANT="assistant",e.DETAILS="details",e.FIX="fix",e.CLOSE="close"}(O||(O={}));var x={id:u.PropTypes.string.def(""),message:(0,w.toType)("IMessage",{}),theme:(0,w.toType)("messageTheme",{}).def(k.PRIMARY),delay:u.PropTypes.number,dismissable:u.PropTypes.bool.def(!0),offsetY:u.PropTypes.number.def(30),spacing:u.PropTypes.number.def(10),extCls:u.PropTypes.string.def(""),onClose:u.PropTypes.func,getContainer:u.PropTypes.instanceOf(HTMLElement),width:u.PropTypes.oneOfType([u.PropTypes.number,u.PropTypes.string]),minWidth:u.PropTypes.oneOfType([u.PropTypes.number,u.PropTypes.string]).def(100),maxWidth:u.PropTypes.oneOfType([u.PropTypes.number,u.PropTypes.string]).def("100%"),actions:(0,w.toType)("IMessageAction",{})};const N=(0,i.defineComponent)({name:"Message",props:x,emits:["destroy","detail"],setup:function(e,t){var n,r=this,o=t.emit,s=t.slots,a=t.expose,c=(0,S.useLocale)("message"),l=(0,S.usePrefix)().resolveClassName,f=(0,i.computed)((function(){return["".concat(l("message")),"".concat(l("message-".concat(e.theme))),"".concat(e.extCls)]})),d=u.bkZIndexManager.getMessageNextIndex(),p=(0,i.computed)((function(){return/^\d+\.?\d*$/.test("".concat(e.delay))?e.delay:"object"!==y(e.message)||(0,i.isVNode)(e.message)?3e3:8e3})),v=function(t){return"number"==typeof e[t]?"".concat(e[t],"px"):e[t]},j=(0,i.computed)((function(){var t={maxWidth:v("maxWidth"),minWidth:v("minWidth")},n="object"===y(e.message)&&!(0,i.isVNode)(e.message);return/%$/.test("".concat(e.width))||/auto/gi.test("".concat(e.width))?Object.assign({width:e.width},t):/^\d+/.test("".concat(e.width))?/^\d+\.?\d*$/.test("".concat(e.width))?Object.assign({width:"".concat(e.width,"px")},t):Object.assign({width:e.width},t):n?{width:"".concat(800,"px")}:{width:"".concat(560,"px")}})),w=(0,i.computed)((function(){return e.getContainer&&(0,u.isElement)(e.getContainer)})),k=(0,i.computed)((function(){return Object.assign({top:"".concat(e.offsetY,"px"),zIndex:d,position:w.value?"absolute":"fixed"},j.value)})),x=(0,i.ref)(null),N=(0,i.ref)(null),E=(0,i.ref)(null),A=(0,i.ref)(!1),L=(0,i.reactive)({isFix:!1,isDetailShow:!1}),P=null,V=function(){P=setTimeout((function(){L.isFix||(A.value=!1)}),p.value)},M=function(e){e.preventDefault(),e.stopPropagation(),A.value=!1},D=(0,i.ref)(null),F=function(){var t=new(g())(E.value,{text:function(){return function(e){var t=e;if("object"===y(e))try{t=JSON.stringify(e)}catch(e){console.error("JSON.stringify Error: ".concat(e))}return t}(e.message.details)}});I(t)},I=function(e,t){["success","error"].forEach((function(r){e.on(r,(function(e){var o=N.value;if(D.value=r,o){var i,s,a=e.trigger,c=a.offsetLeft,l=a.offsetWidth,u=a.offsetTop,f=e.trigger.closest(".message-tree"),d=f?f.scrollTop:0;(i=o.classList).remove.apply(i,["success","error","is-hidden"]),(s=o.classList).add.apply(s,[r,"is-show"]);var p=c+l/2-41,m=u-d-40;o.style.setProperty("transform","translate(".concat(p,"px, ").concat(m,"px")),n&&clearTimeout(n),n=setTimeout((function(){var e,t;(e=o.classList).remove.apply(e,["is-show"]),(t=o.classList).add.apply(t,["is-hidden"])}),2e3)}"function"==typeof t&&t()}))}))},R=function(){var e=new(g())(x.value.querySelectorAll("span.copy-value"),{text:function(e){return e.innerHTML}});I(e)},J=function(e){var t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(e){console.error("Format Json Error: ".concat(e))}return t},_=function(t,n){if(L.isDetailShow=null!=n?n:!L.isDetailShow,U(t,L.isDetailShow),L.isDetailShow&&"object"===y(e.message)&&!(0,i.isVNode)(e.message)){if(e.message.type===T.JSON||!e.message.type){var r=J(e.message.details),s=new(b())(r);setTimeout((function(){x.value&&(x.value.innerHTML="",x.value.append(s.render())),F()}))}e.message.type===T.KEY_VALUE&&setTimeout((function(){F(),R()})),o("detail",L.isDetailShow,e.id)}},U=function(e,t){L.isFix=null!=t?t:!L.isFix},H=function(){var t=arguments.length>0&&void 0!==arguments[0]&&arguments[0];"object"===y(e.message)&&!(0,i.isVNode)(e.message)&&(t?document.removeEventListener("keydown",W):document.addEventListener("keydown",W))},W=function(e){e.altKey&&80===e.keyCode&&U(e)};(0,i.onMounted)((function(){p.value&&V(),A.value=!0,H()})),(0,i.onUnmounted)((function(){clearTimeout(P),H(!0)})),(0,i.watch)(A,(function(){A.value||o("destroy",e.id)}));var Y=(0,i.computed)((function(){var t;return h(t={},O.ASSISTANT,{id:O.ASSISTANT,icon:function(){return(0,i.createVNode)(C.Assistant,null,null)},text:function(){return c.value.assistant},onClick:function(t){e.message.assistant&&window.open(e.message.assistant,"_blank")}}),h(t,O.DETAILS,{id:O.DETAILS,icon:function(){return L.isDetailShow?(0,i.createVNode)(C.AngleDoubleUpLine,null,null):(0,i.createVNode)(C.AngleDoubleDownLine,null,null)},text:function(){return c.value.details},onClick:function(e){return _(e)}}),h(t,O.FIX,{id:O.FIX,icon:function(){return L.isFix?(0,i.createVNode)(C.FixShape,null,null):(0,i.createVNode)(C.FixLine,null,null)},classList:L.isFix?"fixed":"",onClick:function(e){return U(e)}}),h(t,O.CLOSE,{id:O.CLOSE,classList:"normal-color",icon:function(){return e.dismissable&&(0,i.createVNode)(C.Error,{class:"".concat(l("message-close")),onClick:M},null)},onClick:M}),t})),q=[O.ASSISTANT,O.DETAILS,O.FIX,O.CLOSE],B=(0,i.computed)((function(){var t;if((null===(t=e.actions)||void 0===t?void 0:t.length)>0){var n=e.actions.map((function(e){var t=e.id.toLocaleLowerCase(),n=Y.value[t],o=null==n?void 0:n.onClick,i=Object.assign({},Y.value[t]||{},e);if(i.id=t,void 0!==e.classList){var s=Array.isArray(e.classList)?e.classList:[e.classList],a=[];void 0!==n.classList&&(a=Array.isArray(n.classList)?n.classList:[n.classList]),i.classList=[].concat(m(a),m(s))}return"function"==typeof e.onClick?(i.onClick=function(){var t=Reflect.apply(e.onClick,r,[]);void 0!==y(t)&&!t||"function"!=typeof o||Reflect.apply(o,r,[])},i):(i.onClick=o,i)})),o=q.filter((function(e){return!n.some((function(t){return t.id===e}))})).map((function(e){return Y.value[e]}));return n.push.apply(n,m(o)),n}return q.map((function(e){return Y.value[e]}))}));return a({setDetailsShow:_}),{classNames:f,styles:k,visible:A,close:M,setDetailsShow:_,fixMesage:U,copyMessage:F,parseToJson:J,handleMouseenter:function(e){clearTimeout(P)},handleMouseleave:function(e){p.value&&V()},renderMessageActions:function(){var e,t,n=function(e){var t=e.text,n=void 0;if("function"==typeof t&&(n=Reflect.apply(t,r,[])),void 0!==n)return"string"==typeof n?(0,i.createVNode)("span",{class:"message-action-text"},[n]):n};return null!==(t=null===(e=s.action)||void 0===e?void 0:e.call(s))&&void 0!==t?t:B.value.map((function(e){if(e.disabled)return null;if("function"==typeof e.render)return Reflect.apply(e.render,r,[]);var t,o,s=Array.isArray(e.classList)?e.classList.join(" "):e.classList;return(0,i.createVNode)("span",{class:["tool",e.id,s],onClick:function(t){return function(e,t){t.readonly||t.disabled||"function"==typeof t.onClick&&Reflect.apply(t.onClick,r,[e,t])}(t,e)}},[(t=e,o=t.icon,"function"==typeof o?Reflect.apply(o,r,[]):(0,i.createVNode)("span",{class:o},null)),n(e)])}))},refJsonContent:x,refCopyStatus:N,refCopyMsgDiv:E,toolOperation:L,copyStatus:D,t:c,resolveClassName:l,copyValueItem:R}},render:function(){var e=this,t=function(t){return{primary:(0,i.createVNode)(C.Info,null,null),warning:(0,i.createVNode)(C.Warn,null,null),success:(0,i.createVNode)(C.Success,null,null),error:(0,i.createVNode)(C.Close,null,null)}[null!=t?t:e.theme]},n=function(t){if(t.type===T.KEY_VALUE){var n=e.parseToJson(t.details||{});return Object.keys(n).map((function(e){return(0,i.createVNode)("div",{class:"message-row"},[(0,i.createVNode)("label",null,[e]),(0,i.createVNode)("span",{class:"copy-value"},[n[e]])])}))}};return(0,i.createVNode)(i.Transition,{name:"bk-message-fade"},{default:function(){return[(0,i.withDirectives)((0,i.createVNode)("div",{class:e.classNames,style:e.styles,onMouseenter:e.handleMouseenter,onMouseleave:e.handleMouseleave},["object"!==y(e.message)||(0,i.isVNode)(e.message)?(0,i.createVNode)(i.Fragment,null,[(0,i.createVNode)("div",{class:"".concat(e.resolveClassName("message-content"))},[(0,i.createVNode)("div",{class:"".concat(e.resolveClassName("message-icon"))},[t()]),e.message]),e.dismissable&&(0,i.createVNode)(C.Error,{class:"".concat(e.resolveClassName("message-close")),onClick:e.close},null)]):(0,i.createVNode)("div",{class:"".concat(e.resolveClassName("message-content")," multi")},[(0,i.createVNode)("div",{class:"overview"},[(0,i.createVNode)("div",{class:"left-content"},[(0,i.createVNode)("div",{class:"".concat(e.resolveClassName("message-icon"))},[t()]),(0,i.createVNode)("div",{class:"describe"},[null!==(s=null===(o=(r=e.$slots).title)||void 0===o?void 0:o.call(r))&&void 0!==s?s:"【".concat(e.message.code,"】").concat(e.message.overview," ").concat(e.message.suggestion)])]),(0,i.createVNode)("div",{class:"tools"},[e.renderMessageActions()])]),e.toolOperation.isDetailShow&&(0,i.createVNode)("div",{class:"message-detail"},[(0,i.createVNode)("div",{class:"message-copy",ref:"refCopyMsgDiv"},[(0,i.createVNode)(C.CopyShape,null,null)]),(0,i.createVNode)("div",{class:"copy-status",ref:"refCopyStatus"},[(0,i.createVNode)("div",{class:"inner"},[t(e.copyStatus),"success"===e.copyStatus?e.t.copySuccess:e.t.copyFailed])]),(0,i.createVNode)("div",{ref:"refJsonContent",class:"message-tree"},[n(e.message)])])])]),[[i.vShow,e.visible]])];var r,o,s}})}}),E=function(e){!function(e,t){var n=t,r=n.position||"top-right";"string"==typeof t&&(n={message:t});var o=t.onClose,s=n.offsetX||10,a=n.offsetY||30,c=n.spacing,l=void 0===c?10:c;f[r].forEach((function(e){a+=(e.el.offsetHeight||0)+l}));var p="message_".concat(d+=1);n=Object.assign(Object.assign({},n),{offsetX:s,offsetY:a,id:p});var m=document.createElement("div"),y=(0,i.createVNode)(e,n);y.props.onDestroy=function(e){!function(e,t,n,r){null==r||r();var o=t.startsWith("top")?"top":"bottom",i=-1;f[t].forEach((function(t,n){t.props.id===e&&(i=n)}));for(var s=f[t][i].el.offsetHeight,a=f[t].length,c=i;c<a;c++){var l=parseInt(f[t][c].el.style[o],10)-s-n;f[t][c].component.props.offsetY=l}f[t].splice(i,1)}(e,r,l,o),(0,i.render)(null,m)},y.props.onDetail=function(e,t){f[r].forEach((function(e){var n,r;e.props.id!==t&&(null===(r=null===(n=e.component)||void 0===n?void 0:n.exposed)||void 0===r||r.setDetailsShow(null,!1))}))},(0,i.render)(y,m),f[r].push(y),(y.props.getContainer&&(0,u.isElement)(y.props.getContainer)?y.props.getContainer:document.body).appendChild(m.firstElementChild)}(N,e)}})();var l=c.Z;export{l as default};
|
1
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vue__ from "vue";
|
2
|
+
import * as __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__ from "../shared";
|
3
|
+
import * as __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__ from "vue-types";
|
4
|
+
import * as __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__ from "../config-provider";
|
5
|
+
import * as __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__ from "../icon";
|
6
|
+
/******/ var __webpack_modules__ = ({
|
7
|
+
|
8
|
+
/***/ 7647:
|
9
|
+
/***/ (function(module) {
|
10
|
+
|
11
|
+
/*!
|
12
|
+
* clipboard.js v2.0.11
|
13
|
+
* https://clipboardjs.com/
|
14
|
+
*
|
15
|
+
* Licensed MIT © Zeno Rocha
|
16
|
+
*/
|
17
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
18
|
+
if(true)
|
19
|
+
module.exports = factory();
|
20
|
+
else {}
|
21
|
+
})(this, function() {
|
22
|
+
return /******/ (function() { // webpackBootstrap
|
23
|
+
/******/ var __webpack_modules__ = ({
|
24
|
+
|
25
|
+
/***/ 686:
|
26
|
+
/***/ (function(__unused_webpack_module, __nested_webpack_exports__, __nested_webpack_require_623__) {
|
27
|
+
|
28
|
+
"use strict";
|
29
|
+
|
30
|
+
// EXPORTS
|
31
|
+
__nested_webpack_require_623__.d(__nested_webpack_exports__, {
|
32
|
+
"default": function() { return /* binding */ clipboard; }
|
33
|
+
});
|
34
|
+
|
35
|
+
// EXTERNAL MODULE: ./node_modules/tiny-emitter/index.js
|
36
|
+
var tiny_emitter = __nested_webpack_require_623__(279);
|
37
|
+
var tiny_emitter_default = /*#__PURE__*/__nested_webpack_require_623__.n(tiny_emitter);
|
38
|
+
// EXTERNAL MODULE: ./node_modules/good-listener/src/listen.js
|
39
|
+
var listen = __nested_webpack_require_623__(370);
|
40
|
+
var listen_default = /*#__PURE__*/__nested_webpack_require_623__.n(listen);
|
41
|
+
// EXTERNAL MODULE: ./node_modules/select/src/select.js
|
42
|
+
var src_select = __nested_webpack_require_623__(817);
|
43
|
+
var select_default = /*#__PURE__*/__nested_webpack_require_623__.n(src_select);
|
44
|
+
;// CONCATENATED MODULE: ./src/common/command.js
|
45
|
+
/**
|
46
|
+
* Executes a given operation type.
|
47
|
+
* @param {String} type
|
48
|
+
* @return {Boolean}
|
49
|
+
*/
|
50
|
+
function command(type) {
|
51
|
+
try {
|
52
|
+
return document.execCommand(type);
|
53
|
+
} catch (err) {
|
54
|
+
return false;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
;// CONCATENATED MODULE: ./src/actions/cut.js
|
58
|
+
|
59
|
+
|
60
|
+
/**
|
61
|
+
* Cut action wrapper.
|
62
|
+
* @param {String|HTMLElement} target
|
63
|
+
* @return {String}
|
64
|
+
*/
|
65
|
+
|
66
|
+
var ClipboardActionCut = function ClipboardActionCut(target) {
|
67
|
+
var selectedText = select_default()(target);
|
68
|
+
command('cut');
|
69
|
+
return selectedText;
|
70
|
+
};
|
71
|
+
|
72
|
+
/* harmony default export */ var actions_cut = (ClipboardActionCut);
|
73
|
+
;// CONCATENATED MODULE: ./src/common/create-fake-element.js
|
74
|
+
/**
|
75
|
+
* Creates a fake textarea element with a value.
|
76
|
+
* @param {String} value
|
77
|
+
* @return {HTMLElement}
|
78
|
+
*/
|
79
|
+
function createFakeElement(value) {
|
80
|
+
var isRTL = document.documentElement.getAttribute('dir') === 'rtl';
|
81
|
+
var fakeElement = document.createElement('textarea'); // Prevent zooming on iOS
|
82
|
+
|
83
|
+
fakeElement.style.fontSize = '12pt'; // Reset box model
|
84
|
+
|
85
|
+
fakeElement.style.border = '0';
|
86
|
+
fakeElement.style.padding = '0';
|
87
|
+
fakeElement.style.margin = '0'; // Move element out of screen horizontally
|
88
|
+
|
89
|
+
fakeElement.style.position = 'absolute';
|
90
|
+
fakeElement.style[isRTL ? 'right' : 'left'] = '-9999px'; // Move element to the same position vertically
|
91
|
+
|
92
|
+
var yPosition = window.pageYOffset || document.documentElement.scrollTop;
|
93
|
+
fakeElement.style.top = "".concat(yPosition, "px");
|
94
|
+
fakeElement.setAttribute('readonly', '');
|
95
|
+
fakeElement.value = value;
|
96
|
+
return fakeElement;
|
97
|
+
}
|
98
|
+
;// CONCATENATED MODULE: ./src/actions/copy.js
|
99
|
+
|
100
|
+
|
101
|
+
|
102
|
+
/**
|
103
|
+
* Create fake copy action wrapper using a fake element.
|
104
|
+
* @param {String} target
|
105
|
+
* @param {Object} options
|
106
|
+
* @return {String}
|
107
|
+
*/
|
108
|
+
|
109
|
+
var fakeCopyAction = function fakeCopyAction(value, options) {
|
110
|
+
var fakeElement = createFakeElement(value);
|
111
|
+
options.container.appendChild(fakeElement);
|
112
|
+
var selectedText = select_default()(fakeElement);
|
113
|
+
command('copy');
|
114
|
+
fakeElement.remove();
|
115
|
+
return selectedText;
|
116
|
+
};
|
117
|
+
/**
|
118
|
+
* Copy action wrapper.
|
119
|
+
* @param {String|HTMLElement} target
|
120
|
+
* @param {Object} options
|
121
|
+
* @return {String}
|
122
|
+
*/
|
123
|
+
|
124
|
+
|
125
|
+
var ClipboardActionCopy = function ClipboardActionCopy(target) {
|
126
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
127
|
+
container: document.body
|
128
|
+
};
|
129
|
+
var selectedText = '';
|
130
|
+
|
131
|
+
if (typeof target === 'string') {
|
132
|
+
selectedText = fakeCopyAction(target, options);
|
133
|
+
} else if (target instanceof HTMLInputElement && !['text', 'search', 'url', 'tel', 'password'].includes(target === null || target === void 0 ? void 0 : target.type)) {
|
134
|
+
// If input type doesn't support `setSelectionRange`. Simulate it. https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement/setSelectionRange
|
135
|
+
selectedText = fakeCopyAction(target.value, options);
|
136
|
+
} else {
|
137
|
+
selectedText = select_default()(target);
|
138
|
+
command('copy');
|
139
|
+
}
|
140
|
+
|
141
|
+
return selectedText;
|
142
|
+
};
|
143
|
+
|
144
|
+
/* harmony default export */ var actions_copy = (ClipboardActionCopy);
|
145
|
+
;// CONCATENATED MODULE: ./src/actions/default.js
|
146
|
+
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
147
|
+
|
148
|
+
|
149
|
+
|
150
|
+
/**
|
151
|
+
* Inner function which performs selection from either `text` or `target`
|
152
|
+
* properties and then executes copy or cut operations.
|
153
|
+
* @param {Object} options
|
154
|
+
*/
|
155
|
+
|
156
|
+
var ClipboardActionDefault = function ClipboardActionDefault() {
|
157
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
158
|
+
// Defines base properties passed from constructor.
|
159
|
+
var _options$action = options.action,
|
160
|
+
action = _options$action === void 0 ? 'copy' : _options$action,
|
161
|
+
container = options.container,
|
162
|
+
target = options.target,
|
163
|
+
text = options.text; // Sets the `action` to be performed which can be either 'copy' or 'cut'.
|
164
|
+
|
165
|
+
if (action !== 'copy' && action !== 'cut') {
|
166
|
+
throw new Error('Invalid "action" value, use either "copy" or "cut"');
|
167
|
+
} // Sets the `target` property using an element that will be have its content copied.
|
168
|
+
|
169
|
+
|
170
|
+
if (target !== undefined) {
|
171
|
+
if (target && _typeof(target) === 'object' && target.nodeType === 1) {
|
172
|
+
if (action === 'copy' && target.hasAttribute('disabled')) {
|
173
|
+
throw new Error('Invalid "target" attribute. Please use "readonly" instead of "disabled" attribute');
|
174
|
+
}
|
175
|
+
|
176
|
+
if (action === 'cut' && (target.hasAttribute('readonly') || target.hasAttribute('disabled'))) {
|
177
|
+
throw new Error('Invalid "target" attribute. You can\'t cut text from elements with "readonly" or "disabled" attributes');
|
178
|
+
}
|
179
|
+
} else {
|
180
|
+
throw new Error('Invalid "target" value, use a valid Element');
|
181
|
+
}
|
182
|
+
} // Define selection strategy based on `text` property.
|
183
|
+
|
184
|
+
|
185
|
+
if (text) {
|
186
|
+
return actions_copy(text, {
|
187
|
+
container: container
|
188
|
+
});
|
189
|
+
} // Defines which selection strategy based on `target` property.
|
190
|
+
|
191
|
+
|
192
|
+
if (target) {
|
193
|
+
return action === 'cut' ? actions_cut(target) : actions_copy(target, {
|
194
|
+
container: container
|
195
|
+
});
|
196
|
+
}
|
197
|
+
};
|
198
|
+
|
199
|
+
/* harmony default export */ var actions_default = (ClipboardActionDefault);
|
200
|
+
;// CONCATENATED MODULE: ./src/clipboard.js
|
201
|
+
function clipboard_typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { clipboard_typeof = function _typeof(obj) { return typeof obj; }; } else { clipboard_typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return clipboard_typeof(obj); }
|
202
|
+
|
203
|
+
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
204
|
+
|
205
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
206
|
+
|
207
|
+
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
208
|
+
|
209
|
+
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
210
|
+
|
211
|
+
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
212
|
+
|
213
|
+
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
214
|
+
|
215
|
+
function _possibleConstructorReturn(self, call) { if (call && (clipboard_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
216
|
+
|
217
|
+
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
218
|
+
|
219
|
+
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
220
|
+
|
221
|
+
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
222
|
+
|
223
|
+
|
224
|
+
|
225
|
+
|
226
|
+
|
227
|
+
|
228
|
+
/**
|
229
|
+
* Helper function to retrieve attribute value.
|
230
|
+
* @param {String} suffix
|
231
|
+
* @param {Element} element
|
232
|
+
*/
|
233
|
+
|
234
|
+
function getAttributeValue(suffix, element) {
|
235
|
+
var attribute = "data-clipboard-".concat(suffix);
|
236
|
+
|
237
|
+
if (!element.hasAttribute(attribute)) {
|
238
|
+
return;
|
239
|
+
}
|
240
|
+
|
241
|
+
return element.getAttribute(attribute);
|
242
|
+
}
|
243
|
+
/**
|
244
|
+
* Base class which takes one or more elements, adds event listeners to them,
|
245
|
+
* and instantiates a new `ClipboardAction` on each click.
|
246
|
+
*/
|
247
|
+
|
248
|
+
|
249
|
+
var Clipboard = /*#__PURE__*/function (_Emitter) {
|
250
|
+
_inherits(Clipboard, _Emitter);
|
251
|
+
|
252
|
+
var _super = _createSuper(Clipboard);
|
253
|
+
|
254
|
+
/**
|
255
|
+
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
256
|
+
* @param {Object} options
|
257
|
+
*/
|
258
|
+
function Clipboard(trigger, options) {
|
259
|
+
var _this;
|
260
|
+
|
261
|
+
_classCallCheck(this, Clipboard);
|
262
|
+
|
263
|
+
_this = _super.call(this);
|
264
|
+
|
265
|
+
_this.resolveOptions(options);
|
266
|
+
|
267
|
+
_this.listenClick(trigger);
|
268
|
+
|
269
|
+
return _this;
|
270
|
+
}
|
271
|
+
/**
|
272
|
+
* Defines if attributes would be resolved using internal setter functions
|
273
|
+
* or custom functions that were passed in the constructor.
|
274
|
+
* @param {Object} options
|
275
|
+
*/
|
276
|
+
|
277
|
+
|
278
|
+
_createClass(Clipboard, [{
|
279
|
+
key: "resolveOptions",
|
280
|
+
value: function resolveOptions() {
|
281
|
+
var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
282
|
+
this.action = typeof options.action === 'function' ? options.action : this.defaultAction;
|
283
|
+
this.target = typeof options.target === 'function' ? options.target : this.defaultTarget;
|
284
|
+
this.text = typeof options.text === 'function' ? options.text : this.defaultText;
|
285
|
+
this.container = clipboard_typeof(options.container) === 'object' ? options.container : document.body;
|
286
|
+
}
|
287
|
+
/**
|
288
|
+
* Adds a click event listener to the passed trigger.
|
289
|
+
* @param {String|HTMLElement|HTMLCollection|NodeList} trigger
|
290
|
+
*/
|
291
|
+
|
292
|
+
}, {
|
293
|
+
key: "listenClick",
|
294
|
+
value: function listenClick(trigger) {
|
295
|
+
var _this2 = this;
|
296
|
+
|
297
|
+
this.listener = listen_default()(trigger, 'click', function (e) {
|
298
|
+
return _this2.onClick(e);
|
299
|
+
});
|
300
|
+
}
|
301
|
+
/**
|
302
|
+
* Defines a new `ClipboardAction` on each click event.
|
303
|
+
* @param {Event} e
|
304
|
+
*/
|
305
|
+
|
306
|
+
}, {
|
307
|
+
key: "onClick",
|
308
|
+
value: function onClick(e) {
|
309
|
+
var trigger = e.delegateTarget || e.currentTarget;
|
310
|
+
var action = this.action(trigger) || 'copy';
|
311
|
+
var text = actions_default({
|
312
|
+
action: action,
|
313
|
+
container: this.container,
|
314
|
+
target: this.target(trigger),
|
315
|
+
text: this.text(trigger)
|
316
|
+
}); // Fires an event based on the copy operation result.
|
317
|
+
|
318
|
+
this.emit(text ? 'success' : 'error', {
|
319
|
+
action: action,
|
320
|
+
text: text,
|
321
|
+
trigger: trigger,
|
322
|
+
clearSelection: function clearSelection() {
|
323
|
+
if (trigger) {
|
324
|
+
trigger.focus();
|
325
|
+
}
|
326
|
+
|
327
|
+
window.getSelection().removeAllRanges();
|
328
|
+
}
|
329
|
+
});
|
330
|
+
}
|
331
|
+
/**
|
332
|
+
* Default `action` lookup function.
|
333
|
+
* @param {Element} trigger
|
334
|
+
*/
|
335
|
+
|
336
|
+
}, {
|
337
|
+
key: "defaultAction",
|
338
|
+
value: function defaultAction(trigger) {
|
339
|
+
return getAttributeValue('action', trigger);
|
340
|
+
}
|
341
|
+
/**
|
342
|
+
* Default `target` lookup function.
|
343
|
+
* @param {Element} trigger
|
344
|
+
*/
|
345
|
+
|
346
|
+
}, {
|
347
|
+
key: "defaultTarget",
|
348
|
+
value: function defaultTarget(trigger) {
|
349
|
+
var selector = getAttributeValue('target', trigger);
|
350
|
+
|
351
|
+
if (selector) {
|
352
|
+
return document.querySelector(selector);
|
353
|
+
}
|
354
|
+
}
|
355
|
+
/**
|
356
|
+
* Allow fire programmatically a copy action
|
357
|
+
* @param {String|HTMLElement} target
|
358
|
+
* @param {Object} options
|
359
|
+
* @returns Text copied.
|
360
|
+
*/
|
361
|
+
|
362
|
+
}, {
|
363
|
+
key: "defaultText",
|
364
|
+
|
365
|
+
/**
|
366
|
+
* Default `text` lookup function.
|
367
|
+
* @param {Element} trigger
|
368
|
+
*/
|
369
|
+
value: function defaultText(trigger) {
|
370
|
+
return getAttributeValue('text', trigger);
|
371
|
+
}
|
372
|
+
/**
|
373
|
+
* Destroy lifecycle.
|
374
|
+
*/
|
375
|
+
|
376
|
+
}, {
|
377
|
+
key: "destroy",
|
378
|
+
value: function destroy() {
|
379
|
+
this.listener.destroy();
|
380
|
+
}
|
381
|
+
}], [{
|
382
|
+
key: "copy",
|
383
|
+
value: function copy(target) {
|
384
|
+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
385
|
+
container: document.body
|
386
|
+
};
|
387
|
+
return actions_copy(target, options);
|
388
|
+
}
|
389
|
+
/**
|
390
|
+
* Allow fire programmatically a cut action
|
391
|
+
* @param {String|HTMLElement} target
|
392
|
+
* @returns Text cutted.
|
393
|
+
*/
|
394
|
+
|
395
|
+
}, {
|
396
|
+
key: "cut",
|
397
|
+
value: function cut(target) {
|
398
|
+
return actions_cut(target);
|
399
|
+
}
|
400
|
+
/**
|
401
|
+
* Returns the support of the given action, or all actions if no action is
|
402
|
+
* given.
|
403
|
+
* @param {String} [action]
|
404
|
+
*/
|
405
|
+
|
406
|
+
}, {
|
407
|
+
key: "isSupported",
|
408
|
+
value: function isSupported() {
|
409
|
+
var action = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ['copy', 'cut'];
|
410
|
+
var actions = typeof action === 'string' ? [action] : action;
|
411
|
+
var support = !!document.queryCommandSupported;
|
412
|
+
actions.forEach(function (action) {
|
413
|
+
support = support && !!document.queryCommandSupported(action);
|
414
|
+
});
|
415
|
+
return support;
|
416
|
+
}
|
417
|
+
}]);
|
418
|
+
|
419
|
+
return Clipboard;
|
420
|
+
}((tiny_emitter_default()));
|
421
|
+
|
422
|
+
/* harmony default export */ var clipboard = (Clipboard);
|
423
|
+
|
424
|
+
/***/ }),
|
425
|
+
|
426
|
+
/***/ 828:
|
427
|
+
/***/ (function(module) {
|
428
|
+
|
429
|
+
var DOCUMENT_NODE_TYPE = 9;
|
430
|
+
|
431
|
+
/**
|
432
|
+
* A polyfill for Element.matches()
|
433
|
+
*/
|
434
|
+
if (typeof Element !== 'undefined' && !Element.prototype.matches) {
|
435
|
+
var proto = Element.prototype;
|
436
|
+
|
437
|
+
proto.matches = proto.matchesSelector ||
|
438
|
+
proto.mozMatchesSelector ||
|
439
|
+
proto.msMatchesSelector ||
|
440
|
+
proto.oMatchesSelector ||
|
441
|
+
proto.webkitMatchesSelector;
|
442
|
+
}
|
443
|
+
|
444
|
+
/**
|
445
|
+
* Finds the closest parent that matches a selector.
|
446
|
+
*
|
447
|
+
* @param {Element} element
|
448
|
+
* @param {String} selector
|
449
|
+
* @return {Function}
|
450
|
+
*/
|
451
|
+
function closest (element, selector) {
|
452
|
+
while (element && element.nodeType !== DOCUMENT_NODE_TYPE) {
|
453
|
+
if (typeof element.matches === 'function' &&
|
454
|
+
element.matches(selector)) {
|
455
|
+
return element;
|
456
|
+
}
|
457
|
+
element = element.parentNode;
|
458
|
+
}
|
459
|
+
}
|
460
|
+
|
461
|
+
module.exports = closest;
|
462
|
+
|
463
|
+
|
464
|
+
/***/ }),
|
465
|
+
|
466
|
+
/***/ 438:
|
467
|
+
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_15749__) {
|
468
|
+
|
469
|
+
var closest = __nested_webpack_require_15749__(828);
|
470
|
+
|
471
|
+
/**
|
472
|
+
* Delegates event to a selector.
|
473
|
+
*
|
474
|
+
* @param {Element} element
|
475
|
+
* @param {String} selector
|
476
|
+
* @param {String} type
|
477
|
+
* @param {Function} callback
|
478
|
+
* @param {Boolean} useCapture
|
479
|
+
* @return {Object}
|
480
|
+
*/
|
481
|
+
function _delegate(element, selector, type, callback, useCapture) {
|
482
|
+
var listenerFn = listener.apply(this, arguments);
|
483
|
+
|
484
|
+
element.addEventListener(type, listenerFn, useCapture);
|
485
|
+
|
486
|
+
return {
|
487
|
+
destroy: function() {
|
488
|
+
element.removeEventListener(type, listenerFn, useCapture);
|
489
|
+
}
|
490
|
+
}
|
491
|
+
}
|
492
|
+
|
493
|
+
/**
|
494
|
+
* Delegates event to a selector.
|
495
|
+
*
|
496
|
+
* @param {Element|String|Array} [elements]
|
497
|
+
* @param {String} selector
|
498
|
+
* @param {String} type
|
499
|
+
* @param {Function} callback
|
500
|
+
* @param {Boolean} useCapture
|
501
|
+
* @return {Object}
|
502
|
+
*/
|
503
|
+
function delegate(elements, selector, type, callback, useCapture) {
|
504
|
+
// Handle the regular Element usage
|
505
|
+
if (typeof elements.addEventListener === 'function') {
|
506
|
+
return _delegate.apply(null, arguments);
|
507
|
+
}
|
508
|
+
|
509
|
+
// Handle Element-less usage, it defaults to global delegation
|
510
|
+
if (typeof type === 'function') {
|
511
|
+
// Use `document` as the first parameter, then apply arguments
|
512
|
+
// This is a short way to .unshift `arguments` without running into deoptimizations
|
513
|
+
return _delegate.bind(null, document).apply(null, arguments);
|
514
|
+
}
|
515
|
+
|
516
|
+
// Handle Selector-based usage
|
517
|
+
if (typeof elements === 'string') {
|
518
|
+
elements = document.querySelectorAll(elements);
|
519
|
+
}
|
520
|
+
|
521
|
+
// Handle Array-like based usage
|
522
|
+
return Array.prototype.map.call(elements, function (element) {
|
523
|
+
return _delegate(element, selector, type, callback, useCapture);
|
524
|
+
});
|
525
|
+
}
|
526
|
+
|
527
|
+
/**
|
528
|
+
* Finds closest match and invokes callback.
|
529
|
+
*
|
530
|
+
* @param {Element} element
|
531
|
+
* @param {String} selector
|
532
|
+
* @param {String} type
|
533
|
+
* @param {Function} callback
|
534
|
+
* @return {Function}
|
535
|
+
*/
|
536
|
+
function listener(element, selector, type, callback) {
|
537
|
+
return function(e) {
|
538
|
+
e.delegateTarget = closest(e.target, selector);
|
539
|
+
|
540
|
+
if (e.delegateTarget) {
|
541
|
+
callback.call(element, e);
|
542
|
+
}
|
543
|
+
}
|
544
|
+
}
|
545
|
+
|
546
|
+
module.exports = delegate;
|
547
|
+
|
548
|
+
|
549
|
+
/***/ }),
|
550
|
+
|
551
|
+
/***/ 879:
|
552
|
+
/***/ (function(__unused_webpack_module, exports) {
|
553
|
+
|
554
|
+
/**
|
555
|
+
* Check if argument is a HTML element.
|
556
|
+
*
|
557
|
+
* @param {Object} value
|
558
|
+
* @return {Boolean}
|
559
|
+
*/
|
560
|
+
exports.node = function(value) {
|
561
|
+
return value !== undefined
|
562
|
+
&& value instanceof HTMLElement
|
563
|
+
&& value.nodeType === 1;
|
564
|
+
};
|
565
|
+
|
566
|
+
/**
|
567
|
+
* Check if argument is a list of HTML elements.
|
568
|
+
*
|
569
|
+
* @param {Object} value
|
570
|
+
* @return {Boolean}
|
571
|
+
*/
|
572
|
+
exports.nodeList = function(value) {
|
573
|
+
var type = Object.prototype.toString.call(value);
|
574
|
+
|
575
|
+
return value !== undefined
|
576
|
+
&& (type === '[object NodeList]' || type === '[object HTMLCollection]')
|
577
|
+
&& ('length' in value)
|
578
|
+
&& (value.length === 0 || exports.node(value[0]));
|
579
|
+
};
|
580
|
+
|
581
|
+
/**
|
582
|
+
* Check if argument is a string.
|
583
|
+
*
|
584
|
+
* @param {Object} value
|
585
|
+
* @return {Boolean}
|
586
|
+
*/
|
587
|
+
exports.string = function(value) {
|
588
|
+
return typeof value === 'string'
|
589
|
+
|| value instanceof String;
|
590
|
+
};
|
591
|
+
|
592
|
+
/**
|
593
|
+
* Check if argument is a function.
|
594
|
+
*
|
595
|
+
* @param {Object} value
|
596
|
+
* @return {Boolean}
|
597
|
+
*/
|
598
|
+
exports.fn = function(value) {
|
599
|
+
var type = Object.prototype.toString.call(value);
|
600
|
+
|
601
|
+
return type === '[object Function]';
|
602
|
+
};
|
603
|
+
|
604
|
+
|
605
|
+
/***/ }),
|
606
|
+
|
607
|
+
/***/ 370:
|
608
|
+
/***/ (function(module, __unused_webpack_exports, __nested_webpack_require_19113__) {
|
609
|
+
|
610
|
+
var is = __nested_webpack_require_19113__(879);
|
611
|
+
var delegate = __nested_webpack_require_19113__(438);
|
612
|
+
|
613
|
+
/**
|
614
|
+
* Validates all params and calls the right
|
615
|
+
* listener function based on its target type.
|
616
|
+
*
|
617
|
+
* @param {String|HTMLElement|HTMLCollection|NodeList} target
|
618
|
+
* @param {String} type
|
619
|
+
* @param {Function} callback
|
620
|
+
* @return {Object}
|
621
|
+
*/
|
622
|
+
function listen(target, type, callback) {
|
623
|
+
if (!target && !type && !callback) {
|
624
|
+
throw new Error('Missing required arguments');
|
625
|
+
}
|
626
|
+
|
627
|
+
if (!is.string(type)) {
|
628
|
+
throw new TypeError('Second argument must be a String');
|
629
|
+
}
|
630
|
+
|
631
|
+
if (!is.fn(callback)) {
|
632
|
+
throw new TypeError('Third argument must be a Function');
|
633
|
+
}
|
634
|
+
|
635
|
+
if (is.node(target)) {
|
636
|
+
return listenNode(target, type, callback);
|
637
|
+
}
|
638
|
+
else if (is.nodeList(target)) {
|
639
|
+
return listenNodeList(target, type, callback);
|
640
|
+
}
|
641
|
+
else if (is.string(target)) {
|
642
|
+
return listenSelector(target, type, callback);
|
643
|
+
}
|
644
|
+
else {
|
645
|
+
throw new TypeError('First argument must be a String, HTMLElement, HTMLCollection, or NodeList');
|
646
|
+
}
|
647
|
+
}
|
648
|
+
|
649
|
+
/**
|
650
|
+
* Adds an event listener to a HTML element
|
651
|
+
* and returns a remove listener function.
|
652
|
+
*
|
653
|
+
* @param {HTMLElement} node
|
654
|
+
* @param {String} type
|
655
|
+
* @param {Function} callback
|
656
|
+
* @return {Object}
|
657
|
+
*/
|
658
|
+
function listenNode(node, type, callback) {
|
659
|
+
node.addEventListener(type, callback);
|
660
|
+
|
661
|
+
return {
|
662
|
+
destroy: function() {
|
663
|
+
node.removeEventListener(type, callback);
|
664
|
+
}
|
665
|
+
}
|
666
|
+
}
|
667
|
+
|
668
|
+
/**
|
669
|
+
* Add an event listener to a list of HTML elements
|
670
|
+
* and returns a remove listener function.
|
671
|
+
*
|
672
|
+
* @param {NodeList|HTMLCollection} nodeList
|
673
|
+
* @param {String} type
|
674
|
+
* @param {Function} callback
|
675
|
+
* @return {Object}
|
676
|
+
*/
|
677
|
+
function listenNodeList(nodeList, type, callback) {
|
678
|
+
Array.prototype.forEach.call(nodeList, function(node) {
|
679
|
+
node.addEventListener(type, callback);
|
680
|
+
});
|
681
|
+
|
682
|
+
return {
|
683
|
+
destroy: function() {
|
684
|
+
Array.prototype.forEach.call(nodeList, function(node) {
|
685
|
+
node.removeEventListener(type, callback);
|
686
|
+
});
|
687
|
+
}
|
688
|
+
}
|
689
|
+
}
|
690
|
+
|
691
|
+
/**
|
692
|
+
* Add an event listener to a selector
|
693
|
+
* and returns a remove listener function.
|
694
|
+
*
|
695
|
+
* @param {String} selector
|
696
|
+
* @param {String} type
|
697
|
+
* @param {Function} callback
|
698
|
+
* @return {Object}
|
699
|
+
*/
|
700
|
+
function listenSelector(selector, type, callback) {
|
701
|
+
return delegate(document.body, selector, type, callback);
|
702
|
+
}
|
703
|
+
|
704
|
+
module.exports = listen;
|
705
|
+
|
706
|
+
|
707
|
+
/***/ }),
|
708
|
+
|
709
|
+
/***/ 817:
|
710
|
+
/***/ (function(module) {
|
711
|
+
|
712
|
+
function select(element) {
|
713
|
+
var selectedText;
|
714
|
+
|
715
|
+
if (element.nodeName === 'SELECT') {
|
716
|
+
element.focus();
|
717
|
+
|
718
|
+
selectedText = element.value;
|
719
|
+
}
|
720
|
+
else if (element.nodeName === 'INPUT' || element.nodeName === 'TEXTAREA') {
|
721
|
+
var isReadOnly = element.hasAttribute('readonly');
|
722
|
+
|
723
|
+
if (!isReadOnly) {
|
724
|
+
element.setAttribute('readonly', '');
|
725
|
+
}
|
726
|
+
|
727
|
+
element.select();
|
728
|
+
element.setSelectionRange(0, element.value.length);
|
729
|
+
|
730
|
+
if (!isReadOnly) {
|
731
|
+
element.removeAttribute('readonly');
|
732
|
+
}
|
733
|
+
|
734
|
+
selectedText = element.value;
|
735
|
+
}
|
736
|
+
else {
|
737
|
+
if (element.hasAttribute('contenteditable')) {
|
738
|
+
element.focus();
|
739
|
+
}
|
740
|
+
|
741
|
+
var selection = window.getSelection();
|
742
|
+
var range = document.createRange();
|
743
|
+
|
744
|
+
range.selectNodeContents(element);
|
745
|
+
selection.removeAllRanges();
|
746
|
+
selection.addRange(range);
|
747
|
+
|
748
|
+
selectedText = selection.toString();
|
749
|
+
}
|
750
|
+
|
751
|
+
return selectedText;
|
752
|
+
}
|
753
|
+
|
754
|
+
module.exports = select;
|
755
|
+
|
756
|
+
|
757
|
+
/***/ }),
|
758
|
+
|
759
|
+
/***/ 279:
|
760
|
+
/***/ (function(module) {
|
761
|
+
|
762
|
+
function E () {
|
763
|
+
// Keep this empty so it's easier to inherit from
|
764
|
+
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
765
|
+
}
|
766
|
+
|
767
|
+
E.prototype = {
|
768
|
+
on: function (name, callback, ctx) {
|
769
|
+
var e = this.e || (this.e = {});
|
770
|
+
|
771
|
+
(e[name] || (e[name] = [])).push({
|
772
|
+
fn: callback,
|
773
|
+
ctx: ctx
|
774
|
+
});
|
775
|
+
|
776
|
+
return this;
|
777
|
+
},
|
778
|
+
|
779
|
+
once: function (name, callback, ctx) {
|
780
|
+
var self = this;
|
781
|
+
function listener () {
|
782
|
+
self.off(name, listener);
|
783
|
+
callback.apply(ctx, arguments);
|
784
|
+
};
|
785
|
+
|
786
|
+
listener._ = callback
|
787
|
+
return this.on(name, listener, ctx);
|
788
|
+
},
|
789
|
+
|
790
|
+
emit: function (name) {
|
791
|
+
var data = [].slice.call(arguments, 1);
|
792
|
+
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
793
|
+
var i = 0;
|
794
|
+
var len = evtArr.length;
|
795
|
+
|
796
|
+
for (i; i < len; i++) {
|
797
|
+
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
798
|
+
}
|
799
|
+
|
800
|
+
return this;
|
801
|
+
},
|
802
|
+
|
803
|
+
off: function (name, callback) {
|
804
|
+
var e = this.e || (this.e = {});
|
805
|
+
var evts = e[name];
|
806
|
+
var liveEvents = [];
|
807
|
+
|
808
|
+
if (evts && callback) {
|
809
|
+
for (var i = 0, len = evts.length; i < len; i++) {
|
810
|
+
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
811
|
+
liveEvents.push(evts[i]);
|
812
|
+
}
|
813
|
+
}
|
814
|
+
|
815
|
+
// Remove event from queue to prevent memory leak
|
816
|
+
// Suggested by https://github.com/lazd
|
817
|
+
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
|
818
|
+
|
819
|
+
(liveEvents.length)
|
820
|
+
? e[name] = liveEvents
|
821
|
+
: delete e[name];
|
822
|
+
|
823
|
+
return this;
|
824
|
+
}
|
825
|
+
};
|
826
|
+
|
827
|
+
module.exports = E;
|
828
|
+
module.exports.TinyEmitter = E;
|
829
|
+
|
830
|
+
|
831
|
+
/***/ })
|
832
|
+
|
833
|
+
/******/ });
|
834
|
+
/************************************************************************/
|
835
|
+
/******/ // The module cache
|
836
|
+
/******/ var __webpack_module_cache__ = {};
|
837
|
+
/******/
|
838
|
+
/******/ // The require function
|
839
|
+
/******/ function __nested_webpack_require_24495__(moduleId) {
|
840
|
+
/******/ // Check if module is in cache
|
841
|
+
/******/ if(__webpack_module_cache__[moduleId]) {
|
842
|
+
/******/ return __webpack_module_cache__[moduleId].exports;
|
843
|
+
/******/ }
|
844
|
+
/******/ // Create a new module (and put it into the cache)
|
845
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
846
|
+
/******/ // no module.id needed
|
847
|
+
/******/ // no module.loaded needed
|
848
|
+
/******/ exports: {}
|
849
|
+
/******/ };
|
850
|
+
/******/
|
851
|
+
/******/ // Execute the module function
|
852
|
+
/******/ __webpack_modules__[moduleId](module, module.exports, __nested_webpack_require_24495__);
|
853
|
+
/******/
|
854
|
+
/******/ // Return the exports of the module
|
855
|
+
/******/ return module.exports;
|
856
|
+
/******/ }
|
857
|
+
/******/
|
858
|
+
/************************************************************************/
|
859
|
+
/******/ /* webpack/runtime/compat get default export */
|
860
|
+
/******/ !function() {
|
861
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
862
|
+
/******/ __nested_webpack_require_24495__.n = function(module) {
|
863
|
+
/******/ var getter = module && module.__esModule ?
|
864
|
+
/******/ function() { return module['default']; } :
|
865
|
+
/******/ function() { return module; };
|
866
|
+
/******/ __nested_webpack_require_24495__.d(getter, { a: getter });
|
867
|
+
/******/ return getter;
|
868
|
+
/******/ };
|
869
|
+
/******/ }();
|
870
|
+
/******/
|
871
|
+
/******/ /* webpack/runtime/define property getters */
|
872
|
+
/******/ !function() {
|
873
|
+
/******/ // define getter functions for harmony exports
|
874
|
+
/******/ __nested_webpack_require_24495__.d = function(exports, definition) {
|
875
|
+
/******/ for(var key in definition) {
|
876
|
+
/******/ if(__nested_webpack_require_24495__.o(definition, key) && !__nested_webpack_require_24495__.o(exports, key)) {
|
877
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
878
|
+
/******/ }
|
879
|
+
/******/ }
|
880
|
+
/******/ };
|
881
|
+
/******/ }();
|
882
|
+
/******/
|
883
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
884
|
+
/******/ !function() {
|
885
|
+
/******/ __nested_webpack_require_24495__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }
|
886
|
+
/******/ }();
|
887
|
+
/******/
|
888
|
+
/************************************************************************/
|
889
|
+
/******/ // module exports must be returned from runtime so entry inlining is disabled
|
890
|
+
/******/ // startup
|
891
|
+
/******/ // Load entry module and return exports
|
892
|
+
/******/ return __nested_webpack_require_24495__(686);
|
893
|
+
/******/ })()
|
894
|
+
.default;
|
895
|
+
});
|
896
|
+
|
897
|
+
/***/ }),
|
898
|
+
|
899
|
+
/***/ 4346:
|
900
|
+
/***/ (function(module) {
|
901
|
+
|
902
|
+
!function(t,e){ true?module.exports=e():0}(this,(function(){"use strict";function t(t){return null===t?"null":typeof t}function e(t){return!!t&&"object"==typeof t}function r(t){if(void 0===t)return"";if(null===t)return"Object";if("object"==typeof t&&!t.constructor)return"Object";var e=/function ([^(]*)/.exec(t.constructor.toString());return e&&e.length>1?e[1]:""}function n(t,e,r){return"null"===t||"undefined"===t?t:("string"!==t&&"stringifiable"!==t||(r='"'+r.replace(/"/g,'\\"')+'"'),"function"===t?e.toString().replace(/[\r\n]/g,"").replace(/\{.*\}/,"")+"{…}":r)}function o(o){var i="";return e(o)?(i=r(o),Array.isArray(o)&&(i+="["+o.length+"]")):i=n(t(o),o,o),i}function i(t){return"json-formatter-"+t}function s(t,e,r){var n=document.createElement(t);return e&&n.classList.add(i(e)),void 0!==r&&(r instanceof Node?n.appendChild(r):n.appendChild(document.createTextNode(String(r)))),n}!function(t){if(t&&"undefined"!=typeof window){var e=document.createElement("style");e.setAttribute("media","screen"),e.innerHTML=t,document.head.appendChild(e)}}('.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-row,\n.json-formatter-row a,\n.json-formatter-row a:hover {\n color: black;\n text-decoration: none;\n}\n.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-row .json-formatter-string,\n.json-formatter-row .json-formatter-stringifiable {\n color: green;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-row .json-formatter-number {\n color: blue;\n}\n.json-formatter-row .json-formatter-boolean {\n color: red;\n}\n.json-formatter-row .json-formatter-null {\n color: #855A00;\n}\n.json-formatter-row .json-formatter-undefined {\n color: #ca0b69;\n}\n.json-formatter-row .json-formatter-function {\n color: #FF20ED;\n}\n.json-formatter-row .json-formatter-date {\n background-color: rgba(0, 0, 0, 0.05);\n}\n.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: blue;\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-bracket {\n color: blue;\n}\n.json-formatter-row .json-formatter-key {\n color: #00008B;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n.json-formatter-dark.json-formatter-row {\n font-family: monospace;\n}\n.json-formatter-dark.json-formatter-row,\n.json-formatter-dark.json-formatter-row a,\n.json-formatter-dark.json-formatter-row a:hover {\n color: white;\n text-decoration: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-row {\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty {\n opacity: 0.5;\n margin-left: 1rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty:after {\n display: none;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-object:after {\n content: "No properties";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-children.json-formatter-empty.json-formatter-array:after {\n content: "[]";\n}\n.json-formatter-dark.json-formatter-row .json-formatter-string,\n.json-formatter-dark.json-formatter-row .json-formatter-stringifiable {\n color: #31F031;\n white-space: pre;\n word-wrap: break-word;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-number {\n color: #66C2FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-boolean {\n color: #EC4242;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-null {\n color: #EEC97D;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-undefined {\n color: #ef8fbe;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-function {\n color: #FD48CB;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-date {\n background-color: rgba(255, 255, 255, 0.05);\n}\n.json-formatter-dark.json-formatter-row .json-formatter-url {\n text-decoration: underline;\n color: #027BFF;\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-bracket {\n color: #9494FF;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-key {\n color: #23A0DB;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler-link {\n cursor: pointer;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler {\n line-height: 1.2rem;\n font-size: 0.7rem;\n vertical-align: middle;\n opacity: 0.6;\n cursor: pointer;\n padding-right: 0.2rem;\n}\n.json-formatter-dark.json-formatter-row .json-formatter-toggler:after {\n display: inline-block;\n transition: transform 100ms ease-in;\n content: "►";\n}\n.json-formatter-dark.json-formatter-row > a > .json-formatter-preview-text {\n opacity: 0;\n transition: opacity 0.15s ease-in;\n font-style: italic;\n}\n.json-formatter-dark.json-formatter-row:hover > a > .json-formatter-preview-text {\n opacity: 0.6;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-toggler-link .json-formatter-toggler:after {\n transform: rotate(90deg);\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > .json-formatter-children:after {\n display: inline-block;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open > a > .json-formatter-preview-text {\n display: none;\n}\n.json-formatter-dark.json-formatter-row.json-formatter-open.json-formatter-empty:after {\n display: block;\n}\n');var a=/(^\d{1,4}[\.|\\/|-]\d{1,2}[\.|\\/|-]\d{1,4})(\s*(?:0?[1-9]:[0-5]|1(?=[012])\d:[0-5])\d\s*[ap]m)?$/,f=/\d{2}:\d{2}:\d{2} GMT-\d{4}/,m=/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/,l=window.requestAnimationFrame||function(t){return t(),0},d={hoverPreviewEnabled:!1,hoverPreviewArrayCount:100,hoverPreviewFieldCount:5,animateOpen:!0,animateClose:!0,theme:null,useToJSON:!0,sortPropertiesBy:null};return function(){function c(t,e,r,n){void 0===e&&(e=1),void 0===r&&(r=d),this.json=t,this.open=e,this.config=r,this.key=n,this._isOpen=null,void 0===this.config.hoverPreviewEnabled&&(this.config.hoverPreviewEnabled=d.hoverPreviewEnabled),void 0===this.config.hoverPreviewArrayCount&&(this.config.hoverPreviewArrayCount=d.hoverPreviewArrayCount),void 0===this.config.hoverPreviewFieldCount&&(this.config.hoverPreviewFieldCount=d.hoverPreviewFieldCount),void 0===this.config.useToJSON&&(this.config.useToJSON=d.useToJSON),""===this.key&&(this.key='""')}return Object.defineProperty(c.prototype,"isOpen",{get:function(){return null!==this._isOpen?this._isOpen:this.open>0},set:function(t){this._isOpen=t},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isDate",{get:function(){return this.json instanceof Date||"string"===this.type&&(a.test(this.json)||m.test(this.json)||f.test(this.json))},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isUrl",{get:function(){return"string"===this.type&&0===this.json.indexOf("http")},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isArray",{get:function(){return Array.isArray(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isObject",{get:function(){return e(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isEmptyObject",{get:function(){return!this.keys.length&&!this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"isEmpty",{get:function(){return this.isEmptyObject||this.keys&&!this.keys.length&&this.isArray},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"useToJSON",{get:function(){return this.config.useToJSON&&"stringifiable"===this.type},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"hasKey",{get:function(){return void 0!==this.key},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"constructorName",{get:function(){return r(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"type",{get:function(){return this.config.useToJSON&&this.json&&this.json.toJSON?"stringifiable":t(this.json)},enumerable:!0,configurable:!0}),Object.defineProperty(c.prototype,"keys",{get:function(){if(this.isObject){var t=Object.keys(this.json);return!this.isArray&&this.config.sortPropertiesBy?t.sort(this.config.sortPropertiesBy):t}return[]},enumerable:!0,configurable:!0}),c.prototype.toggleOpen=function(){this.isOpen=!this.isOpen,this.element&&(this.isOpen?this.appendChildren(this.config.animateOpen):this.removeChildren(this.config.animateClose),this.element.classList.toggle(i("open")))},c.prototype.openAtDepth=function(t){void 0===t&&(t=1),t<0||(this.open=t,this.isOpen=0!==t,this.element&&(this.removeChildren(!1),0===t?this.element.classList.remove(i("open")):(this.appendChildren(this.config.animateOpen),this.element.classList.add(i("open")))))},c.prototype.getInlinepreview=function(){var t=this;if(this.isArray)return this.json.length>this.config.hoverPreviewArrayCount?"Array["+this.json.length+"]":"["+this.json.map(o).join(", ")+"]";var e=this.keys,r=e.slice(0,this.config.hoverPreviewFieldCount).map((function(e){return e+":"+o(t.json[e])})),n=e.length>=this.config.hoverPreviewFieldCount?"…":"";return"{"+r.join(", ")+n+"}"},c.prototype.render=function(){this.element=s("div","row");var t=this.isObject?s("a","toggler-link"):s("span");if(this.isObject&&!this.useToJSON&&t.appendChild(s("span","toggler")),this.hasKey&&t.appendChild(s("span","key",this.key+":")),this.isObject&&!this.useToJSON){var e=s("span","value"),r=s("span"),o=s("span","constructor-name",this.constructorName);if(r.appendChild(o),this.isArray){var a=s("span");a.appendChild(s("span","bracket","[")),a.appendChild(s("span","number",this.json.length)),a.appendChild(s("span","bracket","]")),r.appendChild(a)}e.appendChild(r),t.appendChild(e)}else{(e=this.isUrl?s("a"):s("span")).classList.add(i(this.type)),this.isDate&&e.classList.add(i("date")),this.isUrl&&(e.classList.add(i("url")),e.setAttribute("href",this.json));var f=n(this.type,this.json,this.useToJSON?this.json.toJSON():this.json);e.appendChild(document.createTextNode(f)),t.appendChild(e)}if(this.isObject&&this.config.hoverPreviewEnabled){var m=s("span","preview-text");m.appendChild(document.createTextNode(this.getInlinepreview())),t.appendChild(m)}var l=s("div","children");return this.isObject&&l.classList.add(i("object")),this.isArray&&l.classList.add(i("array")),this.isEmpty&&l.classList.add(i("empty")),this.config&&this.config.theme&&this.element.classList.add(i(this.config.theme)),this.isOpen&&this.element.classList.add(i("open")),this.element.appendChild(t),this.element.appendChild(l),this.isObject&&this.isOpen&&this.appendChildren(),this.isObject&&!this.useToJSON&&t.addEventListener("click",this.toggleOpen.bind(this)),this.element},c.prototype.appendChildren=function(t){var e=this;void 0===t&&(t=!1);var r=this.element.querySelector("div."+i("children"));if(r&&!this.isEmpty)if(t){var n=0,o=function(){var t=e.keys[n],i=new c(e.json[t],e.open-1,e.config,t);r.appendChild(i.render()),(n+=1)<e.keys.length&&(n>10?o():l(o))};l(o)}else this.keys.forEach((function(t){var n=new c(e.json[t],e.open-1,e.config,t);r.appendChild(n.render())}))},c.prototype.removeChildren=function(t){void 0===t&&(t=!1);var e=this.element.querySelector("div."+i("children"));if(t){var r=0,n=function(){e&&e.children.length&&(e.removeChild(e.children[0]),(r+=1)>10?n():l(n))};l(n)}else e&&(e.innerHTML="")},c}()}));
|
903
|
+
|
904
|
+
|
905
|
+
/***/ })
|
906
|
+
|
907
|
+
/******/ });
|
908
|
+
/************************************************************************/
|
909
|
+
/******/ // The module cache
|
910
|
+
/******/ var __webpack_module_cache__ = {};
|
911
|
+
/******/
|
912
|
+
/******/ // The require function
|
913
|
+
/******/ function __webpack_require__(moduleId) {
|
914
|
+
/******/ // Check if module is in cache
|
915
|
+
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
916
|
+
/******/ if (cachedModule !== undefined) {
|
917
|
+
/******/ return cachedModule.exports;
|
918
|
+
/******/ }
|
919
|
+
/******/ // Create a new module (and put it into the cache)
|
920
|
+
/******/ var module = __webpack_module_cache__[moduleId] = {
|
921
|
+
/******/ // no module.id needed
|
922
|
+
/******/ // no module.loaded needed
|
923
|
+
/******/ exports: {}
|
924
|
+
/******/ };
|
925
|
+
/******/
|
926
|
+
/******/ // Execute the module function
|
927
|
+
/******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
928
|
+
/******/
|
929
|
+
/******/ // Return the exports of the module
|
930
|
+
/******/ return module.exports;
|
931
|
+
/******/ }
|
932
|
+
/******/
|
933
|
+
/************************************************************************/
|
934
|
+
/******/ /* webpack/runtime/compat get default export */
|
935
|
+
/******/ (() => {
|
936
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
937
|
+
/******/ __webpack_require__.n = (module) => {
|
938
|
+
/******/ var getter = module && module.__esModule ?
|
939
|
+
/******/ () => (module['default']) :
|
940
|
+
/******/ () => (module);
|
941
|
+
/******/ __webpack_require__.d(getter, { a: getter });
|
942
|
+
/******/ return getter;
|
943
|
+
/******/ };
|
944
|
+
/******/ })();
|
945
|
+
/******/
|
946
|
+
/******/ /* webpack/runtime/define property getters */
|
947
|
+
/******/ (() => {
|
948
|
+
/******/ // define getter functions for harmony exports
|
949
|
+
/******/ __webpack_require__.d = (exports, definition) => {
|
950
|
+
/******/ for(var key in definition) {
|
951
|
+
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
952
|
+
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
953
|
+
/******/ }
|
954
|
+
/******/ }
|
955
|
+
/******/ };
|
956
|
+
/******/ })();
|
957
|
+
/******/
|
958
|
+
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
959
|
+
/******/ (() => {
|
960
|
+
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
961
|
+
/******/ })();
|
962
|
+
/******/
|
963
|
+
/************************************************************************/
|
964
|
+
var __webpack_exports__ = {};
|
965
|
+
// This entry need to be wrapped in an IIFE because it need to be isolated against other modules in the chunk.
|
966
|
+
(() => {
|
967
|
+
|
968
|
+
// EXPORTS
|
969
|
+
__webpack_require__.d(__webpack_exports__, {
|
970
|
+
Z: () => (/* binding */ src)
|
971
|
+
});
|
972
|
+
|
973
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/typeof.js
|
974
|
+
function _typeof(obj) {
|
975
|
+
"@babel/helpers - typeof";
|
976
|
+
|
977
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) {
|
978
|
+
return typeof obj;
|
979
|
+
} : function (obj) {
|
980
|
+
return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
|
981
|
+
}, _typeof(obj);
|
982
|
+
}
|
983
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
984
|
+
|
985
|
+
function _toPrimitive(input, hint) {
|
986
|
+
if (_typeof(input) !== "object" || input === null) return input;
|
987
|
+
var prim = input[Symbol.toPrimitive];
|
988
|
+
if (prim !== undefined) {
|
989
|
+
var res = prim.call(input, hint || "default");
|
990
|
+
if (_typeof(res) !== "object") return res;
|
991
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
992
|
+
}
|
993
|
+
return (hint === "string" ? String : Number)(input);
|
994
|
+
}
|
995
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
996
|
+
|
997
|
+
|
998
|
+
function _toPropertyKey(arg) {
|
999
|
+
var key = _toPrimitive(arg, "string");
|
1000
|
+
return _typeof(key) === "symbol" ? key : String(key);
|
1001
|
+
}
|
1002
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
1003
|
+
|
1004
|
+
function _defineProperty(obj, key, value) {
|
1005
|
+
key = _toPropertyKey(key);
|
1006
|
+
if (key in obj) {
|
1007
|
+
Object.defineProperty(obj, key, {
|
1008
|
+
value: value,
|
1009
|
+
enumerable: true,
|
1010
|
+
configurable: true,
|
1011
|
+
writable: true
|
1012
|
+
});
|
1013
|
+
} else {
|
1014
|
+
obj[key] = value;
|
1015
|
+
}
|
1016
|
+
return obj;
|
1017
|
+
}
|
1018
|
+
;// CONCATENATED MODULE: external "vue"
|
1019
|
+
var x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1020
|
+
var y = x => () => x
|
1021
|
+
const external_vue_namespaceObject = x({ ["Fragment"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Fragment, ["Transition"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.Transition, ["computed"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.computed, ["createVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.createVNode, ["defineComponent"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.defineComponent, ["isVNode"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.isVNode, ["onMounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onMounted, ["onUnmounted"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.onUnmounted, ["reactive"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.reactive, ["ref"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.ref, ["render"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.render, ["vShow"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.vShow, ["watch"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.watch, ["withDirectives"]: () => __WEBPACK_EXTERNAL_MODULE_vue__.withDirectives });
|
1022
|
+
;// CONCATENATED MODULE: external "../shared"
|
1023
|
+
var external_shared_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1024
|
+
var external_shared_y = x => () => x
|
1025
|
+
const external_shared_namespaceObject = external_shared_x({ ["PropTypes"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.PropTypes, ["bkZIndexManager"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.bkZIndexManager, ["isElement"]: () => __WEBPACK_EXTERNAL_MODULE__shared_65459f0a__.isElement });
|
1026
|
+
;// CONCATENATED MODULE: ../../packages/hooks/use-message.ts
|
1027
|
+
|
1028
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
1029
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
1030
|
+
/*
|
1031
|
+
* Tencent is pleased to support the open source community by making
|
1032
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1033
|
+
*
|
1034
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1035
|
+
*
|
1036
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1037
|
+
*
|
1038
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1039
|
+
*
|
1040
|
+
* ---------------------------------------------------
|
1041
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1042
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1043
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1044
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1045
|
+
*
|
1046
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1047
|
+
* the Software.
|
1048
|
+
*
|
1049
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1050
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1051
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1052
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1053
|
+
* IN THE SOFTWARE.
|
1054
|
+
*/
|
1055
|
+
|
1056
|
+
|
1057
|
+
var instances = {
|
1058
|
+
'top-left': [],
|
1059
|
+
'top-right': [],
|
1060
|
+
'bottom-left': [],
|
1061
|
+
'bottom-right': []
|
1062
|
+
};
|
1063
|
+
var seed = 1;
|
1064
|
+
var Message = function Message(constructor, options) {
|
1065
|
+
var opts = options;
|
1066
|
+
var position = opts.position || 'top-right';
|
1067
|
+
if (typeof options === 'string') {
|
1068
|
+
opts = {
|
1069
|
+
message: options
|
1070
|
+
};
|
1071
|
+
}
|
1072
|
+
var userOnClose = options.onClose;
|
1073
|
+
var horizontalOffset = opts.offsetX || 10;
|
1074
|
+
var verticalOffset = opts.offsetY || 30;
|
1075
|
+
var _opts = opts,
|
1076
|
+
_opts$spacing = _opts.spacing,
|
1077
|
+
spacing = _opts$spacing === void 0 ? 10 : _opts$spacing;
|
1078
|
+
instances[position].forEach(function (vm) {
|
1079
|
+
verticalOffset += (vm.el.offsetHeight || 0) + spacing;
|
1080
|
+
});
|
1081
|
+
seed += 1;
|
1082
|
+
var id = "message_".concat(seed);
|
1083
|
+
opts = _objectSpread(_objectSpread({}, opts), {}, {
|
1084
|
+
offsetX: horizontalOffset,
|
1085
|
+
offsetY: verticalOffset,
|
1086
|
+
id: id
|
1087
|
+
});
|
1088
|
+
var container = document.createElement('div');
|
1089
|
+
var vm = (0,external_vue_namespaceObject.createVNode)(constructor, opts);
|
1090
|
+
// const updateModalPosition = () => {
|
1091
|
+
// let offsetTop = 30;
|
1092
|
+
// instances[position].forEach((vm) => {
|
1093
|
+
// offsetTop += (vm.el.offsetHeight || 0) + spacing;
|
1094
|
+
// vm.props.offsetY = offsetTop;
|
1095
|
+
// });
|
1096
|
+
// };
|
1097
|
+
vm.props.onDestroy = function (id) {
|
1098
|
+
use_message_close(id, position, spacing, userOnClose);
|
1099
|
+
(0,external_vue_namespaceObject.render)(null, container);
|
1100
|
+
};
|
1101
|
+
vm.props.onDetail = function (_isShow, id) {
|
1102
|
+
instances[position].forEach(function (item) {
|
1103
|
+
if (item.props.id !== id) {
|
1104
|
+
var _item$component;
|
1105
|
+
(_item$component = item.component) === null || _item$component === void 0 || (_item$component = _item$component.exposed) === null || _item$component === void 0 ? void 0 : _item$component.setDetailsShow(null, false);
|
1106
|
+
}
|
1107
|
+
});
|
1108
|
+
// setTimeout(() => {
|
1109
|
+
// console.log('updateModalPosition');
|
1110
|
+
// updateModalPosition();
|
1111
|
+
// });
|
1112
|
+
};
|
1113
|
+
|
1114
|
+
(0,external_vue_namespaceObject.render)(vm, container);
|
1115
|
+
instances[position].push(vm);
|
1116
|
+
var target;
|
1117
|
+
if (vm.props.getContainer && (0,external_shared_namespaceObject.isElement)(vm.props.getContainer)) {
|
1118
|
+
target = vm.props.getContainer;
|
1119
|
+
} else {
|
1120
|
+
target = document.body;
|
1121
|
+
}
|
1122
|
+
target.appendChild(container.firstElementChild);
|
1123
|
+
};
|
1124
|
+
function use_message_close(id, position, spacing, userOnClose) {
|
1125
|
+
userOnClose === null || userOnClose === void 0 ? void 0 : userOnClose();
|
1126
|
+
var verticalProperty = position.startsWith('top') ? 'top' : 'bottom';
|
1127
|
+
var instanceIndex = -1;
|
1128
|
+
instances[position].forEach(function (item, index) {
|
1129
|
+
if (item.props.id === id) {
|
1130
|
+
instanceIndex = index;
|
1131
|
+
}
|
1132
|
+
});
|
1133
|
+
var vm = instances[position][instanceIndex];
|
1134
|
+
var removeHeight = vm.el.offsetHeight;
|
1135
|
+
var len = instances[position].length;
|
1136
|
+
for (var i = instanceIndex; i < len; i++) {
|
1137
|
+
var pos = parseInt(instances[position][i].el.style[verticalProperty], 10) - removeHeight - spacing;
|
1138
|
+
instances[position][i].component.props.offsetY = pos;
|
1139
|
+
}
|
1140
|
+
instances[position].splice(instanceIndex, 1);
|
1141
|
+
}
|
1142
|
+
/* harmony default export */ const use_message = (Message);
|
1143
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js
|
1144
|
+
function _arrayLikeToArray(arr, len) {
|
1145
|
+
if (len == null || len > arr.length) len = arr.length;
|
1146
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
1147
|
+
return arr2;
|
1148
|
+
}
|
1149
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js
|
1150
|
+
|
1151
|
+
function _arrayWithoutHoles(arr) {
|
1152
|
+
if (Array.isArray(arr)) return _arrayLikeToArray(arr);
|
1153
|
+
}
|
1154
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js
|
1155
|
+
function _iterableToArray(iter) {
|
1156
|
+
if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter);
|
1157
|
+
}
|
1158
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js
|
1159
|
+
|
1160
|
+
function _unsupportedIterableToArray(o, minLen) {
|
1161
|
+
if (!o) return;
|
1162
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
1163
|
+
var n = Object.prototype.toString.call(o).slice(8, -1);
|
1164
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
1165
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
1166
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
1167
|
+
}
|
1168
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js
|
1169
|
+
function _nonIterableSpread() {
|
1170
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
1171
|
+
}
|
1172
|
+
;// CONCATENATED MODULE: ../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js
|
1173
|
+
|
1174
|
+
|
1175
|
+
|
1176
|
+
|
1177
|
+
function _toConsumableArray(arr) {
|
1178
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread();
|
1179
|
+
}
|
1180
|
+
// EXTERNAL MODULE: ../../node_modules/clipboard/dist/clipboard.js
|
1181
|
+
var clipboard = __webpack_require__(7647);
|
1182
|
+
var clipboard_default = /*#__PURE__*/__webpack_require__.n(clipboard);
|
1183
|
+
// EXTERNAL MODULE: ../../node_modules/json-formatter-js/dist/json-formatter.umd.js
|
1184
|
+
var json_formatter_umd = __webpack_require__(4346);
|
1185
|
+
var json_formatter_umd_default = /*#__PURE__*/__webpack_require__.n(json_formatter_umd);
|
1186
|
+
;// CONCATENATED MODULE: external "vue-types"
|
1187
|
+
var external_vue_types_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1188
|
+
var external_vue_types_y = x => () => x
|
1189
|
+
const external_vue_types_namespaceObject = external_vue_types_x({ ["toType"]: () => __WEBPACK_EXTERNAL_MODULE_vue_types_22de060a__.toType });
|
1190
|
+
;// CONCATENATED MODULE: external "../config-provider"
|
1191
|
+
var external_config_provider_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1192
|
+
var external_config_provider_y = x => () => x
|
1193
|
+
const external_config_provider_namespaceObject = external_config_provider_x({ ["useLocale"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.useLocale, ["usePrefix"]: () => __WEBPACK_EXTERNAL_MODULE__config_provider_9d0186d9__.usePrefix });
|
1194
|
+
;// CONCATENATED MODULE: external "../icon"
|
1195
|
+
var external_icon_x = y => { var x = {}; __webpack_require__.d(x, y); return x; }
|
1196
|
+
var external_icon_y = x => () => x
|
1197
|
+
const external_icon_namespaceObject = external_icon_x({ ["AngleDoubleDownLine"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleDoubleDownLine, ["AngleDoubleUpLine"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.AngleDoubleUpLine, ["Assistant"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Assistant, ["Close"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Close, ["CopyShape"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.CopyShape, ["Error"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Error, ["FixLine"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.FixLine, ["FixShape"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.FixShape, ["Info"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Info, ["Success"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Success, ["Warn"]: () => __WEBPACK_EXTERNAL_MODULE__icon_85385c3e__.Warn });
|
1198
|
+
;// CONCATENATED MODULE: ../../packages/message/src/messageConstructor.tsx
|
1199
|
+
|
1200
|
+
|
1201
|
+
|
1202
|
+
|
1203
|
+
function messageConstructor_ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
1204
|
+
function messageConstructor_objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? messageConstructor_ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : messageConstructor_ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
1205
|
+
/*
|
1206
|
+
* Tencent is pleased to support the open source community by making
|
1207
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1208
|
+
*
|
1209
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1210
|
+
*
|
1211
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1212
|
+
*
|
1213
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1214
|
+
*
|
1215
|
+
* ---------------------------------------------------
|
1216
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1217
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1218
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1219
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1220
|
+
*
|
1221
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1222
|
+
* the Software.
|
1223
|
+
*
|
1224
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1225
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1226
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1227
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1228
|
+
* IN THE SOFTWARE.
|
1229
|
+
*/
|
1230
|
+
|
1231
|
+
|
1232
|
+
|
1233
|
+
|
1234
|
+
|
1235
|
+
|
1236
|
+
|
1237
|
+
var MessageThemeEnum;
|
1238
|
+
(function (MessageThemeEnum) {
|
1239
|
+
MessageThemeEnum["PRIMARY"] = "primary";
|
1240
|
+
MessageThemeEnum["WARNING"] = "warning";
|
1241
|
+
MessageThemeEnum["SUCCESS"] = "success";
|
1242
|
+
MessageThemeEnum["ERROR"] = "error";
|
1243
|
+
})(MessageThemeEnum || (MessageThemeEnum = {}));
|
1244
|
+
var MessageContentType;
|
1245
|
+
(function (MessageContentType) {
|
1246
|
+
MessageContentType["KEY_VALUE"] = "key-value";
|
1247
|
+
MessageContentType["JSON"] = "json";
|
1248
|
+
})(MessageContentType || (MessageContentType = {}));
|
1249
|
+
var IMessageActionType;
|
1250
|
+
(function (IMessageActionType) {
|
1251
|
+
/**
|
1252
|
+
* 联系助手:默认直接拉起企业微信与助手的聊天,需要在 message.assistant 配置对应的企微群ID
|
1253
|
+
*/
|
1254
|
+
IMessageActionType["ASSISTANT"] = "assistant";
|
1255
|
+
/**
|
1256
|
+
* 展开详情:展开面向开发的详情
|
1257
|
+
*/
|
1258
|
+
IMessageActionType["DETAILS"] = "details";
|
1259
|
+
/**
|
1260
|
+
* 图钉按钮:点击后,Message 不会自动消失
|
1261
|
+
*/
|
1262
|
+
IMessageActionType["FIX"] = "fix";
|
1263
|
+
/**
|
1264
|
+
* 关闭:点击关闭,Message 消失
|
1265
|
+
*/
|
1266
|
+
IMessageActionType["CLOSE"] = "close";
|
1267
|
+
})(IMessageActionType || (IMessageActionType = {}));
|
1268
|
+
var messageProps = {
|
1269
|
+
id: external_shared_namespaceObject.PropTypes.string.def(''),
|
1270
|
+
message: (0,external_vue_types_namespaceObject.toType)('IMessage', {}),
|
1271
|
+
theme: (0,external_vue_types_namespaceObject.toType)('messageTheme', {}).def(MessageThemeEnum.PRIMARY),
|
1272
|
+
delay: external_shared_namespaceObject.PropTypes.number,
|
1273
|
+
dismissable: external_shared_namespaceObject.PropTypes.bool.def(true),
|
1274
|
+
offsetY: external_shared_namespaceObject.PropTypes.number.def(30),
|
1275
|
+
spacing: external_shared_namespaceObject.PropTypes.number.def(10),
|
1276
|
+
extCls: external_shared_namespaceObject.PropTypes.string.def(''),
|
1277
|
+
onClose: external_shared_namespaceObject.PropTypes.func,
|
1278
|
+
getContainer: external_shared_namespaceObject.PropTypes.instanceOf(HTMLElement),
|
1279
|
+
width: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.string]),
|
1280
|
+
minWidth: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.string]).def(100),
|
1281
|
+
maxWidth: external_shared_namespaceObject.PropTypes.oneOfType([external_shared_namespaceObject.PropTypes.number, external_shared_namespaceObject.PropTypes.string]).def('100%'),
|
1282
|
+
actions: (0,external_vue_types_namespaceObject.toType)('IMessageAction', {})
|
1283
|
+
};
|
1284
|
+
/* harmony default export */ const messageConstructor = ((0,external_vue_namespaceObject.defineComponent)({
|
1285
|
+
name: 'Message',
|
1286
|
+
props: messageProps,
|
1287
|
+
emits: ['destroy', 'detail'],
|
1288
|
+
setup: function setup(props, _ref) {
|
1289
|
+
var _this = this;
|
1290
|
+
var emit = _ref.emit,
|
1291
|
+
slots = _ref.slots,
|
1292
|
+
expose = _ref.expose;
|
1293
|
+
var t = (0,external_config_provider_namespaceObject.useLocale)('message');
|
1294
|
+
var _usePrefix = (0,external_config_provider_namespaceObject.usePrefix)(),
|
1295
|
+
resolveClassName = _usePrefix.resolveClassName;
|
1296
|
+
var classNames = (0,external_vue_namespaceObject.computed)(function () {
|
1297
|
+
return ["".concat(resolveClassName('message')), "".concat(resolveClassName("message-".concat(props.theme))), "".concat(props.extCls)];
|
1298
|
+
});
|
1299
|
+
var zIndex = external_shared_namespaceObject.bkZIndexManager.getMessageNextIndex();
|
1300
|
+
var singleLineWidth = 560;
|
1301
|
+
var advanceWidth = 800;
|
1302
|
+
var singleLineDelay = 3000;
|
1303
|
+
var advanceDelay = 8000;
|
1304
|
+
var timerDelay = (0,external_vue_namespaceObject.computed)(function () {
|
1305
|
+
if (/^\d+\.?\d*$/.test("".concat(props.delay))) {
|
1306
|
+
return props.delay;
|
1307
|
+
}
|
1308
|
+
if (_typeof(props.message) === 'object' && !(0,external_vue_namespaceObject.isVNode)(props.message)) {
|
1309
|
+
return advanceDelay;
|
1310
|
+
}
|
1311
|
+
return singleLineDelay;
|
1312
|
+
});
|
1313
|
+
var getPropNumberAsStringValue = function getPropNumberAsStringValue(key) {
|
1314
|
+
return typeof props[key] === 'number' ? "".concat(props[key], "px") : props[key];
|
1315
|
+
};
|
1316
|
+
var contentWidth = (0,external_vue_namespaceObject.computed)(function () {
|
1317
|
+
var minMaxWidth = {
|
1318
|
+
maxWidth: getPropNumberAsStringValue('maxWidth'),
|
1319
|
+
minWidth: getPropNumberAsStringValue('minWidth')
|
1320
|
+
};
|
1321
|
+
var isAdvance = _typeof(props.message) === 'object' && !(0,external_vue_namespaceObject.isVNode)(props.message);
|
1322
|
+
if (/%$/.test("".concat(props.width)) || /auto/gi.test("".concat(props.width))) {
|
1323
|
+
return messageConstructor_objectSpread({
|
1324
|
+
width: props.width
|
1325
|
+
}, minMaxWidth);
|
1326
|
+
}
|
1327
|
+
if (/^\d+/.test("".concat(props.width))) {
|
1328
|
+
return /^\d+\.?\d*$/.test("".concat(props.width)) ? messageConstructor_objectSpread({
|
1329
|
+
width: "".concat(props.width, "px")
|
1330
|
+
}, minMaxWidth) : messageConstructor_objectSpread({
|
1331
|
+
width: props.width
|
1332
|
+
}, minMaxWidth);
|
1333
|
+
}
|
1334
|
+
if (isAdvance) {
|
1335
|
+
return {
|
1336
|
+
width: "".concat(advanceWidth, "px")
|
1337
|
+
};
|
1338
|
+
}
|
1339
|
+
return {
|
1340
|
+
width: "".concat(singleLineWidth, "px")
|
1341
|
+
};
|
1342
|
+
});
|
1343
|
+
var isGetContainer = (0,external_vue_namespaceObject.computed)(function () {
|
1344
|
+
return props.getContainer && (0,external_shared_namespaceObject.isElement)(props.getContainer);
|
1345
|
+
});
|
1346
|
+
var styles = (0,external_vue_namespaceObject.computed)(function () {
|
1347
|
+
return Object.assign({
|
1348
|
+
top: "".concat(props.offsetY, "px"),
|
1349
|
+
zIndex: zIndex,
|
1350
|
+
position: isGetContainer.value ? 'absolute' : 'fixed'
|
1351
|
+
}, contentWidth.value);
|
1352
|
+
});
|
1353
|
+
var refJsonContent = (0,external_vue_namespaceObject.ref)(null);
|
1354
|
+
var refCopyStatus = (0,external_vue_namespaceObject.ref)(null);
|
1355
|
+
var refCopyMsgDiv = (0,external_vue_namespaceObject.ref)(null);
|
1356
|
+
var visible = (0,external_vue_namespaceObject.ref)(false);
|
1357
|
+
var toolOperation = (0,external_vue_namespaceObject.reactive)({
|
1358
|
+
isFix: false,
|
1359
|
+
isDetailShow: false
|
1360
|
+
});
|
1361
|
+
var timer = null;
|
1362
|
+
var startTimer = function startTimer() {
|
1363
|
+
timer = setTimeout(function () {
|
1364
|
+
if (toolOperation.isFix) {
|
1365
|
+
return;
|
1366
|
+
}
|
1367
|
+
visible.value = false;
|
1368
|
+
}, timerDelay.value);
|
1369
|
+
};
|
1370
|
+
var close = function close(e) {
|
1371
|
+
e.preventDefault();
|
1372
|
+
e.stopPropagation();
|
1373
|
+
visible.value = false;
|
1374
|
+
};
|
1375
|
+
var copyStatusTimer;
|
1376
|
+
var copyStatus = (0,external_vue_namespaceObject.ref)(null);
|
1377
|
+
var parseToString = function parseToString(value) {
|
1378
|
+
var targetStr = value;
|
1379
|
+
if (_typeof(value) === 'object') {
|
1380
|
+
try {
|
1381
|
+
targetStr = JSON.stringify(value);
|
1382
|
+
} catch (e) {
|
1383
|
+
console.error("JSON.stringify Error: ".concat(e));
|
1384
|
+
}
|
1385
|
+
}
|
1386
|
+
return targetStr;
|
1387
|
+
};
|
1388
|
+
var copyMessage = function copyMessage() {
|
1389
|
+
var copyInstance = new (clipboard_default())(refCopyMsgDiv.value, {
|
1390
|
+
text: function text() {
|
1391
|
+
return parseToString(props.message.details);
|
1392
|
+
}
|
1393
|
+
});
|
1394
|
+
registerCopyCallback(copyInstance);
|
1395
|
+
};
|
1396
|
+
var registerCopyCallback = function registerCopyCallback(copyInstance, complete) {
|
1397
|
+
['success', 'error'].forEach(function (theme) {
|
1398
|
+
copyInstance.on(theme, function (e) {
|
1399
|
+
var target = refCopyStatus.value;
|
1400
|
+
copyStatus.value = theme;
|
1401
|
+
if (target) {
|
1402
|
+
var _target$classList, _target$classList2;
|
1403
|
+
var _e$trigger = e.trigger,
|
1404
|
+
offsetLeft = _e$trigger.offsetLeft,
|
1405
|
+
offsetWidth = _e$trigger.offsetWidth,
|
1406
|
+
offsetTop = _e$trigger.offsetTop;
|
1407
|
+
var msgTree = e.trigger.closest('.message-tree');
|
1408
|
+
var msgTreeScrollTop = msgTree ? msgTree.scrollTop : 0;
|
1409
|
+
(_target$classList = target.classList).remove.apply(_target$classList, ['success', 'error', 'is-hidden']);
|
1410
|
+
(_target$classList2 = target.classList).add.apply(_target$classList2, [theme, 'is-show']);
|
1411
|
+
var transX = offsetLeft + offsetWidth / 2 - 41;
|
1412
|
+
var transY = offsetTop - msgTreeScrollTop - 40;
|
1413
|
+
target.style.setProperty('transform', "translate(".concat(transX, "px, ").concat(transY, "px"));
|
1414
|
+
copyStatusTimer && clearTimeout(copyStatusTimer);
|
1415
|
+
copyStatusTimer = setTimeout(function () {
|
1416
|
+
var _target$classList3, _target$classList4;
|
1417
|
+
(_target$classList3 = target.classList).remove.apply(_target$classList3, ['is-show']);
|
1418
|
+
(_target$classList4 = target.classList).add.apply(_target$classList4, ['is-hidden']);
|
1419
|
+
}, 2000);
|
1420
|
+
}
|
1421
|
+
if (typeof complete === 'function') {
|
1422
|
+
complete();
|
1423
|
+
}
|
1424
|
+
});
|
1425
|
+
});
|
1426
|
+
};
|
1427
|
+
var copyValueItem = function copyValueItem() {
|
1428
|
+
var copyInstance = new (clipboard_default())(refJsonContent.value.querySelectorAll('span.copy-value'), {
|
1429
|
+
text: function text(trigger) {
|
1430
|
+
return trigger.innerHTML;
|
1431
|
+
}
|
1432
|
+
});
|
1433
|
+
registerCopyCallback(copyInstance);
|
1434
|
+
};
|
1435
|
+
var parseToJson = function parseToJson(value) {
|
1436
|
+
var targetJson = value;
|
1437
|
+
if (typeof value === 'string') {
|
1438
|
+
try {
|
1439
|
+
targetJson = JSON.parse(value);
|
1440
|
+
} catch (e) {
|
1441
|
+
console.error("Format Json Error: ".concat(e));
|
1442
|
+
}
|
1443
|
+
}
|
1444
|
+
return targetJson;
|
1445
|
+
};
|
1446
|
+
var setDetailsShow = function setDetailsShow(e, isShow) {
|
1447
|
+
toolOperation.isDetailShow = isShow !== null && isShow !== void 0 ? isShow : !toolOperation.isDetailShow;
|
1448
|
+
fixMesage(e, toolOperation.isDetailShow);
|
1449
|
+
if (toolOperation.isDetailShow && _typeof(props.message) === 'object' && !(0,external_vue_namespaceObject.isVNode)(props.message)) {
|
1450
|
+
if (props.message.type === MessageContentType.JSON || !props.message.type) {
|
1451
|
+
var targetJson = parseToJson(props.message.details);
|
1452
|
+
var formatter = new (json_formatter_umd_default())(targetJson);
|
1453
|
+
setTimeout(function () {
|
1454
|
+
if (refJsonContent.value) {
|
1455
|
+
refJsonContent.value.innerHTML = '';
|
1456
|
+
refJsonContent.value.append(formatter.render());
|
1457
|
+
}
|
1458
|
+
copyMessage();
|
1459
|
+
});
|
1460
|
+
}
|
1461
|
+
if (props.message.type === MessageContentType.KEY_VALUE) {
|
1462
|
+
setTimeout(function () {
|
1463
|
+
copyMessage();
|
1464
|
+
copyValueItem();
|
1465
|
+
});
|
1466
|
+
}
|
1467
|
+
emit('detail', toolOperation.isDetailShow, props.id);
|
1468
|
+
}
|
1469
|
+
};
|
1470
|
+
var fixMesage = function fixMesage(_e, isFix) {
|
1471
|
+
toolOperation.isFix = isFix !== null && isFix !== void 0 ? isFix : !toolOperation.isFix;
|
1472
|
+
};
|
1473
|
+
var addMouseKeyEvent = function addMouseKeyEvent() {
|
1474
|
+
var remove = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
1475
|
+
var isAdvance = _typeof(props.message) === 'object' && !(0,external_vue_namespaceObject.isVNode)(props.message);
|
1476
|
+
if (!isAdvance) {
|
1477
|
+
return;
|
1478
|
+
}
|
1479
|
+
if (remove) {
|
1480
|
+
document.removeEventListener('keydown', handleMouseKeyEvent);
|
1481
|
+
return;
|
1482
|
+
}
|
1483
|
+
document.addEventListener('keydown', handleMouseKeyEvent);
|
1484
|
+
};
|
1485
|
+
var handleMouseKeyEvent = function handleMouseKeyEvent(e) {
|
1486
|
+
if (e.altKey && e.keyCode === 80) {
|
1487
|
+
fixMesage(e);
|
1488
|
+
}
|
1489
|
+
};
|
1490
|
+
(0,external_vue_namespaceObject.onMounted)(function () {
|
1491
|
+
timerDelay.value && startTimer();
|
1492
|
+
visible.value = true;
|
1493
|
+
addMouseKeyEvent();
|
1494
|
+
});
|
1495
|
+
(0,external_vue_namespaceObject.onUnmounted)(function () {
|
1496
|
+
clearTimeout(timer);
|
1497
|
+
addMouseKeyEvent(true);
|
1498
|
+
});
|
1499
|
+
(0,external_vue_namespaceObject.watch)(visible, function () {
|
1500
|
+
if (!visible.value) {
|
1501
|
+
emit('destroy', props.id);
|
1502
|
+
}
|
1503
|
+
});
|
1504
|
+
var handleMouseenter = function handleMouseenter(_e) {
|
1505
|
+
clearTimeout(timer);
|
1506
|
+
};
|
1507
|
+
var handleMouseleave = function handleMouseleave(_e) {
|
1508
|
+
timerDelay.value && startTimer();
|
1509
|
+
};
|
1510
|
+
var handleHeplerClick = function handleHeplerClick(_e) {
|
1511
|
+
if (props.message.assistant) {
|
1512
|
+
window.open(props.message.assistant, '_blank');
|
1513
|
+
}
|
1514
|
+
};
|
1515
|
+
var defActionList = (0,external_vue_namespaceObject.computed)(function () {
|
1516
|
+
var _ref2;
|
1517
|
+
return _ref2 = {}, _defineProperty(_ref2, IMessageActionType.ASSISTANT, {
|
1518
|
+
id: IMessageActionType.ASSISTANT,
|
1519
|
+
icon: function icon() {
|
1520
|
+
return (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Assistant, null, null);
|
1521
|
+
},
|
1522
|
+
text: function text() {
|
1523
|
+
return t.value.assistant;
|
1524
|
+
},
|
1525
|
+
onClick: function onClick(e) {
|
1526
|
+
return handleHeplerClick(e);
|
1527
|
+
}
|
1528
|
+
}), _defineProperty(_ref2, IMessageActionType.DETAILS, {
|
1529
|
+
id: IMessageActionType.DETAILS,
|
1530
|
+
icon: function icon() {
|
1531
|
+
return toolOperation.isDetailShow ? (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleDoubleUpLine, null, null) : (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.AngleDoubleDownLine, null, null);
|
1532
|
+
},
|
1533
|
+
text: function text() {
|
1534
|
+
return t.value.details;
|
1535
|
+
},
|
1536
|
+
onClick: function onClick(e) {
|
1537
|
+
return setDetailsShow(e);
|
1538
|
+
}
|
1539
|
+
}), _defineProperty(_ref2, IMessageActionType.FIX, {
|
1540
|
+
id: IMessageActionType.FIX,
|
1541
|
+
icon: function icon() {
|
1542
|
+
return toolOperation.isFix ? (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.FixShape, null, null) : (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.FixLine, null, null);
|
1543
|
+
},
|
1544
|
+
classList: toolOperation.isFix ? 'fixed' : '',
|
1545
|
+
onClick: function onClick(e) {
|
1546
|
+
return fixMesage(e);
|
1547
|
+
}
|
1548
|
+
}), _defineProperty(_ref2, IMessageActionType.CLOSE, {
|
1549
|
+
id: IMessageActionType.CLOSE,
|
1550
|
+
classList: 'normal-color',
|
1551
|
+
icon: function icon() {
|
1552
|
+
return props.dismissable && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
|
1553
|
+
"class": "".concat(resolveClassName('message-close')),
|
1554
|
+
"onClick": close
|
1555
|
+
}, null);
|
1556
|
+
},
|
1557
|
+
onClick: close
|
1558
|
+
}), _ref2;
|
1559
|
+
});
|
1560
|
+
var sortActionIdList = [IMessageActionType.ASSISTANT, IMessageActionType.DETAILS, IMessageActionType.FIX, IMessageActionType.CLOSE];
|
1561
|
+
var actionList = (0,external_vue_namespaceObject.computed)(function () {
|
1562
|
+
var _props$actions;
|
1563
|
+
if (((_props$actions = props.actions) === null || _props$actions === void 0 ? void 0 : _props$actions.length) > 0) {
|
1564
|
+
var resultList = props.actions.map(function (action) {
|
1565
|
+
var id = action.id.toLocaleLowerCase();
|
1566
|
+
var defAction = defActionList.value[id];
|
1567
|
+
var defClickFn = defAction === null || defAction === void 0 ? void 0 : defAction.onClick;
|
1568
|
+
var target = Object.assign({}, defActionList.value[id] || {}, action);
|
1569
|
+
target.id = id;
|
1570
|
+
if (action.classList !== undefined) {
|
1571
|
+
var classList = Array.isArray(action.classList) ? action.classList : [action.classList];
|
1572
|
+
var defClassList = [];
|
1573
|
+
if (defAction.classList !== undefined) {
|
1574
|
+
defClassList = Array.isArray(defAction.classList) ? defAction.classList : [defAction.classList];
|
1575
|
+
}
|
1576
|
+
target.classList = [].concat(_toConsumableArray(defClassList), _toConsumableArray(classList));
|
1577
|
+
}
|
1578
|
+
if (typeof action.onClick === 'function') {
|
1579
|
+
target.onClick = function () {
|
1580
|
+
var resp = Reflect.apply(action.onClick, _this, []);
|
1581
|
+
if ((_typeof(resp) === undefined || resp) && typeof defClickFn === 'function') {
|
1582
|
+
Reflect.apply(defClickFn, _this, []);
|
1583
|
+
}
|
1584
|
+
};
|
1585
|
+
return target;
|
1586
|
+
}
|
1587
|
+
target.onClick = defClickFn;
|
1588
|
+
return target;
|
1589
|
+
});
|
1590
|
+
var appendList = sortActionIdList.filter(function (id) {
|
1591
|
+
return !resultList.some(function (action) {
|
1592
|
+
return action.id === id;
|
1593
|
+
});
|
1594
|
+
}).map(function (id) {
|
1595
|
+
return defActionList.value[id];
|
1596
|
+
});
|
1597
|
+
resultList.push.apply(resultList, _toConsumableArray(appendList));
|
1598
|
+
return resultList;
|
1599
|
+
}
|
1600
|
+
return sortActionIdList.map(function (id) {
|
1601
|
+
return defActionList.value[id];
|
1602
|
+
});
|
1603
|
+
});
|
1604
|
+
var renderMessageActions = function renderMessageActions() {
|
1605
|
+
var _slots$action, _slots$action2;
|
1606
|
+
var renderIcon = function renderIcon(_ref3) {
|
1607
|
+
var icon = _ref3.icon;
|
1608
|
+
if (typeof icon === 'function') {
|
1609
|
+
return Reflect.apply(icon, _this, []);
|
1610
|
+
}
|
1611
|
+
return (0,external_vue_namespaceObject.createVNode)("span", {
|
1612
|
+
"class": icon
|
1613
|
+
}, null);
|
1614
|
+
};
|
1615
|
+
var renderText = function renderText(_ref4) {
|
1616
|
+
var text = _ref4.text;
|
1617
|
+
var content = undefined;
|
1618
|
+
if (typeof text === 'function') {
|
1619
|
+
content = Reflect.apply(text, _this, []);
|
1620
|
+
}
|
1621
|
+
if (content === undefined) {
|
1622
|
+
return;
|
1623
|
+
}
|
1624
|
+
if (typeof content === 'string') {
|
1625
|
+
return (0,external_vue_namespaceObject.createVNode)("span", {
|
1626
|
+
"class": "message-action-text"
|
1627
|
+
}, [content]);
|
1628
|
+
}
|
1629
|
+
return content;
|
1630
|
+
};
|
1631
|
+
var handleActionClick = function handleActionClick(e, action) {
|
1632
|
+
if (action.readonly || action.disabled) {
|
1633
|
+
return;
|
1634
|
+
}
|
1635
|
+
if (typeof action.onClick === 'function') {
|
1636
|
+
Reflect.apply(action.onClick, _this, [e, action]);
|
1637
|
+
}
|
1638
|
+
};
|
1639
|
+
var renderActionList = function renderActionList() {
|
1640
|
+
return actionList.value.map(function (action) {
|
1641
|
+
if (action.disabled) {
|
1642
|
+
return null;
|
1643
|
+
}
|
1644
|
+
if (typeof action.render === 'function') {
|
1645
|
+
return Reflect.apply(action.render, _this, []);
|
1646
|
+
}
|
1647
|
+
var classList = Array.isArray(action.classList) ? action.classList.join(' ') : action.classList;
|
1648
|
+
return (0,external_vue_namespaceObject.createVNode)("span", {
|
1649
|
+
"class": ['tool', action.id, classList],
|
1650
|
+
"onClick": function onClick(e) {
|
1651
|
+
return handleActionClick(e, action);
|
1652
|
+
}
|
1653
|
+
}, [renderIcon(action), renderText(action)]);
|
1654
|
+
});
|
1655
|
+
};
|
1656
|
+
return (_slots$action = (_slots$action2 = slots.action) === null || _slots$action2 === void 0 ? void 0 : _slots$action2.call(slots)) !== null && _slots$action !== void 0 ? _slots$action : renderActionList();
|
1657
|
+
};
|
1658
|
+
expose({
|
1659
|
+
setDetailsShow: setDetailsShow
|
1660
|
+
});
|
1661
|
+
return {
|
1662
|
+
classNames: classNames,
|
1663
|
+
styles: styles,
|
1664
|
+
visible: visible,
|
1665
|
+
close: close,
|
1666
|
+
setDetailsShow: setDetailsShow,
|
1667
|
+
fixMesage: fixMesage,
|
1668
|
+
copyMessage: copyMessage,
|
1669
|
+
parseToJson: parseToJson,
|
1670
|
+
handleMouseenter: handleMouseenter,
|
1671
|
+
handleMouseleave: handleMouseleave,
|
1672
|
+
renderMessageActions: renderMessageActions,
|
1673
|
+
refJsonContent: refJsonContent,
|
1674
|
+
refCopyStatus: refCopyStatus,
|
1675
|
+
refCopyMsgDiv: refCopyMsgDiv,
|
1676
|
+
toolOperation: toolOperation,
|
1677
|
+
copyStatus: copyStatus,
|
1678
|
+
t: t,
|
1679
|
+
resolveClassName: resolveClassName,
|
1680
|
+
copyValueItem: copyValueItem
|
1681
|
+
};
|
1682
|
+
},
|
1683
|
+
render: function render() {
|
1684
|
+
var _this2 = this;
|
1685
|
+
var renderIcon = function renderIcon(theme) {
|
1686
|
+
var iconMap = {
|
1687
|
+
primary: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Info, null, null),
|
1688
|
+
warning: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Warn, null, null),
|
1689
|
+
success: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Success, null, null),
|
1690
|
+
error: (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Close, null, null)
|
1691
|
+
};
|
1692
|
+
return iconMap[theme !== null && theme !== void 0 ? theme : _this2.theme];
|
1693
|
+
};
|
1694
|
+
var renderMsgDetail = function renderMsgDetail(msg) {
|
1695
|
+
if (msg.type === MessageContentType.KEY_VALUE) {
|
1696
|
+
var target = _this2.parseToJson(msg.details || {});
|
1697
|
+
var keys = Object.keys(target);
|
1698
|
+
return keys.map(function (key) {
|
1699
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1700
|
+
"class": "message-row"
|
1701
|
+
}, [(0,external_vue_namespaceObject.createVNode)("label", null, [key]), (0,external_vue_namespaceObject.createVNode)("span", {
|
1702
|
+
"class": "copy-value"
|
1703
|
+
}, [target[key]])]);
|
1704
|
+
});
|
1705
|
+
}
|
1706
|
+
};
|
1707
|
+
var renderMessage = function renderMessage() {
|
1708
|
+
if (_typeof(_this2.message) === 'object' && !(0,external_vue_namespaceObject.isVNode)(_this2.message)) {
|
1709
|
+
var _this2$$slots$title, _this2$$slots$title2, _this2$$slots;
|
1710
|
+
return (0,external_vue_namespaceObject.createVNode)("div", {
|
1711
|
+
"class": "".concat(_this2.resolveClassName('message-content'), " multi")
|
1712
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1713
|
+
"class": "overview"
|
1714
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1715
|
+
"class": "left-content"
|
1716
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1717
|
+
"class": "".concat(_this2.resolveClassName('message-icon'))
|
1718
|
+
}, [renderIcon()]), (0,external_vue_namespaceObject.createVNode)("div", {
|
1719
|
+
"class": "describe"
|
1720
|
+
}, [(_this2$$slots$title = (_this2$$slots$title2 = (_this2$$slots = _this2.$slots).title) === null || _this2$$slots$title2 === void 0 ? void 0 : _this2$$slots$title2.call(_this2$$slots)) !== null && _this2$$slots$title !== void 0 ? _this2$$slots$title : "\u3010".concat(_this2.message.code, "\u3011").concat(_this2.message.overview, " ").concat(_this2.message.suggestion)])]), (0,external_vue_namespaceObject.createVNode)("div", {
|
1721
|
+
"class": "tools"
|
1722
|
+
}, [_this2.renderMessageActions()])]), _this2.toolOperation.isDetailShow && (0,external_vue_namespaceObject.createVNode)("div", {
|
1723
|
+
"class": "message-detail"
|
1724
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1725
|
+
"class": "message-copy",
|
1726
|
+
"ref": "refCopyMsgDiv"
|
1727
|
+
}, [(0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.CopyShape, null, null)]), (0,external_vue_namespaceObject.createVNode)("div", {
|
1728
|
+
"class": "copy-status",
|
1729
|
+
"ref": "refCopyStatus"
|
1730
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1731
|
+
"class": "inner"
|
1732
|
+
}, [renderIcon(_this2.copyStatus), _this2.copyStatus === 'success' ? _this2.t.copySuccess : _this2.t.copyFailed])]), (0,external_vue_namespaceObject.createVNode)("div", {
|
1733
|
+
"ref": "refJsonContent",
|
1734
|
+
"class": "message-tree"
|
1735
|
+
}, [renderMsgDetail(_this2.message)])])]);
|
1736
|
+
}
|
1737
|
+
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Fragment, null, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1738
|
+
"class": "".concat(_this2.resolveClassName('message-content'))
|
1739
|
+
}, [(0,external_vue_namespaceObject.createVNode)("div", {
|
1740
|
+
"class": "".concat(_this2.resolveClassName('message-icon'))
|
1741
|
+
}, [renderIcon()]), _this2.message]), _this2.dismissable && (0,external_vue_namespaceObject.createVNode)(external_icon_namespaceObject.Error, {
|
1742
|
+
"class": "".concat(_this2.resolveClassName('message-close')),
|
1743
|
+
"onClick": _this2.close
|
1744
|
+
}, null)]);
|
1745
|
+
};
|
1746
|
+
return (0,external_vue_namespaceObject.createVNode)(external_vue_namespaceObject.Transition, {
|
1747
|
+
"name": "bk-message-fade"
|
1748
|
+
}, {
|
1749
|
+
"default": function _default() {
|
1750
|
+
return [(0,external_vue_namespaceObject.withDirectives)((0,external_vue_namespaceObject.createVNode)("div", {
|
1751
|
+
"class": _this2.classNames,
|
1752
|
+
"style": _this2.styles,
|
1753
|
+
"onMouseenter": _this2.handleMouseenter,
|
1754
|
+
"onMouseleave": _this2.handleMouseleave
|
1755
|
+
}, [renderMessage()]), [[external_vue_namespaceObject.vShow, _this2.visible]])];
|
1756
|
+
}
|
1757
|
+
});
|
1758
|
+
}
|
1759
|
+
}));
|
1760
|
+
;// CONCATENATED MODULE: ../../packages/message/src/index.ts
|
1761
|
+
/*
|
1762
|
+
* Tencent is pleased to support the open source community by making
|
1763
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
|
1764
|
+
*
|
1765
|
+
* Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
|
1766
|
+
*
|
1767
|
+
* 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) is licensed under the MIT License.
|
1768
|
+
*
|
1769
|
+
* License for 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition):
|
1770
|
+
*
|
1771
|
+
* ---------------------------------------------------
|
1772
|
+
* Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
|
1773
|
+
* documentation files (the "Software"), to deal in the Software without restriction, including without limitation
|
1774
|
+
* the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and
|
1775
|
+
* to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
1776
|
+
*
|
1777
|
+
* The above copyright notice and this permission notice shall be included in all copies or substantial portions of
|
1778
|
+
* the Software.
|
1779
|
+
*
|
1780
|
+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO
|
1781
|
+
* THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
1782
|
+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
|
1783
|
+
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
1784
|
+
* IN THE SOFTWARE.
|
1785
|
+
*/
|
1786
|
+
|
1787
|
+
|
1788
|
+
var src_Message = function Message(options) {
|
1789
|
+
use_message(messageConstructor, options);
|
1790
|
+
};
|
1791
|
+
/* harmony default export */ const src = (src_Message);
|
1792
|
+
})();
|
1793
|
+
|
1794
|
+
var __webpack_exports__default = __webpack_exports__.Z;
|
1795
|
+
export { __webpack_exports__default as default };
|