@element-plus/nightly 0.0.20220721 → 0.0.20220722
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.css +1 -1
- package/dist/index.full.js +2 -46
- package/dist/index.full.min.js +9 -9
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +9 -9
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +3 -46
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/avatar/index.mjs +2 -2
- package/es/components/avatar/src/avatar.mjs +32 -67
- package/es/components/avatar/src/avatar.mjs.map +1 -1
- package/es/components/avatar/src/avatar2.mjs +67 -32
- package/es/components/avatar/src/avatar2.mjs.map +1 -1
- package/es/components/calendar/index.mjs +2 -2
- package/es/components/calendar/src/calendar.mjs +230 -16
- package/es/components/calendar/src/calendar.mjs.map +1 -1
- package/es/components/calendar/src/calendar2.mjs +16 -230
- package/es/components/calendar/src/calendar2.mjs.map +1 -1
- package/es/components/index.mjs +4 -4
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/content.mjs +207 -87
- package/es/components/popper/src/content.mjs.map +1 -1
- package/es/components/popper/src/content2.mjs +87 -207
- package/es/components/popper/src/content2.mjs.map +1 -1
- package/es/components/tooltip/src/content.mjs +1 -1
- package/es/components/tooltip/src/tooltip.mjs +1 -1
- package/es/directives/index.d.ts +0 -1
- package/es/directives/index.mjs +0 -1
- package/es/directives/index.mjs.map +1 -1
- package/es/index.mjs +4 -5
- package/es/index.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/avatar/index.js +2 -2
- package/lib/components/avatar/src/avatar.js +33 -67
- package/lib/components/avatar/src/avatar.js.map +1 -1
- package/lib/components/avatar/src/avatar2.js +67 -33
- package/lib/components/avatar/src/avatar2.js.map +1 -1
- package/lib/components/calendar/index.js +2 -2
- package/lib/components/calendar/src/calendar.js +233 -16
- package/lib/components/calendar/src/calendar.js.map +1 -1
- package/lib/components/calendar/src/calendar2.js +16 -233
- package/lib/components/calendar/src/calendar2.js.map +1 -1
- package/lib/components/index.js +4 -4
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/content.js +206 -88
- package/lib/components/popper/src/content.js.map +1 -1
- package/lib/components/popper/src/content2.js +88 -206
- package/lib/components/popper/src/content2.js.map +1 -1
- package/lib/components/tooltip/src/content.js +1 -1
- package/lib/components/tooltip/src/tooltip.js +1 -1
- package/lib/directives/index.d.ts +0 -1
- package/lib/directives/index.js +0 -2
- package/lib/directives/index.js.map +1 -1
- package/lib/index.js +83 -85
- package/lib/index.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/theme-chalk/el-message.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/common/var.scss +1 -1
- package/theme-chalk/src/message.scss +2 -1
- package/web-types.json +1 -1
- package/es/directives/resize/index.d.ts +0 -3
- package/es/directives/resize/index.mjs +0 -18
- package/es/directives/resize/index.mjs.map +0 -1
- package/lib/directives/resize/index.d.ts +0 -3
- package/lib/directives/resize/index.js +0 -22
- package/lib/directives/resize/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content.js","sources":["../../../../../../packages/components/popper/src/content.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type { Options, Placement } from '@popperjs/core'\n\ntype ClassObjectType = Record<string, boolean>\ntype ClassType = string | ClassObjectType | ClassType[]\n\nconst POSITIONING_STRATEGIES = ['fixed', 'absolute'] as const\nexport const usePopperCoreConfigProps = buildProps({\n boundariesPadding: {\n type: Number,\n default: 0,\n },\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: () => [],\n },\n gpuAcceleration: {\n type: Boolean,\n default: true,\n },\n offset: {\n type: Number,\n default: 12,\n },\n placement: {\n type: String,\n values: placements,\n default: 'bottom',\n },\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}),\n },\n strategy: {\n type: String,\n values: POSITIONING_STRATEGIES,\n default: 'absolute',\n },\n} as const)\n\nexport const usePopperContentProps = buildProps({\n ...usePopperCoreConfigProps,\n id: String,\n style: { type: definePropType<StyleValue>([String, Array, Object]) },\n className: { type: definePropType<ClassType>([String, Array, Object]) },\n effect: {\n type: String,\n default: 'dark',\n },\n visible: Boolean,\n enterable: {\n type: Boolean,\n default: true,\n },\n pure: Boolean,\n focusOnShow: {\n type: Boolean,\n default: false,\n },\n trapping: {\n type: Boolean,\n default: false,\n },\n popperClass: {\n type: definePropType<ClassType>([String, Array, Object]),\n },\n popperStyle: {\n type: definePropType<StyleValue>([String, Array, Object]),\n },\n referenceEl: {\n type: definePropType<HTMLElement>(Object),\n },\n triggerTargetEl: {\n type: definePropType<HTMLElement>(Object),\n },\n stopPopperMouseEvent: {\n type: Boolean,\n default: true,\n },\n ariaLabel: {\n type: String,\n default: undefined,\n },\n virtualTriggering: Boolean,\n zIndex: Number,\n} as const)\n\nexport const usePopperContentEmits = [\n 'mouseenter',\n 'mouseleave',\n 'focus',\n 'blur',\n 'close',\n]\n\nexport type UsePopperContentProps = ExtractPropTypes<\n typeof usePopperContentProps\n>\n\nexport type UsePopperCoreConfigProps = ExtractPropTypes<\n typeof usePopperCoreConfigProps\n>\n"],"names":["buildProps","definePropType","placements"],"mappings":";;;;;;;;AAEA,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,MAAC,wBAAwB,GAAGA,kBAAU,CAAC;AACnD,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAEC,sBAAc,CAAC,KAAK,CAAC;AAC/B,IAAI,OAAO,EAAE,MAAM,EAAE;AACrB,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAEC,eAAU;AACtB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAED,sBAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;AACvB,GAAG;AACH,EA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,eAAe,EAAE;AACnB,IAAI,IAAI,EAAEA,sBAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,oBAAoB,EAAE;AACxB,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,KAAK,CAAC;AACnB,GAAG;AACH,EAAE,iBAAiB,EAAE,OAAO;AAC5B,EAAE,MAAM,EAAE,MAAM;AAChB,CAAC,EAAE;AACS,MAAC,qBAAqB,GAAG;AACrC,EAAE,YAAY;AACd,EAAE,YAAY;AACd,EAAE,OAAO;AACT,EAAE,MAAM;AACR,EAAE,OAAO;AACT;;;;;;"}
|
|
1
|
+
{"version":3,"file":"content.js","sources":["../../../../../../packages/components/popper/src/content.vue"],"sourcesContent":["<template>\n <div\n ref=\"popperContentRef\"\n :style=\"contentStyle\"\n :class=\"contentClass\"\n tabindex=\"-1\"\n @mouseenter=\"(e) => $emit('mouseenter', e)\"\n @mouseleave=\"(e) => $emit('mouseleave', e)\"\n >\n <el-focus-trap\n :trapped=\"trapped\"\n :trap-on-focus-in=\"true\"\n :focus-trap-el=\"popperContentRef\"\n :focus-start-el=\"focusStartRef\"\n @focus-after-trapped=\"onFocusAfterTrapped\"\n @focus-after-released=\"onFocusAfterReleased\"\n @focusin=\"onFocusInTrap\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onReleaseRequested\"\n >\n <slot />\n </el-focus-trap>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n// @ts-nocheck\nimport {\n computed,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n toRefs,\n unref,\n watch,\n} from 'vue'\nimport { NOOP } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\nimport { createPopper } from '@popperjs/core'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport {\n POPPER_CONTENT_INJECTION_KEY,\n POPPER_INJECTION_KEY,\n formItemContextKey,\n} from '@element-plus/tokens'\nimport { isElement } from '@element-plus/utils'\nimport { usePopperContentEmits, usePopperContentProps } from './content'\nimport { buildPopperOptions, unwrapMeasurableEl } from './utils'\n\nimport type { WatchStopHandle } from 'vue'\n\ndefineOptions({\n name: 'ElPopperContent',\n})\n\nconst emit = defineEmits(usePopperContentEmits)\n\nconst props = defineProps(usePopperContentProps)\n\nconst { popperInstanceRef, contentRef, triggerRef, role } = inject(\n POPPER_INJECTION_KEY,\n undefined\n)!\nconst formItemContext = inject(formItemContextKey, undefined)\nconst { nextZIndex } = useZIndex()\nconst ns = useNamespace('popper')\nconst popperContentRef = ref<HTMLElement>()\nconst focusStartRef = ref<string | HTMLElement>('first')\nconst arrowRef = ref<HTMLElement>()\nconst arrowOffset = ref<number>()\nprovide(POPPER_CONTENT_INJECTION_KEY, {\n arrowRef,\n arrowOffset,\n})\n\nif (\n formItemContext &&\n (formItemContext.addInputId || formItemContext.removeInputId)\n) {\n // disallow auto-id from inside popper content\n provide(formItemContextKey, {\n ...formItemContext,\n addInputId: NOOP,\n removeInputId: NOOP,\n })\n}\n\nconst contentZIndex = ref<number>(props.zIndex || nextZIndex())\nconst trapped = ref<boolean>(false)\n\nlet triggerTargetAriaStopWatch: WatchStopHandle | undefined = undefined\n\nconst computedReference = computed(\n () => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef)\n)\n\nconst contentStyle = computed(\n () => [{ zIndex: unref(contentZIndex) }, props.popperStyle] as any\n)\n\nconst contentClass = computed(() => [\n ns.b(),\n ns.is('pure', props.pure),\n ns.is(props.effect),\n props.popperClass,\n])\n\nconst ariaModal = computed<string | undefined>(() => {\n return role && role.value === 'dialog' ? 'false' : undefined\n})\n\nconst createPopperInstance = ({ referenceEl, popperContentEl, arrowEl }) => {\n const options = buildPopperOptions(props, {\n arrowEl,\n arrowOffset: unref(arrowOffset),\n })\n\n return createPopper(referenceEl, popperContentEl, options)\n}\n\nconst updatePopper = (shouldUpdateZIndex = true) => {\n unref(popperInstanceRef)?.update()\n shouldUpdateZIndex && (contentZIndex.value = props.zIndex || nextZIndex())\n}\n\nconst togglePopperAlive = () => {\n const monitorable = { name: 'eventListeners', enabled: props.visible }\n unref(popperInstanceRef)?.setOptions?.((options) => ({\n ...options,\n modifiers: [...(options.modifiers || []), monitorable],\n }))\n updatePopper(false)\n if (props.visible && props.focusOnShow) {\n trapped.value = true\n } else if (props.visible === false) {\n trapped.value = false\n }\n}\n\nconst onFocusAfterTrapped = () => {\n emit('focus')\n}\n\nconst onFocusAfterReleased = () => {\n focusStartRef.value = 'first'\n emit('blur')\n}\n\nconst onFocusInTrap = (event: FocusEvent) => {\n if (props.visible && !trapped.value) {\n if (event.target) {\n focusStartRef.value = event.target as typeof focusStartRef.value\n }\n trapped.value = true\n if (event.relatedTarget) {\n ;(event.relatedTarget as HTMLElement)?.focus()\n }\n }\n}\n\nconst onFocusoutPrevented = () => {\n if (!props.trapping) {\n trapped.value = false\n }\n}\n\nconst onReleaseRequested = () => {\n trapped.value = false\n emit('close')\n}\n\nonMounted(() => {\n let updateHandle: WatchStopHandle\n watch(\n computedReference,\n (referenceEl) => {\n updateHandle?.()\n const popperInstance = unref(popperInstanceRef)\n popperInstance?.destroy?.()\n if (referenceEl) {\n const popperContentEl = unref(popperContentRef)!\n contentRef.value = popperContentEl\n\n popperInstanceRef.value = createPopperInstance({\n referenceEl,\n popperContentEl,\n arrowEl: unref(arrowRef),\n })\n\n updateHandle = watch(\n () => referenceEl.getBoundingClientRect(),\n () => updatePopper(),\n {\n immediate: true,\n }\n )\n } else {\n popperInstanceRef.value = undefined\n }\n },\n {\n immediate: true,\n }\n )\n\n watch(\n () => props.triggerTargetEl,\n (triggerTargetEl, prevTriggerTargetEl) => {\n triggerTargetAriaStopWatch?.()\n triggerTargetAriaStopWatch = undefined\n\n const el = unref(triggerTargetEl || popperContentRef.value)\n const prevEl = unref(prevTriggerTargetEl || popperContentRef.value)\n\n if (isElement(el)) {\n const { ariaLabel, id } = toRefs(props)\n triggerTargetAriaStopWatch = watch(\n [role, ariaLabel, ariaModal, id],\n (watches) => {\n ;['role', 'aria-label', 'aria-modal', 'id'].forEach((key, idx) => {\n isNil(watches[idx])\n ? el.removeAttribute(key)\n : el.setAttribute(key, watches[idx])\n })\n },\n { immediate: true }\n )\n }\n if (isElement(prevEl)) {\n ;['role', 'aria-label', 'aria-modal', 'id'].forEach((key) => {\n prevEl.removeAttribute(key)\n })\n }\n },\n { immediate: true }\n )\n\n watch(() => props.visible, togglePopperAlive, { immediate: true })\n\n watch(\n () =>\n buildPopperOptions(props, {\n arrowEl: unref(arrowRef),\n arrowOffset: unref(arrowOffset),\n }),\n (option) => popperInstanceRef.value?.setOptions(option)\n )\n})\n\nonBeforeUnmount(() => {\n triggerTargetAriaStopWatch?.()\n triggerTargetAriaStopWatch = undefined\n})\n\ndefineExpose({\n /**\n * @description popper content element\n */\n popperContentRef,\n /**\n * @description popperjs instance\n */\n popperInstanceRef,\n /**\n * @description method for updating popper\n */\n updatePopper,\n\n /**\n * @description content style\n */\n contentStyle,\n})\n</script>\n"],"names":["inject","POPPER_INJECTION_KEY","formItemContextKey","useZIndex","useNamespace","ref","provide","POPPER_CONTENT_INJECTION_KEY","NOOP","computed","unwrapMeasurableEl","unref","buildPopperOptions","createPopper","onMounted","watch","isElement","toRefs","isNil","onBeforeUnmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAA,MAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,YAAA,IAAA,EAAA,GAAAA,UAAA,CACAC,6BACA,KACA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,eAAA,GAAAD,UAAA,CAAAE,uBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,eAAAC,eAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAAC,qBAAA,QAAA,CAAA,CAAA;A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AAAD,SAAA,CAAA,QAAA,CAAA;AACA,QAAA,WAAA,EAAAA,SAAA,CAAA,WAAA,CAAA;AACA,OAAA,CAAA,EAAA,CAAA,MAAA,KAAA;AAAA,QACA,IAAA,EAAA,CAAA;AAEA,QAAA,OAAA,CAAA,EAAA,GAAA,iBAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,UAAA,CAAA,MAAA,CAAA,CAAA;AAAA,OAIA,CAAA,CAAA;AAAA,KAIA,CAAA,CAAA;AAAA,IAIAQ,mBAAA,CAAA,MAAA;AAAA,MAKA,0BAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,0BAAA,EAAA,CAAA;AAAA,MACA,0BAAA,GAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -2,216 +2,98 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var shared = require('@vue/shared');
|
|
7
|
-
var lodashUnified = require('lodash-unified');
|
|
8
5
|
var core = require('@popperjs/core');
|
|
9
|
-
require('../../focus-trap/index.js');
|
|
10
|
-
require('../../../hooks/index.js');
|
|
11
|
-
require('../../../tokens/index.js');
|
|
12
6
|
require('../../../utils/index.js');
|
|
13
|
-
var
|
|
14
|
-
var utils = require('./utils.js');
|
|
15
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
16
|
-
var popper = require('../../../tokens/popper.js');
|
|
17
|
-
var form = require('../../../tokens/form.js');
|
|
18
|
-
var index = require('../../../hooks/use-z-index/index.js');
|
|
19
|
-
var index$1 = require('../../../hooks/use-namespace/index.js');
|
|
20
|
-
var types = require('../../../utils/types.js');
|
|
21
|
-
var focusTrap = require('../../focus-trap/src/focus-trap.js');
|
|
7
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
22
8
|
|
|
23
|
-
const
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const computedReference = vue.computed(() => utils.unwrapMeasurableEl(props.referenceEl) || vue.unref(triggerRef));
|
|
55
|
-
const contentStyle = vue.computed(() => [{ zIndex: vue.unref(contentZIndex) }, props.popperStyle]);
|
|
56
|
-
const contentClass = vue.computed(() => [
|
|
57
|
-
ns.b(),
|
|
58
|
-
ns.is("pure", props.pure),
|
|
59
|
-
ns.is(props.effect),
|
|
60
|
-
props.popperClass
|
|
61
|
-
]);
|
|
62
|
-
const ariaModal = vue.computed(() => {
|
|
63
|
-
return role && role.value === "dialog" ? "false" : void 0;
|
|
64
|
-
});
|
|
65
|
-
const createPopperInstance = ({ referenceEl, popperContentEl, arrowEl }) => {
|
|
66
|
-
const options = utils.buildPopperOptions(props, {
|
|
67
|
-
arrowEl,
|
|
68
|
-
arrowOffset: vue.unref(arrowOffset)
|
|
69
|
-
});
|
|
70
|
-
return core.createPopper(referenceEl, popperContentEl, options);
|
|
71
|
-
};
|
|
72
|
-
const updatePopper = (shouldUpdateZIndex = true) => {
|
|
73
|
-
var _a;
|
|
74
|
-
(_a = vue.unref(popperInstanceRef)) == null ? void 0 : _a.update();
|
|
75
|
-
shouldUpdateZIndex && (contentZIndex.value = props.zIndex || nextZIndex());
|
|
76
|
-
};
|
|
77
|
-
const togglePopperAlive = () => {
|
|
78
|
-
var _a, _b;
|
|
79
|
-
const monitorable = { name: "eventListeners", enabled: props.visible };
|
|
80
|
-
(_b = (_a = vue.unref(popperInstanceRef)) == null ? void 0 : _a.setOptions) == null ? void 0 : _b.call(_a, (options) => ({
|
|
81
|
-
...options,
|
|
82
|
-
modifiers: [...options.modifiers || [], monitorable]
|
|
83
|
-
}));
|
|
84
|
-
updatePopper(false);
|
|
85
|
-
if (props.visible && props.focusOnShow) {
|
|
86
|
-
trapped.value = true;
|
|
87
|
-
} else if (props.visible === false) {
|
|
88
|
-
trapped.value = false;
|
|
89
|
-
}
|
|
90
|
-
};
|
|
91
|
-
const onFocusAfterTrapped = () => {
|
|
92
|
-
emit("focus");
|
|
93
|
-
};
|
|
94
|
-
const onFocusAfterReleased = () => {
|
|
95
|
-
focusStartRef.value = "first";
|
|
96
|
-
emit("blur");
|
|
97
|
-
};
|
|
98
|
-
const onFocusInTrap = (event) => {
|
|
99
|
-
var _a;
|
|
100
|
-
if (props.visible && !trapped.value) {
|
|
101
|
-
if (event.target) {
|
|
102
|
-
focusStartRef.value = event.target;
|
|
103
|
-
}
|
|
104
|
-
trapped.value = true;
|
|
105
|
-
if (event.relatedTarget) {
|
|
106
|
-
;
|
|
107
|
-
(_a = event.relatedTarget) == null ? void 0 : _a.focus();
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
};
|
|
111
|
-
const onFocusoutPrevented = () => {
|
|
112
|
-
if (!props.trapping) {
|
|
113
|
-
trapped.value = false;
|
|
114
|
-
}
|
|
115
|
-
};
|
|
116
|
-
const onReleaseRequested = () => {
|
|
117
|
-
trapped.value = false;
|
|
118
|
-
emit("close");
|
|
119
|
-
};
|
|
120
|
-
vue.onMounted(() => {
|
|
121
|
-
let updateHandle;
|
|
122
|
-
vue.watch(computedReference, (referenceEl) => {
|
|
123
|
-
var _a;
|
|
124
|
-
updateHandle == null ? void 0 : updateHandle();
|
|
125
|
-
const popperInstance = vue.unref(popperInstanceRef);
|
|
126
|
-
(_a = popperInstance == null ? void 0 : popperInstance.destroy) == null ? void 0 : _a.call(popperInstance);
|
|
127
|
-
if (referenceEl) {
|
|
128
|
-
const popperContentEl = vue.unref(popperContentRef);
|
|
129
|
-
contentRef.value = popperContentEl;
|
|
130
|
-
popperInstanceRef.value = createPopperInstance({
|
|
131
|
-
referenceEl,
|
|
132
|
-
popperContentEl,
|
|
133
|
-
arrowEl: vue.unref(arrowRef)
|
|
134
|
-
});
|
|
135
|
-
updateHandle = vue.watch(() => referenceEl.getBoundingClientRect(), () => updatePopper(), {
|
|
136
|
-
immediate: true
|
|
137
|
-
});
|
|
138
|
-
} else {
|
|
139
|
-
popperInstanceRef.value = void 0;
|
|
140
|
-
}
|
|
141
|
-
}, {
|
|
142
|
-
immediate: true
|
|
143
|
-
});
|
|
144
|
-
vue.watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
|
|
145
|
-
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
|
146
|
-
triggerTargetAriaStopWatch = void 0;
|
|
147
|
-
const el = vue.unref(triggerTargetEl || popperContentRef.value);
|
|
148
|
-
const prevEl = vue.unref(prevTriggerTargetEl || popperContentRef.value);
|
|
149
|
-
if (types.isElement(el)) {
|
|
150
|
-
const { ariaLabel, id } = vue.toRefs(props);
|
|
151
|
-
triggerTargetAriaStopWatch = vue.watch([role, ariaLabel, ariaModal, id], (watches) => {
|
|
152
|
-
;
|
|
153
|
-
["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
|
|
154
|
-
lodashUnified.isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
|
155
|
-
});
|
|
156
|
-
}, { immediate: true });
|
|
157
|
-
}
|
|
158
|
-
if (types.isElement(prevEl)) {
|
|
159
|
-
;
|
|
160
|
-
["role", "aria-label", "aria-modal", "id"].forEach((key) => {
|
|
161
|
-
prevEl.removeAttribute(key);
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
}, { immediate: true });
|
|
165
|
-
vue.watch(() => props.visible, togglePopperAlive, { immediate: true });
|
|
166
|
-
vue.watch(() => utils.buildPopperOptions(props, {
|
|
167
|
-
arrowEl: vue.unref(arrowRef),
|
|
168
|
-
arrowOffset: vue.unref(arrowOffset)
|
|
169
|
-
}), (option) => {
|
|
170
|
-
var _a;
|
|
171
|
-
return (_a = popperInstanceRef.value) == null ? void 0 : _a.setOptions(option);
|
|
172
|
-
});
|
|
173
|
-
});
|
|
174
|
-
vue.onBeforeUnmount(() => {
|
|
175
|
-
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
|
176
|
-
triggerTargetAriaStopWatch = void 0;
|
|
177
|
-
});
|
|
178
|
-
expose({
|
|
179
|
-
popperContentRef,
|
|
180
|
-
popperInstanceRef,
|
|
181
|
-
updatePopper,
|
|
182
|
-
contentStyle
|
|
183
|
-
});
|
|
184
|
-
return (_ctx, _cache) => {
|
|
185
|
-
return vue.openBlock(), vue.createElementBlock("div", {
|
|
186
|
-
ref_key: "popperContentRef",
|
|
187
|
-
ref: popperContentRef,
|
|
188
|
-
style: vue.normalizeStyle(vue.unref(contentStyle)),
|
|
189
|
-
class: vue.normalizeClass(vue.unref(contentClass)),
|
|
190
|
-
tabindex: "-1",
|
|
191
|
-
onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
|
|
192
|
-
onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
|
|
193
|
-
}, [
|
|
194
|
-
vue.createVNode(vue.unref(focusTrap["default"]), {
|
|
195
|
-
trapped: trapped.value,
|
|
196
|
-
"trap-on-focus-in": true,
|
|
197
|
-
"focus-trap-el": popperContentRef.value,
|
|
198
|
-
"focus-start-el": focusStartRef.value,
|
|
199
|
-
onFocusAfterTrapped,
|
|
200
|
-
onFocusAfterReleased,
|
|
201
|
-
onFocusin: onFocusInTrap,
|
|
202
|
-
onFocusoutPrevented,
|
|
203
|
-
onReleaseRequested
|
|
204
|
-
}, {
|
|
205
|
-
default: vue.withCtx(() => [
|
|
206
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
207
|
-
]),
|
|
208
|
-
_: 3
|
|
209
|
-
}, 8, ["trapped", "focus-trap-el", "focus-start-el"])
|
|
210
|
-
], 38);
|
|
211
|
-
};
|
|
9
|
+
const POSITIONING_STRATEGIES = ["fixed", "absolute"];
|
|
10
|
+
const usePopperCoreConfigProps = runtime.buildProps({
|
|
11
|
+
boundariesPadding: {
|
|
12
|
+
type: Number,
|
|
13
|
+
default: 0
|
|
14
|
+
},
|
|
15
|
+
fallbackPlacements: {
|
|
16
|
+
type: runtime.definePropType(Array),
|
|
17
|
+
default: () => []
|
|
18
|
+
},
|
|
19
|
+
gpuAcceleration: {
|
|
20
|
+
type: Boolean,
|
|
21
|
+
default: true
|
|
22
|
+
},
|
|
23
|
+
offset: {
|
|
24
|
+
type: Number,
|
|
25
|
+
default: 12
|
|
26
|
+
},
|
|
27
|
+
placement: {
|
|
28
|
+
type: String,
|
|
29
|
+
values: core.placements,
|
|
30
|
+
default: "bottom"
|
|
31
|
+
},
|
|
32
|
+
popperOptions: {
|
|
33
|
+
type: runtime.definePropType(Object),
|
|
34
|
+
default: () => ({})
|
|
35
|
+
},
|
|
36
|
+
strategy: {
|
|
37
|
+
type: String,
|
|
38
|
+
values: POSITIONING_STRATEGIES,
|
|
39
|
+
default: "absolute"
|
|
212
40
|
}
|
|
213
41
|
});
|
|
214
|
-
|
|
42
|
+
const usePopperContentProps = runtime.buildProps({
|
|
43
|
+
...usePopperCoreConfigProps,
|
|
44
|
+
id: String,
|
|
45
|
+
style: { type: runtime.definePropType([String, Array, Object]) },
|
|
46
|
+
className: { type: runtime.definePropType([String, Array, Object]) },
|
|
47
|
+
effect: {
|
|
48
|
+
type: String,
|
|
49
|
+
default: "dark"
|
|
50
|
+
},
|
|
51
|
+
visible: Boolean,
|
|
52
|
+
enterable: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: true
|
|
55
|
+
},
|
|
56
|
+
pure: Boolean,
|
|
57
|
+
focusOnShow: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
trapping: {
|
|
62
|
+
type: Boolean,
|
|
63
|
+
default: false
|
|
64
|
+
},
|
|
65
|
+
popperClass: {
|
|
66
|
+
type: runtime.definePropType([String, Array, Object])
|
|
67
|
+
},
|
|
68
|
+
popperStyle: {
|
|
69
|
+
type: runtime.definePropType([String, Array, Object])
|
|
70
|
+
},
|
|
71
|
+
referenceEl: {
|
|
72
|
+
type: runtime.definePropType(Object)
|
|
73
|
+
},
|
|
74
|
+
triggerTargetEl: {
|
|
75
|
+
type: runtime.definePropType(Object)
|
|
76
|
+
},
|
|
77
|
+
stopPopperMouseEvent: {
|
|
78
|
+
type: Boolean,
|
|
79
|
+
default: true
|
|
80
|
+
},
|
|
81
|
+
ariaLabel: {
|
|
82
|
+
type: String,
|
|
83
|
+
default: void 0
|
|
84
|
+
},
|
|
85
|
+
virtualTriggering: Boolean,
|
|
86
|
+
zIndex: Number
|
|
87
|
+
});
|
|
88
|
+
const usePopperContentEmits = [
|
|
89
|
+
"mouseenter",
|
|
90
|
+
"mouseleave",
|
|
91
|
+
"focus",
|
|
92
|
+
"blur",
|
|
93
|
+
"close"
|
|
94
|
+
];
|
|
215
95
|
|
|
216
|
-
exports
|
|
96
|
+
exports.usePopperContentEmits = usePopperContentEmits;
|
|
97
|
+
exports.usePopperContentProps = usePopperContentProps;
|
|
98
|
+
exports.usePopperCoreConfigProps = usePopperCoreConfigProps;
|
|
217
99
|
//# sourceMappingURL=content2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content2.js","sources":["../../../../../../packages/components/popper/src/content.vue"],"sourcesContent":["<template>\n <div\n ref=\"popperContentRef\"\n :style=\"contentStyle\"\n :class=\"contentClass\"\n tabindex=\"-1\"\n @mouseenter=\"(e) => $emit('mouseenter', e)\"\n @mouseleave=\"(e) => $emit('mouseleave', e)\"\n >\n <el-focus-trap\n :trapped=\"trapped\"\n :trap-on-focus-in=\"true\"\n :focus-trap-el=\"popperContentRef\"\n :focus-start-el=\"focusStartRef\"\n @focus-after-trapped=\"onFocusAfterTrapped\"\n @focus-after-released=\"onFocusAfterReleased\"\n @focusin=\"onFocusInTrap\"\n @focusout-prevented=\"onFocusoutPrevented\"\n @release-requested=\"onReleaseRequested\"\n >\n <slot />\n </el-focus-trap>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\n// @ts-nocheck\nimport {\n computed,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n toRefs,\n unref,\n watch,\n} from 'vue'\nimport { NOOP } from '@vue/shared'\nimport { isNil } from 'lodash-unified'\nimport { createPopper } from '@popperjs/core'\nimport ElFocusTrap from '@element-plus/components/focus-trap'\nimport { useNamespace, useZIndex } from '@element-plus/hooks'\nimport {\n POPPER_CONTENT_INJECTION_KEY,\n POPPER_INJECTION_KEY,\n formItemContextKey,\n} from '@element-plus/tokens'\nimport { isElement } from '@element-plus/utils'\nimport { usePopperContentEmits, usePopperContentProps } from './content'\nimport { buildPopperOptions, unwrapMeasurableEl } from './utils'\n\nimport type { WatchStopHandle } from 'vue'\n\ndefineOptions({\n name: 'ElPopperContent',\n})\n\nconst emit = defineEmits(usePopperContentEmits)\n\nconst props = defineProps(usePopperContentProps)\n\nconst { popperInstanceRef, contentRef, triggerRef, role } = inject(\n POPPER_INJECTION_KEY,\n undefined\n)!\nconst formItemContext = inject(formItemContextKey, undefined)\nconst { nextZIndex } = useZIndex()\nconst ns = useNamespace('popper')\nconst popperContentRef = ref<HTMLElement>()\nconst focusStartRef = ref<string | HTMLElement>('first')\nconst arrowRef = ref<HTMLElement>()\nconst arrowOffset = ref<number>()\nprovide(POPPER_CONTENT_INJECTION_KEY, {\n arrowRef,\n arrowOffset,\n})\n\nif (\n formItemContext &&\n (formItemContext.addInputId || formItemContext.removeInputId)\n) {\n // disallow auto-id from inside popper content\n provide(formItemContextKey, {\n ...formItemContext,\n addInputId: NOOP,\n removeInputId: NOOP,\n })\n}\n\nconst contentZIndex = ref<number>(props.zIndex || nextZIndex())\nconst trapped = ref<boolean>(false)\n\nlet triggerTargetAriaStopWatch: WatchStopHandle | undefined = undefined\n\nconst computedReference = computed(\n () => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef)\n)\n\nconst contentStyle = computed(\n () => [{ zIndex: unref(contentZIndex) }, props.popperStyle] as any\n)\n\nconst contentClass = computed(() => [\n ns.b(),\n ns.is('pure', props.pure),\n ns.is(props.effect),\n props.popperClass,\n])\n\nconst ariaModal = computed<string | undefined>(() => {\n return role && role.value === 'dialog' ? 'false' : undefined\n})\n\nconst createPopperInstance = ({ referenceEl, popperContentEl, arrowEl }) => {\n const options = buildPopperOptions(props, {\n arrowEl,\n arrowOffset: unref(arrowOffset),\n })\n\n return createPopper(referenceEl, popperContentEl, options)\n}\n\nconst updatePopper = (shouldUpdateZIndex = true) => {\n unref(popperInstanceRef)?.update()\n shouldUpdateZIndex && (contentZIndex.value = props.zIndex || nextZIndex())\n}\n\nconst togglePopperAlive = () => {\n const monitorable = { name: 'eventListeners', enabled: props.visible }\n unref(popperInstanceRef)?.setOptions?.((options) => ({\n ...options,\n modifiers: [...(options.modifiers || []), monitorable],\n }))\n updatePopper(false)\n if (props.visible && props.focusOnShow) {\n trapped.value = true\n } else if (props.visible === false) {\n trapped.value = false\n }\n}\n\nconst onFocusAfterTrapped = () => {\n emit('focus')\n}\n\nconst onFocusAfterReleased = () => {\n focusStartRef.value = 'first'\n emit('blur')\n}\n\nconst onFocusInTrap = (event: FocusEvent) => {\n if (props.visible && !trapped.value) {\n if (event.target) {\n focusStartRef.value = event.target as typeof focusStartRef.value\n }\n trapped.value = true\n if (event.relatedTarget) {\n ;(event.relatedTarget as HTMLElement)?.focus()\n }\n }\n}\n\nconst onFocusoutPrevented = () => {\n if (!props.trapping) {\n trapped.value = false\n }\n}\n\nconst onReleaseRequested = () => {\n trapped.value = false\n emit('close')\n}\n\nonMounted(() => {\n let updateHandle: WatchStopHandle\n watch(\n computedReference,\n (referenceEl) => {\n updateHandle?.()\n const popperInstance = unref(popperInstanceRef)\n popperInstance?.destroy?.()\n if (referenceEl) {\n const popperContentEl = unref(popperContentRef)!\n contentRef.value = popperContentEl\n\n popperInstanceRef.value = createPopperInstance({\n referenceEl,\n popperContentEl,\n arrowEl: unref(arrowRef),\n })\n\n updateHandle = watch(\n () => referenceEl.getBoundingClientRect(),\n () => updatePopper(),\n {\n immediate: true,\n }\n )\n } else {\n popperInstanceRef.value = undefined\n }\n },\n {\n immediate: true,\n }\n )\n\n watch(\n () => props.triggerTargetEl,\n (triggerTargetEl, prevTriggerTargetEl) => {\n triggerTargetAriaStopWatch?.()\n triggerTargetAriaStopWatch = undefined\n\n const el = unref(triggerTargetEl || popperContentRef.value)\n const prevEl = unref(prevTriggerTargetEl || popperContentRef.value)\n\n if (isElement(el)) {\n const { ariaLabel, id } = toRefs(props)\n triggerTargetAriaStopWatch = watch(\n [role, ariaLabel, ariaModal, id],\n (watches) => {\n ;['role', 'aria-label', 'aria-modal', 'id'].forEach((key, idx) => {\n isNil(watches[idx])\n ? el.removeAttribute(key)\n : el.setAttribute(key, watches[idx])\n })\n },\n { immediate: true }\n )\n }\n if (isElement(prevEl)) {\n ;['role', 'aria-label', 'aria-modal', 'id'].forEach((key) => {\n prevEl.removeAttribute(key)\n })\n }\n },\n { immediate: true }\n )\n\n watch(() => props.visible, togglePopperAlive, { immediate: true })\n\n watch(\n () =>\n buildPopperOptions(props, {\n arrowEl: unref(arrowRef),\n arrowOffset: unref(arrowOffset),\n }),\n (option) => popperInstanceRef.value?.setOptions(option)\n )\n})\n\nonBeforeUnmount(() => {\n triggerTargetAriaStopWatch?.()\n triggerTargetAriaStopWatch = undefined\n})\n\ndefineExpose({\n /**\n * @description popper content element\n */\n popperContentRef,\n /**\n * @description popperjs instance\n */\n popperInstanceRef,\n /**\n * @description method for updating popper\n */\n updatePopper,\n\n /**\n * @description content style\n */\n contentStyle,\n})\n</script>\n"],"names":["inject","POPPER_INJECTION_KEY","formItemContextKey","useZIndex","useNamespace","ref","provide","POPPER_CONTENT_INJECTION_KEY","NOOP","computed","unwrapMeasurableEl","unref","buildPopperOptions","createPopper","onMounted","watch","isElement","toRefs","isNil","onBeforeUnmount"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAA,MAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,YAAA,IAAA,EAAA,GAAAA,UAAA,CACAC,6BACA,KACA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,eAAA,GAAAD,UAAA,CAAAE,uBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,eAAAC,eAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAAC,qBAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,mBAAAC,OAAA,EAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAAA,QAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,WAAAA,OAAA,EAAA,CAAA;AACA,IAAA,MAAA,cAAAA,OAAA,EAAA,CAAA;AACA,IAAAC,WAAA,CAAAC,mCAAA,EAAA;AAAA,MACA,QAAA;AAAA,MACA,WAAA;AAAA,KACA,CAAA,CAAA;AAEA,IAAA,IACA,eACA,KAAA,eAAA,CAAA,UAAA,IAAA,eAAA,CAAA,aACA,CAAA,EAAA;AAEA,MAAAD,WAAA,CAAAJ,uBAAA,EAAA;AAAA,QACA,GAAA,eAAA;AAAA,QACA,UAAA,EAAAM,WAAA;AAAA,QACA,aAAA,EAAAA,WAAA;AAAA,OACA,CAAA,CAAA;AAAA,KACA;AAEA,IAAA,MAAA,aAAA,GAAAH,OAAA,CAAA,KAAA,CAAA,MAAA,IAAA,YAAA,CAAA,CAAA;AACA,IAAA,MAAA,OAAA,GAAAA,QAAA,KAAA,CAAA,CAAA;AAEA,IAAA,IAAA,0BAAA,GAAA,KAAA,CAAA,CAAA;AAEA,IA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AAA,CAAA,CAAA;AACA,aAAA,CAAA,CAAA;AAAA,WAAA,aAAA,EAAA,IAAA,EAAA,CAAA,CAAA;AACA,SAAA;AAAA,QAAA,IACAF,eAAA,CAAA,MAAA,CAAA,EAAA;AAAA,UACA,CAAA;AAAA,UAEA,CAAA,MAAA,EAAA,YACA,EAAA,YAAA,EAAA,IAAA,CAAA,CAAA,OAAA,CAAA,CAAA,GAAA,KAAA;AAEA,YAAA,MAAA,CAAA;AAEA,WACA,CAAA,CAAA;AACA,SACA;AAAA,OACA,EAAA,EAAA,SAAA,QAAA,CAAA,CAAA;AAAA,MACAD,SACA,CAAA,MAAA,gCAAA,EAAA,EAAA,WACA,IAAA,EAAA,CAAA,CAAA;AAAA,MACAA,SAAA,CAAA,MAAAH,wBAAA,CAAA,KAAA,EAAA;AAEA,QAAA,OAAA,EAAAD,SAAA,CAAA,QAAA,CAAA;AACA,QAAA,WAAA,EAAAA,SAAA,CAAA,WAAA,CAAA;AACA,OAAA,CAAA,EAAA,CAAA,MAAA,KAAA;AAAA,QACA,IAAA,EAAA,CAAA;AAEA,QAAA,OAAA,CAAA,EAAA,GAAA,iBAAA,CAAA,KAAA,KAAA,IAAA,GAAA,KAAA,CAAA,GAAA,EAAA,CAAA,UAAA,CAAA,MAAA,CAAA,CAAA;AAAA,OAIA,CAAA,CAAA;AAAA,KAIA,CAAA,CAAA;AAAA,IAIAQ,mBAAA,CAAA,MAAA;AAAA,MAKA,0BAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,0BAAA,EAAA,CAAA;AAAA,MACA,0BAAA,GAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"content2.js","sources":["../../../../../../packages/components/popper/src/content.ts"],"sourcesContent":["import { placements } from '@popperjs/core'\nimport { buildProps, definePropType } from '@element-plus/utils'\n\nimport type { ExtractPropTypes, StyleValue } from 'vue'\nimport type { Options, Placement } from '@popperjs/core'\n\ntype ClassObjectType = Record<string, boolean>\ntype ClassType = string | ClassObjectType | ClassType[]\n\nconst POSITIONING_STRATEGIES = ['fixed', 'absolute'] as const\nexport const usePopperCoreConfigProps = buildProps({\n boundariesPadding: {\n type: Number,\n default: 0,\n },\n fallbackPlacements: {\n type: definePropType<Placement[]>(Array),\n default: () => [],\n },\n gpuAcceleration: {\n type: Boolean,\n default: true,\n },\n offset: {\n type: Number,\n default: 12,\n },\n placement: {\n type: String,\n values: placements,\n default: 'bottom',\n },\n popperOptions: {\n type: definePropType<Partial<Options>>(Object),\n default: () => ({}),\n },\n strategy: {\n type: String,\n values: POSITIONING_STRATEGIES,\n default: 'absolute',\n },\n} as const)\n\nexport const usePopperContentProps = buildProps({\n ...usePopperCoreConfigProps,\n id: String,\n style: { type: definePropType<StyleValue>([String, Array, Object]) },\n className: { type: definePropType<ClassType>([String, Array, Object]) },\n effect: {\n type: String,\n default: 'dark',\n },\n visible: Boolean,\n enterable: {\n type: Boolean,\n default: true,\n },\n pure: Boolean,\n focusOnShow: {\n type: Boolean,\n default: false,\n },\n trapping: {\n type: Boolean,\n default: false,\n },\n popperClass: {\n type: definePropType<ClassType>([String, Array, Object]),\n },\n popperStyle: {\n type: definePropType<StyleValue>([String, Array, Object]),\n },\n referenceEl: {\n type: definePropType<HTMLElement>(Object),\n },\n triggerTargetEl: {\n type: definePropType<HTMLElement>(Object),\n },\n stopPopperMouseEvent: {\n type: Boolean,\n default: true,\n },\n ariaLabel: {\n type: String,\n default: undefined,\n },\n virtualTriggering: Boolean,\n zIndex: Number,\n} as const)\n\nexport const usePopperContentEmits = [\n 'mouseenter',\n 'mouseleave',\n 'focus',\n 'blur',\n 'close',\n]\n\nexport type UsePopperContentProps = ExtractPropTypes<\n typeof usePopperContentProps\n>\n\nexport type UsePopperCoreConfigProps = ExtractPropTypes<\n typeof usePopperCoreConfigProps\n>\n"],"names":["buildProps","definePropType","placements"],"mappings":";;;;;;;;AAEA,MAAM,sBAAsB,GA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|
@@ -9,7 +9,7 @@ require('../../../utils/index.js');
|
|
|
9
9
|
var tooltip = require('./tooltip.js');
|
|
10
10
|
var tokens = require('./tokens.js');
|
|
11
11
|
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
12
|
-
var content = require('../../popper/src/
|
|
12
|
+
var content = require('../../popper/src/content.js');
|
|
13
13
|
var event = require('../../../utils/dom/event.js');
|
|
14
14
|
|
|
15
15
|
const _sfc_main = vue.defineComponent({
|
|
@@ -9,7 +9,7 @@ require('../../../constants/index.js');
|
|
|
9
9
|
var index = require('../../../hooks/use-namespace/index.js');
|
|
10
10
|
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
11
11
|
var index$1 = require('../../../hooks/use-delayed-toggle/index.js');
|
|
12
|
-
var content = require('../../popper/src/
|
|
12
|
+
var content = require('../../popper/src/content2.js');
|
|
13
13
|
var index$2 = require('../../../hooks/use-popper-container/index.js');
|
|
14
14
|
var trigger = require('../../popper/src/trigger.js');
|
|
15
15
|
var aria = require('../../../constants/aria.js');
|
|
@@ -2,4 +2,3 @@ export { default as ClickOutside } from './click-outside';
|
|
|
2
2
|
export { default as RepeatClick } from './repeat-click';
|
|
3
3
|
export { default as TrapFocus } from './trap-focus';
|
|
4
4
|
export { default as Mousewheel } from './mousewheel';
|
|
5
|
-
export { default as Resize } from './resize';
|
package/lib/directives/index.js
CHANGED
|
@@ -6,7 +6,6 @@ var index = require('./click-outside/index.js');
|
|
|
6
6
|
var index$1 = require('./repeat-click/index.js');
|
|
7
7
|
var index$2 = require('./trap-focus/index.js');
|
|
8
8
|
var index$3 = require('./mousewheel/index.js');
|
|
9
|
-
var index$4 = require('./resize/index.js');
|
|
10
9
|
|
|
11
10
|
|
|
12
11
|
|
|
@@ -14,5 +13,4 @@ exports.ClickOutside = index["default"];
|
|
|
14
13
|
exports.RepeatClick = index$1["default"];
|
|
15
14
|
exports.TrapFocus = index$2["default"];
|
|
16
15
|
exports.Mousewheel = index$3["default"];
|
|
17
|
-
exports.Resize = index$4["default"];
|
|
18
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;"}
|