@wfrog/vc-ui 1.0.0
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/README.md +95 -0
- package/dist/es/chunk/-EkpfdcW.mjs +1100 -0
- package/dist/es/chunk/8rLUmOVR.mjs +29 -0
- package/dist/es/chunk/B-rxnVJv.mjs +3 -0
- package/dist/es/chunk/BAGoDD49.mjs +36 -0
- package/dist/es/chunk/BAtns-Mc.mjs +96 -0
- package/dist/es/chunk/BJS5Pdfp.mjs +55 -0
- package/dist/es/chunk/BMzd-IS6.mjs +900 -0
- package/dist/es/chunk/BWcCXRRK.mjs +229 -0
- package/dist/es/chunk/BX-Ogf7p.mjs +3743 -0
- package/dist/es/chunk/B_tU9Nax.mjs +49 -0
- package/dist/es/chunk/BdDihk0t.mjs +3420 -0
- package/dist/es/chunk/C2LgraHx.mjs +489 -0
- package/dist/es/chunk/C5hWsUfD.mjs +64 -0
- package/dist/es/chunk/C7iSSBUr.mjs +303 -0
- package/dist/es/chunk/CD98REcR.mjs +666 -0
- package/dist/es/chunk/CEClY-_T.mjs +445 -0
- package/dist/es/chunk/CEm0brzD.mjs +35 -0
- package/dist/es/chunk/CMABHk8B.mjs +1942 -0
- package/dist/es/chunk/CS4VKsqy.mjs +19 -0
- package/dist/es/chunk/CVlj9F0I.mjs +291 -0
- package/dist/es/chunk/CZ4ggqDE.mjs +140 -0
- package/dist/es/chunk/CaTfZePA.mjs +533 -0
- package/dist/es/chunk/Ce9ApjrT.mjs +201 -0
- package/dist/es/chunk/ClZGuAIb.mjs +10 -0
- package/dist/es/chunk/Coex0GxM.mjs +450 -0
- package/dist/es/chunk/Ct6q2FXg.mjs +5 -0
- package/dist/es/chunk/CyxEcbcy.mjs +29 -0
- package/dist/es/chunk/D389hx_T.mjs +35 -0
- package/dist/es/chunk/D3DXeVfC.mjs +1171 -0
- package/dist/es/chunk/D3uV7vm-.mjs +45 -0
- package/dist/es/chunk/D5259bwd.mjs +50 -0
- package/dist/es/chunk/DMHNh_tw.mjs +49 -0
- package/dist/es/chunk/DVNTpOBR.mjs +4 -0
- package/dist/es/chunk/DZACQ9LT.mjs +95 -0
- package/dist/es/chunk/De_EXLIy.mjs +22 -0
- package/dist/es/chunk/Dh4jaUSg.mjs +89 -0
- package/dist/es/chunk/DhhdKtyu.mjs +439 -0
- package/dist/es/chunk/DqUIKX7f.mjs +2039 -0
- package/dist/es/chunk/Dqz1zvKN.mjs +59 -0
- package/dist/es/chunk/Dvi7RsXg.mjs +727 -0
- package/dist/es/chunk/DyDMGLoF.mjs +123 -0
- package/dist/es/chunk/E_WRn0OP.mjs +449 -0
- package/dist/es/chunk/Fo0dZYnz.mjs +128 -0
- package/dist/es/chunk/HSv8BL8o.mjs +72 -0
- package/dist/es/chunk/JCIyOUEY.mjs +105 -0
- package/dist/es/chunk/O-uhUKF4.mjs +43 -0
- package/dist/es/chunk/Spa-JKB4.mjs +1046 -0
- package/dist/es/chunk/VAdRxe-1.mjs +16 -0
- package/dist/es/chunk/VCrtRnxt.mjs +1477 -0
- package/dist/es/chunk/ViP2SEY4.mjs +211 -0
- package/dist/es/chunk/aibQ9WSZ.mjs +249 -0
- package/dist/es/chunk/nWBcrYxV.mjs +690 -0
- package/dist/es/chunk/pcqpp-6-.mjs +9 -0
- package/dist/es/chunk/qY9OvNHY.mjs +283 -0
- package/dist/es/chunk/su2Zrql0.mjs +53 -0
- package/dist/es/chunk/zfg5SOj1.mjs +138 -0
- package/dist/es/components/awesome-icon/awesome-icon.d.ts +6 -0
- package/dist/es/components/awesome-icon/awesome-icon.mjs +41 -0
- package/dist/es/components/awesome-icon/awesome-icon.vue.d.ts +5 -0
- package/dist/es/components/awesome-icon/index.d.ts +4 -0
- package/dist/es/components/awesome-icon/index.mjs +6 -0
- package/dist/es/components/backbottom/backbottom.d.ts +7 -0
- package/dist/es/components/backbottom/backbottom.mjs +172 -0
- package/dist/es/components/backbottom/backbottom.vue.d.ts +7 -0
- package/dist/es/components/backbottom/components/child.vue.d.ts +30 -0
- package/dist/es/components/backbottom/index.d.ts +4 -0
- package/dist/es/components/backbottom/index.mjs +6 -0
- package/dist/es/components/button/button.d.ts +18 -0
- package/dist/es/components/button/button.mjs +313 -0
- package/dist/es/components/button/button.vue.d.ts +33 -0
- package/dist/es/components/button/index.css +9 -0
- package/dist/es/components/button/index.d.ts +4 -0
- package/dist/es/components/button/index.mjs +6 -0
- package/dist/es/components/cdn-tag.vue.d.ts +5 -0
- package/dist/es/components/chat-container/chat-container.d.ts +9 -0
- package/dist/es/components/chat-container/chat-container.mjs +77 -0
- package/dist/es/components/chat-container/chat-container.vue.d.ts +29 -0
- package/dist/es/components/chat-container/index.css +9 -0
- package/dist/es/components/chat-container/index.d.ts +4 -0
- package/dist/es/components/chat-container/index.mjs +6 -0
- package/dist/es/components/choice/choice.d.ts +6 -0
- package/dist/es/components/choice/choice.mjs +53 -0
- package/dist/es/components/choice/choice.vue.d.ts +5 -0
- package/dist/es/components/choice/index.css +7 -0
- package/dist/es/components/choice/index.d.ts +4 -0
- package/dist/es/components/choice/index.mjs +6 -0
- package/dist/es/components/choice-boolean/choice-boolean.d.ts +5 -0
- package/dist/es/components/choice-boolean/choice-boolean.mjs +32 -0
- package/dist/es/components/choice-boolean/choice-boolean.vue.d.ts +10 -0
- package/dist/es/components/choice-boolean/index.d.ts +4 -0
- package/dist/es/components/choice-boolean/index.mjs +6 -0
- package/dist/es/components/config-provider/config-provider.d.ts +16 -0
- package/dist/es/components/config-provider/config-provider.mjs +29 -0
- package/dist/es/components/config-provider/config-provider.vue.d.ts +18 -0
- package/dist/es/components/config-provider/config-provider2.mjs +6 -0
- package/dist/es/components/config-provider/index.d.ts +4 -0
- package/dist/es/components/config-provider/index.mjs +6 -0
- package/dist/es/components/cropper/cropper.d.ts +12 -0
- package/dist/es/components/cropper/cropper.mjs +333 -0
- package/dist/es/components/cropper/cropper.vue.d.ts +32 -0
- package/dist/es/components/cropper/index.css +4 -0
- package/dist/es/components/cropper/index.d.ts +4 -0
- package/dist/es/components/cropper/index.mjs +6 -0
- package/dist/es/components/currency/currency.d.ts +21 -0
- package/dist/es/components/currency/currency.mjs +185 -0
- package/dist/es/components/currency/currency.vue.d.ts +14 -0
- package/dist/es/components/currency/index.css +8 -0
- package/dist/es/components/currency/index.d.ts +4 -0
- package/dist/es/components/currency/index.mjs +6 -0
- package/dist/es/components/daterange-picker/daterange-picker.d.ts +6 -0
- package/dist/es/components/daterange-picker/daterange-picker.mjs +5550 -0
- package/dist/es/components/daterange-picker/daterange-picker.vue.d.ts +13 -0
- package/dist/es/components/daterange-picker/index.d.ts +4 -0
- package/dist/es/components/daterange-picker/index.mjs +6 -0
- package/dist/es/components/dialog/dialog.d.ts +13 -0
- package/dist/es/components/dialog/dialog.mjs +537 -0
- package/dist/es/components/dialog/dialog.vue.d.ts +38 -0
- package/dist/es/components/dialog/index.css +87 -0
- package/dist/es/components/dialog/index.d.ts +4 -0
- package/dist/es/components/dialog/index.mjs +6 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.d.ts +33 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.mjs +412 -0
- package/dist/es/components/dialog-camera-upload/dialog-camera-upload.vue.d.ts +23 -0
- package/dist/es/components/dialog-camera-upload/index.css +66 -0
- package/dist/es/components/dialog-camera-upload/index.d.ts +4 -0
- package/dist/es/components/dialog-camera-upload/index.mjs +6 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.d.ts +9 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.mjs +183 -0
- package/dist/es/components/dialog-map-point/dialog-map-point.vue.d.ts +22 -0
- package/dist/es/components/dialog-map-point/index.css +11 -0
- package/dist/es/components/dialog-map-point/index.d.ts +4 -0
- package/dist/es/components/dialog-map-point/index.mjs +6 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.d.ts +16 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.mjs +1391 -0
- package/dist/es/components/dialog-upload-images/dialog-upload-images.vue.d.ts +19 -0
- package/dist/es/components/dialog-upload-images/index.css +62 -0
- package/dist/es/components/dialog-upload-images/index.d.ts +4 -0
- package/dist/es/components/dialog-upload-images/index.mjs +6 -0
- package/dist/es/components/document.vue.d.ts +14 -0
- package/dist/es/components/drawer/drawer.d.ts +7 -0
- package/dist/es/components/drawer/drawer.mjs +412 -0
- package/dist/es/components/drawer/drawer.vue.d.ts +31 -0
- package/dist/es/components/drawer/index.css +56 -0
- package/dist/es/components/drawer/index.d.ts +4 -0
- package/dist/es/components/drawer/index.mjs +6 -0
- package/dist/es/components/easy-pagination/easy-pagination.d.ts +8 -0
- package/dist/es/components/easy-pagination/easy-pagination.mjs +74 -0
- package/dist/es/components/easy-pagination/easy-pagination.vue.d.ts +19 -0
- package/dist/es/components/easy-pagination/index.css +10 -0
- package/dist/es/components/easy-pagination/index.d.ts +4 -0
- package/dist/es/components/easy-pagination/index.mjs +6 -0
- package/dist/es/components/el-icon/el-icon.d.ts +6 -0
- package/dist/es/components/el-icon/el-icon.mjs +46 -0
- package/dist/es/components/el-icon/el-icon.vue.d.ts +6 -0
- package/dist/es/components/el-icon/index.css +7 -0
- package/dist/es/components/el-icon/index.d.ts +4 -0
- package/dist/es/components/el-icon/index.mjs +6 -0
- package/dist/es/components/example-wrapper.vue.d.ts +19 -0
- package/dist/es/components/flag/flag.mjs +44 -0
- package/dist/es/components/flag/flag.vue.d.ts +5 -0
- package/dist/es/components/flag/flags.d.ts +8 -0
- package/dist/es/components/flag/index.d.ts +4 -0
- package/dist/es/components/flag/index.mjs +6 -0
- package/dist/es/components/icon/icon.d.ts +6 -0
- package/dist/es/components/icon/icon.mjs +54 -0
- package/dist/es/components/icon/icon.vue.d.ts +3 -0
- package/dist/es/components/icon/icon2.mjs +27 -0
- package/dist/es/components/icon/index.css +9 -0
- package/dist/es/components/icon/index.d.ts +4 -0
- package/dist/es/components/icon/index.mjs +6 -0
- package/dist/es/components/image/image.d.ts +16 -0
- package/dist/es/components/image/image.mjs +167 -0
- package/dist/es/components/image/image.vue.d.ts +206 -0
- package/dist/es/components/image/index.css +20 -0
- package/dist/es/components/image/index.d.ts +4 -0
- package/dist/es/components/image/index.mjs +6 -0
- package/dist/es/components/input/index.css +9 -0
- package/dist/es/components/input/index.d.ts +4 -0
- package/dist/es/components/input/index.mjs +6 -0
- package/dist/es/components/input/input.d.ts +4 -0
- package/dist/es/components/input/input.mjs +85 -0
- package/dist/es/components/input/input.vue.d.ts +1232 -0
- package/dist/es/components/input-number/index.css +24 -0
- package/dist/es/components/input-number/index.d.ts +4 -0
- package/dist/es/components/input-number/index.mjs +6 -0
- package/dist/es/components/input-number/input-number.d.ts +8 -0
- package/dist/es/components/input-number/input-number.mjs +137 -0
- package/dist/es/components/input-number/input-number.vue.d.ts +35 -0
- package/dist/es/components/pca-picker/components/c.vue.d.ts +123 -0
- package/dist/es/components/pca-picker/components/elevator-item.vue.d.ts +7 -0
- package/dist/es/components/pca-picker/components/filter.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/history.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/hot.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/p.vue.d.ts +2 -0
- package/dist/es/components/pca-picker/components/pca.vue.d.ts +9 -0
- package/dist/es/components/pca-picker/index.css +107 -0
- package/dist/es/components/pca-picker/index.d.ts +4 -0
- package/dist/es/components/pca-picker/index.mjs +6 -0
- package/dist/es/components/pca-picker/pca-picker.d.ts +78 -0
- package/dist/es/components/pca-picker/pca-picker.mjs +1667 -0
- package/dist/es/components/pca-picker/pca-picker.vue.d.ts +583 -0
- package/dist/es/components/qr-code/index.d.ts +4 -0
- package/dist/es/components/qr-code/index.mjs +6 -0
- package/dist/es/components/qr-code/qr-code.d.ts +9 -0
- package/dist/es/components/qr-code/qr-code.mjs +69 -0
- package/dist/es/components/qr-code/qr-code.vue.d.ts +13 -0
- package/dist/es/components/screenfull/index.css +14 -0
- package/dist/es/components/screenfull/index.d.ts +4 -0
- package/dist/es/components/screenfull/index.mjs +6 -0
- package/dist/es/components/screenfull/screenfull.d.ts +4 -0
- package/dist/es/components/screenfull/screenfull.mjs +91 -0
- package/dist/es/components/screenfull/screenfull.vue.d.ts +20 -0
- package/dist/es/components/select/index.css +9 -0
- package/dist/es/components/select/index.d.ts +4 -0
- package/dist/es/components/select/index.mjs +6 -0
- package/dist/es/components/select/select.d.ts +6 -0
- package/dist/es/components/select/select.mjs +63 -0
- package/dist/es/components/select/select.vue.d.ts +6 -0
- package/dist/es/components/single-player/index.css +45 -0
- package/dist/es/components/single-player/index.d.ts +4 -0
- package/dist/es/components/single-player/index.mjs +6 -0
- package/dist/es/components/single-player/single-player.d.ts +4 -0
- package/dist/es/components/single-player/single-player.mjs +1172 -0
- package/dist/es/components/single-player/single-player.vue.d.ts +13 -0
- package/dist/es/components/svg-icon/index.css +9 -0
- package/dist/es/components/svg-icon/index.d.ts +4 -0
- package/dist/es/components/svg-icon/index.mjs +6 -0
- package/dist/es/components/svg-icon/svg-icon.d.ts +5 -0
- package/dist/es/components/svg-icon/svg-icon.mjs +46 -0
- package/dist/es/components/svg-icon/svg-icon.vue.d.ts +18 -0
- package/dist/es/components/switch/index.css +15 -0
- package/dist/es/components/switch/index.d.ts +4 -0
- package/dist/es/components/switch/index.mjs +6 -0
- package/dist/es/components/switch/switch.d.ts +9 -0
- package/dist/es/components/switch/switch.mjs +82 -0
- package/dist/es/components/switch/switch.vue.d.ts +14 -0
- package/dist/es/components/sync-scroll-container/index.css +82 -0
- package/dist/es/components/sync-scroll-container/index.d.ts +4 -0
- package/dist/es/components/sync-scroll-container/index.mjs +6 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.d.ts +6 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.mjs +157 -0
- package/dist/es/components/sync-scroll-container/sync-scroll-container.vue.d.ts +36 -0
- package/dist/es/components/tags/index.css +17 -0
- package/dist/es/components/tags/index.d.ts +4 -0
- package/dist/es/components/tags/index.mjs +6 -0
- package/dist/es/components/tags/tags.d.ts +9 -0
- package/dist/es/components/tags/tags.mjs +296 -0
- package/dist/es/components/tags/tags.vue.d.ts +20 -0
- package/dist/es/components/text-ellipsis/index.css +15 -0
- package/dist/es/components/text-ellipsis/index.d.ts +4 -0
- package/dist/es/components/text-ellipsis/index.mjs +6 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.d.ts +12 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.mjs +137 -0
- package/dist/es/components/text-ellipsis/text-ellipsis.vue.d.ts +41 -0
- package/dist/es/components/thousand-input/index.css +4 -0
- package/dist/es/components/thousand-input/index.d.ts +4 -0
- package/dist/es/components/thousand-input/index.mjs +6 -0
- package/dist/es/components/thousand-input/thousand-input.d.ts +11 -0
- package/dist/es/components/thousand-input/thousand-input.mjs +159 -0
- package/dist/es/components/thousand-input/thousand-input.vue.d.ts +2558 -0
- package/dist/es/components/tinymce/config.d.ts +25 -0
- package/dist/es/components/tinymce/index.css +9 -0
- package/dist/es/components/tinymce/index.d.ts +4 -0
- package/dist/es/components/tinymce/index.mjs +6 -0
- package/dist/es/components/tinymce/tinymce.d.ts +9 -0
- package/dist/es/components/tinymce/tinymce.mjs +176 -0
- package/dist/es/components/tinymce/tinymce.vue.d.ts +20 -0
- package/dist/es/components/tree-picker/components/popover-cascader.d.ts +8 -0
- package/dist/es/components/tree-picker/components/popover-cascader.vue.d.ts +1361 -0
- package/dist/es/components/tree-picker/docs/data.d.ts +2 -0
- package/dist/es/components/tree-picker/index.css +41 -0
- package/dist/es/components/tree-picker/index.d.ts +4 -0
- package/dist/es/components/tree-picker/index.mjs +6 -0
- package/dist/es/components/tree-picker/popover-cascader.css +23 -0
- package/dist/es/components/tree-picker/tree-picker.d.ts +14 -0
- package/dist/es/components/tree-picker/tree-picker.mjs +173 -0
- package/dist/es/components/tree-picker/tree-picker.vue.d.ts +575 -0
- package/dist/es/components/upload-file/index.css +30 -0
- package/dist/es/components/upload-file/index.d.ts +4 -0
- package/dist/es/components/upload-file/index.mjs +6 -0
- package/dist/es/components/upload-file/upload-file.d.ts +39 -0
- package/dist/es/components/upload-file/upload-file.mjs +202 -0
- package/dist/es/components/upload-file/upload-file.vue.d.ts +30 -0
- package/dist/es/directives/cleave/index.d.ts +3 -0
- package/dist/es/directives/focus/index.d.ts +4 -0
- package/dist/es/directives/index.d.ts +3 -0
- package/dist/es/directives/thousand/index.d.ts +3 -0
- package/dist/es/index.d.ts +42 -0
- package/dist/es/index.mjs +122 -0
- package/dist/es/use/useSmallScreen/index.d.ts +4 -0
- package/dist/es/use/useSmallScreen/index.mjs +10 -0
- package/dist/es/use/useStore/index.d.ts +3 -0
- package/dist/es/use/useStore/index.mjs +22 -0
- package/dist/es/utils/index.d.ts +6 -0
- package/dist/es/utils/resolver.d.ts +3 -0
- package/dist/es/utils/resolver.mjs +24 -0
- package/dist/es/utils/typescript.d.ts +6 -0
- package/dist/global.d.ts +42 -0
- package/dist/index.css +869 -0
- package/package.json +58 -0
|
@@ -0,0 +1,2039 @@
|
|
|
1
|
+
import { defineComponent, ref, computed, provide, renderSlot, inject, onBeforeUnmount, createElementBlock, openBlock, normalizeStyle, normalizeClass, unref, withDirectives, cloneVNode, Comment, Fragment, Text, createVNode, onMounted, watch, createBlock, createCommentVNode, mergeProps, withCtx, nextTick, shallowRef, getCurrentInstance, toRef, Teleport as Teleport$1, onBeforeMount, Transition, vShow, readonly, onDeactivated, toDisplayString } from 'vue';
|
|
2
|
+
import { c as buildProps, u as useNamespace, d as definePropType, N as NOOP, e as debugWarn, s as isObject, p as isElement, k as isNil, o as isClient, h as isString, n as fromPairs, f as isNumber, y as tryOnScopeDispose, z as buildProp, j as isFunction, x as isBoolean, i as isArray, A as useGetDerivedNamespace, B as computedEager } from './E_WRn0OP.mjs';
|
|
3
|
+
import { _ as _export_sfc, w as withInstall } from './D389hx_T.mjs';
|
|
4
|
+
import { u as useAriaProps } from './C2LgraHx.mjs';
|
|
5
|
+
import { g as getEventCode, E as EVENT_CODE, c as composeEventHandlers } from './BJS5Pdfp.mjs';
|
|
6
|
+
import { u as unrefElement, g as isFocusable, h as focusElement, o as onClickOutside } from './CEClY-_T.mjs';
|
|
7
|
+
import { f as formItemContextKey, a as useIdInjection, u as useId } from './8rLUmOVR.mjs';
|
|
8
|
+
import { u as useZIndex } from './CEm0brzD.mjs';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Checks if `value` is `undefined`.
|
|
12
|
+
*
|
|
13
|
+
* @static
|
|
14
|
+
* @since 0.1.0
|
|
15
|
+
* @memberOf _
|
|
16
|
+
* @category Lang
|
|
17
|
+
* @param {*} value The value to check.
|
|
18
|
+
* @returns {boolean} Returns `true` if `value` is `undefined`, else `false`.
|
|
19
|
+
* @example
|
|
20
|
+
*
|
|
21
|
+
* _.isUndefined(void 0);
|
|
22
|
+
* // => true
|
|
23
|
+
*
|
|
24
|
+
* _.isUndefined(null);
|
|
25
|
+
* // => false
|
|
26
|
+
*/
|
|
27
|
+
function isUndefined(value) {
|
|
28
|
+
return value === undefined;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const POPPER_INJECTION_KEY = Symbol("popper");
|
|
32
|
+
const POPPER_CONTENT_INJECTION_KEY = Symbol("popperContent");
|
|
33
|
+
|
|
34
|
+
const roleTypes = [
|
|
35
|
+
"dialog",
|
|
36
|
+
"grid",
|
|
37
|
+
"group",
|
|
38
|
+
"listbox",
|
|
39
|
+
"menu",
|
|
40
|
+
"navigation",
|
|
41
|
+
"tooltip",
|
|
42
|
+
"tree"
|
|
43
|
+
];
|
|
44
|
+
const popperProps = buildProps({
|
|
45
|
+
role: {
|
|
46
|
+
type: String,
|
|
47
|
+
values: roleTypes,
|
|
48
|
+
default: "tooltip"
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const __default__$6 = defineComponent({
|
|
53
|
+
name: "ElPopper",
|
|
54
|
+
inheritAttrs: false
|
|
55
|
+
});
|
|
56
|
+
const _sfc_main$8 = /* @__PURE__ */ defineComponent({
|
|
57
|
+
...__default__$6,
|
|
58
|
+
props: popperProps,
|
|
59
|
+
setup(__props, { expose }) {
|
|
60
|
+
const props = __props;
|
|
61
|
+
const triggerRef = ref();
|
|
62
|
+
const popperInstanceRef = ref();
|
|
63
|
+
const contentRef = ref();
|
|
64
|
+
const referenceRef = ref();
|
|
65
|
+
const role = computed(() => props.role);
|
|
66
|
+
const popperProvides = {
|
|
67
|
+
triggerRef,
|
|
68
|
+
popperInstanceRef,
|
|
69
|
+
contentRef,
|
|
70
|
+
referenceRef,
|
|
71
|
+
role
|
|
72
|
+
};
|
|
73
|
+
expose(popperProvides);
|
|
74
|
+
provide(POPPER_INJECTION_KEY, popperProvides);
|
|
75
|
+
return (_ctx, _cache) => {
|
|
76
|
+
return renderSlot(_ctx.$slots, "default");
|
|
77
|
+
};
|
|
78
|
+
}
|
|
79
|
+
});
|
|
80
|
+
var Popper = /* @__PURE__ */ _export_sfc(_sfc_main$8, [["__file", "popper.vue"]]);
|
|
81
|
+
|
|
82
|
+
const __default__$5 = defineComponent({
|
|
83
|
+
name: "ElPopperArrow",
|
|
84
|
+
inheritAttrs: false
|
|
85
|
+
});
|
|
86
|
+
const _sfc_main$7 = /* @__PURE__ */ defineComponent({
|
|
87
|
+
...__default__$5,
|
|
88
|
+
setup(__props, { expose }) {
|
|
89
|
+
const ns = useNamespace("popper");
|
|
90
|
+
const { arrowRef, arrowStyle } = inject(POPPER_CONTENT_INJECTION_KEY, void 0);
|
|
91
|
+
onBeforeUnmount(() => {
|
|
92
|
+
arrowRef.value = void 0;
|
|
93
|
+
});
|
|
94
|
+
expose({
|
|
95
|
+
arrowRef
|
|
96
|
+
});
|
|
97
|
+
return (_ctx, _cache) => {
|
|
98
|
+
return openBlock(), createElementBlock("span", {
|
|
99
|
+
ref_key: "arrowRef",
|
|
100
|
+
ref: arrowRef,
|
|
101
|
+
class: normalizeClass(unref(ns).e("arrow")),
|
|
102
|
+
style: normalizeStyle(unref(arrowStyle)),
|
|
103
|
+
"data-popper-arrow": ""
|
|
104
|
+
}, null, 6);
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
var ElPopperArrow = /* @__PURE__ */ _export_sfc(_sfc_main$7, [["__file", "arrow.vue"]]);
|
|
109
|
+
|
|
110
|
+
const popperTriggerProps = buildProps({
|
|
111
|
+
virtualRef: {
|
|
112
|
+
type: definePropType(Object)
|
|
113
|
+
},
|
|
114
|
+
virtualTriggering: Boolean,
|
|
115
|
+
onMouseenter: {
|
|
116
|
+
type: definePropType(Function)
|
|
117
|
+
},
|
|
118
|
+
onMouseleave: {
|
|
119
|
+
type: definePropType(Function)
|
|
120
|
+
},
|
|
121
|
+
onClick: {
|
|
122
|
+
type: definePropType(Function)
|
|
123
|
+
},
|
|
124
|
+
onKeydown: {
|
|
125
|
+
type: definePropType(Function)
|
|
126
|
+
},
|
|
127
|
+
onFocus: {
|
|
128
|
+
type: definePropType(Function)
|
|
129
|
+
},
|
|
130
|
+
onBlur: {
|
|
131
|
+
type: definePropType(Function)
|
|
132
|
+
},
|
|
133
|
+
onContextmenu: {
|
|
134
|
+
type: definePropType(Function)
|
|
135
|
+
},
|
|
136
|
+
id: String,
|
|
137
|
+
open: Boolean
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
const FORWARD_REF_INJECTION_KEY = Symbol("elForwardRef");
|
|
141
|
+
const useForwardRef = (forwardRef) => {
|
|
142
|
+
const setForwardRef = (el) => {
|
|
143
|
+
forwardRef.value = el;
|
|
144
|
+
};
|
|
145
|
+
provide(FORWARD_REF_INJECTION_KEY, {
|
|
146
|
+
setForwardRef
|
|
147
|
+
});
|
|
148
|
+
};
|
|
149
|
+
const useForwardRefDirective = (setForwardRef) => {
|
|
150
|
+
return {
|
|
151
|
+
mounted(el) {
|
|
152
|
+
setForwardRef(el);
|
|
153
|
+
},
|
|
154
|
+
updated(el) {
|
|
155
|
+
setForwardRef(el);
|
|
156
|
+
},
|
|
157
|
+
unmounted() {
|
|
158
|
+
setForwardRef(null);
|
|
159
|
+
}
|
|
160
|
+
};
|
|
161
|
+
};
|
|
162
|
+
|
|
163
|
+
const NAME = "ElOnlyChild";
|
|
164
|
+
const OnlyChild = defineComponent({
|
|
165
|
+
name: NAME,
|
|
166
|
+
setup(_, {
|
|
167
|
+
slots,
|
|
168
|
+
attrs
|
|
169
|
+
}) {
|
|
170
|
+
var _a;
|
|
171
|
+
const forwardRefInjection = inject(FORWARD_REF_INJECTION_KEY);
|
|
172
|
+
const forwardRefDirective = useForwardRefDirective((_a = forwardRefInjection == null ? void 0 : forwardRefInjection.setForwardRef) != null ? _a : NOOP);
|
|
173
|
+
return () => {
|
|
174
|
+
var _a2;
|
|
175
|
+
const defaultSlot = (_a2 = slots.default) == null ? void 0 : _a2.call(slots, attrs);
|
|
176
|
+
if (!defaultSlot)
|
|
177
|
+
return null;
|
|
178
|
+
const [firstLegitNode, length] = findFirstLegitChild(defaultSlot);
|
|
179
|
+
if (!firstLegitNode) {
|
|
180
|
+
debugWarn(NAME, "no valid child node found");
|
|
181
|
+
return null;
|
|
182
|
+
}
|
|
183
|
+
if (length > 1) {
|
|
184
|
+
debugWarn(NAME, "requires exact only one valid child.");
|
|
185
|
+
}
|
|
186
|
+
return withDirectives(cloneVNode(firstLegitNode, attrs), [[forwardRefDirective]]);
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
});
|
|
190
|
+
function findFirstLegitChild(node) {
|
|
191
|
+
if (!node)
|
|
192
|
+
return [null, 0];
|
|
193
|
+
const children = node;
|
|
194
|
+
const len = children.filter((c) => c.type !== Comment).length;
|
|
195
|
+
for (const child of children) {
|
|
196
|
+
if (isObject(child)) {
|
|
197
|
+
switch (child.type) {
|
|
198
|
+
case Comment:
|
|
199
|
+
continue;
|
|
200
|
+
case Text:
|
|
201
|
+
case "svg":
|
|
202
|
+
return [wrapTextContent(child), len];
|
|
203
|
+
case Fragment:
|
|
204
|
+
return findFirstLegitChild(child.children);
|
|
205
|
+
default:
|
|
206
|
+
return [child, len];
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return [wrapTextContent(child), len];
|
|
210
|
+
}
|
|
211
|
+
return [null, 0];
|
|
212
|
+
}
|
|
213
|
+
function wrapTextContent(s) {
|
|
214
|
+
const ns = useNamespace("only-child");
|
|
215
|
+
return createVNode("span", {
|
|
216
|
+
"class": ns.e("content")
|
|
217
|
+
}, [s]);
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
const __default__$4 = defineComponent({
|
|
221
|
+
name: "ElPopperTrigger",
|
|
222
|
+
inheritAttrs: false
|
|
223
|
+
});
|
|
224
|
+
const _sfc_main$6 = /* @__PURE__ */ defineComponent({
|
|
225
|
+
...__default__$4,
|
|
226
|
+
props: popperTriggerProps,
|
|
227
|
+
setup(__props, { expose }) {
|
|
228
|
+
const props = __props;
|
|
229
|
+
const { role, triggerRef } = inject(POPPER_INJECTION_KEY, void 0);
|
|
230
|
+
useForwardRef(triggerRef);
|
|
231
|
+
const ariaControls = computed(() => {
|
|
232
|
+
return ariaHaspopup.value ? props.id : void 0;
|
|
233
|
+
});
|
|
234
|
+
const ariaDescribedby = computed(() => {
|
|
235
|
+
if (role && role.value === "tooltip") {
|
|
236
|
+
return props.open && props.id ? props.id : void 0;
|
|
237
|
+
}
|
|
238
|
+
return void 0;
|
|
239
|
+
});
|
|
240
|
+
const ariaHaspopup = computed(() => {
|
|
241
|
+
if (role && role.value !== "tooltip") {
|
|
242
|
+
return role.value;
|
|
243
|
+
}
|
|
244
|
+
return void 0;
|
|
245
|
+
});
|
|
246
|
+
const ariaExpanded = computed(() => {
|
|
247
|
+
return ariaHaspopup.value ? `${props.open}` : void 0;
|
|
248
|
+
});
|
|
249
|
+
let virtualTriggerAriaStopWatch = void 0;
|
|
250
|
+
const TRIGGER_ELE_EVENTS = [
|
|
251
|
+
"onMouseenter",
|
|
252
|
+
"onMouseleave",
|
|
253
|
+
"onClick",
|
|
254
|
+
"onKeydown",
|
|
255
|
+
"onFocus",
|
|
256
|
+
"onBlur",
|
|
257
|
+
"onContextmenu"
|
|
258
|
+
];
|
|
259
|
+
onMounted(() => {
|
|
260
|
+
watch(() => props.virtualRef, (virtualEl) => {
|
|
261
|
+
if (virtualEl) {
|
|
262
|
+
triggerRef.value = unrefElement(virtualEl);
|
|
263
|
+
}
|
|
264
|
+
}, {
|
|
265
|
+
immediate: true
|
|
266
|
+
});
|
|
267
|
+
watch(triggerRef, (el, prevEl) => {
|
|
268
|
+
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
|
269
|
+
virtualTriggerAriaStopWatch = void 0;
|
|
270
|
+
if (isElement(prevEl)) {
|
|
271
|
+
TRIGGER_ELE_EVENTS.forEach((eventName) => {
|
|
272
|
+
const handler = props[eventName];
|
|
273
|
+
if (handler) {
|
|
274
|
+
prevEl.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
if (isElement(el)) {
|
|
279
|
+
TRIGGER_ELE_EVENTS.forEach((eventName) => {
|
|
280
|
+
const handler = props[eventName];
|
|
281
|
+
if (handler) {
|
|
282
|
+
el.addEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
if (isFocusable(el)) {
|
|
286
|
+
virtualTriggerAriaStopWatch = watch([ariaControls, ariaDescribedby, ariaHaspopup, ariaExpanded], (watches) => {
|
|
287
|
+
[
|
|
288
|
+
"aria-controls",
|
|
289
|
+
"aria-describedby",
|
|
290
|
+
"aria-haspopup",
|
|
291
|
+
"aria-expanded"
|
|
292
|
+
].forEach((key, idx) => {
|
|
293
|
+
isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
|
294
|
+
});
|
|
295
|
+
}, { immediate: true });
|
|
296
|
+
}
|
|
297
|
+
}
|
|
298
|
+
if (isElement(prevEl) && isFocusable(prevEl)) {
|
|
299
|
+
[
|
|
300
|
+
"aria-controls",
|
|
301
|
+
"aria-describedby",
|
|
302
|
+
"aria-haspopup",
|
|
303
|
+
"aria-expanded"
|
|
304
|
+
].forEach((key) => prevEl.removeAttribute(key));
|
|
305
|
+
}
|
|
306
|
+
}, {
|
|
307
|
+
immediate: true
|
|
308
|
+
});
|
|
309
|
+
});
|
|
310
|
+
onBeforeUnmount(() => {
|
|
311
|
+
virtualTriggerAriaStopWatch == null ? void 0 : virtualTriggerAriaStopWatch();
|
|
312
|
+
virtualTriggerAriaStopWatch = void 0;
|
|
313
|
+
if (triggerRef.value && isElement(triggerRef.value)) {
|
|
314
|
+
const el = triggerRef.value;
|
|
315
|
+
TRIGGER_ELE_EVENTS.forEach((eventName) => {
|
|
316
|
+
const handler = props[eventName];
|
|
317
|
+
if (handler) {
|
|
318
|
+
el.removeEventListener(eventName.slice(2).toLowerCase(), handler, ["onFocus", "onBlur"].includes(eventName));
|
|
319
|
+
}
|
|
320
|
+
});
|
|
321
|
+
triggerRef.value = void 0;
|
|
322
|
+
}
|
|
323
|
+
});
|
|
324
|
+
expose({
|
|
325
|
+
triggerRef
|
|
326
|
+
});
|
|
327
|
+
return (_ctx, _cache) => {
|
|
328
|
+
return !_ctx.virtualTriggering ? (openBlock(), createBlock(unref(OnlyChild), mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
329
|
+
"aria-controls": unref(ariaControls),
|
|
330
|
+
"aria-describedby": unref(ariaDescribedby),
|
|
331
|
+
"aria-expanded": unref(ariaExpanded),
|
|
332
|
+
"aria-haspopup": unref(ariaHaspopup)
|
|
333
|
+
}), {
|
|
334
|
+
default: withCtx(() => [
|
|
335
|
+
renderSlot(_ctx.$slots, "default")
|
|
336
|
+
]),
|
|
337
|
+
_: 3
|
|
338
|
+
}, 16, ["aria-controls", "aria-describedby", "aria-expanded", "aria-haspopup"])) : createCommentVNode("v-if", true);
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
});
|
|
342
|
+
var ElPopperTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$6, [["__file", "trigger.vue"]]);
|
|
343
|
+
|
|
344
|
+
const FOCUS_AFTER_TRAPPED = "focus-trap.focus-after-trapped";
|
|
345
|
+
const FOCUS_AFTER_RELEASED = "focus-trap.focus-after-released";
|
|
346
|
+
const FOCUSOUT_PREVENTED = "focus-trap.focusout-prevented";
|
|
347
|
+
const FOCUS_AFTER_TRAPPED_OPTS = {
|
|
348
|
+
cancelable: true,
|
|
349
|
+
bubbles: false
|
|
350
|
+
};
|
|
351
|
+
const FOCUSOUT_PREVENTED_OPTS = {
|
|
352
|
+
cancelable: true,
|
|
353
|
+
bubbles: false
|
|
354
|
+
};
|
|
355
|
+
const ON_TRAP_FOCUS_EVT = "focusAfterTrapped";
|
|
356
|
+
const ON_RELEASE_FOCUS_EVT = "focusAfterReleased";
|
|
357
|
+
const FOCUS_TRAP_INJECTION_KEY = Symbol("elFocusTrap");
|
|
358
|
+
|
|
359
|
+
const focusReason = ref();
|
|
360
|
+
const lastUserFocusTimestamp = ref(0);
|
|
361
|
+
const lastAutomatedFocusTimestamp = ref(0);
|
|
362
|
+
let focusReasonUserCount = 0;
|
|
363
|
+
const obtainAllFocusableElements = (element) => {
|
|
364
|
+
const nodes = [];
|
|
365
|
+
const walker = document.createTreeWalker(element, NodeFilter.SHOW_ELEMENT, {
|
|
366
|
+
acceptNode: (node) => {
|
|
367
|
+
const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
|
|
368
|
+
if (node.disabled || node.hidden || isHiddenInput)
|
|
369
|
+
return NodeFilter.FILTER_SKIP;
|
|
370
|
+
return node.tabIndex >= 0 || node === document.activeElement ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
while (walker.nextNode())
|
|
374
|
+
nodes.push(walker.currentNode);
|
|
375
|
+
return nodes;
|
|
376
|
+
};
|
|
377
|
+
const getVisibleElement = (elements, container) => {
|
|
378
|
+
for (const element of elements) {
|
|
379
|
+
if (!isHidden(element, container))
|
|
380
|
+
return element;
|
|
381
|
+
}
|
|
382
|
+
};
|
|
383
|
+
const isHidden = (element, container) => {
|
|
384
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV === "test")
|
|
385
|
+
return false;
|
|
386
|
+
if (getComputedStyle(element).visibility === "hidden")
|
|
387
|
+
return true;
|
|
388
|
+
while (element) {
|
|
389
|
+
if (container && element === container)
|
|
390
|
+
return false;
|
|
391
|
+
if (getComputedStyle(element).display === "none")
|
|
392
|
+
return true;
|
|
393
|
+
element = element.parentElement;
|
|
394
|
+
}
|
|
395
|
+
return false;
|
|
396
|
+
};
|
|
397
|
+
const getEdges = (container) => {
|
|
398
|
+
const focusable = obtainAllFocusableElements(container);
|
|
399
|
+
const first = getVisibleElement(focusable, container);
|
|
400
|
+
const last = getVisibleElement(focusable.reverse(), container);
|
|
401
|
+
return [first, last];
|
|
402
|
+
};
|
|
403
|
+
const isSelectable = (element) => {
|
|
404
|
+
return element instanceof HTMLInputElement && "select" in element;
|
|
405
|
+
};
|
|
406
|
+
const tryFocus = (element, shouldSelect) => {
|
|
407
|
+
if (element) {
|
|
408
|
+
const prevFocusedElement = document.activeElement;
|
|
409
|
+
focusElement(element, { preventScroll: true });
|
|
410
|
+
lastAutomatedFocusTimestamp.value = window.performance.now();
|
|
411
|
+
if (element !== prevFocusedElement && isSelectable(element) && shouldSelect) {
|
|
412
|
+
element.select();
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
function removeFromStack(list, item) {
|
|
417
|
+
const copy = [...list];
|
|
418
|
+
const idx = list.indexOf(item);
|
|
419
|
+
if (idx !== -1) {
|
|
420
|
+
copy.splice(idx, 1);
|
|
421
|
+
}
|
|
422
|
+
return copy;
|
|
423
|
+
}
|
|
424
|
+
const createFocusableStack = () => {
|
|
425
|
+
let stack = [];
|
|
426
|
+
const push = (layer) => {
|
|
427
|
+
const currentLayer = stack[0];
|
|
428
|
+
if (currentLayer && layer !== currentLayer) {
|
|
429
|
+
currentLayer.pause();
|
|
430
|
+
}
|
|
431
|
+
stack = removeFromStack(stack, layer);
|
|
432
|
+
stack.unshift(layer);
|
|
433
|
+
};
|
|
434
|
+
const remove = (layer) => {
|
|
435
|
+
var _a, _b;
|
|
436
|
+
stack = removeFromStack(stack, layer);
|
|
437
|
+
(_b = (_a = stack[0]) == null ? void 0 : _a.resume) == null ? void 0 : _b.call(_a);
|
|
438
|
+
};
|
|
439
|
+
return {
|
|
440
|
+
push,
|
|
441
|
+
remove
|
|
442
|
+
};
|
|
443
|
+
};
|
|
444
|
+
const focusFirstDescendant = (elements, shouldSelect = false) => {
|
|
445
|
+
const prevFocusedElement = document.activeElement;
|
|
446
|
+
for (const element of elements) {
|
|
447
|
+
tryFocus(element, shouldSelect);
|
|
448
|
+
if (document.activeElement !== prevFocusedElement)
|
|
449
|
+
return;
|
|
450
|
+
}
|
|
451
|
+
};
|
|
452
|
+
const focusableStack = createFocusableStack();
|
|
453
|
+
const isFocusCausedByUserEvent = () => {
|
|
454
|
+
return lastUserFocusTimestamp.value > lastAutomatedFocusTimestamp.value;
|
|
455
|
+
};
|
|
456
|
+
const notifyFocusReasonPointer = () => {
|
|
457
|
+
focusReason.value = "pointer";
|
|
458
|
+
lastUserFocusTimestamp.value = window.performance.now();
|
|
459
|
+
};
|
|
460
|
+
const notifyFocusReasonKeydown = () => {
|
|
461
|
+
focusReason.value = "keyboard";
|
|
462
|
+
lastUserFocusTimestamp.value = window.performance.now();
|
|
463
|
+
};
|
|
464
|
+
const useFocusReason = () => {
|
|
465
|
+
onMounted(() => {
|
|
466
|
+
if (focusReasonUserCount === 0) {
|
|
467
|
+
document.addEventListener("mousedown", notifyFocusReasonPointer);
|
|
468
|
+
document.addEventListener("touchstart", notifyFocusReasonPointer);
|
|
469
|
+
document.addEventListener("keydown", notifyFocusReasonKeydown);
|
|
470
|
+
}
|
|
471
|
+
focusReasonUserCount++;
|
|
472
|
+
});
|
|
473
|
+
onBeforeUnmount(() => {
|
|
474
|
+
focusReasonUserCount--;
|
|
475
|
+
if (focusReasonUserCount <= 0) {
|
|
476
|
+
document.removeEventListener("mousedown", notifyFocusReasonPointer);
|
|
477
|
+
document.removeEventListener("touchstart", notifyFocusReasonPointer);
|
|
478
|
+
document.removeEventListener("keydown", notifyFocusReasonKeydown);
|
|
479
|
+
}
|
|
480
|
+
});
|
|
481
|
+
return {
|
|
482
|
+
focusReason,
|
|
483
|
+
lastUserFocusTimestamp,
|
|
484
|
+
lastAutomatedFocusTimestamp
|
|
485
|
+
};
|
|
486
|
+
};
|
|
487
|
+
const createFocusOutPreventedEvent = (detail) => {
|
|
488
|
+
return new CustomEvent(FOCUSOUT_PREVENTED, {
|
|
489
|
+
...FOCUSOUT_PREVENTED_OPTS,
|
|
490
|
+
detail
|
|
491
|
+
});
|
|
492
|
+
};
|
|
493
|
+
|
|
494
|
+
let registeredEscapeHandlers = [];
|
|
495
|
+
const cachedHandler = (event) => {
|
|
496
|
+
const code = getEventCode(event);
|
|
497
|
+
if (code === EVENT_CODE.esc) {
|
|
498
|
+
registeredEscapeHandlers.forEach((registeredHandler) => registeredHandler(event));
|
|
499
|
+
}
|
|
500
|
+
};
|
|
501
|
+
const useEscapeKeydown = (handler) => {
|
|
502
|
+
onMounted(() => {
|
|
503
|
+
if (registeredEscapeHandlers.length === 0) {
|
|
504
|
+
document.addEventListener("keydown", cachedHandler);
|
|
505
|
+
}
|
|
506
|
+
if (isClient)
|
|
507
|
+
registeredEscapeHandlers.push(handler);
|
|
508
|
+
});
|
|
509
|
+
onBeforeUnmount(() => {
|
|
510
|
+
registeredEscapeHandlers = registeredEscapeHandlers.filter((registeredHandler) => registeredHandler !== handler);
|
|
511
|
+
if (registeredEscapeHandlers.length === 0) {
|
|
512
|
+
if (isClient)
|
|
513
|
+
document.removeEventListener("keydown", cachedHandler);
|
|
514
|
+
}
|
|
515
|
+
});
|
|
516
|
+
};
|
|
517
|
+
|
|
518
|
+
const _sfc_main$5 = defineComponent({
|
|
519
|
+
name: "ElFocusTrap",
|
|
520
|
+
inheritAttrs: false,
|
|
521
|
+
props: {
|
|
522
|
+
loop: Boolean,
|
|
523
|
+
trapped: Boolean,
|
|
524
|
+
focusTrapEl: Object,
|
|
525
|
+
focusStartEl: {
|
|
526
|
+
type: [Object, String],
|
|
527
|
+
default: "first"
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
emits: [
|
|
531
|
+
ON_TRAP_FOCUS_EVT,
|
|
532
|
+
ON_RELEASE_FOCUS_EVT,
|
|
533
|
+
"focusin",
|
|
534
|
+
"focusout",
|
|
535
|
+
"focusout-prevented",
|
|
536
|
+
"release-requested"
|
|
537
|
+
],
|
|
538
|
+
setup(props, { emit }) {
|
|
539
|
+
const forwardRef = ref();
|
|
540
|
+
let lastFocusBeforeTrapped;
|
|
541
|
+
let lastFocusAfterTrapped;
|
|
542
|
+
const { focusReason } = useFocusReason();
|
|
543
|
+
useEscapeKeydown((event) => {
|
|
544
|
+
if (props.trapped && !focusLayer.paused) {
|
|
545
|
+
emit("release-requested", event);
|
|
546
|
+
}
|
|
547
|
+
});
|
|
548
|
+
const focusLayer = {
|
|
549
|
+
paused: false,
|
|
550
|
+
pause() {
|
|
551
|
+
this.paused = true;
|
|
552
|
+
},
|
|
553
|
+
resume() {
|
|
554
|
+
this.paused = false;
|
|
555
|
+
}
|
|
556
|
+
};
|
|
557
|
+
const onKeydown = (e) => {
|
|
558
|
+
if (!props.loop && !props.trapped)
|
|
559
|
+
return;
|
|
560
|
+
if (focusLayer.paused)
|
|
561
|
+
return;
|
|
562
|
+
const { altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e;
|
|
563
|
+
const { loop } = props;
|
|
564
|
+
const code = getEventCode(e);
|
|
565
|
+
const isTabbing = code === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey;
|
|
566
|
+
const currentFocusingEl = document.activeElement;
|
|
567
|
+
if (isTabbing && currentFocusingEl) {
|
|
568
|
+
const container = currentTarget;
|
|
569
|
+
const [first, last] = getEdges(container);
|
|
570
|
+
const isTabbable = first && last;
|
|
571
|
+
if (!isTabbable) {
|
|
572
|
+
if (currentFocusingEl === container) {
|
|
573
|
+
const focusoutPreventedEvent = createFocusOutPreventedEvent({
|
|
574
|
+
focusReason: focusReason.value
|
|
575
|
+
});
|
|
576
|
+
emit("focusout-prevented", focusoutPreventedEvent);
|
|
577
|
+
if (!focusoutPreventedEvent.defaultPrevented) {
|
|
578
|
+
e.preventDefault();
|
|
579
|
+
}
|
|
580
|
+
}
|
|
581
|
+
} else {
|
|
582
|
+
if (!shiftKey && currentFocusingEl === last) {
|
|
583
|
+
const focusoutPreventedEvent = createFocusOutPreventedEvent({
|
|
584
|
+
focusReason: focusReason.value
|
|
585
|
+
});
|
|
586
|
+
emit("focusout-prevented", focusoutPreventedEvent);
|
|
587
|
+
if (!focusoutPreventedEvent.defaultPrevented) {
|
|
588
|
+
e.preventDefault();
|
|
589
|
+
if (loop)
|
|
590
|
+
tryFocus(first, true);
|
|
591
|
+
}
|
|
592
|
+
} else if (shiftKey && [first, container].includes(currentFocusingEl)) {
|
|
593
|
+
const focusoutPreventedEvent = createFocusOutPreventedEvent({
|
|
594
|
+
focusReason: focusReason.value
|
|
595
|
+
});
|
|
596
|
+
emit("focusout-prevented", focusoutPreventedEvent);
|
|
597
|
+
if (!focusoutPreventedEvent.defaultPrevented) {
|
|
598
|
+
e.preventDefault();
|
|
599
|
+
if (loop)
|
|
600
|
+
tryFocus(last, true);
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
}
|
|
605
|
+
};
|
|
606
|
+
provide(FOCUS_TRAP_INJECTION_KEY, {
|
|
607
|
+
focusTrapRef: forwardRef,
|
|
608
|
+
onKeydown
|
|
609
|
+
});
|
|
610
|
+
watch(() => props.focusTrapEl, (focusTrapEl) => {
|
|
611
|
+
if (focusTrapEl) {
|
|
612
|
+
forwardRef.value = focusTrapEl;
|
|
613
|
+
}
|
|
614
|
+
}, { immediate: true });
|
|
615
|
+
watch([forwardRef], ([forwardRef2], [oldForwardRef]) => {
|
|
616
|
+
if (forwardRef2) {
|
|
617
|
+
forwardRef2.addEventListener("keydown", onKeydown);
|
|
618
|
+
forwardRef2.addEventListener("focusin", onFocusIn);
|
|
619
|
+
forwardRef2.addEventListener("focusout", onFocusOut);
|
|
620
|
+
}
|
|
621
|
+
if (oldForwardRef) {
|
|
622
|
+
oldForwardRef.removeEventListener("keydown", onKeydown);
|
|
623
|
+
oldForwardRef.removeEventListener("focusin", onFocusIn);
|
|
624
|
+
oldForwardRef.removeEventListener("focusout", onFocusOut);
|
|
625
|
+
}
|
|
626
|
+
});
|
|
627
|
+
const trapOnFocus = (e) => {
|
|
628
|
+
emit(ON_TRAP_FOCUS_EVT, e);
|
|
629
|
+
};
|
|
630
|
+
const releaseOnFocus = (e) => emit(ON_RELEASE_FOCUS_EVT, e);
|
|
631
|
+
const onFocusIn = (e) => {
|
|
632
|
+
const trapContainer = unref(forwardRef);
|
|
633
|
+
if (!trapContainer)
|
|
634
|
+
return;
|
|
635
|
+
const target = e.target;
|
|
636
|
+
const relatedTarget = e.relatedTarget;
|
|
637
|
+
const isFocusedInTrap = target && trapContainer.contains(target);
|
|
638
|
+
if (!props.trapped) {
|
|
639
|
+
const isPrevFocusedInTrap = relatedTarget && trapContainer.contains(relatedTarget);
|
|
640
|
+
if (!isPrevFocusedInTrap) {
|
|
641
|
+
lastFocusBeforeTrapped = relatedTarget;
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
if (isFocusedInTrap)
|
|
645
|
+
emit("focusin", e);
|
|
646
|
+
if (focusLayer.paused)
|
|
647
|
+
return;
|
|
648
|
+
if (props.trapped) {
|
|
649
|
+
if (isFocusedInTrap) {
|
|
650
|
+
lastFocusAfterTrapped = target;
|
|
651
|
+
} else {
|
|
652
|
+
tryFocus(lastFocusAfterTrapped, true);
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
};
|
|
656
|
+
const onFocusOut = (e) => {
|
|
657
|
+
const trapContainer = unref(forwardRef);
|
|
658
|
+
if (focusLayer.paused || !trapContainer)
|
|
659
|
+
return;
|
|
660
|
+
if (props.trapped) {
|
|
661
|
+
const relatedTarget = e.relatedTarget;
|
|
662
|
+
if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {
|
|
663
|
+
setTimeout(() => {
|
|
664
|
+
if (!focusLayer.paused && props.trapped) {
|
|
665
|
+
const focusoutPreventedEvent = createFocusOutPreventedEvent({
|
|
666
|
+
focusReason: focusReason.value
|
|
667
|
+
});
|
|
668
|
+
emit("focusout-prevented", focusoutPreventedEvent);
|
|
669
|
+
if (!focusoutPreventedEvent.defaultPrevented) {
|
|
670
|
+
tryFocus(lastFocusAfterTrapped, true);
|
|
671
|
+
}
|
|
672
|
+
}
|
|
673
|
+
}, 0);
|
|
674
|
+
}
|
|
675
|
+
} else {
|
|
676
|
+
const target = e.target;
|
|
677
|
+
const isFocusedInTrap = target && trapContainer.contains(target);
|
|
678
|
+
if (!isFocusedInTrap)
|
|
679
|
+
emit("focusout", e);
|
|
680
|
+
}
|
|
681
|
+
};
|
|
682
|
+
async function startTrap() {
|
|
683
|
+
await nextTick();
|
|
684
|
+
const trapContainer = unref(forwardRef);
|
|
685
|
+
if (trapContainer) {
|
|
686
|
+
focusableStack.push(focusLayer);
|
|
687
|
+
const prevFocusedElement = trapContainer.contains(document.activeElement) ? lastFocusBeforeTrapped : document.activeElement;
|
|
688
|
+
lastFocusBeforeTrapped = prevFocusedElement;
|
|
689
|
+
const isPrevFocusContained = trapContainer.contains(prevFocusedElement);
|
|
690
|
+
if (!isPrevFocusContained) {
|
|
691
|
+
const focusEvent = new Event(FOCUS_AFTER_TRAPPED, FOCUS_AFTER_TRAPPED_OPTS);
|
|
692
|
+
trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
|
|
693
|
+
trapContainer.dispatchEvent(focusEvent);
|
|
694
|
+
if (!focusEvent.defaultPrevented) {
|
|
695
|
+
nextTick(() => {
|
|
696
|
+
let focusStartEl = props.focusStartEl;
|
|
697
|
+
if (!isString(focusStartEl)) {
|
|
698
|
+
tryFocus(focusStartEl);
|
|
699
|
+
if (document.activeElement !== focusStartEl) {
|
|
700
|
+
focusStartEl = "first";
|
|
701
|
+
}
|
|
702
|
+
}
|
|
703
|
+
if (focusStartEl === "first") {
|
|
704
|
+
focusFirstDescendant(obtainAllFocusableElements(trapContainer), true);
|
|
705
|
+
}
|
|
706
|
+
if (document.activeElement === prevFocusedElement || focusStartEl === "container") {
|
|
707
|
+
tryFocus(trapContainer);
|
|
708
|
+
}
|
|
709
|
+
});
|
|
710
|
+
}
|
|
711
|
+
}
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
function stopTrap() {
|
|
715
|
+
const trapContainer = unref(forwardRef);
|
|
716
|
+
if (trapContainer) {
|
|
717
|
+
trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus);
|
|
718
|
+
const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {
|
|
719
|
+
...FOCUS_AFTER_TRAPPED_OPTS,
|
|
720
|
+
detail: {
|
|
721
|
+
focusReason: focusReason.value
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
|
|
725
|
+
trapContainer.dispatchEvent(releasedEvent);
|
|
726
|
+
if (!releasedEvent.defaultPrevented && (focusReason.value == "keyboard" || !isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) {
|
|
727
|
+
tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
|
|
728
|
+
}
|
|
729
|
+
trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus);
|
|
730
|
+
focusableStack.remove(focusLayer);
|
|
731
|
+
lastFocusBeforeTrapped = null;
|
|
732
|
+
lastFocusAfterTrapped = null;
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
onMounted(() => {
|
|
736
|
+
if (props.trapped) {
|
|
737
|
+
startTrap();
|
|
738
|
+
}
|
|
739
|
+
watch(() => props.trapped, (trapped) => {
|
|
740
|
+
if (trapped) {
|
|
741
|
+
startTrap();
|
|
742
|
+
} else {
|
|
743
|
+
stopTrap();
|
|
744
|
+
}
|
|
745
|
+
});
|
|
746
|
+
});
|
|
747
|
+
onBeforeUnmount(() => {
|
|
748
|
+
if (props.trapped) {
|
|
749
|
+
stopTrap();
|
|
750
|
+
}
|
|
751
|
+
if (forwardRef.value) {
|
|
752
|
+
forwardRef.value.removeEventListener("keydown", onKeydown);
|
|
753
|
+
forwardRef.value.removeEventListener("focusin", onFocusIn);
|
|
754
|
+
forwardRef.value.removeEventListener("focusout", onFocusOut);
|
|
755
|
+
forwardRef.value = void 0;
|
|
756
|
+
}
|
|
757
|
+
lastFocusBeforeTrapped = null;
|
|
758
|
+
lastFocusAfterTrapped = null;
|
|
759
|
+
});
|
|
760
|
+
return {
|
|
761
|
+
onKeydown
|
|
762
|
+
};
|
|
763
|
+
}
|
|
764
|
+
});
|
|
765
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
766
|
+
return renderSlot(_ctx.$slots, "default", { handleKeydown: _ctx.onKeydown });
|
|
767
|
+
}
|
|
768
|
+
var ElFocusTrap = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["render", _sfc_render], ["__file", "focus-trap.vue"]]);
|
|
769
|
+
|
|
770
|
+
var E="top",R="bottom",W="right",P="left",me="auto",G=[E,R,W,P],U="start",J="end",Xe="clippingParents",je="viewport",K="popper",Ye="reference",De=G.reduce(function(t,e){return t.concat([e+"-"+U,e+"-"+J])},[]),Ee=[].concat(G,[me]).reduce(function(t,e){return t.concat([e,e+"-"+U,e+"-"+J])},[]),Ge="beforeRead",Je="read",Ke="afterRead",Qe="beforeMain",Ze="main",et="afterMain",tt="beforeWrite",nt="write",rt="afterWrite",ot=[Ge,Je,Ke,Qe,Ze,et,tt,nt,rt];function C(t){return t?(t.nodeName||"").toLowerCase():null}function H(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function Q(t){var e=H(t).Element;return t instanceof e||t instanceof Element}function B(t){var e=H(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Pe(t){if(typeof ShadowRoot=="undefined")return false;var e=H(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function Mt(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},o=e.attributes[n]||{},i=e.elements[n];!B(i)||!C(i)||(Object.assign(i.style,r),Object.keys(o).forEach(function(a){var s=o[a];s===false?i.removeAttribute(a):i.setAttribute(a,s===true?"":s);}));});}function Rt(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var o=e.elements[r],i=e.attributes[r]||{},a=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),s=a.reduce(function(f,c){return f[c]="",f},{});!B(o)||!C(o)||(Object.assign(o.style,s),Object.keys(i).forEach(function(f){o.removeAttribute(f);}));});}}var Ae={name:"applyStyles",enabled:true,phase:"write",fn:Mt,effect:Rt,requires:["computeStyles"]};function q(t){return t.split("-")[0]}var X=Math.max,ve=Math.min,Z=Math.round;function ee(t,e){e===void 0&&(e=false);var n=t.getBoundingClientRect(),r=1,o=1;if(B(t)&&e){var i=t.offsetHeight,a=t.offsetWidth;a>0&&(r=Z(n.width)/a||1),i>0&&(o=Z(n.height)/i||1);}return {width:n.width/r,height:n.height/o,top:n.top/o,right:n.right/r,bottom:n.bottom/o,left:n.left/r,x:n.left/r,y:n.top/o}}function ke(t){var e=ee(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function it(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return true;if(n&&Pe(n)){var r=e;do{if(r&&t.isSameNode(r))return true;r=r.parentNode||r.host;}while(r)}return false}function N(t){return H(t).getComputedStyle(t)}function Wt(t){return ["table","td","th"].indexOf(C(t))>=0}function I(t){return ((Q(t)?t.ownerDocument:t.document)||window.document).documentElement}function ge(t){return C(t)==="html"?t:t.assignedSlot||t.parentNode||(Pe(t)?t.host:null)||I(t)}function at(t){return !B(t)||N(t).position==="fixed"?null:t.offsetParent}function Bt(t){var e=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,n=navigator.userAgent.indexOf("Trident")!==-1;if(n&&B(t)){var r=N(t);if(r.position==="fixed")return null}var o=ge(t);for(Pe(o)&&(o=o.host);B(o)&&["html","body"].indexOf(C(o))<0;){var i=N(o);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||e&&i.willChange==="filter"||e&&i.filter&&i.filter!=="none")return o;o=o.parentNode;}return null}function se(t){for(var e=H(t),n=at(t);n&&Wt(n)&&N(n).position==="static";)n=at(n);return n&&(C(n)==="html"||C(n)==="body"&&N(n).position==="static")?e:n||Bt(t)||e}function Le(t){return ["top","bottom"].indexOf(t)>=0?"x":"y"}function fe(t,e,n){return X(t,ve(e,n))}function St(t,e,n){var r=fe(t,e,n);return r>n?n:r}function st(){return {top:0,right:0,bottom:0,left:0}}function ft(t){return Object.assign({},st(),t)}function ct(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var Tt=function(t,e){return t=typeof t=="function"?t(Object.assign({},e.rects,{placement:e.placement})):t,ft(typeof t!="number"?t:ct(t,G))};function Ht(t){var e,n=t.state,r=t.name,o=t.options,i=n.elements.arrow,a=n.modifiersData.popperOffsets,s=q(n.placement),f=Le(s),c=[P,W].indexOf(s)>=0,u=c?"height":"width";if(!(!i||!a)){var m=Tt(o.padding,n),v=ke(i),l=f==="y"?E:P,h=f==="y"?R:W,p=n.rects.reference[u]+n.rects.reference[f]-a[f]-n.rects.popper[u],g=a[f]-n.rects.reference[f],x=se(i),y=x?f==="y"?x.clientHeight||0:x.clientWidth||0:0,$=p/2-g/2,d=m[l],b=y-v[u]-m[h],w=y/2-v[u]/2+$,O=fe(d,w,b),j=f;n.modifiersData[r]=(e={},e[j]=O,e.centerOffset=O-w,e);}}function Ct(t){var e=t.state,n=t.options,r=n.element,o=r===void 0?"[data-popper-arrow]":r;o!=null&&(typeof o=="string"&&(o=e.elements.popper.querySelector(o),!o)||!it(e.elements.popper,o)||(e.elements.arrow=o));}var pt={name:"arrow",enabled:true,phase:"main",fn:Ht,effect:Ct,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function te(t){return t.split("-")[1]}var qt={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Vt(t){var e=t.x,n=t.y,r=window,o=r.devicePixelRatio||1;return {x:Z(e*o)/o||0,y:Z(n*o)/o||0}}function ut(t){var e,n=t.popper,r=t.popperRect,o=t.placement,i=t.variation,a=t.offsets,s=t.position,f=t.gpuAcceleration,c=t.adaptive,u=t.roundOffsets,m=t.isFixed,v=a.x,l=v===void 0?0:v,h=a.y,p=h===void 0?0:h,g=typeof u=="function"?u({x:l,y:p}):{x:l,y:p};l=g.x,p=g.y;var x=a.hasOwnProperty("x"),y=a.hasOwnProperty("y"),$=P,d=E,b=window;if(c){var w=se(n),O="clientHeight",j="clientWidth";if(w===H(n)&&(w=I(n),N(w).position!=="static"&&s==="absolute"&&(O="scrollHeight",j="scrollWidth")),w=w,o===E||(o===P||o===W)&&i===J){d=R;var A=m&&w===b&&b.visualViewport?b.visualViewport.height:w[O];p-=A-r.height,p*=f?1:-1;}if(o===P||(o===E||o===R)&&i===J){$=W;var k=m&&w===b&&b.visualViewport?b.visualViewport.width:w[j];l-=k-r.width,l*=f?1:-1;}}var D=Object.assign({position:s},c&&qt),S=u===true?Vt({x:l,y:p}):{x:l,y:p};if(l=S.x,p=S.y,f){var L;return Object.assign({},D,(L={},L[d]=y?"0":"",L[$]=x?"0":"",L.transform=(b.devicePixelRatio||1)<=1?"translate("+l+"px, "+p+"px)":"translate3d("+l+"px, "+p+"px, 0)",L))}return Object.assign({},D,(e={},e[d]=y?p+"px":"",e[$]=x?l+"px":"",e.transform="",e))}function Nt(t){var e=t.state,n=t.options,r=n.gpuAcceleration,o=r===void 0?true:r,i=n.adaptive,a=i===void 0?true:i,s=n.roundOffsets,f=s===void 0?true:s,c={placement:q(e.placement),variation:te(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:o,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,ut(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:a,roundOffsets:f})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,ut(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:false,roundOffsets:f})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement});}var Me={name:"computeStyles",enabled:true,phase:"beforeWrite",fn:Nt,data:{}},ye={passive:true};function It(t){var e=t.state,n=t.instance,r=t.options,o=r.scroll,i=o===void 0?true:o,a=r.resize,s=a===void 0?true:a,f=H(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return i&&c.forEach(function(u){u.addEventListener("scroll",n.update,ye);}),s&&f.addEventListener("resize",n.update,ye),function(){i&&c.forEach(function(u){u.removeEventListener("scroll",n.update,ye);}),s&&f.removeEventListener("resize",n.update,ye);}}var Re={name:"eventListeners",enabled:true,phase:"write",fn:function(){},effect:It,data:{}},_t={left:"right",right:"left",bottom:"top",top:"bottom"};function be(t){return t.replace(/left|right|bottom|top/g,function(e){return _t[e]})}var zt={start:"end",end:"start"};function lt(t){return t.replace(/start|end/g,function(e){return zt[e]})}function We(t){var e=H(t),n=e.pageXOffset,r=e.pageYOffset;return {scrollLeft:n,scrollTop:r}}function Be(t){return ee(I(t)).left+We(t).scrollLeft}function Ft(t){var e=H(t),n=I(t),r=e.visualViewport,o=n.clientWidth,i=n.clientHeight,a=0,s=0;return r&&(o=r.width,i=r.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(a=r.offsetLeft,s=r.offsetTop)),{width:o,height:i,x:a+Be(t),y:s}}function Ut(t){var e,n=I(t),r=We(t),o=(e=t.ownerDocument)==null?void 0:e.body,i=X(n.scrollWidth,n.clientWidth,o?o.scrollWidth:0,o?o.clientWidth:0),a=X(n.scrollHeight,n.clientHeight,o?o.scrollHeight:0,o?o.clientHeight:0),s=-r.scrollLeft+Be(t),f=-r.scrollTop;return N(o||n).direction==="rtl"&&(s+=X(n.clientWidth,o?o.clientWidth:0)-i),{width:i,height:a,x:s,y:f}}function Se(t){var e=N(t),n=e.overflow,r=e.overflowX,o=e.overflowY;return /auto|scroll|overlay|hidden/.test(n+o+r)}function dt(t){return ["html","body","#document"].indexOf(C(t))>=0?t.ownerDocument.body:B(t)&&Se(t)?t:dt(ge(t))}function ce(t,e){var n;e===void 0&&(e=[]);var r=dt(t),o=r===((n=t.ownerDocument)==null?void 0:n.body),i=H(r),a=o?[i].concat(i.visualViewport||[],Se(r)?r:[]):r,s=e.concat(a);return o?s:s.concat(ce(ge(a)))}function Te(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function Xt(t){var e=ee(t);return e.top=e.top+t.clientTop,e.left=e.left+t.clientLeft,e.bottom=e.top+t.clientHeight,e.right=e.left+t.clientWidth,e.width=t.clientWidth,e.height=t.clientHeight,e.x=e.left,e.y=e.top,e}function ht(t,e){return e===je?Te(Ft(t)):Q(e)?Xt(e):Te(Ut(I(t)))}function Yt(t){var e=ce(ge(t)),n=["absolute","fixed"].indexOf(N(t).position)>=0,r=n&&B(t)?se(t):t;return Q(r)?e.filter(function(o){return Q(o)&&it(o,r)&&C(o)!=="body"}):[]}function Gt(t,e,n){var r=e==="clippingParents"?Yt(t):[].concat(e),o=[].concat(r,[n]),i=o[0],a=o.reduce(function(s,f){var c=ht(t,f);return s.top=X(c.top,s.top),s.right=ve(c.right,s.right),s.bottom=ve(c.bottom,s.bottom),s.left=X(c.left,s.left),s},ht(t,i));return a.width=a.right-a.left,a.height=a.bottom-a.top,a.x=a.left,a.y=a.top,a}function mt(t){var e=t.reference,n=t.element,r=t.placement,o=r?q(r):null,i=r?te(r):null,a=e.x+e.width/2-n.width/2,s=e.y+e.height/2-n.height/2,f;switch(o){case E:f={x:a,y:e.y-n.height};break;case R:f={x:a,y:e.y+e.height};break;case W:f={x:e.x+e.width,y:s};break;case P:f={x:e.x-n.width,y:s};break;default:f={x:e.x,y:e.y};}var c=o?Le(o):null;if(c!=null){var u=c==="y"?"height":"width";switch(i){case U:f[c]=f[c]-(e[u]/2-n[u]/2);break;case J:f[c]=f[c]+(e[u]/2-n[u]/2);break}}return f}function ne(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=r===void 0?t.placement:r,i=n.boundary,a=i===void 0?Xe:i,s=n.rootBoundary,f=s===void 0?je:s,c=n.elementContext,u=c===void 0?K:c,m=n.altBoundary,v=m===void 0?false:m,l=n.padding,h=l===void 0?0:l,p=ft(typeof h!="number"?h:ct(h,G)),g=u===K?Ye:K,x=t.rects.popper,y=t.elements[v?g:u],$=Gt(Q(y)?y:y.contextElement||I(t.elements.popper),a,f),d=ee(t.elements.reference),b=mt({reference:d,element:x,placement:o}),w=Te(Object.assign({},x,b)),O=u===K?w:d,j={top:$.top-O.top+p.top,bottom:O.bottom-$.bottom+p.bottom,left:$.left-O.left+p.left,right:O.right-$.right+p.right},A=t.modifiersData.offset;if(u===K&&A){var k=A[o];Object.keys(j).forEach(function(D){var S=[W,R].indexOf(D)>=0?1:-1,L=[E,R].indexOf(D)>=0?"y":"x";j[D]+=k[L]*S;});}return j}function Jt(t,e){e===void 0&&(e={});var n=e,r=n.placement,o=n.boundary,i=n.rootBoundary,a=n.padding,s=n.flipVariations,f=n.allowedAutoPlacements,c=f===void 0?Ee:f,u=te(r),m=u?s?De:De.filter(function(h){return te(h)===u}):G,v=m.filter(function(h){return c.indexOf(h)>=0});v.length===0&&(v=m);var l=v.reduce(function(h,p){return h[p]=ne(t,{placement:p,boundary:o,rootBoundary:i,padding:a})[q(p)],h},{});return Object.keys(l).sort(function(h,p){return l[h]-l[p]})}function Kt(t){if(q(t)===me)return [];var e=be(t);return [lt(t),e,lt(e)]}function Qt(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var o=n.mainAxis,i=o===void 0?true:o,a=n.altAxis,s=a===void 0?true:a,f=n.fallbackPlacements,c=n.padding,u=n.boundary,m=n.rootBoundary,v=n.altBoundary,l=n.flipVariations,h=l===void 0?true:l,p=n.allowedAutoPlacements,g=e.options.placement,x=q(g),y=x===g,$=f||(y||!h?[be(g)]:Kt(g)),d=[g].concat($).reduce(function(z,V){return z.concat(q(V)===me?Jt(e,{placement:V,boundary:u,rootBoundary:m,padding:c,flipVariations:h,allowedAutoPlacements:p}):V)},[]),b=e.rects.reference,w=e.rects.popper,O=new Map,j=true,A=d[0],k=0;k<d.length;k++){var D=d[k],S=q(D),L=te(D)===U,re=[E,R].indexOf(S)>=0,oe=re?"width":"height",M=ne(e,{placement:D,boundary:u,rootBoundary:m,altBoundary:v,padding:c}),T=re?L?W:P:L?R:E;b[oe]>w[oe]&&(T=be(T));var pe=be(T),_=[];if(i&&_.push(M[S]<=0),s&&_.push(M[T]<=0,M[pe]<=0),_.every(function(z){return z})){A=D,j=false;break}O.set(D,_);}if(j)for(var ue=h?3:1,xe=function(z){var V=d.find(function(de){var ae=O.get(de);if(ae)return ae.slice(0,z).every(function(Y){return Y})});if(V)return A=V,"break"},ie=ue;ie>0;ie--){var le=xe(ie);if(le==="break")break}e.placement!==A&&(e.modifiersData[r]._skip=true,e.placement=A,e.reset=true);}}var vt={name:"flip",enabled:true,phase:"main",fn:Qt,requiresIfExists:["offset"],data:{_skip:false}};function gt(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function yt(t){return [E,W,R,P].some(function(e){return t[e]>=0})}function Zt(t){var e=t.state,n=t.name,r=e.rects.reference,o=e.rects.popper,i=e.modifiersData.preventOverflow,a=ne(e,{elementContext:"reference"}),s=ne(e,{altBoundary:true}),f=gt(a,r),c=gt(s,o,i),u=yt(f),m=yt(c);e.modifiersData[n]={referenceClippingOffsets:f,popperEscapeOffsets:c,isReferenceHidden:u,hasPopperEscaped:m},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":u,"data-popper-escaped":m});}var bt={name:"hide",enabled:true,phase:"main",requiresIfExists:["preventOverflow"],fn:Zt};function en(t,e,n){var r=q(t),o=[P,E].indexOf(r)>=0?-1:1,i=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,a=i[0],s=i[1];return a=a||0,s=(s||0)*o,[P,W].indexOf(r)>=0?{x:s,y:a}:{x:a,y:s}}function tn(t){var e=t.state,n=t.options,r=t.name,o=n.offset,i=o===void 0?[0,0]:o,a=Ee.reduce(function(u,m){return u[m]=en(m,e.rects,i),u},{}),s=a[e.placement],f=s.x,c=s.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=f,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=a;}var wt={name:"offset",enabled:true,phase:"main",requires:["popperOffsets"],fn:tn};function nn(t){var e=t.state,n=t.name;e.modifiersData[n]=mt({reference:e.rects.reference,element:e.rects.popper,placement:e.placement});}var He={name:"popperOffsets",enabled:true,phase:"read",fn:nn,data:{}};function rn(t){return t==="x"?"y":"x"}function on(t){var e=t.state,n=t.options,r=t.name,o=n.mainAxis,i=o===void 0?true:o,a=n.altAxis,s=a===void 0?false:a,f=n.boundary,c=n.rootBoundary,u=n.altBoundary,m=n.padding,v=n.tether,l=v===void 0?true:v,h=n.tetherOffset,p=h===void 0?0:h,g=ne(e,{boundary:f,rootBoundary:c,padding:m,altBoundary:u}),x=q(e.placement),y=te(e.placement),$=!y,d=Le(x),b=rn(d),w=e.modifiersData.popperOffsets,O=e.rects.reference,j=e.rects.popper,A=typeof p=="function"?p(Object.assign({},e.rects,{placement:e.placement})):p,k=typeof A=="number"?{mainAxis:A,altAxis:A}:Object.assign({mainAxis:0,altAxis:0},A),D=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,S={x:0,y:0};if(w){if(i){var L,re=d==="y"?E:P,oe=d==="y"?R:W,M=d==="y"?"height":"width",T=w[d],pe=T+g[re],_=T-g[oe],ue=l?-j[M]/2:0,xe=y===U?O[M]:j[M],ie=y===U?-j[M]:-O[M],le=e.elements.arrow,z=l&&le?ke(le):{width:0,height:0},V=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:st(),de=V[re],ae=V[oe],Y=fe(0,O[M],z[M]),jt=$?O[M]/2-ue-Y-de-k.mainAxis:xe-Y-de-k.mainAxis,Dt=$?-O[M]/2+ue+Y+ae+k.mainAxis:ie+Y+ae+k.mainAxis,Oe=e.elements.arrow&&se(e.elements.arrow),Et=Oe?d==="y"?Oe.clientTop||0:Oe.clientLeft||0:0,Ce=(L=D==null?void 0:D[d])!=null?L:0,Pt=T+jt-Ce-Et,At=T+Dt-Ce,qe=fe(l?ve(pe,Pt):pe,T,l?X(_,At):_);w[d]=qe,S[d]=qe-T;}if(s){var Ve,kt=d==="x"?E:P,Lt=d==="x"?R:W,F=w[b],he=b==="y"?"height":"width",Ne=F+g[kt],Ie=F-g[Lt],$e=[E,P].indexOf(x)!==-1,_e=(Ve=D==null?void 0:D[b])!=null?Ve:0,ze=$e?Ne:F-O[he]-j[he]-_e+k.altAxis,Fe=$e?F+O[he]+j[he]-_e-k.altAxis:Ie,Ue=l&&$e?St(ze,F,Fe):fe(l?ze:Ne,F,l?Fe:Ie);w[b]=Ue,S[b]=Ue-F;}e.modifiersData[r]=S;}}var xt={name:"preventOverflow",enabled:true,phase:"main",fn:on,requiresIfExists:["offset"]};function an(t){return {scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function sn(t){return t===H(t)||!B(t)?We(t):an(t)}function fn(t){var e=t.getBoundingClientRect(),n=Z(e.width)/t.offsetWidth||1,r=Z(e.height)/t.offsetHeight||1;return n!==1||r!==1}function cn(t,e,n){n===void 0&&(n=false);var r=B(e),o=B(e)&&fn(e),i=I(e),a=ee(t,o),s={scrollLeft:0,scrollTop:0},f={x:0,y:0};return (r||!r&&!n)&&((C(e)!=="body"||Se(i))&&(s=sn(e)),B(e)?(f=ee(e,true),f.x+=e.clientLeft,f.y+=e.clientTop):i&&(f.x=Be(i))),{x:a.left+s.scrollLeft-f.x,y:a.top+s.scrollTop-f.y,width:a.width,height:a.height}}function pn(t){var e=new Map,n=new Set,r=[];t.forEach(function(i){e.set(i.name,i);});function o(i){n.add(i.name);var a=[].concat(i.requires||[],i.requiresIfExists||[]);a.forEach(function(s){if(!n.has(s)){var f=e.get(s);f&&o(f);}}),r.push(i);}return t.forEach(function(i){n.has(i.name)||o(i);}),r}function un(t){var e=pn(t);return ot.reduce(function(n,r){return n.concat(e.filter(function(o){return o.phase===r}))},[])}function ln(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t());});})),e}}function dn(t){var e=t.reduce(function(n,r){var o=n[r.name];return n[r.name]=o?Object.assign({},o,r,{options:Object.assign({},o.options,r.options),data:Object.assign({},o.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var Ot={placement:"bottom",modifiers:[],strategy:"absolute"};function $t(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return !e.some(function(r){return !(r&&typeof r.getBoundingClientRect=="function")})}function we(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,o=e.defaultOptions,i=o===void 0?Ot:o;return function(a,s,f){f===void 0&&(f=i);var c={placement:"bottom",orderedModifiers:[],options:Object.assign({},Ot,i),modifiersData:{},elements:{reference:a,popper:s},attributes:{},styles:{}},u=[],m=false,v={state:c,setOptions:function(p){var g=typeof p=="function"?p(c.options):p;h(),c.options=Object.assign({},i,c.options,g),c.scrollParents={reference:Q(a)?ce(a):a.contextElement?ce(a.contextElement):[],popper:ce(s)};var x=un(dn([].concat(r,c.options.modifiers)));return c.orderedModifiers=x.filter(function(y){return y.enabled}),l(),v.update()},forceUpdate:function(){if(!m){var p=c.elements,g=p.reference,x=p.popper;if($t(g,x)){c.rects={reference:cn(g,se(x),c.options.strategy==="fixed"),popper:ke(x)},c.reset=false,c.placement=c.options.placement,c.orderedModifiers.forEach(function(j){return c.modifiersData[j.name]=Object.assign({},j.data)});for(var y=0;y<c.orderedModifiers.length;y++){if(c.reset===true){c.reset=false,y=-1;continue}var $=c.orderedModifiers[y],d=$.fn,b=$.options,w=b===void 0?{}:b,O=$.name;typeof d=="function"&&(c=d({state:c,options:w,name:O,instance:v})||c);}}}},update:ln(function(){return new Promise(function(p){v.forceUpdate(),p(c);})}),destroy:function(){h(),m=true;}};if(!$t(a,s))return v;v.setOptions(f).then(function(p){!m&&f.onFirstUpdate&&f.onFirstUpdate(p);});function l(){c.orderedModifiers.forEach(function(p){var g=p.name,x=p.options,y=x===void 0?{}:x,$=p.effect;if(typeof $=="function"){var d=$({state:c,name:g,instance:v,options:y}),b=function(){};u.push(d||b);}});}function h(){u.forEach(function(p){return p()}),u=[];}return v}}we();var mn=[Re,He,Me,Ae];we({defaultModifiers:mn});var gn=[Re,He,Me,Ae,wt,vt,xt,pt,bt],yn=we({defaultModifiers:gn});
|
|
771
|
+
|
|
772
|
+
const popperArrowProps = buildProps({
|
|
773
|
+
arrowOffset: {
|
|
774
|
+
type: Number,
|
|
775
|
+
default: 5
|
|
776
|
+
}
|
|
777
|
+
});
|
|
778
|
+
|
|
779
|
+
const POSITIONING_STRATEGIES = ["fixed", "absolute"];
|
|
780
|
+
const popperCoreConfigProps = buildProps({
|
|
781
|
+
boundariesPadding: {
|
|
782
|
+
type: Number,
|
|
783
|
+
default: 0
|
|
784
|
+
},
|
|
785
|
+
fallbackPlacements: {
|
|
786
|
+
type: definePropType(Array),
|
|
787
|
+
default: void 0
|
|
788
|
+
},
|
|
789
|
+
gpuAcceleration: {
|
|
790
|
+
type: Boolean,
|
|
791
|
+
default: true
|
|
792
|
+
},
|
|
793
|
+
offset: {
|
|
794
|
+
type: Number,
|
|
795
|
+
default: 12
|
|
796
|
+
},
|
|
797
|
+
placement: {
|
|
798
|
+
type: String,
|
|
799
|
+
values: Ee,
|
|
800
|
+
default: "bottom"
|
|
801
|
+
},
|
|
802
|
+
popperOptions: {
|
|
803
|
+
type: definePropType(Object),
|
|
804
|
+
default: () => ({})
|
|
805
|
+
},
|
|
806
|
+
strategy: {
|
|
807
|
+
type: String,
|
|
808
|
+
values: POSITIONING_STRATEGIES,
|
|
809
|
+
default: "absolute"
|
|
810
|
+
}
|
|
811
|
+
});
|
|
812
|
+
const popperContentProps = buildProps({
|
|
813
|
+
...popperCoreConfigProps,
|
|
814
|
+
...popperArrowProps,
|
|
815
|
+
id: String,
|
|
816
|
+
style: {
|
|
817
|
+
type: definePropType([String, Array, Object])
|
|
818
|
+
},
|
|
819
|
+
className: {
|
|
820
|
+
type: definePropType([String, Array, Object])
|
|
821
|
+
},
|
|
822
|
+
effect: {
|
|
823
|
+
type: definePropType(String),
|
|
824
|
+
default: "dark"
|
|
825
|
+
},
|
|
826
|
+
visible: Boolean,
|
|
827
|
+
enterable: {
|
|
828
|
+
type: Boolean,
|
|
829
|
+
default: true
|
|
830
|
+
},
|
|
831
|
+
pure: Boolean,
|
|
832
|
+
focusOnShow: Boolean,
|
|
833
|
+
trapping: Boolean,
|
|
834
|
+
popperClass: {
|
|
835
|
+
type: definePropType([String, Array, Object])
|
|
836
|
+
},
|
|
837
|
+
popperStyle: {
|
|
838
|
+
type: definePropType([String, Array, Object])
|
|
839
|
+
},
|
|
840
|
+
referenceEl: {
|
|
841
|
+
type: definePropType(Object)
|
|
842
|
+
},
|
|
843
|
+
triggerTargetEl: {
|
|
844
|
+
type: definePropType(Object)
|
|
845
|
+
},
|
|
846
|
+
stopPopperMouseEvent: {
|
|
847
|
+
type: Boolean,
|
|
848
|
+
default: true
|
|
849
|
+
},
|
|
850
|
+
virtualTriggering: Boolean,
|
|
851
|
+
zIndex: Number,
|
|
852
|
+
...useAriaProps(["ariaLabel"]),
|
|
853
|
+
loop: Boolean
|
|
854
|
+
});
|
|
855
|
+
const popperContentEmits = {
|
|
856
|
+
mouseenter: (evt) => evt instanceof MouseEvent,
|
|
857
|
+
mouseleave: (evt) => evt instanceof MouseEvent,
|
|
858
|
+
focus: () => true,
|
|
859
|
+
blur: () => true,
|
|
860
|
+
close: () => true
|
|
861
|
+
};
|
|
862
|
+
|
|
863
|
+
const usePopperContentFocusTrap = (props, emit) => {
|
|
864
|
+
const trapped = ref(false);
|
|
865
|
+
const focusStartRef = ref();
|
|
866
|
+
const onFocusAfterTrapped = () => {
|
|
867
|
+
emit("focus");
|
|
868
|
+
};
|
|
869
|
+
const onFocusAfterReleased = (event) => {
|
|
870
|
+
var _a;
|
|
871
|
+
if (((_a = event.detail) == null ? void 0 : _a.focusReason) !== "pointer") {
|
|
872
|
+
focusStartRef.value = "first";
|
|
873
|
+
emit("blur");
|
|
874
|
+
}
|
|
875
|
+
};
|
|
876
|
+
const onFocusInTrap = (event) => {
|
|
877
|
+
if (props.visible && !trapped.value) {
|
|
878
|
+
if (event.target) {
|
|
879
|
+
focusStartRef.value = event.target;
|
|
880
|
+
}
|
|
881
|
+
trapped.value = true;
|
|
882
|
+
}
|
|
883
|
+
};
|
|
884
|
+
const onFocusoutPrevented = (event) => {
|
|
885
|
+
if (!props.trapping) {
|
|
886
|
+
if (event.detail.focusReason === "pointer") {
|
|
887
|
+
event.preventDefault();
|
|
888
|
+
}
|
|
889
|
+
trapped.value = false;
|
|
890
|
+
}
|
|
891
|
+
};
|
|
892
|
+
const onReleaseRequested = () => {
|
|
893
|
+
trapped.value = false;
|
|
894
|
+
emit("close");
|
|
895
|
+
};
|
|
896
|
+
onBeforeUnmount(() => {
|
|
897
|
+
focusStartRef.value = void 0;
|
|
898
|
+
});
|
|
899
|
+
return {
|
|
900
|
+
focusStartRef,
|
|
901
|
+
trapped,
|
|
902
|
+
onFocusAfterReleased,
|
|
903
|
+
onFocusAfterTrapped,
|
|
904
|
+
onFocusInTrap,
|
|
905
|
+
onFocusoutPrevented,
|
|
906
|
+
onReleaseRequested
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
|
|
910
|
+
const buildPopperOptions = (props, modifiers = []) => {
|
|
911
|
+
const { placement, strategy, popperOptions } = props;
|
|
912
|
+
const options = {
|
|
913
|
+
placement,
|
|
914
|
+
strategy,
|
|
915
|
+
...popperOptions,
|
|
916
|
+
modifiers: [...genModifiers(props), ...modifiers]
|
|
917
|
+
};
|
|
918
|
+
deriveExtraModifiers(options, popperOptions == null ? void 0 : popperOptions.modifiers);
|
|
919
|
+
return options;
|
|
920
|
+
};
|
|
921
|
+
const unwrapMeasurableEl = ($el) => {
|
|
922
|
+
if (!isClient)
|
|
923
|
+
return;
|
|
924
|
+
return unrefElement($el);
|
|
925
|
+
};
|
|
926
|
+
function genModifiers(options) {
|
|
927
|
+
const { offset, gpuAcceleration, fallbackPlacements } = options;
|
|
928
|
+
return [
|
|
929
|
+
{
|
|
930
|
+
name: "offset",
|
|
931
|
+
options: {
|
|
932
|
+
offset: [0, offset != null ? offset : 12]
|
|
933
|
+
}
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
name: "preventOverflow",
|
|
937
|
+
options: {
|
|
938
|
+
padding: {
|
|
939
|
+
top: 0,
|
|
940
|
+
bottom: 0,
|
|
941
|
+
left: 0,
|
|
942
|
+
right: 0
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
},
|
|
946
|
+
{
|
|
947
|
+
name: "flip",
|
|
948
|
+
options: {
|
|
949
|
+
padding: 5,
|
|
950
|
+
fallbackPlacements
|
|
951
|
+
}
|
|
952
|
+
},
|
|
953
|
+
{
|
|
954
|
+
name: "computeStyles",
|
|
955
|
+
options: {
|
|
956
|
+
gpuAcceleration
|
|
957
|
+
}
|
|
958
|
+
}
|
|
959
|
+
];
|
|
960
|
+
}
|
|
961
|
+
function deriveExtraModifiers(options, modifiers) {
|
|
962
|
+
if (modifiers) {
|
|
963
|
+
options.modifiers = [...options.modifiers, ...modifiers != null ? modifiers : []];
|
|
964
|
+
}
|
|
965
|
+
}
|
|
966
|
+
|
|
967
|
+
const usePopper = (referenceElementRef, popperElementRef, opts = {}) => {
|
|
968
|
+
const stateUpdater = {
|
|
969
|
+
name: "updateState",
|
|
970
|
+
enabled: true,
|
|
971
|
+
phase: "write",
|
|
972
|
+
fn: ({ state }) => {
|
|
973
|
+
const derivedState = deriveState(state);
|
|
974
|
+
Object.assign(states.value, derivedState);
|
|
975
|
+
},
|
|
976
|
+
requires: ["computeStyles"]
|
|
977
|
+
};
|
|
978
|
+
const options = computed(() => {
|
|
979
|
+
const { onFirstUpdate, placement, strategy, modifiers } = unref(opts);
|
|
980
|
+
return {
|
|
981
|
+
onFirstUpdate,
|
|
982
|
+
placement: placement || "bottom",
|
|
983
|
+
strategy: strategy || "absolute",
|
|
984
|
+
modifiers: [
|
|
985
|
+
...modifiers || [],
|
|
986
|
+
stateUpdater,
|
|
987
|
+
{ name: "applyStyles", enabled: false }
|
|
988
|
+
]
|
|
989
|
+
};
|
|
990
|
+
});
|
|
991
|
+
const instanceRef = shallowRef();
|
|
992
|
+
const states = ref({
|
|
993
|
+
styles: {
|
|
994
|
+
popper: {
|
|
995
|
+
position: unref(options).strategy,
|
|
996
|
+
left: "0",
|
|
997
|
+
top: "0"
|
|
998
|
+
},
|
|
999
|
+
arrow: {
|
|
1000
|
+
position: "absolute"
|
|
1001
|
+
}
|
|
1002
|
+
},
|
|
1003
|
+
attributes: {}
|
|
1004
|
+
});
|
|
1005
|
+
const destroy = () => {
|
|
1006
|
+
if (!instanceRef.value)
|
|
1007
|
+
return;
|
|
1008
|
+
instanceRef.value.destroy();
|
|
1009
|
+
instanceRef.value = void 0;
|
|
1010
|
+
};
|
|
1011
|
+
watch(options, (newOptions) => {
|
|
1012
|
+
const instance = unref(instanceRef);
|
|
1013
|
+
if (instance) {
|
|
1014
|
+
instance.setOptions(newOptions);
|
|
1015
|
+
}
|
|
1016
|
+
}, {
|
|
1017
|
+
deep: true
|
|
1018
|
+
});
|
|
1019
|
+
watch([referenceElementRef, popperElementRef], ([referenceElement, popperElement]) => {
|
|
1020
|
+
destroy();
|
|
1021
|
+
if (!referenceElement || !popperElement)
|
|
1022
|
+
return;
|
|
1023
|
+
instanceRef.value = yn(referenceElement, popperElement, unref(options));
|
|
1024
|
+
});
|
|
1025
|
+
onBeforeUnmount(() => {
|
|
1026
|
+
destroy();
|
|
1027
|
+
});
|
|
1028
|
+
return {
|
|
1029
|
+
state: computed(() => {
|
|
1030
|
+
var _a;
|
|
1031
|
+
return { ...((_a = unref(instanceRef)) == null ? void 0 : _a.state) || {} };
|
|
1032
|
+
}),
|
|
1033
|
+
styles: computed(() => unref(states).styles),
|
|
1034
|
+
attributes: computed(() => unref(states).attributes),
|
|
1035
|
+
update: () => {
|
|
1036
|
+
var _a;
|
|
1037
|
+
return (_a = unref(instanceRef)) == null ? void 0 : _a.update();
|
|
1038
|
+
},
|
|
1039
|
+
forceUpdate: () => {
|
|
1040
|
+
var _a;
|
|
1041
|
+
return (_a = unref(instanceRef)) == null ? void 0 : _a.forceUpdate();
|
|
1042
|
+
},
|
|
1043
|
+
instanceRef: computed(() => unref(instanceRef))
|
|
1044
|
+
};
|
|
1045
|
+
};
|
|
1046
|
+
function deriveState(state) {
|
|
1047
|
+
const elements = Object.keys(state.elements);
|
|
1048
|
+
const styles = fromPairs(elements.map((element) => [element, state.styles[element] || {}]));
|
|
1049
|
+
const attributes = fromPairs(elements.map((element) => [element, state.attributes[element]]));
|
|
1050
|
+
return {
|
|
1051
|
+
styles,
|
|
1052
|
+
attributes
|
|
1053
|
+
};
|
|
1054
|
+
}
|
|
1055
|
+
|
|
1056
|
+
const DEFAULT_ARROW_OFFSET = 0;
|
|
1057
|
+
const usePopperContent = (props) => {
|
|
1058
|
+
const { popperInstanceRef, contentRef, triggerRef, role } = inject(POPPER_INJECTION_KEY, void 0);
|
|
1059
|
+
const arrowRef = ref();
|
|
1060
|
+
const arrowOffset = computed(() => props.arrowOffset);
|
|
1061
|
+
const eventListenerModifier = computed(() => {
|
|
1062
|
+
return {
|
|
1063
|
+
name: "eventListeners",
|
|
1064
|
+
enabled: !!props.visible
|
|
1065
|
+
};
|
|
1066
|
+
});
|
|
1067
|
+
const arrowModifier = computed(() => {
|
|
1068
|
+
var _a;
|
|
1069
|
+
const arrowEl = unref(arrowRef);
|
|
1070
|
+
const offset = (_a = unref(arrowOffset)) != null ? _a : DEFAULT_ARROW_OFFSET;
|
|
1071
|
+
return {
|
|
1072
|
+
name: "arrow",
|
|
1073
|
+
enabled: !isUndefined(arrowEl),
|
|
1074
|
+
options: {
|
|
1075
|
+
element: arrowEl,
|
|
1076
|
+
padding: offset
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
});
|
|
1080
|
+
const options = computed(() => {
|
|
1081
|
+
return {
|
|
1082
|
+
onFirstUpdate: () => {
|
|
1083
|
+
update();
|
|
1084
|
+
},
|
|
1085
|
+
...buildPopperOptions(props, [
|
|
1086
|
+
unref(arrowModifier),
|
|
1087
|
+
unref(eventListenerModifier)
|
|
1088
|
+
])
|
|
1089
|
+
};
|
|
1090
|
+
});
|
|
1091
|
+
const computedReference = computed(() => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef));
|
|
1092
|
+
const { attributes, state, styles, update, forceUpdate, instanceRef } = usePopper(computedReference, contentRef, options);
|
|
1093
|
+
watch(instanceRef, (instance) => popperInstanceRef.value = instance, {
|
|
1094
|
+
flush: "sync"
|
|
1095
|
+
});
|
|
1096
|
+
onMounted(() => {
|
|
1097
|
+
watch(() => {
|
|
1098
|
+
var _a, _b;
|
|
1099
|
+
return (_b = (_a = unref(computedReference)) == null ? void 0 : _a.getBoundingClientRect) == null ? void 0 : _b.call(_a);
|
|
1100
|
+
}, () => {
|
|
1101
|
+
update();
|
|
1102
|
+
});
|
|
1103
|
+
});
|
|
1104
|
+
onBeforeUnmount(() => {
|
|
1105
|
+
popperInstanceRef.value = void 0;
|
|
1106
|
+
});
|
|
1107
|
+
return {
|
|
1108
|
+
attributes,
|
|
1109
|
+
arrowRef,
|
|
1110
|
+
contentRef,
|
|
1111
|
+
instanceRef,
|
|
1112
|
+
state,
|
|
1113
|
+
styles,
|
|
1114
|
+
role,
|
|
1115
|
+
forceUpdate,
|
|
1116
|
+
update
|
|
1117
|
+
};
|
|
1118
|
+
};
|
|
1119
|
+
|
|
1120
|
+
const usePopperContentDOM = (props, {
|
|
1121
|
+
attributes,
|
|
1122
|
+
styles,
|
|
1123
|
+
role
|
|
1124
|
+
}) => {
|
|
1125
|
+
const { nextZIndex } = useZIndex();
|
|
1126
|
+
const ns = useNamespace("popper");
|
|
1127
|
+
const contentAttrs = computed(() => unref(attributes).popper);
|
|
1128
|
+
const contentZIndex = ref(isNumber(props.zIndex) ? props.zIndex : nextZIndex());
|
|
1129
|
+
const contentClass = computed(() => [
|
|
1130
|
+
ns.b(),
|
|
1131
|
+
ns.is("pure", props.pure),
|
|
1132
|
+
ns.is(props.effect),
|
|
1133
|
+
props.popperClass
|
|
1134
|
+
]);
|
|
1135
|
+
const contentStyle = computed(() => {
|
|
1136
|
+
return [
|
|
1137
|
+
{ zIndex: unref(contentZIndex) },
|
|
1138
|
+
unref(styles).popper,
|
|
1139
|
+
props.popperStyle || {}
|
|
1140
|
+
];
|
|
1141
|
+
});
|
|
1142
|
+
const ariaModal = computed(() => role.value === "dialog" ? "false" : void 0);
|
|
1143
|
+
const arrowStyle = computed(() => unref(styles).arrow || {});
|
|
1144
|
+
const updateZIndex = () => {
|
|
1145
|
+
contentZIndex.value = isNumber(props.zIndex) ? props.zIndex : nextZIndex();
|
|
1146
|
+
};
|
|
1147
|
+
return {
|
|
1148
|
+
ariaModal,
|
|
1149
|
+
arrowStyle,
|
|
1150
|
+
contentAttrs,
|
|
1151
|
+
contentClass,
|
|
1152
|
+
contentStyle,
|
|
1153
|
+
contentZIndex,
|
|
1154
|
+
updateZIndex
|
|
1155
|
+
};
|
|
1156
|
+
};
|
|
1157
|
+
|
|
1158
|
+
const __default__$3 = defineComponent({
|
|
1159
|
+
name: "ElPopperContent"
|
|
1160
|
+
});
|
|
1161
|
+
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
1162
|
+
...__default__$3,
|
|
1163
|
+
props: popperContentProps,
|
|
1164
|
+
emits: popperContentEmits,
|
|
1165
|
+
setup(__props, { expose, emit }) {
|
|
1166
|
+
const props = __props;
|
|
1167
|
+
const {
|
|
1168
|
+
focusStartRef,
|
|
1169
|
+
trapped,
|
|
1170
|
+
onFocusAfterReleased,
|
|
1171
|
+
onFocusAfterTrapped,
|
|
1172
|
+
onFocusInTrap,
|
|
1173
|
+
onFocusoutPrevented,
|
|
1174
|
+
onReleaseRequested
|
|
1175
|
+
} = usePopperContentFocusTrap(props, emit);
|
|
1176
|
+
const { attributes, arrowRef, contentRef, styles, instanceRef, role, update } = usePopperContent(props);
|
|
1177
|
+
const {
|
|
1178
|
+
ariaModal,
|
|
1179
|
+
arrowStyle,
|
|
1180
|
+
contentAttrs,
|
|
1181
|
+
contentClass,
|
|
1182
|
+
contentStyle,
|
|
1183
|
+
updateZIndex
|
|
1184
|
+
} = usePopperContentDOM(props, {
|
|
1185
|
+
styles,
|
|
1186
|
+
attributes,
|
|
1187
|
+
role
|
|
1188
|
+
});
|
|
1189
|
+
const formItemContext = inject(formItemContextKey, void 0);
|
|
1190
|
+
provide(POPPER_CONTENT_INJECTION_KEY, {
|
|
1191
|
+
arrowStyle,
|
|
1192
|
+
arrowRef
|
|
1193
|
+
});
|
|
1194
|
+
if (formItemContext) {
|
|
1195
|
+
provide(formItemContextKey, {
|
|
1196
|
+
...formItemContext,
|
|
1197
|
+
addInputId: NOOP,
|
|
1198
|
+
removeInputId: NOOP
|
|
1199
|
+
});
|
|
1200
|
+
}
|
|
1201
|
+
let triggerTargetAriaStopWatch = void 0;
|
|
1202
|
+
const updatePopper = (shouldUpdateZIndex = true) => {
|
|
1203
|
+
update();
|
|
1204
|
+
shouldUpdateZIndex && updateZIndex();
|
|
1205
|
+
};
|
|
1206
|
+
const togglePopperAlive = () => {
|
|
1207
|
+
updatePopper(false);
|
|
1208
|
+
if (props.visible && props.focusOnShow) {
|
|
1209
|
+
trapped.value = true;
|
|
1210
|
+
} else if (props.visible === false) {
|
|
1211
|
+
trapped.value = false;
|
|
1212
|
+
}
|
|
1213
|
+
};
|
|
1214
|
+
onMounted(() => {
|
|
1215
|
+
watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
|
|
1216
|
+
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
|
1217
|
+
triggerTargetAriaStopWatch = void 0;
|
|
1218
|
+
const el = unref(triggerTargetEl || contentRef.value);
|
|
1219
|
+
const prevEl = unref(prevTriggerTargetEl || contentRef.value);
|
|
1220
|
+
if (isElement(el)) {
|
|
1221
|
+
triggerTargetAriaStopWatch = watch([role, () => props.ariaLabel, ariaModal, () => props.id], (watches) => {
|
|
1222
|
+
["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
|
|
1223
|
+
isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
|
1224
|
+
});
|
|
1225
|
+
}, { immediate: true });
|
|
1226
|
+
}
|
|
1227
|
+
if (prevEl !== el && isElement(prevEl)) {
|
|
1228
|
+
["role", "aria-label", "aria-modal", "id"].forEach((key) => {
|
|
1229
|
+
prevEl.removeAttribute(key);
|
|
1230
|
+
});
|
|
1231
|
+
}
|
|
1232
|
+
}, { immediate: true });
|
|
1233
|
+
watch(() => props.visible, togglePopperAlive, { immediate: true });
|
|
1234
|
+
});
|
|
1235
|
+
onBeforeUnmount(() => {
|
|
1236
|
+
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
|
1237
|
+
triggerTargetAriaStopWatch = void 0;
|
|
1238
|
+
contentRef.value = void 0;
|
|
1239
|
+
});
|
|
1240
|
+
expose({
|
|
1241
|
+
popperContentRef: contentRef,
|
|
1242
|
+
popperInstanceRef: instanceRef,
|
|
1243
|
+
updatePopper,
|
|
1244
|
+
contentStyle
|
|
1245
|
+
});
|
|
1246
|
+
return (_ctx, _cache) => {
|
|
1247
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
1248
|
+
ref_key: "contentRef",
|
|
1249
|
+
ref: contentRef
|
|
1250
|
+
}, unref(contentAttrs), {
|
|
1251
|
+
style: unref(contentStyle),
|
|
1252
|
+
class: unref(contentClass),
|
|
1253
|
+
tabindex: "-1",
|
|
1254
|
+
onMouseenter: (e) => _ctx.$emit("mouseenter", e),
|
|
1255
|
+
onMouseleave: (e) => _ctx.$emit("mouseleave", e)
|
|
1256
|
+
}), [
|
|
1257
|
+
createVNode(unref(ElFocusTrap), {
|
|
1258
|
+
loop: _ctx.loop,
|
|
1259
|
+
trapped: unref(trapped),
|
|
1260
|
+
"trap-on-focus-in": true,
|
|
1261
|
+
"focus-trap-el": unref(contentRef),
|
|
1262
|
+
"focus-start-el": unref(focusStartRef),
|
|
1263
|
+
onFocusAfterTrapped: unref(onFocusAfterTrapped),
|
|
1264
|
+
onFocusAfterReleased: unref(onFocusAfterReleased),
|
|
1265
|
+
onFocusin: unref(onFocusInTrap),
|
|
1266
|
+
onFocusoutPrevented: unref(onFocusoutPrevented),
|
|
1267
|
+
onReleaseRequested: unref(onReleaseRequested)
|
|
1268
|
+
}, {
|
|
1269
|
+
default: withCtx(() => [
|
|
1270
|
+
renderSlot(_ctx.$slots, "default")
|
|
1271
|
+
]),
|
|
1272
|
+
_: 3
|
|
1273
|
+
}, 8, ["loop", "trapped", "focus-trap-el", "focus-start-el", "onFocusAfterTrapped", "onFocusAfterReleased", "onFocusin", "onFocusoutPrevented", "onReleaseRequested"])
|
|
1274
|
+
], 16, ["onMouseenter", "onMouseleave"]);
|
|
1275
|
+
};
|
|
1276
|
+
}
|
|
1277
|
+
});
|
|
1278
|
+
var ElPopperContent = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__file", "content.vue"]]);
|
|
1279
|
+
|
|
1280
|
+
const ElPopper = withInstall(Popper);
|
|
1281
|
+
|
|
1282
|
+
const TOOLTIP_INJECTION_KEY = Symbol("elTooltip");
|
|
1283
|
+
|
|
1284
|
+
function useTimeout() {
|
|
1285
|
+
let timeoutHandle;
|
|
1286
|
+
const registerTimeout = (fn, delay) => {
|
|
1287
|
+
cancelTimeout();
|
|
1288
|
+
timeoutHandle = window.setTimeout(fn, delay);
|
|
1289
|
+
};
|
|
1290
|
+
const cancelTimeout = () => window.clearTimeout(timeoutHandle);
|
|
1291
|
+
tryOnScopeDispose(() => cancelTimeout());
|
|
1292
|
+
return {
|
|
1293
|
+
registerTimeout,
|
|
1294
|
+
cancelTimeout
|
|
1295
|
+
};
|
|
1296
|
+
}
|
|
1297
|
+
|
|
1298
|
+
const useDelayedToggleProps = buildProps({
|
|
1299
|
+
showAfter: {
|
|
1300
|
+
type: Number,
|
|
1301
|
+
default: 0
|
|
1302
|
+
},
|
|
1303
|
+
hideAfter: {
|
|
1304
|
+
type: Number,
|
|
1305
|
+
default: 200
|
|
1306
|
+
},
|
|
1307
|
+
autoClose: {
|
|
1308
|
+
type: Number,
|
|
1309
|
+
default: 0
|
|
1310
|
+
}
|
|
1311
|
+
});
|
|
1312
|
+
const useDelayedToggle = ({
|
|
1313
|
+
showAfter,
|
|
1314
|
+
hideAfter,
|
|
1315
|
+
autoClose,
|
|
1316
|
+
open,
|
|
1317
|
+
close
|
|
1318
|
+
}) => {
|
|
1319
|
+
const { registerTimeout } = useTimeout();
|
|
1320
|
+
const {
|
|
1321
|
+
registerTimeout: registerTimeoutForAutoClose,
|
|
1322
|
+
cancelTimeout: cancelTimeoutForAutoClose
|
|
1323
|
+
} = useTimeout();
|
|
1324
|
+
const onOpen = (event, delay = unref(showAfter)) => {
|
|
1325
|
+
registerTimeout(() => {
|
|
1326
|
+
open(event);
|
|
1327
|
+
const _autoClose = unref(autoClose);
|
|
1328
|
+
if (isNumber(_autoClose) && _autoClose > 0) {
|
|
1329
|
+
registerTimeoutForAutoClose(() => {
|
|
1330
|
+
close(event);
|
|
1331
|
+
}, _autoClose);
|
|
1332
|
+
}
|
|
1333
|
+
}, delay);
|
|
1334
|
+
};
|
|
1335
|
+
const onClose = (event, delay = unref(hideAfter)) => {
|
|
1336
|
+
cancelTimeoutForAutoClose();
|
|
1337
|
+
registerTimeout(() => {
|
|
1338
|
+
close(event);
|
|
1339
|
+
}, delay);
|
|
1340
|
+
};
|
|
1341
|
+
return {
|
|
1342
|
+
onOpen,
|
|
1343
|
+
onClose
|
|
1344
|
+
};
|
|
1345
|
+
};
|
|
1346
|
+
|
|
1347
|
+
const teleportProps = buildProps({
|
|
1348
|
+
to: {
|
|
1349
|
+
type: definePropType([String, Object]),
|
|
1350
|
+
required: true
|
|
1351
|
+
},
|
|
1352
|
+
disabled: Boolean
|
|
1353
|
+
});
|
|
1354
|
+
|
|
1355
|
+
const useTooltipContentProps = buildProps({
|
|
1356
|
+
...useDelayedToggleProps,
|
|
1357
|
+
...popperContentProps,
|
|
1358
|
+
appendTo: {
|
|
1359
|
+
type: teleportProps.to.type
|
|
1360
|
+
},
|
|
1361
|
+
content: {
|
|
1362
|
+
type: String,
|
|
1363
|
+
default: ""
|
|
1364
|
+
},
|
|
1365
|
+
rawContent: Boolean,
|
|
1366
|
+
persistent: Boolean,
|
|
1367
|
+
visible: {
|
|
1368
|
+
type: definePropType(Boolean),
|
|
1369
|
+
default: null
|
|
1370
|
+
},
|
|
1371
|
+
transition: String,
|
|
1372
|
+
teleported: {
|
|
1373
|
+
type: Boolean,
|
|
1374
|
+
default: true
|
|
1375
|
+
},
|
|
1376
|
+
disabled: Boolean,
|
|
1377
|
+
...useAriaProps(["ariaLabel"])
|
|
1378
|
+
});
|
|
1379
|
+
|
|
1380
|
+
const useTooltipTriggerProps = buildProps({
|
|
1381
|
+
...popperTriggerProps,
|
|
1382
|
+
disabled: Boolean,
|
|
1383
|
+
trigger: {
|
|
1384
|
+
type: definePropType([String, Array]),
|
|
1385
|
+
default: "hover"
|
|
1386
|
+
},
|
|
1387
|
+
triggerKeys: {
|
|
1388
|
+
type: definePropType(Array),
|
|
1389
|
+
default: () => [EVENT_CODE.enter, EVENT_CODE.numpadEnter, EVENT_CODE.space]
|
|
1390
|
+
},
|
|
1391
|
+
focusOnTarget: Boolean
|
|
1392
|
+
});
|
|
1393
|
+
|
|
1394
|
+
const _prop = buildProp({
|
|
1395
|
+
type: definePropType(Boolean),
|
|
1396
|
+
default: null
|
|
1397
|
+
});
|
|
1398
|
+
const _event = buildProp({
|
|
1399
|
+
type: definePropType(Function)
|
|
1400
|
+
});
|
|
1401
|
+
const createModelToggleComposable = (name) => {
|
|
1402
|
+
const updateEventKey = `update:${name}`;
|
|
1403
|
+
const updateEventKeyRaw = `onUpdate:${name}`;
|
|
1404
|
+
const useModelToggleEmits2 = [updateEventKey];
|
|
1405
|
+
const useModelToggleProps2 = {
|
|
1406
|
+
[name]: _prop,
|
|
1407
|
+
[updateEventKeyRaw]: _event
|
|
1408
|
+
};
|
|
1409
|
+
const useModelToggle2 = ({
|
|
1410
|
+
indicator,
|
|
1411
|
+
toggleReason,
|
|
1412
|
+
shouldHideWhenRouteChanges,
|
|
1413
|
+
shouldProceed,
|
|
1414
|
+
onShow,
|
|
1415
|
+
onHide
|
|
1416
|
+
}) => {
|
|
1417
|
+
const instance = getCurrentInstance();
|
|
1418
|
+
const { emit } = instance;
|
|
1419
|
+
const props = instance.props;
|
|
1420
|
+
const hasUpdateHandler = computed(() => isFunction(props[updateEventKeyRaw]));
|
|
1421
|
+
const isModelBindingAbsent = computed(() => props[name] === null);
|
|
1422
|
+
const doShow = (event) => {
|
|
1423
|
+
if (indicator.value === true) {
|
|
1424
|
+
return;
|
|
1425
|
+
}
|
|
1426
|
+
indicator.value = true;
|
|
1427
|
+
if (toggleReason) {
|
|
1428
|
+
toggleReason.value = event;
|
|
1429
|
+
}
|
|
1430
|
+
if (isFunction(onShow)) {
|
|
1431
|
+
onShow(event);
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
const doHide = (event) => {
|
|
1435
|
+
if (indicator.value === false) {
|
|
1436
|
+
return;
|
|
1437
|
+
}
|
|
1438
|
+
indicator.value = false;
|
|
1439
|
+
if (toggleReason) {
|
|
1440
|
+
toggleReason.value = event;
|
|
1441
|
+
}
|
|
1442
|
+
if (isFunction(onHide)) {
|
|
1443
|
+
onHide(event);
|
|
1444
|
+
}
|
|
1445
|
+
};
|
|
1446
|
+
const show = (event) => {
|
|
1447
|
+
if (props.disabled === true || isFunction(shouldProceed) && !shouldProceed())
|
|
1448
|
+
return;
|
|
1449
|
+
const shouldEmit = hasUpdateHandler.value && isClient;
|
|
1450
|
+
if (shouldEmit) {
|
|
1451
|
+
emit(updateEventKey, true);
|
|
1452
|
+
}
|
|
1453
|
+
if (isModelBindingAbsent.value || !shouldEmit) {
|
|
1454
|
+
doShow(event);
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
const hide = (event) => {
|
|
1458
|
+
if (props.disabled === true || !isClient)
|
|
1459
|
+
return;
|
|
1460
|
+
const shouldEmit = hasUpdateHandler.value && isClient;
|
|
1461
|
+
if (shouldEmit) {
|
|
1462
|
+
emit(updateEventKey, false);
|
|
1463
|
+
}
|
|
1464
|
+
if (isModelBindingAbsent.value || !shouldEmit) {
|
|
1465
|
+
doHide(event);
|
|
1466
|
+
}
|
|
1467
|
+
};
|
|
1468
|
+
const onChange = (val) => {
|
|
1469
|
+
if (!isBoolean(val))
|
|
1470
|
+
return;
|
|
1471
|
+
if (props.disabled && val) {
|
|
1472
|
+
if (hasUpdateHandler.value) {
|
|
1473
|
+
emit(updateEventKey, false);
|
|
1474
|
+
}
|
|
1475
|
+
} else if (indicator.value !== val) {
|
|
1476
|
+
if (val) {
|
|
1477
|
+
doShow();
|
|
1478
|
+
} else {
|
|
1479
|
+
doHide();
|
|
1480
|
+
}
|
|
1481
|
+
}
|
|
1482
|
+
};
|
|
1483
|
+
const toggle = () => {
|
|
1484
|
+
if (indicator.value) {
|
|
1485
|
+
hide();
|
|
1486
|
+
} else {
|
|
1487
|
+
show();
|
|
1488
|
+
}
|
|
1489
|
+
};
|
|
1490
|
+
watch(() => props[name], onChange);
|
|
1491
|
+
if (shouldHideWhenRouteChanges && instance.appContext.config.globalProperties.$route !== void 0) {
|
|
1492
|
+
watch(() => ({
|
|
1493
|
+
...instance.proxy.$route
|
|
1494
|
+
}), () => {
|
|
1495
|
+
if (shouldHideWhenRouteChanges.value && indicator.value) {
|
|
1496
|
+
hide();
|
|
1497
|
+
}
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
onMounted(() => {
|
|
1501
|
+
onChange(props[name]);
|
|
1502
|
+
});
|
|
1503
|
+
return {
|
|
1504
|
+
hide,
|
|
1505
|
+
show,
|
|
1506
|
+
toggle,
|
|
1507
|
+
hasUpdateHandler
|
|
1508
|
+
};
|
|
1509
|
+
};
|
|
1510
|
+
return {
|
|
1511
|
+
useModelToggle: useModelToggle2,
|
|
1512
|
+
useModelToggleProps: useModelToggleProps2,
|
|
1513
|
+
useModelToggleEmits: useModelToggleEmits2
|
|
1514
|
+
};
|
|
1515
|
+
};
|
|
1516
|
+
|
|
1517
|
+
const {
|
|
1518
|
+
useModelToggleProps: useTooltipModelToggleProps,
|
|
1519
|
+
useModelToggleEmits: useTooltipModelToggleEmits,
|
|
1520
|
+
useModelToggle: useTooltipModelToggle
|
|
1521
|
+
} = createModelToggleComposable("visible");
|
|
1522
|
+
const useTooltipProps = buildProps({
|
|
1523
|
+
...popperProps,
|
|
1524
|
+
...useTooltipModelToggleProps,
|
|
1525
|
+
...useTooltipContentProps,
|
|
1526
|
+
...useTooltipTriggerProps,
|
|
1527
|
+
...popperArrowProps,
|
|
1528
|
+
showArrow: {
|
|
1529
|
+
type: Boolean,
|
|
1530
|
+
default: true
|
|
1531
|
+
}
|
|
1532
|
+
});
|
|
1533
|
+
const tooltipEmits = [
|
|
1534
|
+
...useTooltipModelToggleEmits,
|
|
1535
|
+
"before-show",
|
|
1536
|
+
"before-hide",
|
|
1537
|
+
"show",
|
|
1538
|
+
"hide",
|
|
1539
|
+
"open",
|
|
1540
|
+
"close"
|
|
1541
|
+
];
|
|
1542
|
+
|
|
1543
|
+
const isTriggerType = (trigger, type) => {
|
|
1544
|
+
if (isArray(trigger)) {
|
|
1545
|
+
return trigger.includes(type);
|
|
1546
|
+
}
|
|
1547
|
+
return trigger === type;
|
|
1548
|
+
};
|
|
1549
|
+
const whenTrigger = (trigger, type, handler) => {
|
|
1550
|
+
return (e) => {
|
|
1551
|
+
isTriggerType(unref(trigger), type) && handler(e);
|
|
1552
|
+
};
|
|
1553
|
+
};
|
|
1554
|
+
|
|
1555
|
+
const __default__$2 = defineComponent({
|
|
1556
|
+
name: "ElTooltipTrigger"
|
|
1557
|
+
});
|
|
1558
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
1559
|
+
...__default__$2,
|
|
1560
|
+
props: useTooltipTriggerProps,
|
|
1561
|
+
setup(__props, { expose }) {
|
|
1562
|
+
const props = __props;
|
|
1563
|
+
const ns = useNamespace("tooltip");
|
|
1564
|
+
const { controlled, id, open, onOpen, onClose, onToggle } = inject(TOOLTIP_INJECTION_KEY, void 0);
|
|
1565
|
+
const triggerRef = ref(null);
|
|
1566
|
+
const stopWhenControlledOrDisabled = () => {
|
|
1567
|
+
if (unref(controlled) || props.disabled) {
|
|
1568
|
+
return true;
|
|
1569
|
+
}
|
|
1570
|
+
};
|
|
1571
|
+
const trigger = toRef(props, "trigger");
|
|
1572
|
+
const onMouseenter = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", (e) => {
|
|
1573
|
+
onOpen(e);
|
|
1574
|
+
if (props.focusOnTarget && e.target) {
|
|
1575
|
+
nextTick(() => {
|
|
1576
|
+
focusElement(e.target, { preventScroll: true });
|
|
1577
|
+
});
|
|
1578
|
+
}
|
|
1579
|
+
}));
|
|
1580
|
+
const onMouseleave = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "hover", onClose));
|
|
1581
|
+
const onClick = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "click", (e) => {
|
|
1582
|
+
if (e.button === 0) {
|
|
1583
|
+
onToggle(e);
|
|
1584
|
+
}
|
|
1585
|
+
}));
|
|
1586
|
+
const onFocus = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onOpen));
|
|
1587
|
+
const onBlur = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "focus", onClose));
|
|
1588
|
+
const onContextMenu = composeEventHandlers(stopWhenControlledOrDisabled, whenTrigger(trigger, "contextmenu", (e) => {
|
|
1589
|
+
e.preventDefault();
|
|
1590
|
+
onToggle(e);
|
|
1591
|
+
}));
|
|
1592
|
+
const onKeydown = composeEventHandlers(stopWhenControlledOrDisabled, (e) => {
|
|
1593
|
+
const code = getEventCode(e);
|
|
1594
|
+
if (props.triggerKeys.includes(code)) {
|
|
1595
|
+
e.preventDefault();
|
|
1596
|
+
onToggle(e);
|
|
1597
|
+
}
|
|
1598
|
+
});
|
|
1599
|
+
expose({
|
|
1600
|
+
triggerRef
|
|
1601
|
+
});
|
|
1602
|
+
return (_ctx, _cache) => {
|
|
1603
|
+
return openBlock(), createBlock(unref(ElPopperTrigger), {
|
|
1604
|
+
id: unref(id),
|
|
1605
|
+
"virtual-ref": _ctx.virtualRef,
|
|
1606
|
+
open: unref(open),
|
|
1607
|
+
"virtual-triggering": _ctx.virtualTriggering,
|
|
1608
|
+
class: normalizeClass(unref(ns).e("trigger")),
|
|
1609
|
+
onBlur: unref(onBlur),
|
|
1610
|
+
onClick: unref(onClick),
|
|
1611
|
+
onContextmenu: unref(onContextMenu),
|
|
1612
|
+
onFocus: unref(onFocus),
|
|
1613
|
+
onMouseenter: unref(onMouseenter),
|
|
1614
|
+
onMouseleave: unref(onMouseleave),
|
|
1615
|
+
onKeydown: unref(onKeydown)
|
|
1616
|
+
}, {
|
|
1617
|
+
default: withCtx(() => [
|
|
1618
|
+
renderSlot(_ctx.$slots, "default")
|
|
1619
|
+
]),
|
|
1620
|
+
_: 3
|
|
1621
|
+
}, 8, ["id", "virtual-ref", "open", "virtual-triggering", "class", "onBlur", "onClick", "onContextmenu", "onFocus", "onMouseenter", "onMouseleave", "onKeydown"]);
|
|
1622
|
+
};
|
|
1623
|
+
}
|
|
1624
|
+
});
|
|
1625
|
+
var ElTooltipTrigger = /* @__PURE__ */ _export_sfc(_sfc_main$3, [["__file", "trigger.vue"]]);
|
|
1626
|
+
|
|
1627
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
1628
|
+
__name: "teleport",
|
|
1629
|
+
props: teleportProps,
|
|
1630
|
+
setup(__props) {
|
|
1631
|
+
return (_ctx, _cache) => {
|
|
1632
|
+
return _ctx.disabled ? renderSlot(_ctx.$slots, "default", { key: 0 }) : (openBlock(), createBlock(Teleport$1, {
|
|
1633
|
+
key: 1,
|
|
1634
|
+
to: _ctx.to
|
|
1635
|
+
}, [
|
|
1636
|
+
renderSlot(_ctx.$slots, "default")
|
|
1637
|
+
], 8, ["to"]));
|
|
1638
|
+
};
|
|
1639
|
+
}
|
|
1640
|
+
});
|
|
1641
|
+
var Teleport = /* @__PURE__ */ _export_sfc(_sfc_main$2, [["__file", "teleport.vue"]]);
|
|
1642
|
+
|
|
1643
|
+
const ElTeleport = withInstall(Teleport);
|
|
1644
|
+
|
|
1645
|
+
const usePopperContainerId = () => {
|
|
1646
|
+
const namespace = useGetDerivedNamespace();
|
|
1647
|
+
const idInjection = useIdInjection();
|
|
1648
|
+
const id = computed(() => {
|
|
1649
|
+
return `${namespace.value}-popper-container-${idInjection.prefix}`;
|
|
1650
|
+
});
|
|
1651
|
+
const selector = computed(() => `#${id.value}`);
|
|
1652
|
+
return {
|
|
1653
|
+
id,
|
|
1654
|
+
selector
|
|
1655
|
+
};
|
|
1656
|
+
};
|
|
1657
|
+
const createContainer = (id) => {
|
|
1658
|
+
const container = document.createElement("div");
|
|
1659
|
+
container.id = id;
|
|
1660
|
+
document.body.appendChild(container);
|
|
1661
|
+
return container;
|
|
1662
|
+
};
|
|
1663
|
+
const usePopperContainer = () => {
|
|
1664
|
+
const { id, selector } = usePopperContainerId();
|
|
1665
|
+
onBeforeMount(() => {
|
|
1666
|
+
if (!isClient)
|
|
1667
|
+
return;
|
|
1668
|
+
if (typeof process !== "undefined" && process.env.NODE_ENV === "test" || !document.body.querySelector(selector.value)) {
|
|
1669
|
+
createContainer(id.value);
|
|
1670
|
+
}
|
|
1671
|
+
});
|
|
1672
|
+
return {
|
|
1673
|
+
id,
|
|
1674
|
+
selector
|
|
1675
|
+
};
|
|
1676
|
+
};
|
|
1677
|
+
|
|
1678
|
+
const unique = (arr) => [...new Set(arr)];
|
|
1679
|
+
const extractFirst = (arr) => {
|
|
1680
|
+
return isArray(arr) ? arr[0] : arr;
|
|
1681
|
+
};
|
|
1682
|
+
const castArray = (arr) => {
|
|
1683
|
+
if (!arr && arr !== 0)
|
|
1684
|
+
return [];
|
|
1685
|
+
return isArray(arr) ? arr : [arr];
|
|
1686
|
+
};
|
|
1687
|
+
|
|
1688
|
+
const __default__$1 = defineComponent({
|
|
1689
|
+
name: "ElTooltipContent",
|
|
1690
|
+
inheritAttrs: false
|
|
1691
|
+
});
|
|
1692
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
1693
|
+
...__default__$1,
|
|
1694
|
+
props: useTooltipContentProps,
|
|
1695
|
+
setup(__props, { expose }) {
|
|
1696
|
+
const props = __props;
|
|
1697
|
+
const { selector } = usePopperContainerId();
|
|
1698
|
+
const ns = useNamespace("tooltip");
|
|
1699
|
+
const contentRef = ref();
|
|
1700
|
+
const popperContentRef = computedEager(() => {
|
|
1701
|
+
var _a;
|
|
1702
|
+
return (_a = contentRef.value) == null ? void 0 : _a.popperContentRef;
|
|
1703
|
+
});
|
|
1704
|
+
let stopHandle;
|
|
1705
|
+
const {
|
|
1706
|
+
controlled,
|
|
1707
|
+
id,
|
|
1708
|
+
open,
|
|
1709
|
+
trigger,
|
|
1710
|
+
onClose,
|
|
1711
|
+
onOpen,
|
|
1712
|
+
onShow,
|
|
1713
|
+
onHide,
|
|
1714
|
+
onBeforeShow,
|
|
1715
|
+
onBeforeHide
|
|
1716
|
+
} = inject(TOOLTIP_INJECTION_KEY, void 0);
|
|
1717
|
+
const transitionClass = computed(() => {
|
|
1718
|
+
return props.transition || `${ns.namespace.value}-fade-in-linear`;
|
|
1719
|
+
});
|
|
1720
|
+
const persistentRef = computed(() => {
|
|
1721
|
+
if (typeof process !== "undefined") {
|
|
1722
|
+
if (process.env.NODE_ENV === "test" && !process.env.RUN_TEST_WITH_PERSISTENT) {
|
|
1723
|
+
return true;
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
return props.persistent;
|
|
1727
|
+
});
|
|
1728
|
+
onBeforeUnmount(() => {
|
|
1729
|
+
stopHandle == null ? void 0 : stopHandle();
|
|
1730
|
+
});
|
|
1731
|
+
const shouldRender = computed(() => {
|
|
1732
|
+
return unref(persistentRef) ? true : unref(open);
|
|
1733
|
+
});
|
|
1734
|
+
const shouldShow = computed(() => {
|
|
1735
|
+
return props.disabled ? false : unref(open);
|
|
1736
|
+
});
|
|
1737
|
+
const appendTo = computed(() => {
|
|
1738
|
+
return props.appendTo || selector.value;
|
|
1739
|
+
});
|
|
1740
|
+
const contentStyle = computed(() => {
|
|
1741
|
+
var _a;
|
|
1742
|
+
return (_a = props.style) != null ? _a : {};
|
|
1743
|
+
});
|
|
1744
|
+
const ariaHidden = ref(true);
|
|
1745
|
+
const onTransitionLeave = () => {
|
|
1746
|
+
onHide();
|
|
1747
|
+
isFocusInsideContent() && focusElement(document.body, { preventScroll: true });
|
|
1748
|
+
ariaHidden.value = true;
|
|
1749
|
+
};
|
|
1750
|
+
const stopWhenControlled = () => {
|
|
1751
|
+
if (unref(controlled))
|
|
1752
|
+
return true;
|
|
1753
|
+
};
|
|
1754
|
+
const onContentEnter = composeEventHandlers(stopWhenControlled, () => {
|
|
1755
|
+
if (props.enterable && isTriggerType(unref(trigger), "hover")) {
|
|
1756
|
+
onOpen();
|
|
1757
|
+
}
|
|
1758
|
+
});
|
|
1759
|
+
const onContentLeave = composeEventHandlers(stopWhenControlled, () => {
|
|
1760
|
+
if (isTriggerType(unref(trigger), "hover")) {
|
|
1761
|
+
onClose();
|
|
1762
|
+
}
|
|
1763
|
+
});
|
|
1764
|
+
const onBeforeEnter = () => {
|
|
1765
|
+
var _a, _b;
|
|
1766
|
+
(_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
1767
|
+
onBeforeShow == null ? void 0 : onBeforeShow();
|
|
1768
|
+
};
|
|
1769
|
+
const onBeforeLeave = () => {
|
|
1770
|
+
onBeforeHide == null ? void 0 : onBeforeHide();
|
|
1771
|
+
};
|
|
1772
|
+
const onAfterShow = () => {
|
|
1773
|
+
onShow();
|
|
1774
|
+
};
|
|
1775
|
+
const onBlur = () => {
|
|
1776
|
+
if (!props.virtualTriggering) {
|
|
1777
|
+
onClose();
|
|
1778
|
+
}
|
|
1779
|
+
};
|
|
1780
|
+
const isFocusInsideContent = (event) => {
|
|
1781
|
+
var _a;
|
|
1782
|
+
const popperContent = (_a = contentRef.value) == null ? void 0 : _a.popperContentRef;
|
|
1783
|
+
const activeElement = (event == null ? void 0 : event.relatedTarget) || document.activeElement;
|
|
1784
|
+
return popperContent == null ? void 0 : popperContent.contains(activeElement);
|
|
1785
|
+
};
|
|
1786
|
+
watch(() => unref(open), (val) => {
|
|
1787
|
+
if (!val) {
|
|
1788
|
+
stopHandle == null ? void 0 : stopHandle();
|
|
1789
|
+
} else {
|
|
1790
|
+
ariaHidden.value = false;
|
|
1791
|
+
stopHandle = onClickOutside(popperContentRef, () => {
|
|
1792
|
+
if (unref(controlled))
|
|
1793
|
+
return;
|
|
1794
|
+
const needClose = castArray(unref(trigger)).every((item) => {
|
|
1795
|
+
return item !== "hover" && item !== "focus";
|
|
1796
|
+
});
|
|
1797
|
+
if (needClose) {
|
|
1798
|
+
onClose();
|
|
1799
|
+
}
|
|
1800
|
+
}, { detectIframe: true });
|
|
1801
|
+
}
|
|
1802
|
+
}, {
|
|
1803
|
+
flush: "post"
|
|
1804
|
+
});
|
|
1805
|
+
watch(() => props.content, () => {
|
|
1806
|
+
var _a, _b;
|
|
1807
|
+
(_b = (_a = contentRef.value) == null ? void 0 : _a.updatePopper) == null ? void 0 : _b.call(_a);
|
|
1808
|
+
});
|
|
1809
|
+
expose({
|
|
1810
|
+
contentRef,
|
|
1811
|
+
isFocusInsideContent
|
|
1812
|
+
});
|
|
1813
|
+
return (_ctx, _cache) => {
|
|
1814
|
+
return openBlock(), createBlock(unref(ElTeleport), {
|
|
1815
|
+
disabled: !_ctx.teleported,
|
|
1816
|
+
to: unref(appendTo)
|
|
1817
|
+
}, {
|
|
1818
|
+
default: withCtx(() => [
|
|
1819
|
+
unref(shouldRender) || !ariaHidden.value ? (openBlock(), createBlock(Transition, {
|
|
1820
|
+
key: 0,
|
|
1821
|
+
name: unref(transitionClass),
|
|
1822
|
+
appear: !unref(persistentRef),
|
|
1823
|
+
onAfterLeave: onTransitionLeave,
|
|
1824
|
+
onBeforeEnter,
|
|
1825
|
+
onAfterEnter: onAfterShow,
|
|
1826
|
+
onBeforeLeave,
|
|
1827
|
+
persisted: ""
|
|
1828
|
+
}, {
|
|
1829
|
+
default: withCtx(() => [
|
|
1830
|
+
withDirectives(createVNode(unref(ElPopperContent), mergeProps({
|
|
1831
|
+
id: unref(id),
|
|
1832
|
+
ref_key: "contentRef",
|
|
1833
|
+
ref: contentRef
|
|
1834
|
+
}, _ctx.$attrs, {
|
|
1835
|
+
"aria-label": _ctx.ariaLabel,
|
|
1836
|
+
"aria-hidden": ariaHidden.value,
|
|
1837
|
+
"boundaries-padding": _ctx.boundariesPadding,
|
|
1838
|
+
"fallback-placements": _ctx.fallbackPlacements,
|
|
1839
|
+
"gpu-acceleration": _ctx.gpuAcceleration,
|
|
1840
|
+
offset: _ctx.offset,
|
|
1841
|
+
placement: _ctx.placement,
|
|
1842
|
+
"popper-options": _ctx.popperOptions,
|
|
1843
|
+
"arrow-offset": _ctx.arrowOffset,
|
|
1844
|
+
strategy: _ctx.strategy,
|
|
1845
|
+
effect: _ctx.effect,
|
|
1846
|
+
enterable: _ctx.enterable,
|
|
1847
|
+
pure: _ctx.pure,
|
|
1848
|
+
"popper-class": _ctx.popperClass,
|
|
1849
|
+
"popper-style": [_ctx.popperStyle, unref(contentStyle)],
|
|
1850
|
+
"reference-el": _ctx.referenceEl,
|
|
1851
|
+
"trigger-target-el": _ctx.triggerTargetEl,
|
|
1852
|
+
visible: unref(shouldShow),
|
|
1853
|
+
"z-index": _ctx.zIndex,
|
|
1854
|
+
loop: _ctx.loop,
|
|
1855
|
+
onMouseenter: unref(onContentEnter),
|
|
1856
|
+
onMouseleave: unref(onContentLeave),
|
|
1857
|
+
onBlur,
|
|
1858
|
+
onClose: unref(onClose)
|
|
1859
|
+
}), {
|
|
1860
|
+
default: withCtx(() => [
|
|
1861
|
+
renderSlot(_ctx.$slots, "default")
|
|
1862
|
+
]),
|
|
1863
|
+
_: 3
|
|
1864
|
+
}, 16, ["id", "aria-label", "aria-hidden", "boundaries-padding", "fallback-placements", "gpu-acceleration", "offset", "placement", "popper-options", "arrow-offset", "strategy", "effect", "enterable", "pure", "popper-class", "popper-style", "reference-el", "trigger-target-el", "visible", "z-index", "loop", "onMouseenter", "onMouseleave", "onClose"]), [
|
|
1865
|
+
[vShow, unref(shouldShow)]
|
|
1866
|
+
])
|
|
1867
|
+
]),
|
|
1868
|
+
_: 3
|
|
1869
|
+
}, 8, ["name", "appear"])) : createCommentVNode("v-if", true)
|
|
1870
|
+
]),
|
|
1871
|
+
_: 3
|
|
1872
|
+
}, 8, ["disabled", "to"]);
|
|
1873
|
+
};
|
|
1874
|
+
}
|
|
1875
|
+
});
|
|
1876
|
+
var ElTooltipContent = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__file", "content.vue"]]);
|
|
1877
|
+
|
|
1878
|
+
const __default__ = defineComponent({
|
|
1879
|
+
name: "ElTooltip"
|
|
1880
|
+
});
|
|
1881
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
1882
|
+
...__default__,
|
|
1883
|
+
props: useTooltipProps,
|
|
1884
|
+
emits: tooltipEmits,
|
|
1885
|
+
setup(__props, { expose, emit }) {
|
|
1886
|
+
const props = __props;
|
|
1887
|
+
usePopperContainer();
|
|
1888
|
+
const ns = useNamespace("tooltip");
|
|
1889
|
+
const id = useId();
|
|
1890
|
+
const popperRef = ref();
|
|
1891
|
+
const contentRef = ref();
|
|
1892
|
+
const updatePopper = () => {
|
|
1893
|
+
var _a;
|
|
1894
|
+
const popperComponent = unref(popperRef);
|
|
1895
|
+
if (popperComponent) {
|
|
1896
|
+
(_a = popperComponent.popperInstanceRef) == null ? void 0 : _a.update();
|
|
1897
|
+
}
|
|
1898
|
+
};
|
|
1899
|
+
const open = ref(false);
|
|
1900
|
+
const toggleReason = ref();
|
|
1901
|
+
const { show, hide, hasUpdateHandler } = useTooltipModelToggle({
|
|
1902
|
+
indicator: open,
|
|
1903
|
+
toggleReason
|
|
1904
|
+
});
|
|
1905
|
+
const { onOpen, onClose } = useDelayedToggle({
|
|
1906
|
+
showAfter: toRef(props, "showAfter"),
|
|
1907
|
+
hideAfter: toRef(props, "hideAfter"),
|
|
1908
|
+
autoClose: toRef(props, "autoClose"),
|
|
1909
|
+
open: show,
|
|
1910
|
+
close: hide
|
|
1911
|
+
});
|
|
1912
|
+
const controlled = computed(() => isBoolean(props.visible) && !hasUpdateHandler.value);
|
|
1913
|
+
const kls = computed(() => {
|
|
1914
|
+
return [ns.b(), props.popperClass];
|
|
1915
|
+
});
|
|
1916
|
+
provide(TOOLTIP_INJECTION_KEY, {
|
|
1917
|
+
controlled,
|
|
1918
|
+
id,
|
|
1919
|
+
open: readonly(open),
|
|
1920
|
+
trigger: toRef(props, "trigger"),
|
|
1921
|
+
onOpen,
|
|
1922
|
+
onClose,
|
|
1923
|
+
onToggle: (event) => {
|
|
1924
|
+
if (unref(open)) {
|
|
1925
|
+
onClose(event);
|
|
1926
|
+
} else {
|
|
1927
|
+
onOpen(event);
|
|
1928
|
+
}
|
|
1929
|
+
},
|
|
1930
|
+
onShow: () => {
|
|
1931
|
+
emit("show", toggleReason.value);
|
|
1932
|
+
},
|
|
1933
|
+
onHide: () => {
|
|
1934
|
+
emit("hide", toggleReason.value);
|
|
1935
|
+
},
|
|
1936
|
+
onBeforeShow: () => {
|
|
1937
|
+
emit("before-show", toggleReason.value);
|
|
1938
|
+
},
|
|
1939
|
+
onBeforeHide: () => {
|
|
1940
|
+
emit("before-hide", toggleReason.value);
|
|
1941
|
+
},
|
|
1942
|
+
updatePopper
|
|
1943
|
+
});
|
|
1944
|
+
watch(() => props.disabled, (disabled) => {
|
|
1945
|
+
if (disabled && open.value) {
|
|
1946
|
+
open.value = false;
|
|
1947
|
+
}
|
|
1948
|
+
});
|
|
1949
|
+
const isFocusInsideContent = (event) => {
|
|
1950
|
+
var _a;
|
|
1951
|
+
return (_a = contentRef.value) == null ? void 0 : _a.isFocusInsideContent(event);
|
|
1952
|
+
};
|
|
1953
|
+
onDeactivated(() => open.value && hide());
|
|
1954
|
+
onBeforeUnmount(() => {
|
|
1955
|
+
toggleReason.value = void 0;
|
|
1956
|
+
});
|
|
1957
|
+
expose({
|
|
1958
|
+
popperRef,
|
|
1959
|
+
contentRef,
|
|
1960
|
+
isFocusInsideContent,
|
|
1961
|
+
updatePopper,
|
|
1962
|
+
onOpen,
|
|
1963
|
+
onClose,
|
|
1964
|
+
hide
|
|
1965
|
+
});
|
|
1966
|
+
return (_ctx, _cache) => {
|
|
1967
|
+
return openBlock(), createBlock(unref(ElPopper), {
|
|
1968
|
+
ref_key: "popperRef",
|
|
1969
|
+
ref: popperRef,
|
|
1970
|
+
role: _ctx.role
|
|
1971
|
+
}, {
|
|
1972
|
+
default: withCtx(() => [
|
|
1973
|
+
createVNode(ElTooltipTrigger, {
|
|
1974
|
+
disabled: _ctx.disabled,
|
|
1975
|
+
trigger: _ctx.trigger,
|
|
1976
|
+
"trigger-keys": _ctx.triggerKeys,
|
|
1977
|
+
"virtual-ref": _ctx.virtualRef,
|
|
1978
|
+
"virtual-triggering": _ctx.virtualTriggering,
|
|
1979
|
+
"focus-on-target": _ctx.focusOnTarget
|
|
1980
|
+
}, {
|
|
1981
|
+
default: withCtx(() => [
|
|
1982
|
+
_ctx.$slots.default ? renderSlot(_ctx.$slots, "default", { key: 0 }) : createCommentVNode("v-if", true)
|
|
1983
|
+
]),
|
|
1984
|
+
_: 3
|
|
1985
|
+
}, 8, ["disabled", "trigger", "trigger-keys", "virtual-ref", "virtual-triggering", "focus-on-target"]),
|
|
1986
|
+
createVNode(ElTooltipContent, {
|
|
1987
|
+
ref_key: "contentRef",
|
|
1988
|
+
ref: contentRef,
|
|
1989
|
+
"aria-label": _ctx.ariaLabel,
|
|
1990
|
+
"boundaries-padding": _ctx.boundariesPadding,
|
|
1991
|
+
content: _ctx.content,
|
|
1992
|
+
disabled: _ctx.disabled,
|
|
1993
|
+
effect: _ctx.effect,
|
|
1994
|
+
enterable: _ctx.enterable,
|
|
1995
|
+
"fallback-placements": _ctx.fallbackPlacements,
|
|
1996
|
+
"hide-after": _ctx.hideAfter,
|
|
1997
|
+
"gpu-acceleration": _ctx.gpuAcceleration,
|
|
1998
|
+
offset: _ctx.offset,
|
|
1999
|
+
persistent: _ctx.persistent,
|
|
2000
|
+
"popper-class": unref(kls),
|
|
2001
|
+
"popper-style": _ctx.popperStyle,
|
|
2002
|
+
placement: _ctx.placement,
|
|
2003
|
+
"popper-options": _ctx.popperOptions,
|
|
2004
|
+
"arrow-offset": _ctx.arrowOffset,
|
|
2005
|
+
pure: _ctx.pure,
|
|
2006
|
+
"raw-content": _ctx.rawContent,
|
|
2007
|
+
"reference-el": _ctx.referenceEl,
|
|
2008
|
+
"trigger-target-el": _ctx.triggerTargetEl,
|
|
2009
|
+
"show-after": _ctx.showAfter,
|
|
2010
|
+
strategy: _ctx.strategy,
|
|
2011
|
+
teleported: _ctx.teleported,
|
|
2012
|
+
transition: _ctx.transition,
|
|
2013
|
+
"virtual-triggering": _ctx.virtualTriggering,
|
|
2014
|
+
"z-index": _ctx.zIndex,
|
|
2015
|
+
"append-to": _ctx.appendTo,
|
|
2016
|
+
loop: _ctx.loop
|
|
2017
|
+
}, {
|
|
2018
|
+
default: withCtx(() => [
|
|
2019
|
+
renderSlot(_ctx.$slots, "content", {}, () => [
|
|
2020
|
+
_ctx.rawContent ? (openBlock(), createElementBlock("span", {
|
|
2021
|
+
key: 0,
|
|
2022
|
+
innerHTML: _ctx.content
|
|
2023
|
+
}, null, 8, ["innerHTML"])) : (openBlock(), createElementBlock("span", { key: 1 }, toDisplayString(_ctx.content), 1))
|
|
2024
|
+
]),
|
|
2025
|
+
_ctx.showArrow ? (openBlock(), createBlock(unref(ElPopperArrow), { key: 0 })) : createCommentVNode("v-if", true)
|
|
2026
|
+
]),
|
|
2027
|
+
_: 3
|
|
2028
|
+
}, 8, ["aria-label", "boundaries-padding", "content", "disabled", "effect", "enterable", "fallback-placements", "hide-after", "gpu-acceleration", "offset", "persistent", "popper-class", "popper-style", "placement", "popper-options", "arrow-offset", "pure", "raw-content", "reference-el", "trigger-target-el", "show-after", "strategy", "teleported", "transition", "virtual-triggering", "z-index", "append-to", "loop"])
|
|
2029
|
+
]),
|
|
2030
|
+
_: 3
|
|
2031
|
+
}, 8, ["role"]);
|
|
2032
|
+
};
|
|
2033
|
+
}
|
|
2034
|
+
});
|
|
2035
|
+
var Tooltip = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "tooltip.vue"]]);
|
|
2036
|
+
|
|
2037
|
+
const ElTooltip = withInstall(Tooltip);
|
|
2038
|
+
|
|
2039
|
+
export { Ee as E, FOCUS_TRAP_INJECTION_KEY as F, ElTooltip as a, ElTeleport as b, castArray as c, ElFocusTrap as d, extractFirst as e, useTooltipTriggerProps as f, unique as g, roleTypes as r, teleportProps as t, useTooltipContentProps as u };
|