@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.mjs","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":[],"mappings":";;;;AAEA,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,MAAC,wBAAwB,GAAG,UAAU,CAAC;AACnD,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,cAAc,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,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO,EAAE,CAAC;AACvB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IA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Ac,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.mjs","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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAA,MAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,YAAA,IAAA,EAAA,GAAA,MAAA,CACA,sBACA,KACA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,eAAA,GAAA,MAAA,CAAA,kBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,eAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,mBAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,IAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,WAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,cAAA,GAAA,EAAA,CAAA;AACA,IAAA,OAAA,CAAA,4BAAA,EAAA;AAA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AA,CAAA;AAAA,OAIA,CAAA,CAAA;AAAA,KAIA,CAAA,CAAA;AAAA,IAIA,eAAA,CAAA,MAAA;AAAA,MAKA,0BAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,0BAAA,EAAA,CAAA;AAAA,MACA,0BAAA,GAAA,KAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,213 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { NOOP } from '@vue/shared';
|
|
3
|
-
import { isNil } from 'lodash-unified';
|
|
4
|
-
import { createPopper } from '@popperjs/core';
|
|
5
|
-
import '../../focus-trap/index.mjs';
|
|
6
|
-
import '../../../hooks/index.mjs';
|
|
7
|
-
import '../../../tokens/index.mjs';
|
|
1
|
+
import { placements } from '@popperjs/core';
|
|
8
2
|
import '../../../utils/index.mjs';
|
|
9
|
-
import {
|
|
10
|
-
import { unwrapMeasurableEl, buildPopperOptions } from './utils.mjs';
|
|
11
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
12
|
-
import { POPPER_INJECTION_KEY, POPPER_CONTENT_INJECTION_KEY } from '../../../tokens/popper.mjs';
|
|
13
|
-
import { formItemContextKey } from '../../../tokens/form.mjs';
|
|
14
|
-
import { useZIndex } from '../../../hooks/use-z-index/index.mjs';
|
|
15
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
16
|
-
import { isElement } from '../../../utils/types.mjs';
|
|
17
|
-
import ElFocusTrap from '../../focus-trap/src/focus-trap.mjs';
|
|
3
|
+
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
18
4
|
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
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
|
-
const computedReference = computed(() => unwrapMeasurableEl(props.referenceEl) || unref(triggerRef));
|
|
51
|
-
const contentStyle = computed(() => [{ zIndex: unref(contentZIndex) }, props.popperStyle]);
|
|
52
|
-
const contentClass = computed(() => [
|
|
53
|
-
ns.b(),
|
|
54
|
-
ns.is("pure", props.pure),
|
|
55
|
-
ns.is(props.effect),
|
|
56
|
-
props.popperClass
|
|
57
|
-
]);
|
|
58
|
-
const ariaModal = computed(() => {
|
|
59
|
-
return role && role.value === "dialog" ? "false" : void 0;
|
|
60
|
-
});
|
|
61
|
-
const createPopperInstance = ({ referenceEl, popperContentEl, arrowEl }) => {
|
|
62
|
-
const options = buildPopperOptions(props, {
|
|
63
|
-
arrowEl,
|
|
64
|
-
arrowOffset: unref(arrowOffset)
|
|
65
|
-
});
|
|
66
|
-
return createPopper(referenceEl, popperContentEl, options);
|
|
67
|
-
};
|
|
68
|
-
const updatePopper = (shouldUpdateZIndex = true) => {
|
|
69
|
-
var _a;
|
|
70
|
-
(_a = unref(popperInstanceRef)) == null ? void 0 : _a.update();
|
|
71
|
-
shouldUpdateZIndex && (contentZIndex.value = props.zIndex || nextZIndex());
|
|
72
|
-
};
|
|
73
|
-
const togglePopperAlive = () => {
|
|
74
|
-
var _a, _b;
|
|
75
|
-
const monitorable = { name: "eventListeners", enabled: props.visible };
|
|
76
|
-
(_b = (_a = unref(popperInstanceRef)) == null ? void 0 : _a.setOptions) == null ? void 0 : _b.call(_a, (options) => ({
|
|
77
|
-
...options,
|
|
78
|
-
modifiers: [...options.modifiers || [], monitorable]
|
|
79
|
-
}));
|
|
80
|
-
updatePopper(false);
|
|
81
|
-
if (props.visible && props.focusOnShow) {
|
|
82
|
-
trapped.value = true;
|
|
83
|
-
} else if (props.visible === false) {
|
|
84
|
-
trapped.value = false;
|
|
85
|
-
}
|
|
86
|
-
};
|
|
87
|
-
const onFocusAfterTrapped = () => {
|
|
88
|
-
emit("focus");
|
|
89
|
-
};
|
|
90
|
-
const onFocusAfterReleased = () => {
|
|
91
|
-
focusStartRef.value = "first";
|
|
92
|
-
emit("blur");
|
|
93
|
-
};
|
|
94
|
-
const onFocusInTrap = (event) => {
|
|
95
|
-
var _a;
|
|
96
|
-
if (props.visible && !trapped.value) {
|
|
97
|
-
if (event.target) {
|
|
98
|
-
focusStartRef.value = event.target;
|
|
99
|
-
}
|
|
100
|
-
trapped.value = true;
|
|
101
|
-
if (event.relatedTarget) {
|
|
102
|
-
;
|
|
103
|
-
(_a = event.relatedTarget) == null ? void 0 : _a.focus();
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
const onFocusoutPrevented = () => {
|
|
108
|
-
if (!props.trapping) {
|
|
109
|
-
trapped.value = false;
|
|
110
|
-
}
|
|
111
|
-
};
|
|
112
|
-
const onReleaseRequested = () => {
|
|
113
|
-
trapped.value = false;
|
|
114
|
-
emit("close");
|
|
115
|
-
};
|
|
116
|
-
onMounted(() => {
|
|
117
|
-
let updateHandle;
|
|
118
|
-
watch(computedReference, (referenceEl) => {
|
|
119
|
-
var _a;
|
|
120
|
-
updateHandle == null ? void 0 : updateHandle();
|
|
121
|
-
const popperInstance = unref(popperInstanceRef);
|
|
122
|
-
(_a = popperInstance == null ? void 0 : popperInstance.destroy) == null ? void 0 : _a.call(popperInstance);
|
|
123
|
-
if (referenceEl) {
|
|
124
|
-
const popperContentEl = unref(popperContentRef);
|
|
125
|
-
contentRef.value = popperContentEl;
|
|
126
|
-
popperInstanceRef.value = createPopperInstance({
|
|
127
|
-
referenceEl,
|
|
128
|
-
popperContentEl,
|
|
129
|
-
arrowEl: unref(arrowRef)
|
|
130
|
-
});
|
|
131
|
-
updateHandle = watch(() => referenceEl.getBoundingClientRect(), () => updatePopper(), {
|
|
132
|
-
immediate: true
|
|
133
|
-
});
|
|
134
|
-
} else {
|
|
135
|
-
popperInstanceRef.value = void 0;
|
|
136
|
-
}
|
|
137
|
-
}, {
|
|
138
|
-
immediate: true
|
|
139
|
-
});
|
|
140
|
-
watch(() => props.triggerTargetEl, (triggerTargetEl, prevTriggerTargetEl) => {
|
|
141
|
-
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
|
142
|
-
triggerTargetAriaStopWatch = void 0;
|
|
143
|
-
const el = unref(triggerTargetEl || popperContentRef.value);
|
|
144
|
-
const prevEl = unref(prevTriggerTargetEl || popperContentRef.value);
|
|
145
|
-
if (isElement(el)) {
|
|
146
|
-
const { ariaLabel, id } = toRefs(props);
|
|
147
|
-
triggerTargetAriaStopWatch = watch([role, ariaLabel, ariaModal, id], (watches) => {
|
|
148
|
-
;
|
|
149
|
-
["role", "aria-label", "aria-modal", "id"].forEach((key, idx) => {
|
|
150
|
-
isNil(watches[idx]) ? el.removeAttribute(key) : el.setAttribute(key, watches[idx]);
|
|
151
|
-
});
|
|
152
|
-
}, { immediate: true });
|
|
153
|
-
}
|
|
154
|
-
if (isElement(prevEl)) {
|
|
155
|
-
;
|
|
156
|
-
["role", "aria-label", "aria-modal", "id"].forEach((key) => {
|
|
157
|
-
prevEl.removeAttribute(key);
|
|
158
|
-
});
|
|
159
|
-
}
|
|
160
|
-
}, { immediate: true });
|
|
161
|
-
watch(() => props.visible, togglePopperAlive, { immediate: true });
|
|
162
|
-
watch(() => buildPopperOptions(props, {
|
|
163
|
-
arrowEl: unref(arrowRef),
|
|
164
|
-
arrowOffset: unref(arrowOffset)
|
|
165
|
-
}), (option) => {
|
|
166
|
-
var _a;
|
|
167
|
-
return (_a = popperInstanceRef.value) == null ? void 0 : _a.setOptions(option);
|
|
168
|
-
});
|
|
169
|
-
});
|
|
170
|
-
onBeforeUnmount(() => {
|
|
171
|
-
triggerTargetAriaStopWatch == null ? void 0 : triggerTargetAriaStopWatch();
|
|
172
|
-
triggerTargetAriaStopWatch = void 0;
|
|
173
|
-
});
|
|
174
|
-
expose({
|
|
175
|
-
popperContentRef,
|
|
176
|
-
popperInstanceRef,
|
|
177
|
-
updatePopper,
|
|
178
|
-
contentStyle
|
|
179
|
-
});
|
|
180
|
-
return (_ctx, _cache) => {
|
|
181
|
-
return openBlock(), createElementBlock("div", {
|
|
182
|
-
ref_key: "popperContentRef",
|
|
183
|
-
ref: popperContentRef,
|
|
184
|
-
style: normalizeStyle(unref(contentStyle)),
|
|
185
|
-
class: normalizeClass(unref(contentClass)),
|
|
186
|
-
tabindex: "-1",
|
|
187
|
-
onMouseenter: _cache[0] || (_cache[0] = (e) => _ctx.$emit("mouseenter", e)),
|
|
188
|
-
onMouseleave: _cache[1] || (_cache[1] = (e) => _ctx.$emit("mouseleave", e))
|
|
189
|
-
}, [
|
|
190
|
-
createVNode(unref(ElFocusTrap), {
|
|
191
|
-
trapped: trapped.value,
|
|
192
|
-
"trap-on-focus-in": true,
|
|
193
|
-
"focus-trap-el": popperContentRef.value,
|
|
194
|
-
"focus-start-el": focusStartRef.value,
|
|
195
|
-
onFocusAfterTrapped,
|
|
196
|
-
onFocusAfterReleased,
|
|
197
|
-
onFocusin: onFocusInTrap,
|
|
198
|
-
onFocusoutPrevented,
|
|
199
|
-
onReleaseRequested
|
|
200
|
-
}, {
|
|
201
|
-
default: withCtx(() => [
|
|
202
|
-
renderSlot(_ctx.$slots, "default")
|
|
203
|
-
]),
|
|
204
|
-
_: 3
|
|
205
|
-
}, 8, ["trapped", "focus-trap-el", "focus-start-el"])
|
|
206
|
-
], 38);
|
|
207
|
-
};
|
|
5
|
+
const POSITIONING_STRATEGIES = ["fixed", "absolute"];
|
|
6
|
+
const usePopperCoreConfigProps = buildProps({
|
|
7
|
+
boundariesPadding: {
|
|
8
|
+
type: Number,
|
|
9
|
+
default: 0
|
|
10
|
+
},
|
|
11
|
+
fallbackPlacements: {
|
|
12
|
+
type: definePropType(Array),
|
|
13
|
+
default: () => []
|
|
14
|
+
},
|
|
15
|
+
gpuAcceleration: {
|
|
16
|
+
type: Boolean,
|
|
17
|
+
default: true
|
|
18
|
+
},
|
|
19
|
+
offset: {
|
|
20
|
+
type: Number,
|
|
21
|
+
default: 12
|
|
22
|
+
},
|
|
23
|
+
placement: {
|
|
24
|
+
type: String,
|
|
25
|
+
values: placements,
|
|
26
|
+
default: "bottom"
|
|
27
|
+
},
|
|
28
|
+
popperOptions: {
|
|
29
|
+
type: definePropType(Object),
|
|
30
|
+
default: () => ({})
|
|
31
|
+
},
|
|
32
|
+
strategy: {
|
|
33
|
+
type: String,
|
|
34
|
+
values: POSITIONING_STRATEGIES,
|
|
35
|
+
default: "absolute"
|
|
208
36
|
}
|
|
209
37
|
});
|
|
210
|
-
|
|
38
|
+
const usePopperContentProps = buildProps({
|
|
39
|
+
...usePopperCoreConfigProps,
|
|
40
|
+
id: String,
|
|
41
|
+
style: { type: definePropType([String, Array, Object]) },
|
|
42
|
+
className: { type: definePropType([String, Array, Object]) },
|
|
43
|
+
effect: {
|
|
44
|
+
type: String,
|
|
45
|
+
default: "dark"
|
|
46
|
+
},
|
|
47
|
+
visible: Boolean,
|
|
48
|
+
enterable: {
|
|
49
|
+
type: Boolean,
|
|
50
|
+
default: true
|
|
51
|
+
},
|
|
52
|
+
pure: Boolean,
|
|
53
|
+
focusOnShow: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
trapping: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
popperClass: {
|
|
62
|
+
type: definePropType([String, Array, Object])
|
|
63
|
+
},
|
|
64
|
+
popperStyle: {
|
|
65
|
+
type: definePropType([String, Array, Object])
|
|
66
|
+
},
|
|
67
|
+
referenceEl: {
|
|
68
|
+
type: definePropType(Object)
|
|
69
|
+
},
|
|
70
|
+
triggerTargetEl: {
|
|
71
|
+
type: definePropType(Object)
|
|
72
|
+
},
|
|
73
|
+
stopPopperMouseEvent: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: true
|
|
76
|
+
},
|
|
77
|
+
ariaLabel: {
|
|
78
|
+
type: String,
|
|
79
|
+
default: void 0
|
|
80
|
+
},
|
|
81
|
+
virtualTriggering: Boolean,
|
|
82
|
+
zIndex: Number
|
|
83
|
+
});
|
|
84
|
+
const usePopperContentEmits = [
|
|
85
|
+
"mouseenter",
|
|
86
|
+
"mouseleave",
|
|
87
|
+
"focus",
|
|
88
|
+
"blur",
|
|
89
|
+
"close"
|
|
90
|
+
];
|
|
211
91
|
|
|
212
|
-
export {
|
|
92
|
+
export { usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps };
|
|
213
93
|
//# sourceMappingURL=content2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"content2.mjs","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":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DA,IAAA,MAAA,EAAA,iBAAA,EAAA,UAAA,EAAA,YAAA,IAAA,EAAA,GAAA,MAAA,CACA,sBACA,KACA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,eAAA,GAAA,MAAA,CAAA,kBAAA,EAAA,KAAA,CAAA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,eAAA,SAAA,EAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,QAAA,CAAA,CAAA;AACA,IAAA,MAAA,mBAAA,GAAA,EAAA,CAAA;AACA,IAAA,MAAA,aAAA,GAAA,IAAA,OAAA,CAAA,CAAA;AACA,IAAA,MAAA,WAAA,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AAA,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,IAIA,eAAA,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.mjs","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":[],"mappings":";;;;AAEA,MAAM,sBAAsB,GAAG,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;AACzC,MAAC,wBAAwB,GAAG,UAAU,CAAC;AACnD,EAAE,iBAAiB,EAAE;AACrB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,kBAAkB,EAAE;AACtB,IAAI,IAAI,EAAE,cAAc,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,EAAE,UAAU;AACtB,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,aAAa,EAAE;AACjB,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO,EAA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AG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,cAAc,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;;;;"}
|
|
@@ -5,7 +5,7 @@ import '../../../utils/index.mjs';
|
|
|
5
5
|
import { useTooltipContentProps } from './tooltip.mjs';
|
|
6
6
|
import { TOOLTIP_INJECTION_KEY } from './tokens.mjs';
|
|
7
7
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
-
import ElPopperContent from '../../popper/src/
|
|
8
|
+
import ElPopperContent from '../../popper/src/content.mjs';
|
|
9
9
|
import { composeEventHandlers } from '../../../utils/dom/event.mjs';
|
|
10
10
|
|
|
11
11
|
const _sfc_main = defineComponent({
|
|
@@ -5,7 +5,7 @@ import '../../../constants/index.mjs';
|
|
|
5
5
|
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
6
6
|
import { buildProps, definePropType } from '../../../utils/vue/props/runtime.mjs';
|
|
7
7
|
import { useDelayedToggleProps } from '../../../hooks/use-delayed-toggle/index.mjs';
|
|
8
|
-
import { usePopperContentProps } from '../../popper/src/
|
|
8
|
+
import { usePopperContentProps } from '../../popper/src/content2.mjs';
|
|
9
9
|
import { POPPER_CONTAINER_SELECTOR } from '../../../hooks/use-popper-container/index.mjs';
|
|
10
10
|
import { usePopperTriggerProps } from '../../popper/src/trigger.mjs';
|
|
11
11
|
import { EVENT_CODE } from '../../../constants/aria.mjs';
|
package/es/directives/index.d.ts
CHANGED
|
@@ -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/es/directives/index.mjs
CHANGED
|
@@ -2,5 +2,4 @@ export { default as ClickOutside } from './click-outside/index.mjs';
|
|
|
2
2
|
export { default as RepeatClick } from './repeat-click/index.mjs';
|
|
3
3
|
export { default as TrapFocus } from './trap-focus/index.mjs';
|
|
4
4
|
export { default as Mousewheel } from './mousewheel/index.mjs';
|
|
5
|
-
export { default as Resize } from './resize/index.mjs';
|
|
6
5
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;"}
|
package/es/index.mjs
CHANGED
|
@@ -13,7 +13,7 @@ export { alertEffects, alertEmits, alertProps } from './components/alert/src/ale
|
|
|
13
13
|
export { ElAlert } from './components/alert/index.mjs';
|
|
14
14
|
export { autocompleteEmits, autocompleteProps } from './components/autocomplete/src/autocomplete.mjs';
|
|
15
15
|
export { ElAutocomplete } from './components/autocomplete/index.mjs';
|
|
16
|
-
export { avatarEmits, avatarProps } from './components/avatar/src/
|
|
16
|
+
export { avatarEmits, avatarProps } from './components/avatar/src/avatar.mjs';
|
|
17
17
|
export { ElAvatar } from './components/avatar/index.mjs';
|
|
18
18
|
export { backtopEmits, backtopProps } from './components/backtop/src/backtop.mjs';
|
|
19
19
|
export { ElBacktop } from './components/backtop/index.mjs';
|
|
@@ -24,7 +24,7 @@ export { breadcrumbItemProps } from './components/breadcrumb/src/breadcrumb-item
|
|
|
24
24
|
export { ElBreadcrumb, ElBreadcrumbItem } from './components/breadcrumb/index.mjs';
|
|
25
25
|
export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './components/button/src/button.mjs';
|
|
26
26
|
export { ElButton, ElButtonGroup } from './components/button/index.mjs';
|
|
27
|
-
export { calendarEmits, calendarProps } from './components/calendar/src/
|
|
27
|
+
export { calendarEmits, calendarProps } from './components/calendar/src/calendar2.mjs';
|
|
28
28
|
export { ElCalendar } from './components/calendar/index.mjs';
|
|
29
29
|
export { cardProps } from './components/card/src/card.mjs';
|
|
30
30
|
export { ElCard } from './components/card/index.mjs';
|
|
@@ -94,11 +94,11 @@ export { popconfirmProps } from './components/popconfirm/src/popconfirm.mjs';
|
|
|
94
94
|
export { ElPopconfirm } from './components/popconfirm/index.mjs';
|
|
95
95
|
export { Effect, usePopperProps } from './components/popper/src/popper.mjs';
|
|
96
96
|
export { usePopperTriggerProps } from './components/popper/src/trigger.mjs';
|
|
97
|
-
export { usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './components/popper/src/
|
|
97
|
+
export { usePopperContentEmits, usePopperContentProps, usePopperCoreConfigProps } from './components/popper/src/content2.mjs';
|
|
98
98
|
export { usePopperArrowProps } from './components/popper/src/arrow.mjs';
|
|
99
99
|
export { default as ElPopperArrow } from './components/popper/src/arrow2.mjs';
|
|
100
100
|
export { default as ElPopperTrigger } from './components/popper/src/trigger2.mjs';
|
|
101
|
-
export { default as ElPopperContent } from './components/popper/src/
|
|
101
|
+
export { default as ElPopperContent } from './components/popper/src/content.mjs';
|
|
102
102
|
export { ElPopper } from './components/popper/index.mjs';
|
|
103
103
|
export { progressProps } from './components/progress/src/progress.mjs';
|
|
104
104
|
export { ElProgress } from './components/progress/index.mjs';
|
|
@@ -195,7 +195,6 @@ export { default as ClickOutside } from './directives/click-outside/index.mjs';
|
|
|
195
195
|
export { default as RepeatClick } from './directives/repeat-click/index.mjs';
|
|
196
196
|
export { default as TrapFocus } from './directives/trap-focus/index.mjs';
|
|
197
197
|
export { default as Mousewheel } from './directives/mousewheel/index.mjs';
|
|
198
|
-
export { default as Resize } from './directives/resize/index.mjs';
|
|
199
198
|
export { useAttrs } from './hooks/use-attrs/index.mjs';
|
|
200
199
|
export { useDisabled, useSize, useSizeProp } from './hooks/use-common-props/index.mjs';
|
|
201
200
|
export { useDeprecated } from './hooks/use-deprecated/index.mjs';
|
package/es/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/constants'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n\nexport { default as dayjs } from 'dayjs'\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../packages/element-plus/index.ts"],"sourcesContent":["import installer from './defaults'\nexport * from '@element-plus/components'\nexport * from '@element-plus/constants'\nexport * from '@element-plus/directives'\nexport * from '@element-plus/hooks'\nexport * from '@element-plus/tokens'\nexport * from './make-installer'\n\nexport const install = installer.install\nexport const version = installer.version\nexport default installer\n\nexport { default as dayjs } from 'dayjs'\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOY,MAAC,OAAO,GAAG,SAAS,CAAC,QAAQ;AAC7B,MAAC,OAAO,GAAG,SAAS,CAAC;;;;"}
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20220722";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20220722'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
|
-
var avatar$1 = require('./src/
|
|
7
|
-
var avatar = require('./src/
|
|
6
|
+
var avatar$1 = require('./src/avatar2.js');
|
|
7
|
+
var avatar = require('./src/avatar.js');
|
|
8
8
|
var install = require('../../utils/vue/install.js');
|
|
9
9
|
|
|
10
10
|
const ElAvatar = install.withInstall(avatar$1["default"]);
|
|
@@ -2,77 +2,43 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var vue = require('vue');
|
|
6
|
-
var index$1 = require('../../icon/index.js');
|
|
7
|
-
require('../../../hooks/index.js');
|
|
8
5
|
require('../../../utils/index.js');
|
|
9
|
-
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var shared = require('@vue/shared');
|
|
6
|
+
require('../../../constants/index.js');
|
|
7
|
+
var runtime = require('../../../utils/vue/props/runtime.js');
|
|
8
|
+
var size = require('../../../constants/size.js');
|
|
13
9
|
var core = require('@vueuse/core');
|
|
14
|
-
var
|
|
10
|
+
var icon = require('../../../utils/vue/icon.js');
|
|
15
11
|
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
const { size } = props;
|
|
41
|
-
return core.isNumber(size) ? ns.cssVarBlock({
|
|
42
|
-
size: style.addUnit(size) || ""
|
|
43
|
-
}) : void 0;
|
|
44
|
-
});
|
|
45
|
-
const fitStyle = vue.computed(() => ({
|
|
46
|
-
objectFit: props.fit
|
|
47
|
-
}));
|
|
48
|
-
vue.watch(() => props.src, () => hasLoadError.value = false);
|
|
49
|
-
function handleError(e) {
|
|
50
|
-
hasLoadError.value = true;
|
|
51
|
-
emit("error", e);
|
|
52
|
-
}
|
|
53
|
-
return (_ctx, _cache) => {
|
|
54
|
-
return vue.openBlock(), vue.createElementBlock("span", {
|
|
55
|
-
class: vue.normalizeClass(vue.unref(avatarClass)),
|
|
56
|
-
style: vue.normalizeStyle(vue.unref(sizeStyle))
|
|
57
|
-
}, [
|
|
58
|
-
(_ctx.src || _ctx.srcSet) && !hasLoadError.value ? (vue.openBlock(), vue.createElementBlock("img", {
|
|
59
|
-
key: 0,
|
|
60
|
-
src: _ctx.src,
|
|
61
|
-
alt: _ctx.alt,
|
|
62
|
-
srcset: _ctx.srcSet,
|
|
63
|
-
style: vue.normalizeStyle(vue.unref(fitStyle)),
|
|
64
|
-
onError: handleError
|
|
65
|
-
}, null, 44, _hoisted_1)) : _ctx.icon ? (vue.openBlock(), vue.createBlock(vue.unref(index$1.ElIcon), { key: 1 }, {
|
|
66
|
-
default: vue.withCtx(() => [
|
|
67
|
-
(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.icon)))
|
|
68
|
-
]),
|
|
69
|
-
_: 1
|
|
70
|
-
})) : vue.renderSlot(_ctx.$slots, "default", { key: 2 })
|
|
71
|
-
], 6);
|
|
72
|
-
};
|
|
12
|
+
const avatarProps = runtime.buildProps({
|
|
13
|
+
size: {
|
|
14
|
+
type: [Number, String],
|
|
15
|
+
values: size.componentSizes,
|
|
16
|
+
default: "",
|
|
17
|
+
validator: (val) => core.isNumber(val)
|
|
18
|
+
},
|
|
19
|
+
shape: {
|
|
20
|
+
type: String,
|
|
21
|
+
values: ["circle", "square"],
|
|
22
|
+
default: "circle"
|
|
23
|
+
},
|
|
24
|
+
icon: {
|
|
25
|
+
type: icon.iconPropType
|
|
26
|
+
},
|
|
27
|
+
src: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
alt: String,
|
|
32
|
+
srcSet: String,
|
|
33
|
+
fit: {
|
|
34
|
+
type: runtime.definePropType(String),
|
|
35
|
+
default: "cover"
|
|
73
36
|
}
|
|
74
37
|
});
|
|
75
|
-
|
|
38
|
+
const avatarEmits = {
|
|
39
|
+
error: (evt) => evt instanceof Event
|
|
40
|
+
};
|
|
76
41
|
|
|
77
|
-
exports
|
|
42
|
+
exports.avatarEmits = avatarEmits;
|
|
43
|
+
exports.avatarProps = avatarProps;
|
|
78
44
|
//# sourceMappingURL=avatar.js.map
|