@element-plus/nightly 0.0.20230215 → 0.0.20230217
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/attributes.json +1 -1
- package/dist/index.full.js +29 -5
- package/dist/index.full.min.js +10 -10
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +11 -11
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +29 -5
- 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/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.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/cascader/src/cascader.mjs.map +1 -1
- package/es/components/cascader/src/cascader2.mjs.map +1 -1
- package/es/components/cascader-panel/src/config.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.mjs.map +1 -1
- package/es/components/cascader-panel/src/index.vue.d.ts +6 -0
- package/es/components/cascader-panel/src/node.d.ts +15 -0
- package/es/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/components/descriptions/src/descriptions-cell.mjs +3 -2
- package/es/components/descriptions/src/descriptions-cell.mjs.map +1 -1
- package/es/components/dropdown/src/dropdown2.mjs +26 -1
- package/es/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/components/focus-trap/src/focus-trap.mjs +1 -1
- package/es/components/focus-trap/src/focus-trap.mjs.map +1 -1
- package/es/components/tree/index.d.ts +2 -2
- package/es/components/tree/src/tree.mjs.map +1 -1
- package/es/components/tree/src/tree.vue.d.ts +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/cascader/src/cascader.js.map +1 -1
- package/lib/components/cascader/src/cascader2.js.map +1 -1
- package/lib/components/cascader-panel/src/config.js.map +1 -1
- package/lib/components/cascader-panel/src/index.js.map +1 -1
- package/lib/components/cascader-panel/src/index.vue.d.ts +6 -0
- package/lib/components/cascader-panel/src/node.d.ts +15 -0
- package/lib/components/cascader-panel/src/node.js.map +1 -1
- package/lib/components/descriptions/src/descriptions-cell.js +3 -2
- package/lib/components/descriptions/src/descriptions-cell.js.map +1 -1
- package/lib/components/dropdown/src/dropdown2.js +25 -0
- package/lib/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/components/focus-trap/src/focus-trap.js +1 -1
- package/lib/components/focus-trap/src/focus-trap.js.map +1 -1
- package/lib/components/tree/index.d.ts +2 -2
- package/lib/components/tree/src/tree.js.map +1 -1
- package/lib/components/tree/src/tree.vue.d.ts +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/tags.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown2.js","sources":["../../../../../../packages/components/dropdown/src/dropdown.vue"],"sourcesContent":["<template>\n <div :class=\"[ns.b(), ns.is('disabled', disabled)]\">\n <el-tooltip\n ref=\"popperRef\"\n :role=\"role\"\n :effect=\"effect\"\n :fallback-placements=\"['bottom', 'top']\"\n :popper-options=\"popperOptions\"\n :gpu-acceleration=\"false\"\n :hide-after=\"trigger === 'hover' ? hideTimeout : 0\"\n :manual-mode=\"true\"\n :placement=\"placement\"\n :popper-class=\"[ns.e('popper'), popperClass]\"\n :reference-element=\"referenceElementRef?.$el\"\n :trigger=\"trigger\"\n :trigger-keys=\"triggerKeys\"\n :trigger-target-el=\"contentRef\"\n :show-after=\"trigger === 'hover' ? showTimeout : 0\"\n :stop-popper-mouse-event=\"false\"\n :virtual-ref=\"triggeringElementRef\"\n :virtual-triggering=\"splitButton\"\n :disabled=\"disabled\"\n :transition=\"`${ns.namespace.value}-zoom-in-top`\"\n :teleported=\"teleported\"\n pure\n persistent\n @before-show=\"handleBeforeShowTooltip\"\n @show=\"handleShowTooltip\"\n @before-hide=\"handleBeforeHideTooltip\"\n >\n <template #content>\n <el-scrollbar\n ref=\"scrollbar\"\n :wrap-style=\"wrapStyle\"\n tag=\"div\"\n :view-class=\"ns.e('list')\"\n >\n <el-roving-focus-group\n :loop=\"loop\"\n :current-tab-id=\"currentTabId\"\n orientation=\"horizontal\"\n @current-tab-id-change=\"handleCurrentTabIdChange\"\n @entry-focus=\"handleEntryFocus\"\n >\n <el-dropdown-collection>\n <slot name=\"dropdown\" />\n </el-dropdown-collection>\n </el-roving-focus-group>\n </el-scrollbar>\n </template>\n <template v-if=\"!splitButton\" #default>\n <el-only-child :id=\"triggerId\" role=\"button\" :tabindex=\"tabindex\">\n <slot name=\"default\" />\n </el-only-child>\n </template>\n </el-tooltip>\n <template v-if=\"splitButton\">\n <el-button-group>\n <el-button\n ref=\"referenceElementRef\"\n v-bind=\"buttonProps\"\n :size=\"dropdownSize\"\n :type=\"type\"\n :disabled=\"disabled\"\n :tabindex=\"tabindex\"\n @click=\"handlerMainButtonClick\"\n >\n <slot name=\"default\" />\n </el-button>\n <el-button\n :id=\"triggerId\"\n ref=\"triggeringElementRef\"\n v-bind=\"buttonProps\"\n role=\"button\"\n :size=\"dropdownSize\"\n :type=\"type\"\n :class=\"ns.e('caret-button')\"\n :disabled=\"disabled\"\n :tabindex=\"tabindex\"\n :aria-label=\"t('el.dropdown.toggleDropdown')\"\n >\n <el-icon :class=\"ns.e('icon')\"><arrow-down /></el-icon>\n </el-button>\n </el-button-group>\n </template>\n </div>\n</template>\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n provide,\n ref,\n toRef,\n unref,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport ElIcon from '@element-plus/components/icon'\nimport ElRovingFocusGroup from '@element-plus/components/roving-focus-group'\nimport { ElOnlyChild } from '@element-plus/components/slot'\nimport { addUnit } from '@element-plus/utils'\nimport { ArrowDown } from '@element-plus/icons-vue'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { useId, useLocale, useNamespace, useSize } from '@element-plus/hooks'\nimport { ElCollection as ElDropdownCollection, dropdownProps } from './dropdown'\nimport { DROPDOWN_INJECTION_KEY } from './tokens'\n\nimport type { CSSProperties } from 'vue'\n\nconst { ButtonGroup: ElButtonGroup } = ElButton\n\nexport default defineComponent({\n name: 'ElDropdown',\n components: {\n ElButton,\n ElButtonGroup,\n ElScrollbar,\n ElDropdownCollection,\n ElTooltip,\n ElRovingFocusGroup,\n ElOnlyChild,\n ElIcon,\n ArrowDown,\n },\n props: dropdownProps,\n emits: ['visible-change', 'click', 'command'],\n setup(props, { emit }) {\n const _instance = getCurrentInstance()\n const ns = useNamespace('dropdown')\n const { t } = useLocale()\n\n const triggeringElementRef = ref()\n const referenceElementRef = ref()\n const popperRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const contentRef = ref<HTMLElement | null>(null)\n const scrollbar = ref(null)\n const currentTabId = ref<string | null>(null)\n const isUsingKeyboard = ref(false)\n const triggerKeys = [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.down]\n\n const wrapStyle = computed<CSSProperties>(() => ({\n maxHeight: addUnit(props.maxHeight),\n }))\n const dropdownTriggerKls = computed(() => [ns.m(dropdownSize.value)])\n\n const defaultTriggerId = useId().value\n const triggerId = computed<string>(() => {\n return props.id || defaultTriggerId\n })\n\n function handleClick() {\n handleClose()\n }\n\n function handleClose() {\n popperRef.value?.onClose()\n }\n\n function handleOpen() {\n popperRef.value?.onOpen()\n }\n\n const dropdownSize = useSize()\n\n function commandHandler(...args: any[]) {\n emit('command', ...args)\n }\n\n function onItemEnter() {\n // NOOP for now\n }\n\n function onItemLeave() {\n const contentEl = unref(contentRef)\n\n contentEl?.focus()\n currentTabId.value = null\n }\n\n function handleCurrentTabIdChange(id: string) {\n currentTabId.value = id\n }\n\n function handleEntryFocus(e: Event) {\n if (!isUsingKeyboard.value) {\n e.preventDefault()\n e.stopImmediatePropagation()\n }\n }\n\n function handleBeforeShowTooltip() {\n emit('visible-change', true)\n }\n\n function handleShowTooltip(event?: Event) {\n if (event?.type === 'keydown') {\n contentRef.value.focus()\n }\n }\n\n function handleBeforeHideTooltip() {\n emit('visible-change', false)\n }\n\n provide(DROPDOWN_INJECTION_KEY, {\n contentRef,\n role: computed(() => props.role),\n triggerId,\n isUsingKeyboard,\n onItemEnter,\n onItemLeave,\n })\n\n provide('elDropdown', {\n instance: _instance,\n dropdownSize,\n handleClick,\n commandHandler,\n trigger: toRef(props, 'trigger'),\n hideOnClick: toRef(props, 'hideOnClick'),\n })\n\n const onFocusAfterTrapped = (e: Event) => {\n e.preventDefault()\n contentRef.value?.focus?.({\n preventScroll: true,\n })\n }\n\n const handlerMainButtonClick = (event: MouseEvent) => {\n emit('click', event)\n }\n\n return {\n t,\n ns,\n scrollbar,\n wrapStyle,\n dropdownTriggerKls,\n dropdownSize,\n triggerId,\n triggerKeys,\n currentTabId,\n handleCurrentTabIdChange,\n handlerMainButtonClick,\n handleEntryFocus,\n handleClose,\n handleOpen,\n handleBeforeShowTooltip,\n handleShowTooltip,\n handleBeforeHideTooltip,\n onFocusAfterTrapped,\n popperRef,\n contentRef,\n triggeringElementRef,\n referenceElementRef,\n }\n },\n})\n</script>\n"],"names":["ElButton","defineComponent","ElScrollbar","ElDropdownCollection","ElTooltip","ElRovingFocusGroup","ElOnlyChild","ElIcon","ArrowDown","dropdownProps","getCurrentInstance","useNamespace","useLocale","ref","EVENT_CODE","computed","addUnit","useId","useSize","unref","provide","DROPDOWN_INJECTION_KEY","toRef","_resolveComponent","_openBlock","_createElementBlock","_normalizeClass","_createVNode","_createSlots","_withCtx","_createBlock","_mergeProps","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAiHA,MAAM,EAAE,aAAa,aAAkB,EAAA,GAAAA,cAAA,CAAA;AAEvC,MAAK,YAAaC,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,YAAA;AAAA,EACN,UAAY,EAAA;AAAA,cACVD,cAAA;AAAA,IACA,aAAA;AAAA,iBACAE,mBAAA;AAAA,0BACAC,qBAAA;AAAA,eACAC,iBAAA;AAAA,wBACAC,2BAAA;AAAA,iBACAC,mBAAA;AAAA,YACAC,cAAA;AAAA,eACAC,kBAAA;AAAA,GACF;AAAA,EACA,KAAO,EAAAC,sBAAA;AAAA,EACP,KAAO,EAAA,CAAC,gBAAkB,EAAA,OAAA,EAAS,SAAS,CAAA;AAAA,EAC5C,KAAA,CAAM,KAAO,EAAA,EAAE,IAAQ,EAAA,EAAA;AACrB,IAAA,MAAM,YAAYC,sBAAmB,EAAA,CAAA;AACrC,IAAM,MAAA,EAAA,GAAKC,qBAAa,UAAU,CAAA,CAAA;AAClC,IAAM,MAAA,EAAE,MAAMC,iBAAU,EAAA,CAAA;AAExB,IAAA,MAAM,uBAAuBC,OAA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IAAA,CAAA,YAAA;AAAA,UAAA,IAAA,EAAA,IAAA,CAAA,IAAA;iCAEe;AAAA,UAAA,QAAA,EAAA,IAAA,CAAA,QAAA;AAAA,UAAA,OAAA,EAAA,IAAA,CAAA,sBAAA;;;AAEzB,YAAAC,qCAaY,CAAA;AAAA,WAZL,CAAA;AAAA,UACL,CAAI,EAAA,CAAA;AAAA,SAAA,EACI,EAAW,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,UAAA,EAAA,UAAA,EAAA,SAAA,CAAA,CAAA;AAAA,QAAAL,eACd,CAAA,oBAAA,EAAAI,cAAA,CAAA;AAAA,UACJ,EAAM,EAAA,IAAA,CAAA,SAAA;AAAA,UACN,GAAM,EAAA,sBAAA;AAAA,SACN,EAAA,IAAA,CAAA,WAAW,EAAA;AAAA,UACX,IAAU,EAAA,QAAA;AAAA,UACV,IAAU,EAAA,IAAA,CAAA,YAAA;AAAA,UACV,eAAa;AAAA,UAAA,KAAA,EAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,cAAA,CAAA;iCAEyC;AAAA,UAAA,QAAA,EAAA,IAAA,CAAA,QAAA;AAAA,UAA7C,YAAO,EAAA,IAAA,CAAA,CAAA,CAAA,4BAAI,CAAA;AAAA,SAAA,CAAA,EAAA;qCAAwB;AAAA,YAAAJ,eAAA,CAAA,kBAAA,EAAA;AAAA,cAAA,KAAA,EAAAD,kBAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,MAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"dropdown2.js","sources":["../../../../../../packages/components/dropdown/src/dropdown.vue"],"sourcesContent":["<template>\n <div :class=\"[ns.b(), ns.is('disabled', disabled)]\">\n <el-tooltip\n ref=\"popperRef\"\n :role=\"role\"\n :effect=\"effect\"\n :fallback-placements=\"['bottom', 'top']\"\n :popper-options=\"popperOptions\"\n :gpu-acceleration=\"false\"\n :hide-after=\"trigger === 'hover' ? hideTimeout : 0\"\n :manual-mode=\"true\"\n :placement=\"placement\"\n :popper-class=\"[ns.e('popper'), popperClass]\"\n :reference-element=\"referenceElementRef?.$el\"\n :trigger=\"trigger\"\n :trigger-keys=\"triggerKeys\"\n :trigger-target-el=\"contentRef\"\n :show-after=\"trigger === 'hover' ? showTimeout : 0\"\n :stop-popper-mouse-event=\"false\"\n :virtual-ref=\"triggeringElementRef\"\n :virtual-triggering=\"splitButton\"\n :disabled=\"disabled\"\n :transition=\"`${ns.namespace.value}-zoom-in-top`\"\n :teleported=\"teleported\"\n pure\n persistent\n @before-show=\"handleBeforeShowTooltip\"\n @show=\"handleShowTooltip\"\n @before-hide=\"handleBeforeHideTooltip\"\n >\n <template #content>\n <el-scrollbar\n ref=\"scrollbar\"\n :wrap-style=\"wrapStyle\"\n tag=\"div\"\n :view-class=\"ns.e('list')\"\n >\n <el-roving-focus-group\n :loop=\"loop\"\n :current-tab-id=\"currentTabId\"\n orientation=\"horizontal\"\n @current-tab-id-change=\"handleCurrentTabIdChange\"\n @entry-focus=\"handleEntryFocus\"\n >\n <el-dropdown-collection>\n <slot name=\"dropdown\" />\n </el-dropdown-collection>\n </el-roving-focus-group>\n </el-scrollbar>\n </template>\n <template v-if=\"!splitButton\" #default>\n <el-only-child\n :id=\"triggerId\"\n ref=\"triggeringElementRef\"\n role=\"button\"\n :tabindex=\"tabindex\"\n >\n <slot name=\"default\" />\n </el-only-child>\n </template>\n </el-tooltip>\n <template v-if=\"splitButton\">\n <el-button-group>\n <el-button\n ref=\"referenceElementRef\"\n v-bind=\"buttonProps\"\n :size=\"dropdownSize\"\n :type=\"type\"\n :disabled=\"disabled\"\n :tabindex=\"tabindex\"\n @click=\"handlerMainButtonClick\"\n >\n <slot name=\"default\" />\n </el-button>\n <el-button\n :id=\"triggerId\"\n ref=\"triggeringElementRef\"\n v-bind=\"buttonProps\"\n role=\"button\"\n :size=\"dropdownSize\"\n :type=\"type\"\n :class=\"ns.e('caret-button')\"\n :disabled=\"disabled\"\n :tabindex=\"tabindex\"\n :aria-label=\"t('el.dropdown.toggleDropdown')\"\n >\n <el-icon :class=\"ns.e('icon')\"><arrow-down /></el-icon>\n </el-button>\n </el-button-group>\n </template>\n </div>\n</template>\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n onUnmounted,\n provide,\n ref,\n toRef,\n unref,\n watch,\n} from 'vue'\nimport ElButton from '@element-plus/components/button'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport ElScrollbar from '@element-plus/components/scrollbar'\nimport ElIcon from '@element-plus/components/icon'\nimport ElRovingFocusGroup from '@element-plus/components/roving-focus-group'\nimport { ElOnlyChild } from '@element-plus/components/slot'\nimport { addUnit, isArray } from '@element-plus/utils'\nimport { ArrowDown } from '@element-plus/icons-vue'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { useId, useLocale, useNamespace, useSize } from '@element-plus/hooks'\nimport { ElCollection as ElDropdownCollection, dropdownProps } from './dropdown'\nimport { DROPDOWN_INJECTION_KEY } from './tokens'\n\nimport type { CSSProperties } from 'vue'\n\nconst { ButtonGroup: ElButtonGroup } = ElButton\n\nexport default defineComponent({\n name: 'ElDropdown',\n components: {\n ElButton,\n ElButtonGroup,\n ElScrollbar,\n ElDropdownCollection,\n ElTooltip,\n ElRovingFocusGroup,\n ElOnlyChild,\n ElIcon,\n ArrowDown,\n },\n props: dropdownProps,\n emits: ['visible-change', 'click', 'command'],\n setup(props, { emit }) {\n const _instance = getCurrentInstance()\n const ns = useNamespace('dropdown')\n const { t } = useLocale()\n\n const triggeringElementRef = ref()\n const referenceElementRef = ref()\n const popperRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const contentRef = ref<HTMLElement | null>(null)\n const scrollbar = ref(null)\n const currentTabId = ref<string | null>(null)\n const isUsingKeyboard = ref(false)\n const triggerKeys = [EVENT_CODE.enter, EVENT_CODE.space, EVENT_CODE.down]\n\n const wrapStyle = computed<CSSProperties>(() => ({\n maxHeight: addUnit(props.maxHeight),\n }))\n const dropdownTriggerKls = computed(() => [ns.m(dropdownSize.value)])\n\n const defaultTriggerId = useId().value\n const triggerId = computed<string>(() => {\n return props.id || defaultTriggerId\n })\n\n // The goal of this code is to focus on the tooltip triggering element when it is hovered.\n // This is a temporary fix for where closing the dropdown through pointerleave event focuses on a\n // completely different element. For a permanent solution, remove all calls to any \"element.focus()\"\n // that are triggered through pointer enter/leave events.\n watch(\n [triggeringElementRef, toRef(props, 'trigger')],\n ([triggeringElement, trigger], [prevTriggeringElement]) => {\n const triggerArray = isArray(trigger) ? trigger : [trigger]\n if (prevTriggeringElement?.$el?.removeEventListener) {\n prevTriggeringElement.$el.removeEventListener(\n 'pointerenter',\n onAutofocusTriggerEnter\n )\n }\n if (triggeringElement?.$el?.removeEventListener) {\n triggeringElement.$el.removeEventListener(\n 'pointerenter',\n onAutofocusTriggerEnter\n )\n }\n if (\n triggeringElement?.$el?.addEventListener &&\n triggerArray.includes('hover')\n ) {\n triggeringElement.$el.addEventListener(\n 'pointerenter',\n onAutofocusTriggerEnter\n )\n }\n },\n { immediate: true }\n )\n\n onUnmounted(() => {\n if (triggeringElement?.$el?.removeEventListener) {\n triggeringElement.$el.removeEventListener(\n 'pointerenter',\n onAutofocusTriggerEnter\n )\n }\n })\n\n function handleClick() {\n handleClose()\n }\n\n function handleClose() {\n popperRef.value?.onClose()\n }\n\n function handleOpen() {\n popperRef.value?.onOpen()\n }\n\n const dropdownSize = useSize()\n\n function commandHandler(...args: any[]) {\n emit('command', ...args)\n }\n\n function onAutofocusTriggerEnter() {\n triggeringElementRef.value?.$el?.focus()\n }\n\n function onItemEnter() {\n // NOOP for now\n }\n\n function onItemLeave() {\n const contentEl = unref(contentRef)\n\n contentEl?.focus()\n currentTabId.value = null\n }\n\n function handleCurrentTabIdChange(id: string) {\n currentTabId.value = id\n }\n\n function handleEntryFocus(e: Event) {\n if (!isUsingKeyboard.value) {\n e.preventDefault()\n e.stopImmediatePropagation()\n }\n }\n\n function handleBeforeShowTooltip() {\n emit('visible-change', true)\n }\n\n function handleShowTooltip(event?: Event) {\n if (event?.type === 'keydown') {\n contentRef.value.focus()\n }\n }\n\n function handleBeforeHideTooltip() {\n emit('visible-change', false)\n }\n\n provide(DROPDOWN_INJECTION_KEY, {\n contentRef,\n role: computed(() => props.role),\n triggerId,\n isUsingKeyboard,\n onItemEnter,\n onItemLeave,\n })\n\n provide('elDropdown', {\n instance: _instance,\n dropdownSize,\n handleClick,\n commandHandler,\n trigger: toRef(props, 'trigger'),\n hideOnClick: toRef(props, 'hideOnClick'),\n })\n\n const onFocusAfterTrapped = (e: Event) => {\n e.preventDefault()\n contentRef.value?.focus?.({\n preventScroll: true,\n })\n }\n\n const handlerMainButtonClick = (event: MouseEvent) => {\n emit('click', event)\n }\n\n return {\n t,\n ns,\n scrollbar,\n wrapStyle,\n dropdownTriggerKls,\n dropdownSize,\n triggerId,\n triggerKeys,\n currentTabId,\n handleCurrentTabIdChange,\n handlerMainButtonClick,\n handleEntryFocus,\n handleClose,\n handleOpen,\n handleBeforeShowTooltip,\n handleShowTooltip,\n handleBeforeHideTooltip,\n onFocusAfterTrapped,\n popperRef,\n contentRef,\n triggeringElementRef,\n referenceElementRef,\n }\n },\n})\n</script>\n"],"names":["ElButton","defineComponent","ElScrollbar","ElDropdownCollection","ElTooltip","ElRovingFocusGroup","ElOnlyChild","ElIcon","ArrowDown","dropdownProps","getCurrentInstance","useNamespace","useLocale","ref","EVENT_CODE","computed","addUnit","useId","watch","toRef","isArray","onUnmounted","useSize","unref","provide","DROPDOWN_INJECTION_KEY","_resolveComponent","_openBlock","_createElementBlock","_normalizeClass","_createVNode","_createSlots","_withCtx","_renderSlot","_createBlock","_mergeProps"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwHA,MAAM,EAAE,aAAa,aAAkB,EAAA,GAAAA,cAAA,CAAA;AAEvC,MAAK,YAAaC,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,YAAA;AAAA,EAC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A,EAAA,2BAaY;AAAA,SAAA,CAZT,EAAI;AAAA,UACL,OAAI,EAAAH,WAAA,CAAA,MAAA;AAAA,YACeC,cAAA,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,WACd,CAAA;AAAA,UACJ,CAAM,EAAA,CAAA;AAAA,SAAA,EACA,EAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,UAAA,EAAA,UAAA,EAAA,SAAA,CAAA,CAAA;AAAA,QACNH,oCAAW,EAAAK,cAAA,CAAA;AAAA,UACX,EAAU,EAAA,IAAA,CAAA,SAAA;AAAA,UACV,GAAU,EAAA,sBAAA;AAAA,SAAA,kBACG,EAAA;AAAA,UAAA,IAAA,EAAA,QAAA;iCAEyC;AAAA,UAAA,IAAA,EAAA,IAAA,CAAA,IAAA;AAAA,UAA7C,KAAA,EAAA,IAAK,CAAE,EAAA,CAAA,CAAA,CAAA,cAAA,CAAA;AAAI,UAAA,QAAA,EAAA,IAAA,CAAA,QAAA;iCAAwB;AAAA,UAAA,YAAA,EAAA,IAAA,CAAA,CAAA,CAAA,4BAAA,CAAA;AAAA,SAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -221,7 +221,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
221
221
|
});
|
|
222
222
|
trapContainer.addEventListener(tokens.FOCUS_AFTER_RELEASED, releaseOnFocus);
|
|
223
223
|
trapContainer.dispatchEvent(releasedEvent);
|
|
224
|
-
if (!releasedEvent.defaultPrevented && (focusReason.value == "keyboard" || !utils.isFocusCausedByUserEvent())) {
|
|
224
|
+
if (!releasedEvent.defaultPrevented && (focusReason.value == "keyboard" || !utils.isFocusCausedByUserEvent() || trapContainer.contains(document.activeElement))) {
|
|
225
225
|
utils.tryFocus(lastFocusBeforeTrapped != null ? lastFocusBeforeTrapped : document.body);
|
|
226
226
|
}
|
|
227
227
|
trapContainer.removeEventListener(tokens.FOCUS_AFTER_RELEASED, trapOnFocus);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"focus-trap.js","sources":["../../../../../../packages/components/focus-trap/src/focus-trap.vue"],"sourcesContent":["<template>\n <slot :handle-keydown=\"onKeydown\" />\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n unref,\n watch,\n} from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { useEscapeKeydown } from '@element-plus/hooks'\nimport { isString } from '@element-plus/utils'\nimport {\n createFocusOutPreventedEvent,\n focusFirstDescendant,\n focusableStack,\n getEdges,\n isFocusCausedByUserEvent,\n obtainAllFocusableElements,\n tryFocus,\n useFocusReason,\n} from './utils'\nimport {\n FOCUS_AFTER_RELEASED,\n FOCUS_AFTER_TRAPPED,\n FOCUS_AFTER_TRAPPED_OPTS,\n FOCUS_TRAP_INJECTION_KEY,\n ON_RELEASE_FOCUS_EVT,\n ON_TRAP_FOCUS_EVT,\n} from './tokens'\n\nimport type { PropType } from 'vue'\nimport type { FocusLayer } from './utils'\n\nexport default defineComponent({\n name: 'ElFocusTrap',\n inheritAttrs: false,\n props: {\n loop: Boolean,\n trapped: Boolean,\n focusTrapEl: Object as PropType<HTMLElement>,\n focusStartEl: {\n type: [Object, String] as PropType<'container' | 'first' | HTMLElement>,\n default: 'first',\n },\n },\n emits: [\n ON_TRAP_FOCUS_EVT,\n ON_RELEASE_FOCUS_EVT,\n 'focusin',\n 'focusout',\n 'focusout-prevented',\n 'release-requested',\n ],\n setup(props, { emit }) {\n const forwardRef = ref<HTMLElement | undefined>()\n let lastFocusBeforeTrapped: HTMLElement | null\n let lastFocusAfterTrapped: HTMLElement | null\n\n const { focusReason } = useFocusReason()\n\n useEscapeKeydown((event) => {\n if (props.trapped && !focusLayer.paused) {\n emit('release-requested', event)\n }\n })\n\n const focusLayer: FocusLayer = {\n paused: false,\n pause() {\n this.paused = true\n },\n resume() {\n this.paused = false\n },\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n if (!props.loop && !props.trapped) return\n if (focusLayer.paused) return\n\n const { key, altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e\n const { loop } = props\n const isTabbing =\n key === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey\n\n const currentFocusingEl = document.activeElement\n if (isTabbing && currentFocusingEl) {\n const container = currentTarget as HTMLElement\n const [first, last] = getEdges(container)\n const isTabbable = first && last\n if (!isTabbable) {\n if (currentFocusingEl === container) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n e.preventDefault()\n }\n }\n } else {\n if (!shiftKey && currentFocusingEl === last) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n e.preventDefault()\n if (loop) tryFocus(first, true)\n }\n } else if (\n shiftKey &&\n [first, container].includes(currentFocusingEl as HTMLElement)\n ) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n e.preventDefault()\n if (loop) tryFocus(last, true)\n }\n }\n }\n }\n }\n\n provide(FOCUS_TRAP_INJECTION_KEY, {\n focusTrapRef: forwardRef,\n onKeydown,\n })\n\n watch(\n () => props.focusTrapEl,\n (focusTrapEl) => {\n if (focusTrapEl) {\n forwardRef.value = focusTrapEl\n }\n },\n { immediate: true }\n )\n\n watch([forwardRef], ([forwardRef], [oldForwardRef]) => {\n if (forwardRef) {\n forwardRef.addEventListener('keydown', onKeydown)\n forwardRef.addEventListener('focusin', onFocusIn)\n forwardRef.addEventListener('focusout', onFocusOut)\n }\n if (oldForwardRef) {\n oldForwardRef.removeEventListener('keydown', onKeydown)\n oldForwardRef.removeEventListener('focusin', onFocusIn)\n oldForwardRef.removeEventListener('focusout', onFocusOut)\n }\n })\n\n const trapOnFocus = (e: Event) => {\n emit(ON_TRAP_FOCUS_EVT, e)\n }\n const releaseOnFocus = (e: Event) => emit(ON_RELEASE_FOCUS_EVT, e)\n\n const onFocusIn = (e: FocusEvent) => {\n const trapContainer = unref(forwardRef)\n if (!trapContainer) return\n\n const target = e.target as HTMLElement | null\n const relatedTarget = e.relatedTarget as HTMLElement | null\n const isFocusedInTrap = target && trapContainer.contains(target)\n\n if (!props.trapped) {\n const isPrevFocusedInTrap =\n relatedTarget && trapContainer.contains(relatedTarget)\n if (!isPrevFocusedInTrap) {\n lastFocusBeforeTrapped = relatedTarget\n }\n }\n\n if (isFocusedInTrap) emit('focusin', e)\n\n if (focusLayer.paused) return\n\n if (props.trapped) {\n if (isFocusedInTrap) {\n lastFocusAfterTrapped = target\n } else {\n tryFocus(lastFocusAfterTrapped, true)\n }\n }\n }\n\n const onFocusOut = (e: Event) => {\n const trapContainer = unref(forwardRef)\n if (focusLayer.paused || !trapContainer) return\n\n if (props.trapped) {\n const relatedTarget = (e as FocusEvent)\n .relatedTarget as HTMLElement | null\n if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {\n // Give embedded focus layer time to pause this layer before reclaiming focus\n // And only reclaim focus if it should currently be trapping\n setTimeout(() => {\n if (!focusLayer.paused && props.trapped) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n tryFocus(lastFocusAfterTrapped, true)\n }\n }\n }, 0)\n }\n } else {\n const target = e.target as HTMLElement | null\n const isFocusedInTrap = target && trapContainer.contains(target)\n if (!isFocusedInTrap) emit('focusout', e)\n }\n }\n\n async function startTrap() {\n // Wait for forwardRef to resolve\n await nextTick()\n const trapContainer = unref(forwardRef)\n if (trapContainer) {\n focusableStack.push(focusLayer)\n const prevFocusedElement = trapContainer.contains(\n document.activeElement\n )\n ? lastFocusBeforeTrapped\n : document.activeElement\n lastFocusBeforeTrapped = prevFocusedElement as HTMLElement | null\n const isPrevFocusContained = trapContainer.contains(prevFocusedElement)\n if (!isPrevFocusContained) {\n const focusEvent = new Event(\n FOCUS_AFTER_TRAPPED,\n FOCUS_AFTER_TRAPPED_OPTS\n )\n trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus)\n trapContainer.dispatchEvent(focusEvent)\n if (!focusEvent.defaultPrevented) {\n nextTick(() => {\n let focusStartEl = props.focusStartEl\n if (!isString(focusStartEl)) {\n tryFocus(focusStartEl)\n if (document.activeElement !== focusStartEl) {\n focusStartEl = 'first'\n }\n }\n if (focusStartEl === 'first') {\n focusFirstDescendant(\n obtainAllFocusableElements(trapContainer),\n true\n )\n }\n if (\n document.activeElement === prevFocusedElement ||\n focusStartEl === 'container'\n ) {\n tryFocus(trapContainer)\n }\n })\n }\n }\n }\n }\n\n function stopTrap() {\n const trapContainer = unref(forwardRef)\n\n if (trapContainer) {\n trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus)\n\n const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {\n ...FOCUS_AFTER_TRAPPED_OPTS,\n detail: {\n focusReason: focusReason.value,\n },\n })\n trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus)\n trapContainer.dispatchEvent(releasedEvent)\n\n if (\n !releasedEvent.defaultPrevented &&\n (focusReason.value == 'keyboard' || !isFocusCausedByUserEvent())\n ) {\n tryFocus(lastFocusBeforeTrapped ?? document.body)\n }\n\n trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, trapOnFocus)\n focusableStack.remove(focusLayer)\n }\n }\n\n onMounted(() => {\n if (props.trapped) {\n startTrap()\n }\n\n watch(\n () => props.trapped,\n (trapped) => {\n if (trapped) {\n startTrap()\n } else {\n stopTrap()\n }\n }\n )\n })\n\n onBeforeUnmount(() => {\n if (props.trapped) {\n stopTrap()\n }\n })\n\n return {\n onKeydown,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ON_TRAP_FOCUS_EVT","ON_RELEASE_FOCUS_EVT","ref","useFocusReason","useEscapeKeydown","EVENT_CODE","getEdges","createFocusOutPreventedEvent","tryFocus","provide","FOCUS_TRAP_INJECTION_KEY","watch","unref","isNil","nextTick","focusableStack","FOCUS_AFTER_TRAPPED","FOCUS_AFTER_TRAPPED_OPTS","isString","focusFirstDescendant","obtainAllFocusableElements","FOCUS_AFTER_RELEASED","isFocusCausedByUserEvent","onMounted","onBeforeUnmount","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;AAwCA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,aAAA;AAAA,EACN,YAAc,EAAA,KAAA;AAAA,EACd,KAAO,EAAA;AAAA,IACL,IAAM,EAAA,OAAA;AAAA,IACN,OAAS,EAAA,OAAA;AAAA,IACT,WAAa,EAAA,MAAA;AAAA,IACb,YAAc,EAAA;AAAA,MACZ,IAAA,EAAM,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,MACrB,OAAS,EAAA,OAAA;AAAA,KACX;AAAA,GACF;AAAA,EACA,KAAO,EAAA;AAAA,IACLC,wBAAA;AAAA,IACAC,2BAAA;AAAA,IACA,SAAA;AAAA,IACA,UAAA;AAAA,IACA,oBAAA;AAAA,IACA,mBAAA;AAAA,GACF;AAAA,EACA,KAAA,CAAM,KAAO,EAAA,EAAE,IAAQ,EAAA,EAAA;AACrB,IAAA,MAAM,aAAaC,OAA6B,EAAA,CAAA;AAChD,IAAI,IAAA,sBAAA,CAAA;AACJ,IAAI,IAAA,qBAAA,CAAA;AAEJ,IAAM,MAAA,EAAE,gBAAgBC,oBAAe,EAAA,CAAA;AAEvC,IAAAC,sBAAA,CAAiB,CAAC,KAAU,KAAA;AAC1B,MAAA,IAAI,KAAM,CAAA,OAAA,IAAW,CAAC,UAAA,CAAW,MAAQ,EAAA;AACvC,QAAA,I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AA,mBAAA,CAAoBa,6BAAsB,WAAW,CAAA,CAAA;AACnE,QAAAN,oBAAA,CAAe,OAAO,UAAU,CAAA,CAAA;AAAA,OAClC;AAAA,KACF;AAEA,IAAAQ,aAAA,CAAU,MAAM;AACd,MAAA,IAAI,MAAM,OAAS,EAAA;AACjB,QAAU,SAAA,EAAA,CAAA;AAAA,OACZ;AAEA,MAAAZ,SAAA,CACE,MAAM,KAAA,CAAM,OACZ,EAAA,CAAC,OAAY,KAAA;AACX,QAAA,IAAI,OAAS,EAAA;AACX,UAAU,SAAA,EAAA,CAAA;AAAA,SACL,MAAA;AACL,UAAS,QAAA,EAAA,CAAA;AAAA,SACX;AAAA,OAEJ,CAAA,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAAa,mBAAA,CAAgB,MAAM;AACpB,MAAA,IAAI,MAAM,OAAS,EAAA;AACjB,QAAS,QAAA,EAAA,CAAA;AAAA,OACX;AAAA,KACD,CAAA,CAAA;AAED,IAAO,OAAA;AAAA,MACL,SAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;SArUCC,cAAoC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAA7B,eAAgB,IAAS,CAAA,SAAA,EAAA,CAAA,CAAA;;;;;;"}
|
|
1
|
+
{"version":3,"file":"focus-trap.js","sources":["../../../../../../packages/components/focus-trap/src/focus-trap.vue"],"sourcesContent":["<template>\n <slot :handle-keydown=\"onKeydown\" />\n</template>\n<script lang=\"ts\">\nimport {\n defineComponent,\n nextTick,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n unref,\n watch,\n} from 'vue'\nimport { isNil } from 'lodash-unified'\nimport { EVENT_CODE } from '@element-plus/constants'\nimport { useEscapeKeydown } from '@element-plus/hooks'\nimport { isString } from '@element-plus/utils'\nimport {\n createFocusOutPreventedEvent,\n focusFirstDescendant,\n focusableStack,\n getEdges,\n isFocusCausedByUserEvent,\n obtainAllFocusableElements,\n tryFocus,\n useFocusReason,\n} from './utils'\nimport {\n FOCUS_AFTER_RELEASED,\n FOCUS_AFTER_TRAPPED,\n FOCUS_AFTER_TRAPPED_OPTS,\n FOCUS_TRAP_INJECTION_KEY,\n ON_RELEASE_FOCUS_EVT,\n ON_TRAP_FOCUS_EVT,\n} from './tokens'\n\nimport type { PropType } from 'vue'\nimport type { FocusLayer } from './utils'\n\nexport default defineComponent({\n name: 'ElFocusTrap',\n inheritAttrs: false,\n props: {\n loop: Boolean,\n trapped: Boolean,\n focusTrapEl: Object as PropType<HTMLElement>,\n focusStartEl: {\n type: [Object, String] as PropType<'container' | 'first' | HTMLElement>,\n default: 'first',\n },\n },\n emits: [\n ON_TRAP_FOCUS_EVT,\n ON_RELEASE_FOCUS_EVT,\n 'focusin',\n 'focusout',\n 'focusout-prevented',\n 'release-requested',\n ],\n setup(props, { emit }) {\n const forwardRef = ref<HTMLElement | undefined>()\n let lastFocusBeforeTrapped: HTMLElement | null\n let lastFocusAfterTrapped: HTMLElement | null\n\n const { focusReason } = useFocusReason()\n\n useEscapeKeydown((event) => {\n if (props.trapped && !focusLayer.paused) {\n emit('release-requested', event)\n }\n })\n\n const focusLayer: FocusLayer = {\n paused: false,\n pause() {\n this.paused = true\n },\n resume() {\n this.paused = false\n },\n }\n\n const onKeydown = (e: KeyboardEvent) => {\n if (!props.loop && !props.trapped) return\n if (focusLayer.paused) return\n\n const { key, altKey, ctrlKey, metaKey, currentTarget, shiftKey } = e\n const { loop } = props\n const isTabbing =\n key === EVENT_CODE.tab && !altKey && !ctrlKey && !metaKey\n\n const currentFocusingEl = document.activeElement\n if (isTabbing && currentFocusingEl) {\n const container = currentTarget as HTMLElement\n const [first, last] = getEdges(container)\n const isTabbable = first && last\n if (!isTabbable) {\n if (currentFocusingEl === container) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n e.preventDefault()\n }\n }\n } else {\n if (!shiftKey && currentFocusingEl === last) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n e.preventDefault()\n if (loop) tryFocus(first, true)\n }\n } else if (\n shiftKey &&\n [first, container].includes(currentFocusingEl as HTMLElement)\n ) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n e.preventDefault()\n if (loop) tryFocus(last, true)\n }\n }\n }\n }\n }\n\n provide(FOCUS_TRAP_INJECTION_KEY, {\n focusTrapRef: forwardRef,\n onKeydown,\n })\n\n watch(\n () => props.focusTrapEl,\n (focusTrapEl) => {\n if (focusTrapEl) {\n forwardRef.value = focusTrapEl\n }\n },\n { immediate: true }\n )\n\n watch([forwardRef], ([forwardRef], [oldForwardRef]) => {\n if (forwardRef) {\n forwardRef.addEventListener('keydown', onKeydown)\n forwardRef.addEventListener('focusin', onFocusIn)\n forwardRef.addEventListener('focusout', onFocusOut)\n }\n if (oldForwardRef) {\n oldForwardRef.removeEventListener('keydown', onKeydown)\n oldForwardRef.removeEventListener('focusin', onFocusIn)\n oldForwardRef.removeEventListener('focusout', onFocusOut)\n }\n })\n\n const trapOnFocus = (e: Event) => {\n emit(ON_TRAP_FOCUS_EVT, e)\n }\n const releaseOnFocus = (e: Event) => emit(ON_RELEASE_FOCUS_EVT, e)\n\n const onFocusIn = (e: FocusEvent) => {\n const trapContainer = unref(forwardRef)\n if (!trapContainer) return\n\n const target = e.target as HTMLElement | null\n const relatedTarget = e.relatedTarget as HTMLElement | null\n const isFocusedInTrap = target && trapContainer.contains(target)\n\n if (!props.trapped) {\n const isPrevFocusedInTrap =\n relatedTarget && trapContainer.contains(relatedTarget)\n if (!isPrevFocusedInTrap) {\n lastFocusBeforeTrapped = relatedTarget\n }\n }\n\n if (isFocusedInTrap) emit('focusin', e)\n\n if (focusLayer.paused) return\n\n if (props.trapped) {\n if (isFocusedInTrap) {\n lastFocusAfterTrapped = target\n } else {\n tryFocus(lastFocusAfterTrapped, true)\n }\n }\n }\n\n const onFocusOut = (e: Event) => {\n const trapContainer = unref(forwardRef)\n if (focusLayer.paused || !trapContainer) return\n\n if (props.trapped) {\n const relatedTarget = (e as FocusEvent)\n .relatedTarget as HTMLElement | null\n if (!isNil(relatedTarget) && !trapContainer.contains(relatedTarget)) {\n // Give embedded focus layer time to pause this layer before reclaiming focus\n // And only reclaim focus if it should currently be trapping\n setTimeout(() => {\n if (!focusLayer.paused && props.trapped) {\n const focusoutPreventedEvent = createFocusOutPreventedEvent({\n focusReason: focusReason.value,\n })\n emit('focusout-prevented', focusoutPreventedEvent)\n if (!focusoutPreventedEvent.defaultPrevented) {\n tryFocus(lastFocusAfterTrapped, true)\n }\n }\n }, 0)\n }\n } else {\n const target = e.target as HTMLElement | null\n const isFocusedInTrap = target && trapContainer.contains(target)\n if (!isFocusedInTrap) emit('focusout', e)\n }\n }\n\n async function startTrap() {\n // Wait for forwardRef to resolve\n await nextTick()\n const trapContainer = unref(forwardRef)\n if (trapContainer) {\n focusableStack.push(focusLayer)\n const prevFocusedElement = trapContainer.contains(\n document.activeElement\n )\n ? lastFocusBeforeTrapped\n : document.activeElement\n lastFocusBeforeTrapped = prevFocusedElement as HTMLElement | null\n const isPrevFocusContained = trapContainer.contains(prevFocusedElement)\n if (!isPrevFocusContained) {\n const focusEvent = new Event(\n FOCUS_AFTER_TRAPPED,\n FOCUS_AFTER_TRAPPED_OPTS\n )\n trapContainer.addEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus)\n trapContainer.dispatchEvent(focusEvent)\n if (!focusEvent.defaultPrevented) {\n nextTick(() => {\n let focusStartEl = props.focusStartEl\n if (!isString(focusStartEl)) {\n tryFocus(focusStartEl)\n if (document.activeElement !== focusStartEl) {\n focusStartEl = 'first'\n }\n }\n if (focusStartEl === 'first') {\n focusFirstDescendant(\n obtainAllFocusableElements(trapContainer),\n true\n )\n }\n if (\n document.activeElement === prevFocusedElement ||\n focusStartEl === 'container'\n ) {\n tryFocus(trapContainer)\n }\n })\n }\n }\n }\n }\n\n function stopTrap() {\n const trapContainer = unref(forwardRef)\n\n if (trapContainer) {\n trapContainer.removeEventListener(FOCUS_AFTER_TRAPPED, trapOnFocus)\n\n const releasedEvent = new CustomEvent(FOCUS_AFTER_RELEASED, {\n ...FOCUS_AFTER_TRAPPED_OPTS,\n detail: {\n focusReason: focusReason.value,\n },\n })\n trapContainer.addEventListener(FOCUS_AFTER_RELEASED, releaseOnFocus)\n trapContainer.dispatchEvent(releasedEvent)\n if (\n !releasedEvent.defaultPrevented &&\n (focusReason.value == 'keyboard' ||\n !isFocusCausedByUserEvent() ||\n trapContainer.contains(document.activeElement))\n ) {\n tryFocus(lastFocusBeforeTrapped ?? document.body)\n }\n\n trapContainer.removeEventListener(FOCUS_AFTER_RELEASED, trapOnFocus)\n focusableStack.remove(focusLayer)\n }\n }\n\n onMounted(() => {\n if (props.trapped) {\n startTrap()\n }\n\n watch(\n () => props.trapped,\n (trapped) => {\n if (trapped) {\n startTrap()\n } else {\n stopTrap()\n }\n }\n )\n })\n\n onBeforeUnmount(() => {\n if (props.trapped) {\n stopTrap()\n }\n })\n\n return {\n onKeydown,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ON_TRAP_FOCUS_EVT","ON_RELEASE_FOCUS_EVT","ref","useFocusReason","useEscapeKeydown","EVENT_CODE","getEdges","createFocusOutPreventedEvent","tryFocus","provide","FOCUS_TRAP_INJECTION_KEY","watch","unref","isNil","nextTick","focusableStack","FOCUS_AFTER_TRAPPED","FOCUS_AFTER_TRAPPED_OPTS","isString","focusFirstDescendant","obtainAllFocusableElements","FOCUS_AFTER_RELEASED","isFocusCausedByUserEvent","onMounted","onBeforeUnmount","_renderSlot"],"mappings":";;;;;;;;;;;;;;;;AAwCA,MAAK,YAAaA,mB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,CAAA;AAAA,SACL,MAAA;AACL,UAAS,QAAA,EAAA,CAAA;AAAA,SACX;AAAA,OAEJ,CAAA,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAAa,mBAAA,CAAgB,MAAM;AACpB,MAAA,IAAI,MAAM,OAAS,EAAA;AACjB,QAAS,QAAA,EAAA,CAAA;AAAA,OACX;AAAA,KACD,CAAA,CAAA;AAED,IAAO,OAAA;AAAA,MACL,SAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;SAtUCC,cAAoC,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,EAAA,EAA7B,eAAgB,IAAS,CAAA,SAAA,EAAA,CAAA,CAAA;;;;;;"}
|
|
@@ -323,7 +323,7 @@ declare const _Tree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
323
323
|
getCurrentNode: () => import("./src/tree.type").TreeNodeData;
|
|
324
324
|
getCurrentKey: () => any;
|
|
325
325
|
setCheckedNodes: (nodes: import("./src/model/node").default[], leafOnly?: boolean | undefined) => void;
|
|
326
|
-
setCheckedKeys: (keys:
|
|
326
|
+
setCheckedKeys: (keys: import("./src/tree.type").TreeKey[], leafOnly?: boolean | undefined) => void;
|
|
327
327
|
setChecked: (data: import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeKey, checked: boolean, deep: boolean) => void;
|
|
328
328
|
getHalfCheckedNodes: () => import("./src/tree.type").TreeNodeData[];
|
|
329
329
|
getHalfCheckedKeys: () => import("./src/tree.type").TreeKey[];
|
|
@@ -758,7 +758,7 @@ export declare const ElTree: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
758
758
|
getCurrentNode: () => import("./src/tree.type").TreeNodeData;
|
|
759
759
|
getCurrentKey: () => any;
|
|
760
760
|
setCheckedNodes: (nodes: import("./src/model/node").default[], leafOnly?: boolean | undefined) => void;
|
|
761
|
-
setCheckedKeys: (keys:
|
|
761
|
+
setCheckedKeys: (keys: import("./src/tree.type").TreeKey[], leafOnly?: boolean | undefined) => void;
|
|
762
762
|
setChecked: (data: import("./src/tree.type").TreeNodeData | import("./src/tree.type").TreeKey, checked: boolean, deep: boolean) => void;
|
|
763
763
|
getHalfCheckedNodes: () => import("./src/tree.type").TreeNodeData[];
|
|
764
764
|
getHalfCheckedKeys: () => import("./src/tree.type").TreeKey[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tree.js","sources":["../../../../../../packages/components/tree/src/tree.vue"],"sourcesContent":["<template>\n <div\n ref=\"el$\"\n :class=\"[\n ns.b(),\n ns.is('dragging', !!dragState.draggingNode),\n ns.is('drop-not-allow', !dragState.allowDrop),\n ns.is('drop-inner', dragState.dropType === 'inner'),\n { [ns.m('highlight-current')]: highlightCurrent },\n ]\"\n role=\"tree\"\n >\n <el-tree-node\n v-for=\"child in root.childNodes\"\n :key=\"getNodeKey(child)\"\n :node=\"child\"\n :props=\"props\"\n :accordion=\"accordion\"\n :render-after-expand=\"renderAfterExpand\"\n :show-checkbox=\"showCheckbox\"\n :render-content=\"renderContent\"\n @node-expand=\"handleNodeExpand\"\n />\n <div v-if=\"isEmpty\" :class=\"ns.e('empty-block')\">\n <span :class=\"ns.e('empty-text')\">{{\n emptyText ?? t('el.tree.emptyText')\n }}</span>\n </div>\n <div\n v-show=\"dragState.showDropIndicator\"\n ref=\"dropIndicator$\"\n :class=\"ns.e('drop-indicator')\"\n />\n </div>\n</template>\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n provide,\n ref,\n watch,\n} from 'vue'\nimport { iconPropType } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { formItemContextKey } from '@element-plus/tokens'\nimport TreeStore from './model/tree-store'\nimport { getNodeKey as getNodeKeyUtil, handleCurrentChange } from './model/util'\nimport ElTreeNode from './tree-node.vue'\nimport { useNodeExpandEventBroadcast } from './model/useNodeExpandEventBroadcast'\nimport { useDragNodeHandler } from './model/useDragNode'\nimport { useKeydown } from './model/useKeydown'\nimport type Node from './model/node'\n\nimport type { ComponentInternalInstance, PropType } from 'vue'\nimport type { Nullable } from '@element-plus/utils'\nimport type {\n TreeComponentProps,\n TreeData,\n TreeKey,\n TreeNodeData,\n} from './tree.type'\n\nexport default defineComponent({\n name: 'ElTree',\n components: { ElTreeNode },\n props: {\n data: {\n type: Array,\n default: () => [],\n },\n emptyText: {\n type: String,\n },\n renderAfterExpand: {\n type: Boolean,\n default: true,\n },\n nodeKey: String,\n checkStrictly: Boolean,\n defaultExpandAll: Boolean,\n expandOnClickNode: {\n type: Boolean,\n default: true,\n },\n checkOnClickNode: Boolean,\n checkDescendants: {\n type: Boolean,\n default: false,\n },\n autoExpandParent: {\n type: Boolean,\n default: true,\n },\n defaultCheckedKeys: Array as PropType<\n TreeComponentProps['defaultCheckedKeys']\n >,\n defaultExpandedKeys: Array as PropType<\n TreeComponentProps['defaultExpandedKeys']\n >,\n currentNodeKey: [String, Number] as PropType<string | number>,\n renderContent: Function,\n showCheckbox: {\n type: Boolean,\n default: false,\n },\n draggable: {\n type: Boolean,\n default: false,\n },\n allowDrag: Function,\n allowDrop: Function,\n props: {\n type: Object as PropType<TreeComponentProps['props']>,\n default: () => ({\n children: 'children',\n label: 'label',\n disabled: 'disabled',\n }),\n },\n lazy: {\n type: Boolean,\n default: false,\n },\n highlightCurrent: Boolean,\n load: Function as PropType<TreeComponentProps['load']>,\n filterNodeMethod: Function as PropType<\n TreeComponentProps['filterNodeMethod']\n >,\n accordion: Boolean,\n indent: {\n type: Number,\n default: 18,\n },\n icon: {\n type: iconPropType,\n },\n },\n emits: [\n 'check-change',\n 'current-change',\n 'node-click',\n 'node-contextmenu',\n 'node-collapse',\n 'node-expand',\n 'check',\n 'node-drag-start',\n 'node-drag-end',\n 'node-drop',\n 'node-drag-leave',\n 'node-drag-enter',\n 'node-drag-over',\n ],\n setup(props, ctx) {\n const { t } = useLocale()\n const ns = useNamespace('tree')\n\n const store = ref<TreeStore>(\n new TreeStore({\n key: props.nodeKey,\n data: props.data,\n lazy: props.lazy,\n props: props.props,\n load: props.load,\n currentNodeKey: props.currentNodeKey,\n checkStrictly: props.checkStrictly,\n checkDescendants: props.checkDescendants,\n defaultCheckedKeys: props.defaultCheckedKeys,\n defaultExpandedKeys: props.defaultExpandedKeys,\n autoExpandParent: props.autoExpandParent,\n defaultExpandAll: props.defaultExpandAll,\n filterNodeMethod: props.filterNodeMethod,\n })\n )\n\n store.value.initialize()\n\n const root = ref<Node>(store.value.root)\n const currentNode = ref<Node>(null)\n const el$ = ref<Nullable<HTMLElement>>(null)\n const dropIndicator$ = ref<Nullable<HTMLElement>>(null)\n\n const { broadcastExpanded } = useNodeExpandEventBroadcast(props)\n\n const { dragState } = useDragNodeHandler({\n props,\n ctx,\n el$,\n dropIndicator$,\n store,\n })\n\n useKeydown({ el$ }, store)\n\n const isEmpty = computed(() => {\n const { childNodes } = root.value\n return (\n !childNodes ||\n childNodes.length === 0 ||\n childNodes.every(({ visible }) => !visible)\n )\n })\n\n watch(\n () => props.currentNodeKey,\n (newVal) => {\n store.value.setCurrentNodeKey(newVal)\n }\n )\n\n watch(\n () => props.defaultCheckedKeys,\n (newVal) => {\n store.value.setDefaultCheckedKey(newVal)\n }\n )\n\n watch(\n () => props.defaultExpandedKeys,\n (newVal) => {\n store.value.setDefaultExpandedKeys(newVal)\n }\n )\n\n watch(\n () => props.data,\n (newVal) => {\n store.value.setData(newVal)\n },\n { deep: true }\n )\n\n watch(\n () => props.checkStrictly,\n (newVal) => {\n store.value.checkStrictly = newVal\n }\n )\n\n const filter = (value) => {\n if (!props.filterNodeMethod)\n throw new Error('[Tree] filterNodeMethod is required when filter')\n store.value.filter(value)\n }\n\n const getNodeKey = (node: Node) => {\n return getNodeKeyUtil(props.nodeKey, node.data)\n }\n\n const getNodePath = (data: TreeKey | TreeNodeData) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in getNodePath')\n const node = store.value.getNode(data)\n if (!node) return []\n const path = [node.data]\n let parent = node.parent\n while (parent && parent !== root.value) {\n path.push(parent.data)\n parent = parent.parent\n }\n return path.reverse()\n }\n\n const getCheckedNodes = (\n leafOnly?: boolean,\n includeHalfChecked?: boolean\n ): TreeNodeData[] => {\n return store.value.getCheckedNodes(leafOnly, includeHalfChecked)\n }\n\n const getCheckedKeys = (leafOnly?: boolean): TreeKey[] => {\n return store.value.getCheckedKeys(leafOnly)\n }\n\n const getCurrentNode = (): TreeNodeData => {\n const currentNode = store.value.getCurrentNode()\n return currentNode ? currentNode.data : null\n }\n\n const getCurrentKey = (): any => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in getCurrentKey')\n const currentNode = getCurrentNode()\n return currentNode ? currentNode[props.nodeKey] : null\n }\n\n const setCheckedNodes = (nodes: Node[], leafOnly?: boolean) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCheckedNodes')\n store.value.setCheckedNodes(nodes, leafOnly)\n }\n\n const setCheckedKeys = (keys, leafOnly?: boolean) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCheckedKeys')\n store.value.setCheckedKeys(keys, leafOnly)\n }\n\n const setChecked = (\n data: TreeKey | TreeNodeData,\n checked: boolean,\n deep: boolean\n ) => {\n store.value.setChecked(data, checked, deep)\n }\n\n const getHalfCheckedNodes = (): TreeNodeData[] => {\n return store.value.getHalfCheckedNodes()\n }\n\n const getHalfCheckedKeys = (): TreeKey[] => {\n return store.value.getHalfCheckedKeys()\n }\n\n const setCurrentNode = (node: Node, shouldAutoExpandParent = true) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCurrentNode')\n\n handleCurrentChange(store, ctx.emit, () =>\n store.value.setUserCurrentNode(node, shouldAutoExpandParent)\n )\n }\n\n const setCurrentKey = (key?: TreeKey, shouldAutoExpandParent = true) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCurrentKey')\n\n handleCurrentChange(store, ctx.emit, () =>\n store.value.setCurrentNodeKey(key, shouldAutoExpandParent)\n )\n }\n\n const getNode = (data: TreeKey | TreeNodeData): Node => {\n return store.value.getNode(data)\n }\n\n const remove = (data: TreeNodeData | Node) => {\n store.value.remove(data)\n }\n\n const append = (\n data: TreeNodeData,\n parentNode: TreeNodeData | TreeKey | Node\n ) => {\n store.value.append(data, parentNode)\n }\n\n const insertBefore = (\n data: TreeNodeData,\n refNode: TreeKey | TreeNodeData | Node\n ) => {\n store.value.insertBefore(data, refNode)\n }\n\n const insertAfter = (\n data: TreeNodeData,\n refNode: TreeKey | TreeNodeData | Node\n ) => {\n store.value.insertAfter(data, refNode)\n }\n\n const handleNodeExpand = (\n nodeData: TreeNodeData,\n node: Node,\n instance: ComponentInternalInstance\n ) => {\n broadcastExpanded(node)\n ctx.emit('node-expand', nodeData, node, instance)\n }\n\n const updateKeyChildren = (key: TreeKey, data: TreeData) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in updateKeyChild')\n store.value.updateChildren(key, data)\n }\n\n provide('RootTree', {\n ctx,\n props,\n store,\n root,\n currentNode,\n instance: getCurrentInstance(),\n } as any)\n\n provide(formItemContextKey, undefined)\n\n return {\n ns,\n // ref\n store,\n root,\n currentNode,\n dragState,\n el$,\n dropIndicator$,\n\n // computed\n isEmpty,\n\n // methods\n filter,\n getNodeKey,\n getNodePath,\n getCheckedNodes,\n getCheckedKeys,\n getCurrentNode,\n getCurrentKey,\n setCheckedNodes,\n setCheckedKeys,\n setChecked,\n getHalfCheckedNodes,\n getHalfCheckedKeys,\n setCurrentNode,\n setCurrentKey,\n t,\n getNode,\n remove,\n append,\n insertBefore,\n insertAfter,\n handleNodeExpand,\n updateKeyChildren,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElTreeNode","iconPropType","useLocale","useNamespace","ref","TreeStore","useNodeExpandEventBroadcast","useDragNodeHandler","useKeydown","computed","watch","getNodeKeyUtil","handleCurrentChange","provide","getCurrentInstance","formItemContextKey","_resolveComponent","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createElementVNode","_toDisplayString","_withDirectives","_vShow"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiEA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,QAAA;AAAA,EACN,UAAA,EAAY,cAAEC,mBAAW,EAAA;AAAA,EACzB,KAAO,EAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,IAAM,EAAA,KAAA;AAAA,MACN,OAAA,EAAS,MAAM,EAAC;AAAA,KAClB;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MAAA;AAAA,KACR;AAAA,IACA,iBAAmB,EAAA;AAAA,MACjB,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,IAAA;AAAA,KACX;AAAA,IACA,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,OAAA;AAAA,IACf,gBAAkB,EAAA,OAAA;AAAA,IAClB,iBAAmB,EAAA;AAAA,MACjB,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,IAAA;AAAA,KACX;AAAA,IACA,gBAAkB,EAAA,OAAA;AAAA,IAClB,gBAAkB,EAAA;AAAA,MAChB,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,IACA,gBAAkB,EAAA;AAAA,MAChB,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,IAAA;AAAA,KACX;AAAA,IACA,kBAAoB,EAAA,KAAA;AAAA,IAGpB,mBAAqB,EAAA,KAAA;AAAA,IAGrB,cAAA,EAAgB,CAAC,MAAA,EAAQ,MAAM,CAAA;AAAA,IAC/B,aAAe,EAAA,QAAA;AAAA,IACf,YAAc,EAAA;AAAA,MACZ,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,KAAA;AAAA,KACX;AAAA,IACA,S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EAAA,IAAA,CAAA,gBAAA;;AAEL,KAAA,CAAA,EAAA,GAAA,CAAA;AAIL,IAAA,IAAA,CAAA,OAAA,IAAAA,aAAA,EAAA,EAAAC,sBAAA,CAAA,KAAA,EAAA;MAJe,GAAK,EAAA,CAAA;AAAM,MAAA,KAAA,EAAAG,kBAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,aAAA,CAAA,CAAA;OAGrB;AAAA,MAFFC,sBAAO,CAAA,MAAA,EAAA;AAAI,QAAA,KAAA,EAAAD,yCACF,CAAA,CAAA;AAAA,OAAA,EAAAE,mBAAA,CAAA,CAAA,EAAA,GAAA,IAAA,CAAA,SAAA,KAAA,IAAA,GAAA,EAAA,GAAA,IAAA,CAAA,CAAA,CAAA,mBAAA,CAAA,CAAA,EAAA,CAAA,CAAA;mCAOhB,CAAA,MAAA,EAAA,IAAA,CAAA;AAAA,IAAAC,kBAFI,CAAAF,sBAAA,CAAA,KAAA,EAAA;AAAA,MACH,GAAA,EAAA,gBAAO;AAAI,MAAA,KAAA,EAAAD,kBAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,gBAAA,CAAA,CAAA;AAFJ,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA;AAA2B,MAAA,CAAAI,SAAA,EAAA,IAAA,CAAA,SAAA,CAAA,iBAAA,CAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"tree.js","sources":["../../../../../../packages/components/tree/src/tree.vue"],"sourcesContent":["<template>\n <div\n ref=\"el$\"\n :class=\"[\n ns.b(),\n ns.is('dragging', !!dragState.draggingNode),\n ns.is('drop-not-allow', !dragState.allowDrop),\n ns.is('drop-inner', dragState.dropType === 'inner'),\n { [ns.m('highlight-current')]: highlightCurrent },\n ]\"\n role=\"tree\"\n >\n <el-tree-node\n v-for=\"child in root.childNodes\"\n :key=\"getNodeKey(child)\"\n :node=\"child\"\n :props=\"props\"\n :accordion=\"accordion\"\n :render-after-expand=\"renderAfterExpand\"\n :show-checkbox=\"showCheckbox\"\n :render-content=\"renderContent\"\n @node-expand=\"handleNodeExpand\"\n />\n <div v-if=\"isEmpty\" :class=\"ns.e('empty-block')\">\n <span :class=\"ns.e('empty-text')\">{{\n emptyText ?? t('el.tree.emptyText')\n }}</span>\n </div>\n <div\n v-show=\"dragState.showDropIndicator\"\n ref=\"dropIndicator$\"\n :class=\"ns.e('drop-indicator')\"\n />\n </div>\n</template>\n<script lang=\"ts\">\n// @ts-nocheck\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n provide,\n ref,\n watch,\n} from 'vue'\nimport { iconPropType } from '@element-plus/utils'\nimport { useLocale, useNamespace } from '@element-plus/hooks'\nimport { formItemContextKey } from '@element-plus/tokens'\nimport TreeStore from './model/tree-store'\nimport { getNodeKey as getNodeKeyUtil, handleCurrentChange } from './model/util'\nimport ElTreeNode from './tree-node.vue'\nimport { useNodeExpandEventBroadcast } from './model/useNodeExpandEventBroadcast'\nimport { useDragNodeHandler } from './model/useDragNode'\nimport { useKeydown } from './model/useKeydown'\nimport type Node from './model/node'\n\nimport type { ComponentInternalInstance, PropType } from 'vue'\nimport type { Nullable } from '@element-plus/utils'\nimport type {\n TreeComponentProps,\n TreeData,\n TreeKey,\n TreeNodeData,\n} from './tree.type'\n\nexport default defineComponent({\n name: 'ElTree',\n components: { ElTreeNode },\n props: {\n data: {\n type: Array,\n default: () => [],\n },\n emptyText: {\n type: String,\n },\n renderAfterExpand: {\n type: Boolean,\n default: true,\n },\n nodeKey: String,\n checkStrictly: Boolean,\n defaultExpandAll: Boolean,\n expandOnClickNode: {\n type: Boolean,\n default: true,\n },\n checkOnClickNode: Boolean,\n checkDescendants: {\n type: Boolean,\n default: false,\n },\n autoExpandParent: {\n type: Boolean,\n default: true,\n },\n defaultCheckedKeys: Array as PropType<\n TreeComponentProps['defaultCheckedKeys']\n >,\n defaultExpandedKeys: Array as PropType<\n TreeComponentProps['defaultExpandedKeys']\n >,\n currentNodeKey: [String, Number] as PropType<string | number>,\n renderContent: Function,\n showCheckbox: {\n type: Boolean,\n default: false,\n },\n draggable: {\n type: Boolean,\n default: false,\n },\n allowDrag: Function,\n allowDrop: Function,\n props: {\n type: Object as PropType<TreeComponentProps['props']>,\n default: () => ({\n children: 'children',\n label: 'label',\n disabled: 'disabled',\n }),\n },\n lazy: {\n type: Boolean,\n default: false,\n },\n highlightCurrent: Boolean,\n load: Function as PropType<TreeComponentProps['load']>,\n filterNodeMethod: Function as PropType<\n TreeComponentProps['filterNodeMethod']\n >,\n accordion: Boolean,\n indent: {\n type: Number,\n default: 18,\n },\n icon: {\n type: iconPropType,\n },\n },\n emits: [\n 'check-change',\n 'current-change',\n 'node-click',\n 'node-contextmenu',\n 'node-collapse',\n 'node-expand',\n 'check',\n 'node-drag-start',\n 'node-drag-end',\n 'node-drop',\n 'node-drag-leave',\n 'node-drag-enter',\n 'node-drag-over',\n ],\n setup(props, ctx) {\n const { t } = useLocale()\n const ns = useNamespace('tree')\n\n const store = ref<TreeStore>(\n new TreeStore({\n key: props.nodeKey,\n data: props.data,\n lazy: props.lazy,\n props: props.props,\n load: props.load,\n currentNodeKey: props.currentNodeKey,\n checkStrictly: props.checkStrictly,\n checkDescendants: props.checkDescendants,\n defaultCheckedKeys: props.defaultCheckedKeys,\n defaultExpandedKeys: props.defaultExpandedKeys,\n autoExpandParent: props.autoExpandParent,\n defaultExpandAll: props.defaultExpandAll,\n filterNodeMethod: props.filterNodeMethod,\n })\n )\n\n store.value.initialize()\n\n const root = ref<Node>(store.value.root)\n const currentNode = ref<Node>(null)\n const el$ = ref<Nullable<HTMLElement>>(null)\n const dropIndicator$ = ref<Nullable<HTMLElement>>(null)\n\n const { broadcastExpanded } = useNodeExpandEventBroadcast(props)\n\n const { dragState } = useDragNodeHandler({\n props,\n ctx,\n el$,\n dropIndicator$,\n store,\n })\n\n useKeydown({ el$ }, store)\n\n const isEmpty = computed(() => {\n const { childNodes } = root.value\n return (\n !childNodes ||\n childNodes.length === 0 ||\n childNodes.every(({ visible }) => !visible)\n )\n })\n\n watch(\n () => props.currentNodeKey,\n (newVal) => {\n store.value.setCurrentNodeKey(newVal)\n }\n )\n\n watch(\n () => props.defaultCheckedKeys,\n (newVal) => {\n store.value.setDefaultCheckedKey(newVal)\n }\n )\n\n watch(\n () => props.defaultExpandedKeys,\n (newVal) => {\n store.value.setDefaultExpandedKeys(newVal)\n }\n )\n\n watch(\n () => props.data,\n (newVal) => {\n store.value.setData(newVal)\n },\n { deep: true }\n )\n\n watch(\n () => props.checkStrictly,\n (newVal) => {\n store.value.checkStrictly = newVal\n }\n )\n\n const filter = (value) => {\n if (!props.filterNodeMethod)\n throw new Error('[Tree] filterNodeMethod is required when filter')\n store.value.filter(value)\n }\n\n const getNodeKey = (node: Node) => {\n return getNodeKeyUtil(props.nodeKey, node.data)\n }\n\n const getNodePath = (data: TreeKey | TreeNodeData) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in getNodePath')\n const node = store.value.getNode(data)\n if (!node) return []\n const path = [node.data]\n let parent = node.parent\n while (parent && parent !== root.value) {\n path.push(parent.data)\n parent = parent.parent\n }\n return path.reverse()\n }\n\n const getCheckedNodes = (\n leafOnly?: boolean,\n includeHalfChecked?: boolean\n ): TreeNodeData[] => {\n return store.value.getCheckedNodes(leafOnly, includeHalfChecked)\n }\n\n const getCheckedKeys = (leafOnly?: boolean): TreeKey[] => {\n return store.value.getCheckedKeys(leafOnly)\n }\n\n const getCurrentNode = (): TreeNodeData => {\n const currentNode = store.value.getCurrentNode()\n return currentNode ? currentNode.data : null\n }\n\n const getCurrentKey = (): any => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in getCurrentKey')\n const currentNode = getCurrentNode()\n return currentNode ? currentNode[props.nodeKey] : null\n }\n\n const setCheckedNodes = (nodes: Node[], leafOnly?: boolean) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCheckedNodes')\n store.value.setCheckedNodes(nodes, leafOnly)\n }\n\n const setCheckedKeys = (keys: TreeKey[], leafOnly?: boolean) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCheckedKeys')\n store.value.setCheckedKeys(keys, leafOnly)\n }\n\n const setChecked = (\n data: TreeKey | TreeNodeData,\n checked: boolean,\n deep: boolean\n ) => {\n store.value.setChecked(data, checked, deep)\n }\n\n const getHalfCheckedNodes = (): TreeNodeData[] => {\n return store.value.getHalfCheckedNodes()\n }\n\n const getHalfCheckedKeys = (): TreeKey[] => {\n return store.value.getHalfCheckedKeys()\n }\n\n const setCurrentNode = (node: Node, shouldAutoExpandParent = true) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCurrentNode')\n\n handleCurrentChange(store, ctx.emit, () =>\n store.value.setUserCurrentNode(node, shouldAutoExpandParent)\n )\n }\n\n const setCurrentKey = (key?: TreeKey, shouldAutoExpandParent = true) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in setCurrentKey')\n\n handleCurrentChange(store, ctx.emit, () =>\n store.value.setCurrentNodeKey(key, shouldAutoExpandParent)\n )\n }\n\n const getNode = (data: TreeKey | TreeNodeData): Node => {\n return store.value.getNode(data)\n }\n\n const remove = (data: TreeNodeData | Node) => {\n store.value.remove(data)\n }\n\n const append = (\n data: TreeNodeData,\n parentNode: TreeNodeData | TreeKey | Node\n ) => {\n store.value.append(data, parentNode)\n }\n\n const insertBefore = (\n data: TreeNodeData,\n refNode: TreeKey | TreeNodeData | Node\n ) => {\n store.value.insertBefore(data, refNode)\n }\n\n const insertAfter = (\n data: TreeNodeData,\n refNode: TreeKey | TreeNodeData | Node\n ) => {\n store.value.insertAfter(data, refNode)\n }\n\n const handleNodeExpand = (\n nodeData: TreeNodeData,\n node: Node,\n instance: ComponentInternalInstance\n ) => {\n broadcastExpanded(node)\n ctx.emit('node-expand', nodeData, node, instance)\n }\n\n const updateKeyChildren = (key: TreeKey, data: TreeData) => {\n if (!props.nodeKey)\n throw new Error('[Tree] nodeKey is required in updateKeyChild')\n store.value.updateChildren(key, data)\n }\n\n provide('RootTree', {\n ctx,\n props,\n store,\n root,\n currentNode,\n instance: getCurrentInstance(),\n } as any)\n\n provide(formItemContextKey, undefined)\n\n return {\n ns,\n // ref\n store,\n root,\n currentNode,\n dragState,\n el$,\n dropIndicator$,\n\n // computed\n isEmpty,\n\n // methods\n filter,\n getNodeKey,\n getNodePath,\n getCheckedNodes,\n getCheckedKeys,\n getCurrentNode,\n getCurrentKey,\n setCheckedNodes,\n setCheckedKeys,\n setChecked,\n getHalfCheckedNodes,\n getHalfCheckedKeys,\n setCurrentNode,\n setCurrentKey,\n t,\n getNode,\n remove,\n append,\n insertBefore,\n insertAfter,\n handleNodeExpand,\n updateKeyChildren,\n }\n },\n})\n</script>\n"],"names":["defineComponent","ElTreeNode","iconPropType","useLocale","useNamespace","ref","TreeStore","useNodeExpandEventBroadcast","useDragNodeHandler","useKeydown","computed","watch","getNodeKeyUtil","handleCurrentChange","provide","getCurrentInstance","formItemContextKey","_resolveComponent","_openBlock","_createElementBlock","_Fragment","_renderList","_normalizeClass","_createElementVNode","_toDisplayString","_withDirectives","_vShow"],"mappings":";;;;;;;;;;;;;;;;;;;;AAiEA,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,QAAA;AAAA,EACN,UAAA,EAAY,cAAEC,mBAAW,EAAA;AAAA,EACzB,KAAO,EAAA;AAAA,IACL,IAAM,EAAA;AAAA,MACJ,IAAM,EAAA,KAAA;AAAA,MACN,OAAA,EAAS,MAAM,EAAC;AAAA,KAClB;AAAA,IACA,SAAW,EAAA;AAAA,MACT,IAAM,EAAA,MAAA;AAAA,KACR;AAAA,IACA,iBAAmB,EAAA;AAAA,MACjB,IAAM,EAAA,OAAA;AAAA,MACN,OAAS,EAAA,IAAA;AAAA,KACX;AAAA,IACA,OAAS,EAAA,MAAA;AAAA,IACT,aAAe,EAAA,OAAA;AAAA,IACf,gBAAkB,EAAA,OAAA;AAAA,IAClB,iBAAmB,EAAA;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A,KAAA,EAAA;AAAA,MACH,GAAA,EAAA,gBAAO;AAAI,MAAA,KAAA,EAAAD,kBAAA,CAAA,IAAA,CAAA,EAAA,CAAA,CAAA,CAAA,gBAAA,CAAA,CAAA;AAFJ,KAAA,EAAA,IAAA,EAAA,CAAA,CAAA,EAAA;AAA2B,MAAA,CAAAI,SAAA,EAAA,IAAA,CAAA,SAAA,CAAA,iBAAA,CAAA;;;;;;;;"}
|
|
@@ -326,7 +326,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
326
326
|
getCurrentNode: () => TreeNodeData;
|
|
327
327
|
getCurrentKey: () => any;
|
|
328
328
|
setCheckedNodes: (nodes: Node[], leafOnly?: boolean | undefined) => void;
|
|
329
|
-
setCheckedKeys: (keys:
|
|
329
|
+
setCheckedKeys: (keys: TreeKey[], leafOnly?: boolean | undefined) => void;
|
|
330
330
|
setChecked: (data: TreeKey | TreeNodeData, checked: boolean, deep: boolean) => void;
|
|
331
331
|
getHalfCheckedNodes: () => TreeNodeData[];
|
|
332
332
|
getHalfCheckedKeys: () => TreeKey[];
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20230217";
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20230217'\n"],"names":[],"mappings":";;;;AAAY,MAAC,OAAO,GAAG;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@element-plus/nightly",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.20230217",
|
|
4
4
|
"description": "A Component Library for Vue 3",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"element-plus",
|
|
@@ -85,5 +85,5 @@
|
|
|
85
85
|
"not ie 11",
|
|
86
86
|
"not op_mini all"
|
|
87
87
|
],
|
|
88
|
-
"gitHead": "
|
|
88
|
+
"gitHead": "aebeabd984be02dd730aa15ae927d45398300885"
|
|
89
89
|
}
|
package/tags.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"el-affix":{"attributes":["offset","position","target","z-index","change","scroll"],"description":"Fix the element to a specific visible area.\n\n[Docs](https://element-plus.org/en-US/component/affix.html#affix)"},"el-alert":{"attributes":["title","type","description","closable","center","close-text","show-icon","effect","close"],"description":"Displays important alert messages.\n\n[Docs](https://element-plus.org/en-US/component/alert.html#alert)"},"el-autocomplete":{"attributes":["model-value","placeholder","clearable","disabled","value-key","debounce","placement","fetch-suggestions","trigger-on-focus","select-when-unmatched","name","label","hide-loading","popper-class","popper-append-to-body","teleported","highlight-first-item","fit-input-width","select","change"],"description":"Get some recommended tips based on the current input.\n\n[Docs](https://element-plus.org/en-US/component/autocomplete.html#autocomplete)"},"el-avatar":{"attributes":["icon","size","shape","src","src-set","alt","fit","error"],"description":"Avatars can be used to represent people or objects. It supports images, Icons, or characters.\n\n[Docs](https://element-plus.org/en-US/component/avatar.html#avatar)"},"el-backtop":{"attributes":["target","visibility-height","right","bottom","click"],"description":"A button to back to top.\n\n[Docs](https://element-plus.org/en-US/component/backtop.html#backtop)"},"el-badge":{"attributes":["value","max","is-dot","hidden","type"],"description":"A number or status mark on buttons and icons.\n\n[Docs](https://element-plus.org/en-US/component/badge.html#badge)"},"el-breadcrumb":{"attributes":["separator","separator-icon"],"subtags":["el-breadcrumb-item"],"description":"Displays the location of the current page, making it easier to browser back.\n\n[Docs](https://element-plus.org/en-US/component/breadcrumb.html#breadcrumb)"},"el-breadcrumb-item":{"attributes":["to","replace"],"description":"[Docs](https://element-plus.org/en-US/component/breadcrumb.html#breadcrumbitem)"},"el-button":{"attributes":["size","type","plain","text","bg","link","round","circle","loading","loading-icon","disabled","icon","autofocus","native-type","auto-insert-space","color","dark"],"description":"Commonly used button.\n\n[Docs](https://element-plus.org/en-US/component/button.html#button)"},"el-button-group":{"attributes":["size","type"],"subtags":["el-button"],"description":"[Docs](https://element-plus.org/en-US/component/button.html#buttongroup)"},"el-calendar":{"attributes":["model-value","range"],"description":"Display date.\n\n[Docs](https://element-plus.org/en-US/component/calendar.html#calendar)"},"el-card":{"attributes":["header","body-style","shadow"],"description":"Integrate information in a card container.\n\n[Docs](https://element-plus.org/en-US/component/card.html#card)"},"el-carousel":{"attributes":["height","initial-index","trigger","autoplay","interval","indicator-position","arrow","type","loop","direction","pause-on-hover","change"],"subtags":["el-carousel-item"],"description":"Loop a series of images or texts in a limited space\n\n[Docs](https://element-plus.org/en-US/component/carousel.html#carousel)"},"el-carousel-item":{"attributes":["name","label"],"description":"[Docs](https://element-plus.org/en-US/component/carousel.html#carousel-item)"},"el-cascader":{"attributes":["model-value","options","props","size","placeholder","disabled","clearable","show-all-levels","collapse-tags","collapse-tags-tooltip","separator","filterable","filter-method","debounce","before-filter","popper-class","teleported","popper-append-to-body","tag-type","validate-event","change","expand-change","blur","focus","visible-change","remove-tag"],"description":"If the options have a clear hierarchical structure, Cascader can be used to view and select them.\n\n[Docs](https://element-plus.org/en-US/component/cascader.html#cascader)"},"el-cascader-panel":{"attributes":["model-value","options","props","change","expand-change"],"description":"[Docs](https://element-plus.org/en-US/component/cascader.html#cascaderpanel)"},"el-checkbox":{"attributes":["model-value","label","true-label","false-label","disabled","border","size","name","checked","indeterminate","validate-event","tabindex","id","controls","change"],"description":"A group of options for multiple choices.\n\n[Docs](https://element-plus.org/en-US/component/checkbox.html#checkbox)"},"el-checkbox-group":{"attributes":["model-value","size","disabled","min","max","label","text-color","fill","tag","validate-event","change"],"subtags":["el-checkbox","el-checkbox-button"],"description":"[Docs](https://element-plus.org/en-US/component/checkbox.html#checkboxgroup)"},"el-checkbox-button":{"attributes":["label","true-label","false-label","disabled","name","checked"],"description":"[Docs](https://element-plus.org/en-US/component/checkbox.html#checkboxbutton)"},"el-collapse":{"attributes":["model-value","accordion","change"],"subtags":["el-collapse-item"],"description":"Use Collapse to store contents.\n\n[Docs](https://element-plus.org/en-US/component/collapse.html#collapse)"},"el-collapse-item":{"attributes":["name","title","disabled"],"description":"[Docs](https://element-plus.org/en-US/component/collapse.html#collapse-item)"},"el-color-picker":{"attributes":["model-value","disabled","size","show-alpha","color-format","popper-class","predefine","validate-event","tabindex","label","id","change","active-change"],"description":"ColorPicker is a color selector supporting multiple color formats.\n\n[Docs](https://element-plus.org/en-US/component/color-picker.html#colorpicker)"},"el-config-provider":{"attributes":["locale","size","z-index","namespace","button","message","experimental-features"],"description":"Config Provider is used for providing global configurations, which enables your entire application to access these configurations everywhere.\n\n[Docs](https://element-plus.org/en-US/component/config-provider.html#config-provider)"},"el-container":{"attributes":["direction"],"subtags":["el-container","el-header","el-aside","el-main","el-footer"],"description":"Container components for scaffolding basic structure of the page:\n\n[Docs](https://element-plus.org/en-US/component/container.html#container)"},"el-header":{"attributes":["height"],"description":"[Docs](https://element-plus.org/en-US/component/container.html#header)"},"el-aside":{"attributes":["width"],"description":"[Docs](https://element-plus.org/en-US/component/container.html#aside)"},"el-main":{"description":"[Docs](https://element-plus.org/en-US/component/container.html#main)"},"el-footer":{"attributes":["height"],"description":"[Docs](https://element-plus.org/en-US/component/container.html#footer)"},"el-date-picker":{"attributes":["model-value","readonly","disabled","size","editable","clearable","placeholder","start-placeholder","end-placeholder","type","format","popper-class","range-separator","default-value","default-time","value-format","id","name","unlink-panels","prefix-icon","clear-icon","validate-event","disabled-date","shortcuts","cell-class-name","teleported","change","blur","focus","calendar-change","panel-change","visible-change"],"description":"Use Date Picker for date input.\n\n[Docs](https://element-plus.org/en-US/component/date-picker.html#datepicker)"},"el-descriptions":{"attributes":["border","column","direction","size","title","extra"],"subtags":["el-descriptions-item"],"description":"Display multiple fields in list form.\n\n[Docs](https://element-plus.org/en-US/component/descriptions.html#descriptions)"},"el-descriptions-item":{"attributes":["label","span","width","min-width","align","label-align","class-name","label-class-name"],"description":"[Docs](https://element-plus.org/en-US/component/descriptions.html#descriptions-item)"},"el-dialog":{"attributes":["model-value","title","width","fullscreen","top","modal","append-to-body","lock-scroll","custom-class","open-delay","close-delay","close-on-click-modal","close-on-press-escape","show-close","before-close","draggable","center","align-center","destroy-on-close","open","opened","close","closed","open-auto-focus","close-auto-focus"],"description":"Informs users while preserving the current page state.\n\n[Docs](https://element-plus.org/en-US/component/dialog.html#dialog)"},"el-divider":{"attributes":["direction","border-style","content-position"],"description":"The dividing line that separates the content.\n\n[Docs](https://element-plus.org/en-US/component/divider.html#divider)"},"el-drawer":{"attributes":["model-value","append-to-body","lock-scroll","before-close","close-on-click-modal","close-on-press-escape","open-delay","close-delay","custom-class","destroy-on-close","modal","direction","show-close","size","title","with-header","modal-class","z-index","open","opened","close","closed"],"description":"Sometimes, `Dialog` does not always satisfy our requirements, let's say you have a massive form, or you need space to display something like `terms & conditions`, `Drawer` has almost identical API with `Dialog`, but it introduces different user experience.\n\n[Docs](https://element-plus.org/en-US/component/drawer.html#drawer)"},"el-dropdown":{"attributes":["type","size","max-height","split-button","disabled","placement","trigger","hide-on-click","show-timeout","hide-timeout","role","tabindex","popper-class","popper-options","teleported","click","command","visible-change"],"subtags":["el-dropdown-menu"],"description":"Toggleable menu for displaying lists of links and actions.\n\n[Docs](https://element-plus.org/en-US/component/dropdown.html#dropdown)"},"el-dropdown-menu":{"subtags":["el-dropdown-item"],"description":"[Docs](https://element-plus.org/en-US/component/dropdown.html#dropdown-menu)"},"el-dropdown-item":{"attributes":["command","disabled","divided","icon"],"description":"[Docs](https://element-plus.org/en-US/component/dropdown.html#dropdown-item)"},"el-empty":{"attributes":["image","image-size","description"],"description":"Placeholder hints for empty states.\n\n[Docs](https://element-plus.org/en-US/component/empty.html#empty)"},"el-form":{"attributes":["model","rules","inline","label-position","label-width","label-suffix","hide-required-asterisk","require-asterisk-position","show-message","inline-message","status-icon","validate-on-rule-change","size","disabled","scroll-to-error","validate"],"subtags":["el-form-item"],"description":"Form consists of `input`, `radio`, `select`, `checkbox` and so on. With form, you can collect, verify and submit data.\n\n[Docs](https://element-plus.org/en-US/component/form.html#form)"},"el-form-item":{"attributes":["prop","label","label-width","required","rules","error","show-message","inline-message","size","for","validate-status"],"description":"[Docs](https://element-plus.org/en-US/component/form.html#formitem)"},"el-icon":{"attributes":["color","size"],"description":"Element Plus provides a set of common icons.\n\n[Docs](https://element-plus.org/en-US/component/icon.html#icon)"},"el-image":{"attributes":["src","fit","hide-on-click-modal","`loading`","lazy","scroll-container","alt","referrer-policy","preview-src-list","z-index","initial-index","close-on-press-escape","preview-teleported","load","error","switch","close"],"description":"Besides the native features of img, support lazy load, custom placeholder and load failure, etc.\n\n[Docs](https://element-plus.org/en-US/component/image.html#image)"},"el-image-viewer":{"attributes":["url-list","z-index","initial-index","infinite","hide-on-click-modal","teleported","zoom-rate","close","switch"],"description":"[Docs](https://element-plus.org/en-US/component/image.html#image-viewer)"},"el-input-number":{"attributes":["model-value","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","name","label","placeholder","id","value-on-clear","validate-event","change","blur","focus"],"description":"Input numerical values with a customizable range.\n\n[Docs](https://element-plus.org/en-US/component/input-number.html#input-number)"},"el-input":{"attributes":["type","model-value","maxlength","minlength","show-word-limit","placeholder","clearable","formatter","parser","show-password","disabled","size","prefix-icon","suffix-icon","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","label","tabindex","validate-event","input-style","blur","focus","change","input","clear"],"description":"Input data using mouse or keyboard.\n\n[Docs](https://element-plus.org/en-US/component/input.html#input)"},"el-row":{"attributes":["gutter","justify","align","tag"],"subtags":["el-col"],"description":"[Docs](https://element-plus.org/en-US/component/layout.html#row)"},"el-col":{"attributes":["span","offset","push","pull","xs","sm","md","lg","xl","tag"],"description":"[Docs](https://element-plus.org/en-US/component/layout.html#col)"},"el-link":{"attributes":["type","underline","disabled","href","icon"],"description":"Text hyperlink\n\n[Docs](https://element-plus.org/en-US/component/link.html#link)"},"el-menu":{"attributes":["mode","collapse","ellipsis","background-color","text-color","active-text-color","default-active","default-openeds","unique-opened","menu-trigger","router","collapse-transition","popper-effect","select","open","close"],"subtags":["el-sub-menu","el-menu-item","el-menu-item-group"],"description":"Menu that provides navigation for your website.\n\n[Docs](https://element-plus.org/en-US/component/menu.html#menu)"},"el-sub-menu":{"attributes":["index","popper-class","show-timeout","hide-timeout","disabled","popper-append-to-body","teleported","popper-offset","expand-close-icon","expand-open-icon","collapse-close-icon","collapse-open-icon"],"subtags":["el-sub-menu","el-menu-item","el-menu-item-group"],"description":"[Docs](https://element-plus.org/en-US/component/menu.html#submenu)"},"el-menu-item":{"attributes":["index","route","disabled","click"],"description":"[Docs](https://element-plus.org/en-US/component/menu.html#menu-item)"},"el-menu-item-group":{"attributes":["title"],"subtags":["el-menu-item"],"description":"[Docs](https://element-plus.org/en-US/component/menu.html#menu-item-group)"},"el-page-header":{"attributes":["icon","title","content","back"],"description":"If path of the page is simple, it is recommended to use PageHeader instead of the Breadcrumb.\n\n[Docs](https://element-plus.org/en-US/component/page-header.html#page-header)"},"el-pagination":{"attributes":["small","background","page-size","default-page-size","total","page-count","pager-count","current-page","default-current-page","layout","page-sizes","popper-class","prev-text","prev-icon","next-text","next-icon","disabled","hide-on-single-page","size-change","current-change","prev-click","next-click"],"description":"If you have too much data to display in one page, use pagination.\n\n[Docs](https://element-plus.org/en-US/component/pagination.html#pagination)"},"el-popconfirm":{"attributes":["title","confirm-button-text","cancel-button-text","confirm-button-type","cancel-button-type","icon","icon-color","hide-icon","teleported","persistent","width","confirm","cancel"],"description":"A simple confirmation dialog of an element click action.\n\n[Docs](https://element-plus.org/en-US/component/popconfirm.html#popconfirm)"},"el-popover":{"attributes":["trigger","title","effect","content","width","placement","disabled","visible","offset","transition","show-arrow","popper-options","popper-class","popper-style","show-after","hide-after","auto-close","tabindex","teleported","persistent","show","before-enter","after-enter","hide","before-leave","after-leave"],"description":":::tip\n\n[Docs](https://element-plus.org/en-US/component/popover.html#popover)"},"el-progress":{"attributes":["percentage","type","stroke-width","text-inside","status","indeterminate","duration","color","width","show-text","stroke-linecap","format"],"description":"Progress is used to show the progress of current operation, and inform the user the current status.\n\n[Docs](https://element-plus.org/en-US/component/progress.html#progress)"},"el-radio":{"attributes":["model-value","label","disabled","border","size","name","change"],"description":"Single selection among multiple options.\n\n[Docs](https://element-plus.org/en-US/component/radio.html#radio)"},"el-radio-group":{"attributes":["model-value","size","disabled","text-color","fill","validate-event","label","name","id","change"],"subtags":["el-radio","el-radio-button"],"description":"[Docs](https://element-plus.org/en-US/component/radio.html#radiogroup)"},"el-radio-button":{"attributes":["label","disabled","name"],"description":"[Docs](https://element-plus.org/en-US/component/radio.html#radiobutton)"},"el-rate":{"attributes":["model-value","max","size","disabled","allow-half","low-threshold","high-threshold","colors","void-color","disabled-void-color","icons","void-icon","disabled-void-icon","show-text","show-score","text-color","texts","score-template","clearable","id","label","change"],"description":"Used for rating\n\n[Docs](https://element-plus.org/en-US/component/rate.html#rate)"},"el-result":{"attributes":["title","sub-title","icon"],"description":"Used to give feedback on the result of user's operation or access exception.\n\n[Docs](https://element-plus.org/en-US/component/result.html#result)"},"el-scrollbar":{"attributes":["height","max-height","native","wrap-style","wrap-class","view-style","view-class","noresize","tag","always","min-size","scroll"],"description":"Used to replace the browser's native scrollbar.\n\n[Docs](https://element-plus.org/en-US/component/scrollbar.html#scrollbar)"},"el-select-v2":{"attributes":["model-value","multiple","disabled","value-key","size","clearable","clear-icon","collapse-tags","collapse-tags-tooltip","multiple-limit","name","effect","autocomplete","placeholder","filterable","allow-create","reserve-keyword","no-data-text","popper-class","popper-append-to-body","teleported","persistent","popper-options","automatic-dropdown","height","scrollbar-always-on","remote","remote-method","validate-event","placement","change","visible-change","remove-tag","clear","blur","focus"],"description":"[Docs](https://element-plus.org/en-US/component/select-v2.html#selectv2)"},"el-select":{"attributes":["model-value","multiple","disabled","value-key","size","clearable","collapse-tags","collapse-tags-tooltip","multiple-limit","name","effect","autocomplete","placeholder","filterable","allow-create","filter-method","remote","remote-method","remote-show-suffix","loading","loading-text","no-match-text","no-data-text","popper-class","reserve-keyword","default-first-option","popper-append-to-body","teleported","persistent","automatic-dropdown","clear-icon","fit-input-width","suffix-icon","suffix-transition","tag-type","validate-event","placement","change","visible-change","remove-tag","clear","blur","focus"],"subtags":["el-option-group","el-option"],"description":"When there are plenty of options, use a drop-down menu to display and select desired ones.\n\n[Docs](https://element-plus.org/en-US/component/select.html#select)"},"el-option-group":{"attributes":["label","disabled"],"subtags":["el-option"],"description":"[Docs](https://element-plus.org/en-US/component/select.html#option-group)"},"el-option":{"attributes":["value","label","disabled"],"description":"[Docs](https://element-plus.org/en-US/component/select.html#option)"},"el-skeleton":{"attributes":["animated","count","loading","rows","throttle"],"description":"When loading data, and you need a rich experience for visual and interactions for your end users, you can choose `skeleton`.\n\n[Docs](https://element-plus.org/en-US/component/skeleton.html#skeleton)"},"el-skeleton-item":{"attributes":["variant"],"description":"[Docs](https://element-plus.org/en-US/component/skeleton.html#skeleton-item)"},"el-slider":{"attributes":["model-value","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","label","range-start-label","range-end-label","format-value-text","debounce","tooltip-class","placement","marks","validate-event","change","input"],"description":"Drag the slider within a fixed range.\n\n[Docs](https://element-plus.org/en-US/component/slider.html#slider)"},"el-space":{"attributes":["alignment","class","direction","prefix-cls","style","spacer","size","wrap","fill","fill-ratio"],"description":"Even though we have [Divider]\n\n[Docs](https://element-plus.org/en-US/component/space.html#space)"},"el-statistic":{"description":"Display statistics.\n\n[Docs](https://element-plus.org/en-US/component/statistic.html#statistic)"},"el-countdown":{"description":":::demo Countdown component, support to add other components control countdown.\n\n[Docs](https://element-plus.org/en-US/component/statistic.html#countdown)"},"el-steps":{"attributes":["space","direction","active","process-status","finish-status","align-center","simple"],"subtags":["el-step"],"description":"Guide the user to complete tasks in accordance with the process. Its steps can be set according to the actual application scenario and the number of the steps can't be less than 2.\n\n[Docs](https://element-plus.org/en-US/component/steps.html#steps)"},"el-step":{"attributes":["title","description","icon","status"],"description":"[Docs](https://element-plus.org/en-US/component/steps.html#step)"},"el-switch":{"attributes":["model-value","disabled","loading","size","width","inline-prompt","active-icon","inactive-icon","active-text","inactive-text","active-value","inactive-value","active-color","inactive-color","border-color","name","validate-event","before-change","change"],"description":"Switch is used for switching between two opposing states.\n\n[Docs](https://element-plus.org/en-US/component/switch.html#switch)"},"el-table-v2":{"attributes":["cache","estimated-row-height","header-class","header-props","header-cell-props","header-height","footer-height","row-class","row-key","row-props","row-height","cell-props","columns","data","data-getter","fixed-data","expand-column-key","expanded-row-keys","default-expanded-row-keys","class","fixed","width","height","max-height","h-scrollbar-size","v-scrollbar-size","scrollbar-always-on","sort-by","sort-state","column-sort","expanded-rows-change","end-reached","scroll","rows-rendered","row-expand","row-event-handlers"],"description":"[Docs](https://element-plus.org/en-US/component/table-v2.html#tablev2)"},"el-table":{"attributes":["data","height","max-height","stripe","border","size","fit","show-header","highlight-current-row","current-row-key","row-class-name","row-style","cell-class-name","cell-style","header-row-class-name","header-row-style","header-cell-class-name","header-cell-style","row-key","empty-text","default-expand-all","expand-row-keys","default-sort","tooltip-effect","tooltip-options","show-summary","sum-text","summary-method","span-method","select-on-indeterminate","indent","lazy","load","tree-props","table-layout","scrollbar-always-on","flexible","select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-click","cell-dblclick","cell-contextmenu","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],"subtags":["el-table-column"],"description":"Display multiple data with similar format. You can sort, filter, compare your data in a table.\n\n[Docs](https://element-plus.org/en-US/component/table.html#table)"},"el-table-column":{"attributes":["type","index","label","column-key","prop","width","min-width","fixed","render-header","sortable","sort-method","sort-by","sort-orders","resizable","formatter","show-overflow-tooltip","align","header-align","class-name","label-class-name","selectable","reserve-selection","filters","filter-placement","filter-multiple","filter-method","filtered-value"],"description":"[Docs](https://element-plus.org/en-US/component/table.html#table-column)"},"el-tabs":{"attributes":["model-value","type","closable","addable","editable","tab-position","stretch","before-leave","tab-click","tab-change","tab-remove","tab-add","edit"],"subtags":["el-tab-pane"],"description":"Divide data collections which are related yet belong to different types.\n\n[Docs](https://element-plus.org/en-US/component/tabs.html#tabs)"},"el-tab-pane":{"attributes":["label","disabled","name","closable","lazy"],"description":"[Docs](https://element-plus.org/en-US/component/tabs.html#tab-pane)"},"el-check-tag":{"attributes":["checked","change"],"description":"[Docs](https://element-plus.org/en-US/component/tag.html#checktag)"},"el-tag":{"attributes":["type","closable","disable-transitions","hit","color","size","effect","round","click","close"],"description":"Used for marking and selection.\n\n[Docs](https://element-plus.org/en-US/component/tag.html#tag)"},"el-time-picker":{"attributes":["model-value","readonly","disabled","editable","clearable","size","placeholder","start-placeholder","end-placeholder","is-range","arrow-control","popper-class","range-separator","format","default-value","id","name","prefix-icon","clear-icon","disabled-hours","disabled-minutes","disabled-seconds","teleported","change","blur","focus","visible-change"],"description":"Use Time Picker for time input.\n\n[Docs](https://element-plus.org/en-US/component/time-picker.html#timepicker)"},"el-time-select":{"attributes":["model-value","disabled","editable","clearable","size","placeholder","name","effect","prefix-icon","clear-icon","start","end","step","min-time","max-time","format","change","blur","focus"],"description":"Use Time Select for time input.\n\n[Docs](https://element-plus.org/en-US/component/time-select.html#timeselect)"},"el-timeline":{"subtags":["el-timeline-item"],"description":"Visually display timeline.\n\n[Docs](https://element-plus.org/en-US/component/timeline.html#timeline)"},"el-timeline-item":{"attributes":["timestamp","hide-timestamp","center","placement","type","color","size","icon","hollow"],"description":"[Docs](https://element-plus.org/en-US/component/timeline.html#timeline-item)"},"el-tooltip":{"attributes":["append-to","effect","content","raw-content","placement","visible","disabled","offset","transition","popper-options","show-after","show-arrow","hide-after","auto-close","manual","popper-class","enterable","tabindex","teleported","trigger","virtual-triggering","virtual-ref","trigger-keys"],"description":"Display prompt information for mouse hover.\n\n[Docs](https://element-plus.org/en-US/component/tooltip.html#tooltip)"},"el-transfer":{"attributes":["model-value","data","filterable","filter-placeholder","filter-method","target-order","titles","button-texts","render-content","format","props","left-default-checked","right-default-checked","validate-event","change","left-check-change","right-check-change"],"description":"[Docs](https://element-plus.org/en-US/component/transfer.html#transfer)"},"el-own":{"attributes":["cache-data"],"description":"[Docs](https://element-plus.org/en-US/component/tree-select.html#own)"},"el-tree-v2":{"attributes":["data","empty-text","props","highlight-current","expand-on-click-node","check-on-click-node","default-expanded-keys","show-checkbox","check-strictly","default-checked-keys","current-node-key","filter-method","indent","icon","node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse"],"description":"[Docs](https://element-plus.org/en-US/component/tree-v2.html#treev2)"},"el-tree":{"attributes":["data","empty-text","node-key","props","render-after-expand","load","render-content","highlight-current","default-expand-all","expand-on-click-node","check-on-click-node","auto-expand-parent","default-expanded-keys","show-checkbox","check-strictly","default-checked-keys","current-node-key","filter-node-method","accordion","indent","icon","lazy","draggable","allow-drag","allow-drop","node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse","node-drag-start","node-drag-enter","node-drag-leave","node-drag-over","node-drag-end","node-drop"],"description":"Display a set of data with hierarchies.\n\n[Docs](https://element-plus.org/en-US/component/tree.html#tree)"},"el-upload":{"attributes":["action","headers","method","multiple","data","name","with-credentials","show-file-list","drag","accept","on-preview","on-remove","on-success","on-error","on-progress","on-change","on-exceed","before-upload","before-remove","file-list","list-type","auto-upload","http-request","disabled","limit"],"description":"Upload files by clicking or drag-and-drop.\n\n[Docs](https://element-plus.org/en-US/component/upload.html#upload)"}}
|
|
1
|
+
{"el-affix":{"attributes":["offset","position","target","z-index","change","scroll"],"description":"Fix the element to a specific visible area.\n\n[Docs](https://element-plus.org/en-US/component/affix.html#affix)"},"el-alert":{"attributes":["title","type","description","closable","center","close-text","show-icon","effect","close"],"description":"Displays important alert messages.\n\n[Docs](https://element-plus.org/en-US/component/alert.html#alert)"},"el-autocomplete":{"attributes":["model-value","placeholder","clearable","disabled","value-key","debounce","placement","fetch-suggestions","trigger-on-focus","select-when-unmatched","name","label","hide-loading","popper-class","popper-append-to-body","teleported","highlight-first-item","fit-input-width","select","change"],"description":"Get some recommended tips based on the current input.\n\n[Docs](https://element-plus.org/en-US/component/autocomplete.html#autocomplete)"},"el-avatar":{"attributes":["icon","size","shape","src","src-set","alt","fit","error"],"description":"Avatars can be used to represent people or objects. It supports images, Icons, or characters.\n\n[Docs](https://element-plus.org/en-US/component/avatar.html#avatar)"},"el-backtop":{"attributes":["target","visibility-height","right","bottom","click"],"description":"A button to back to top.\n\n[Docs](https://element-plus.org/en-US/component/backtop.html#backtop)"},"el-badge":{"attributes":["value","max","is-dot","hidden","type"],"description":"A number or status mark on buttons and icons.\n\n[Docs](https://element-plus.org/en-US/component/badge.html#badge)"},"el-breadcrumb":{"attributes":["separator","separator-icon"],"subtags":["el-breadcrumb-item"],"description":"Displays the location of the current page, making it easier to browser back.\n\n[Docs](https://element-plus.org/en-US/component/breadcrumb.html#breadcrumb)"},"el-breadcrumb-item":{"attributes":["to","replace"],"description":"[Docs](https://element-plus.org/en-US/component/breadcrumb.html#breadcrumbitem)"},"el-button":{"attributes":["size","type","plain","text","bg","link","round","circle","loading","loading-icon","disabled","icon","autofocus","native-type","auto-insert-space","color","dark"],"description":"Commonly used button.\n\n[Docs](https://element-plus.org/en-US/component/button.html#button)"},"el-button-group":{"attributes":["size","type"],"subtags":["el-button"],"description":"[Docs](https://element-plus.org/en-US/component/button.html#buttongroup)"},"el-calendar":{"attributes":["model-value","range"],"description":"Display date.\n\n[Docs](https://element-plus.org/en-US/component/calendar.html#calendar)"},"el-card":{"attributes":["header","body-style","shadow"],"description":"Integrate information in a card container.\n\n[Docs](https://element-plus.org/en-US/component/card.html#card)"},"el-carousel":{"attributes":["height","initial-index","trigger","autoplay","interval","indicator-position","arrow","type","loop","direction","pause-on-hover","change"],"subtags":["el-carousel-item"],"description":"Loop a series of images or texts in a limited space\n\n[Docs](https://element-plus.org/en-US/component/carousel.html#carousel)"},"el-carousel-item":{"attributes":["name","label"],"description":"[Docs](https://element-plus.org/en-US/component/carousel.html#carousel-item)"},"el-cascader":{"attributes":["model-value","options","props","size","placeholder","disabled","clearable","show-all-levels","collapse-tags","collapse-tags-tooltip","separator","filterable","filter-method","debounce","before-filter","popper-class","teleported","popper-append-to-body ^","tag-type","validate-event","change","expand-change","blur","focus","visible-change","remove-tag"],"description":"If the options have a clear hierarchical structure, Cascader can be used to view and select them.\n\n[Docs](https://element-plus.org/en-US/component/cascader.html#cascader)"},"el-cascader-panel":{"attributes":["model-value","options","props","change","expand-change","close"],"description":"[Docs](https://element-plus.org/en-US/component/cascader.html#cascaderpanel)"},"el-checkbox":{"attributes":["model-value","label","true-label","false-label","disabled","border","size","name","checked","indeterminate","validate-event","tabindex","id","controls","change"],"description":"A group of options for multiple choices.\n\n[Docs](https://element-plus.org/en-US/component/checkbox.html#checkbox)"},"el-checkbox-group":{"attributes":["model-value","size","disabled","min","max","label","text-color","fill","tag","validate-event","change"],"subtags":["el-checkbox","el-checkbox-button"],"description":"[Docs](https://element-plus.org/en-US/component/checkbox.html#checkboxgroup)"},"el-checkbox-button":{"attributes":["label","true-label","false-label","disabled","name","checked"],"description":"[Docs](https://element-plus.org/en-US/component/checkbox.html#checkboxbutton)"},"el-collapse":{"attributes":["model-value","accordion","change"],"subtags":["el-collapse-item"],"description":"Use Collapse to store contents.\n\n[Docs](https://element-plus.org/en-US/component/collapse.html#collapse)"},"el-collapse-item":{"attributes":["name","title","disabled"],"description":"[Docs](https://element-plus.org/en-US/component/collapse.html#collapse-item)"},"el-color-picker":{"attributes":["model-value","disabled","size","show-alpha","color-format","popper-class","predefine","validate-event","tabindex","label","id","change","active-change"],"description":"ColorPicker is a color selector supporting multiple color formats.\n\n[Docs](https://element-plus.org/en-US/component/color-picker.html#colorpicker)"},"el-config-provider":{"attributes":["locale","size","z-index","namespace","button","message","experimental-features"],"description":"Config Provider is used for providing global configurations, which enables your entire application to access these configurations everywhere.\n\n[Docs](https://element-plus.org/en-US/component/config-provider.html#config-provider)"},"el-container":{"attributes":["direction"],"subtags":["el-container","el-header","el-aside","el-main","el-footer"],"description":"Container components for scaffolding basic structure of the page:\n\n[Docs](https://element-plus.org/en-US/component/container.html#container)"},"el-header":{"attributes":["height"],"description":"[Docs](https://element-plus.org/en-US/component/container.html#header)"},"el-aside":{"attributes":["width"],"description":"[Docs](https://element-plus.org/en-US/component/container.html#aside)"},"el-main":{"description":"[Docs](https://element-plus.org/en-US/component/container.html#main)"},"el-footer":{"attributes":["height"],"description":"[Docs](https://element-plus.org/en-US/component/container.html#footer)"},"el-date-picker":{"attributes":["model-value","readonly","disabled","size","editable","clearable","placeholder","start-placeholder","end-placeholder","type","format","popper-class","range-separator","default-value","default-time","value-format","id","name","unlink-panels","prefix-icon","clear-icon","validate-event","disabled-date","shortcuts","cell-class-name","teleported","change","blur","focus","calendar-change","panel-change","visible-change"],"description":"Use Date Picker for date input.\n\n[Docs](https://element-plus.org/en-US/component/date-picker.html#datepicker)"},"el-descriptions":{"attributes":["border","column","direction","size","title","extra"],"subtags":["el-descriptions-item"],"description":"Display multiple fields in list form.\n\n[Docs](https://element-plus.org/en-US/component/descriptions.html#descriptions)"},"el-descriptions-item":{"attributes":["label","span","width","min-width","align","label-align","class-name","label-class-name"],"description":"[Docs](https://element-plus.org/en-US/component/descriptions.html#descriptions-item)"},"el-dialog":{"attributes":["model-value","title","width","fullscreen","top","modal","append-to-body","lock-scroll","custom-class","open-delay","close-delay","close-on-click-modal","close-on-press-escape","show-close","before-close","draggable","center","align-center","destroy-on-close","open","opened","close","closed","open-auto-focus","close-auto-focus"],"description":"Informs users while preserving the current page state.\n\n[Docs](https://element-plus.org/en-US/component/dialog.html#dialog)"},"el-divider":{"attributes":["direction","border-style","content-position"],"description":"The dividing line that separates the content.\n\n[Docs](https://element-plus.org/en-US/component/divider.html#divider)"},"el-drawer":{"attributes":["model-value","append-to-body","lock-scroll","before-close","close-on-click-modal","close-on-press-escape","open-delay","close-delay","custom-class","destroy-on-close","modal","direction","show-close","size","title","with-header","modal-class","z-index","open","opened","close","closed"],"description":"Sometimes, `Dialog` does not always satisfy our requirements, let's say you have a massive form, or you need space to display something like `terms & conditions`, `Drawer` has almost identical API with `Dialog`, but it introduces different user experience.\n\n[Docs](https://element-plus.org/en-US/component/drawer.html#drawer)"},"el-dropdown":{"attributes":["type","size","max-height","split-button","disabled","placement","trigger","hide-on-click","show-timeout","hide-timeout","role","tabindex","popper-class","popper-options","teleported","click","command","visible-change"],"subtags":["el-dropdown-menu"],"description":"Toggleable menu for displaying lists of links and actions.\n\n[Docs](https://element-plus.org/en-US/component/dropdown.html#dropdown)"},"el-dropdown-menu":{"subtags":["el-dropdown-item"],"description":"[Docs](https://element-plus.org/en-US/component/dropdown.html#dropdown-menu)"},"el-dropdown-item":{"attributes":["command","disabled","divided","icon"],"description":"[Docs](https://element-plus.org/en-US/component/dropdown.html#dropdown-item)"},"el-empty":{"attributes":["image","image-size","description"],"description":"Placeholder hints for empty states.\n\n[Docs](https://element-plus.org/en-US/component/empty.html#empty)"},"el-form":{"attributes":["model","rules","inline","label-position","label-width","label-suffix","hide-required-asterisk","require-asterisk-position","show-message","inline-message","status-icon","validate-on-rule-change","size","disabled","scroll-to-error","validate"],"subtags":["el-form-item"],"description":"Form consists of `input`, `radio`, `select`, `checkbox` and so on. With form, you can collect, verify and submit data.\n\n[Docs](https://element-plus.org/en-US/component/form.html#form)"},"el-form-item":{"attributes":["prop","label","label-width","required","rules","error","show-message","inline-message","size","for","validate-status"],"description":"[Docs](https://element-plus.org/en-US/component/form.html#formitem)"},"el-icon":{"attributes":["color","size"],"description":"Element Plus provides a set of common icons.\n\n[Docs](https://element-plus.org/en-US/component/icon.html#icon)"},"el-image":{"attributes":["src","fit","hide-on-click-modal","`loading`","lazy","scroll-container","alt","referrer-policy","preview-src-list","z-index","initial-index","close-on-press-escape","preview-teleported","load","error","switch","close"],"description":"Besides the native features of img, support lazy load, custom placeholder and load failure, etc.\n\n[Docs](https://element-plus.org/en-US/component/image.html#image)"},"el-image-viewer":{"attributes":["url-list","z-index","initial-index","infinite","hide-on-click-modal","teleported","zoom-rate","close","switch"],"description":"[Docs](https://element-plus.org/en-US/component/image.html#image-viewer)"},"el-input-number":{"attributes":["model-value","min","max","step","step-strictly","precision","size","readonly","disabled","controls","controls-position","name","label","placeholder","id","value-on-clear","validate-event","change","blur","focus"],"description":"Input numerical values with a customizable range.\n\n[Docs](https://element-plus.org/en-US/component/input-number.html#input-number)"},"el-input":{"attributes":["type","model-value","maxlength","minlength","show-word-limit","placeholder","clearable","formatter","parser","show-password","disabled","size","prefix-icon","suffix-icon","rows","autosize","autocomplete","name","readonly","max","min","step","resize","autofocus","form","label","tabindex","validate-event","input-style","blur","focus","change","input","clear"],"description":"Input data using mouse or keyboard.\n\n[Docs](https://element-plus.org/en-US/component/input.html#input)"},"el-row":{"attributes":["gutter","justify","align","tag"],"subtags":["el-col"],"description":"[Docs](https://element-plus.org/en-US/component/layout.html#row)"},"el-col":{"attributes":["span","offset","push","pull","xs","sm","md","lg","xl","tag"],"description":"[Docs](https://element-plus.org/en-US/component/layout.html#col)"},"el-link":{"attributes":["type","underline","disabled","href","icon"],"description":"Text hyperlink\n\n[Docs](https://element-plus.org/en-US/component/link.html#link)"},"el-menu":{"attributes":["mode","collapse","ellipsis","background-color","text-color","active-text-color","default-active","default-openeds","unique-opened","menu-trigger","router","collapse-transition","popper-effect","select","open","close"],"subtags":["el-sub-menu","el-menu-item","el-menu-item-group"],"description":"Menu that provides navigation for your website.\n\n[Docs](https://element-plus.org/en-US/component/menu.html#menu)"},"el-sub-menu":{"attributes":["index","popper-class","show-timeout","hide-timeout","disabled","popper-append-to-body","teleported","popper-offset","expand-close-icon","expand-open-icon","collapse-close-icon","collapse-open-icon"],"subtags":["el-sub-menu","el-menu-item","el-menu-item-group"],"description":"[Docs](https://element-plus.org/en-US/component/menu.html#submenu)"},"el-menu-item":{"attributes":["index","route","disabled","click"],"description":"[Docs](https://element-plus.org/en-US/component/menu.html#menu-item)"},"el-menu-item-group":{"attributes":["title"],"subtags":["el-menu-item"],"description":"[Docs](https://element-plus.org/en-US/component/menu.html#menu-item-group)"},"el-page-header":{"attributes":["icon","title","content","back"],"description":"If path of the page is simple, it is recommended to use PageHeader instead of the Breadcrumb.\n\n[Docs](https://element-plus.org/en-US/component/page-header.html#page-header)"},"el-pagination":{"attributes":["small","background","page-size","default-page-size","total","page-count","pager-count","current-page","default-current-page","layout","page-sizes","popper-class","prev-text","prev-icon","next-text","next-icon","disabled","hide-on-single-page","size-change","current-change","prev-click","next-click"],"description":"If you have too much data to display in one page, use pagination.\n\n[Docs](https://element-plus.org/en-US/component/pagination.html#pagination)"},"el-popconfirm":{"attributes":["title","confirm-button-text","cancel-button-text","confirm-button-type","cancel-button-type","icon","icon-color","hide-icon","teleported","persistent","width","confirm","cancel"],"description":"A simple confirmation dialog of an element click action.\n\n[Docs](https://element-plus.org/en-US/component/popconfirm.html#popconfirm)"},"el-popover":{"attributes":["trigger","title","effect","content","width","placement","disabled","visible","offset","transition","show-arrow","popper-options","popper-class","popper-style","show-after","hide-after","auto-close","tabindex","teleported","persistent","show","before-enter","after-enter","hide","before-leave","after-leave"],"description":":::tip\n\n[Docs](https://element-plus.org/en-US/component/popover.html#popover)"},"el-progress":{"attributes":["percentage","type","stroke-width","text-inside","status","indeterminate","duration","color","width","show-text","stroke-linecap","format"],"description":"Progress is used to show the progress of current operation, and inform the user the current status.\n\n[Docs](https://element-plus.org/en-US/component/progress.html#progress)"},"el-radio":{"attributes":["model-value","label","disabled","border","size","name","change"],"description":"Single selection among multiple options.\n\n[Docs](https://element-plus.org/en-US/component/radio.html#radio)"},"el-radio-group":{"attributes":["model-value","size","disabled","text-color","fill","validate-event","label","name","id","change"],"subtags":["el-radio","el-radio-button"],"description":"[Docs](https://element-plus.org/en-US/component/radio.html#radiogroup)"},"el-radio-button":{"attributes":["label","disabled","name"],"description":"[Docs](https://element-plus.org/en-US/component/radio.html#radiobutton)"},"el-rate":{"attributes":["model-value","max","size","disabled","allow-half","low-threshold","high-threshold","colors","void-color","disabled-void-color","icons","void-icon","disabled-void-icon","show-text","show-score","text-color","texts","score-template","clearable","id","label","change"],"description":"Used for rating\n\n[Docs](https://element-plus.org/en-US/component/rate.html#rate)"},"el-result":{"attributes":["title","sub-title","icon"],"description":"Used to give feedback on the result of user's operation or access exception.\n\n[Docs](https://element-plus.org/en-US/component/result.html#result)"},"el-scrollbar":{"attributes":["height","max-height","native","wrap-style","wrap-class","view-style","view-class","noresize","tag","always","min-size","scroll"],"description":"Used to replace the browser's native scrollbar.\n\n[Docs](https://element-plus.org/en-US/component/scrollbar.html#scrollbar)"},"el-select-v2":{"attributes":["model-value","multiple","disabled","value-key","size","clearable","clear-icon","collapse-tags","collapse-tags-tooltip","multiple-limit","name","effect","autocomplete","placeholder","filterable","allow-create","reserve-keyword","no-data-text","popper-class","popper-append-to-body","teleported","persistent","popper-options","automatic-dropdown","height","scrollbar-always-on","remote","remote-method","validate-event","placement","change","visible-change","remove-tag","clear","blur","focus"],"description":"[Docs](https://element-plus.org/en-US/component/select-v2.html#selectv2)"},"el-select":{"attributes":["model-value","multiple","disabled","value-key","size","clearable","collapse-tags","collapse-tags-tooltip","multiple-limit","name","effect","autocomplete","placeholder","filterable","allow-create","filter-method","remote","remote-method","remote-show-suffix","loading","loading-text","no-match-text","no-data-text","popper-class","reserve-keyword","default-first-option","popper-append-to-body","teleported","persistent","automatic-dropdown","clear-icon","fit-input-width","suffix-icon","suffix-transition","tag-type","validate-event","placement","change","visible-change","remove-tag","clear","blur","focus"],"subtags":["el-option-group","el-option"],"description":"When there are plenty of options, use a drop-down menu to display and select desired ones.\n\n[Docs](https://element-plus.org/en-US/component/select.html#select)"},"el-option-group":{"attributes":["label","disabled"],"subtags":["el-option"],"description":"[Docs](https://element-plus.org/en-US/component/select.html#option-group)"},"el-option":{"attributes":["value","label","disabled"],"description":"[Docs](https://element-plus.org/en-US/component/select.html#option)"},"el-skeleton":{"attributes":["animated","count","loading","rows","throttle"],"description":"When loading data, and you need a rich experience for visual and interactions for your end users, you can choose `skeleton`.\n\n[Docs](https://element-plus.org/en-US/component/skeleton.html#skeleton)"},"el-skeleton-item":{"attributes":["variant"],"description":"[Docs](https://element-plus.org/en-US/component/skeleton.html#skeleton-item)"},"el-slider":{"attributes":["model-value","min","max","disabled","step","show-input","show-input-controls","size","input-size","show-stops","show-tooltip","format-tooltip","range","vertical","height","label","range-start-label","range-end-label","format-value-text","debounce","tooltip-class","placement","marks","validate-event","change","input"],"description":"Drag the slider within a fixed range.\n\n[Docs](https://element-plus.org/en-US/component/slider.html#slider)"},"el-space":{"attributes":["alignment","class","direction","prefix-cls","style","spacer","size","wrap","fill","fill-ratio"],"description":"Even though we have [Divider]\n\n[Docs](https://element-plus.org/en-US/component/space.html#space)"},"el-statistic":{"description":"Display statistics.\n\n[Docs](https://element-plus.org/en-US/component/statistic.html#statistic)"},"el-countdown":{"description":":::demo Countdown component, support to add other components control countdown.\n\n[Docs](https://element-plus.org/en-US/component/statistic.html#countdown)"},"el-steps":{"attributes":["space","direction","active","process-status","finish-status","align-center","simple"],"subtags":["el-step"],"description":"Guide the user to complete tasks in accordance with the process. Its steps can be set according to the actual application scenario and the number of the steps can't be less than 2.\n\n[Docs](https://element-plus.org/en-US/component/steps.html#steps)"},"el-step":{"attributes":["title","description","icon","status"],"description":"[Docs](https://element-plus.org/en-US/component/steps.html#step)"},"el-switch":{"attributes":["model-value","disabled","loading","size","width","inline-prompt","active-icon","inactive-icon","active-text","inactive-text","active-value","inactive-value","active-color","inactive-color","border-color","name","validate-event","before-change","change"],"description":"Switch is used for switching between two opposing states.\n\n[Docs](https://element-plus.org/en-US/component/switch.html#switch)"},"el-table-v2":{"attributes":["cache","estimated-row-height","header-class","header-props","header-cell-props","header-height","footer-height","row-class","row-key","row-props","row-height","cell-props","columns","data","data-getter","fixed-data","expand-column-key","expanded-row-keys","default-expanded-row-keys","class","fixed","width","height","max-height","h-scrollbar-size","v-scrollbar-size","scrollbar-always-on","sort-by","sort-state","column-sort","expanded-rows-change","end-reached","scroll","rows-rendered","row-expand","row-event-handlers"],"description":"[Docs](https://element-plus.org/en-US/component/table-v2.html#tablev2)"},"el-table":{"attributes":["data","height","max-height","stripe","border","size","fit","show-header","highlight-current-row","current-row-key","row-class-name","row-style","cell-class-name","cell-style","header-row-class-name","header-row-style","header-cell-class-name","header-cell-style","row-key","empty-text","default-expand-all","expand-row-keys","default-sort","tooltip-effect","tooltip-options","show-summary","sum-text","summary-method","span-method","select-on-indeterminate","indent","lazy","load","tree-props","table-layout","scrollbar-always-on","flexible","select","select-all","selection-change","cell-mouse-enter","cell-mouse-leave","cell-click","cell-dblclick","cell-contextmenu","row-click","row-contextmenu","row-dblclick","header-click","header-contextmenu","sort-change","filter-change","current-change","header-dragend","expand-change"],"subtags":["el-table-column"],"description":"Display multiple data with similar format. You can sort, filter, compare your data in a table.\n\n[Docs](https://element-plus.org/en-US/component/table.html#table)"},"el-table-column":{"attributes":["type","index","label","column-key","prop","width","min-width","fixed","render-header","sortable","sort-method","sort-by","sort-orders","resizable","formatter","show-overflow-tooltip","align","header-align","class-name","label-class-name","selectable","reserve-selection","filters","filter-placement","filter-multiple","filter-method","filtered-value"],"description":"[Docs](https://element-plus.org/en-US/component/table.html#table-column)"},"el-tabs":{"attributes":["model-value","type","closable","addable","editable","tab-position","stretch","before-leave","tab-click","tab-change","tab-remove","tab-add","edit"],"subtags":["el-tab-pane"],"description":"Divide data collections which are related yet belong to different types.\n\n[Docs](https://element-plus.org/en-US/component/tabs.html#tabs)"},"el-tab-pane":{"attributes":["label","disabled","name","closable","lazy"],"description":"[Docs](https://element-plus.org/en-US/component/tabs.html#tab-pane)"},"el-check-tag":{"attributes":["checked","change"],"description":"[Docs](https://element-plus.org/en-US/component/tag.html#checktag)"},"el-tag":{"attributes":["type","closable","disable-transitions","hit","color","size","effect","round","click","close"],"description":"Used for marking and selection.\n\n[Docs](https://element-plus.org/en-US/component/tag.html#tag)"},"el-time-picker":{"attributes":["model-value","readonly","disabled","editable","clearable","size","placeholder","start-placeholder","end-placeholder","is-range","arrow-control","popper-class","range-separator","format","default-value","id","name","prefix-icon","clear-icon","disabled-hours","disabled-minutes","disabled-seconds","teleported","change","blur","focus","visible-change"],"description":"Use Time Picker for time input.\n\n[Docs](https://element-plus.org/en-US/component/time-picker.html#timepicker)"},"el-time-select":{"attributes":["model-value","disabled","editable","clearable","size","placeholder","name","effect","prefix-icon","clear-icon","start","end","step","min-time","max-time","format","change","blur","focus"],"description":"Use Time Select for time input.\n\n[Docs](https://element-plus.org/en-US/component/time-select.html#timeselect)"},"el-timeline":{"subtags":["el-timeline-item"],"description":"Visually display timeline.\n\n[Docs](https://element-plus.org/en-US/component/timeline.html#timeline)"},"el-timeline-item":{"attributes":["timestamp","hide-timestamp","center","placement","type","color","size","icon","hollow"],"description":"[Docs](https://element-plus.org/en-US/component/timeline.html#timeline-item)"},"el-tooltip":{"attributes":["append-to","effect","content","raw-content","placement","visible","disabled","offset","transition","popper-options","show-after","show-arrow","hide-after","auto-close","manual","popper-class","enterable","tabindex","teleported","trigger","virtual-triggering","virtual-ref","trigger-keys"],"description":"Display prompt information for mouse hover.\n\n[Docs](https://element-plus.org/en-US/component/tooltip.html#tooltip)"},"el-transfer":{"attributes":["model-value","data","filterable","filter-placeholder","filter-method","target-order","titles","button-texts","render-content","format","props","left-default-checked","right-default-checked","validate-event","change","left-check-change","right-check-change"],"description":"[Docs](https://element-plus.org/en-US/component/transfer.html#transfer)"},"el-own":{"attributes":["cache-data"],"description":"[Docs](https://element-plus.org/en-US/component/tree-select.html#own)"},"el-tree-v2":{"attributes":["data","empty-text","props","highlight-current","expand-on-click-node","check-on-click-node","default-expanded-keys","show-checkbox","check-strictly","default-checked-keys","current-node-key","filter-method","indent","icon","node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse"],"description":"[Docs](https://element-plus.org/en-US/component/tree-v2.html#treev2)"},"el-tree":{"attributes":["data","empty-text","node-key","props","render-after-expand","load","render-content","highlight-current","default-expand-all","expand-on-click-node","check-on-click-node","auto-expand-parent","default-expanded-keys","show-checkbox","check-strictly","default-checked-keys","current-node-key","filter-node-method","accordion","indent","icon","lazy","draggable","allow-drag","allow-drop","node-click","node-contextmenu","check-change","check","current-change","node-expand","node-collapse","node-drag-start","node-drag-enter","node-drag-leave","node-drag-over","node-drag-end","node-drop"],"description":"Display a set of data with hierarchies.\n\n[Docs](https://element-plus.org/en-US/component/tree.html#tree)"},"el-upload":{"attributes":["action","headers","method","multiple","data","name","with-credentials","show-file-list","drag","accept","on-preview","on-remove","on-success","on-error","on-progress","on-change","on-exceed","before-upload","before-remove","file-list","list-type","auto-upload","http-request","disabled","limit"],"description":"Upload files by clicking or drag-and-drop.\n\n[Docs](https://element-plus.org/en-US/component/upload.html#upload)"}}
|