@element-plus/nightly 0.0.20240118 → 0.0.20240119
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +29 -17
- package/dist/index.full.min.js +3 -3
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +7 -7
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +29 -17
- 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-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.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/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.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/index.mjs +2 -2
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +35 -4
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +4 -35
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/pagination/src/components/pager.mjs +17 -216
- package/es/components/pagination/src/components/pager.mjs.map +1 -1
- package/es/components/pagination/src/components/pager2.mjs +216 -17
- package/es/components/pagination/src/components/pager2.mjs.map +1 -1
- package/es/components/pagination/src/pagination.mjs +1 -1
- package/es/components/scrollbar/index.mjs +1 -1
- package/es/components/scrollbar/src/bar2.mjs +1 -1
- package/es/components/scrollbar/src/thumb.mjs +11 -130
- package/es/components/scrollbar/src/thumb.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb2.mjs +130 -11
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/space/src/use-space.mjs +7 -8
- package/es/components/space/src/use-space.mjs.map +1 -1
- package/es/components/tour/index.d.ts +9 -9
- package/es/components/tour/src/helper.d.ts +1 -1
- package/es/components/tour/src/helper.mjs +20 -7
- package/es/components/tour/src/helper.mjs.map +1 -1
- package/es/components/tour/src/step.d.ts +1 -1
- package/es/components/tour/src/step.mjs +1 -1
- package/es/components/tour/src/step.mjs.map +1 -1
- package/es/components/tour/src/step.vue.d.ts +3 -3
- package/es/components/tour/src/tour.vue.d.ts +3 -3
- package/es/components/tour/src/types.d.ts +1 -1
- package/es/index.mjs +2 -2
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/index.js +2 -2
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +35 -4
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +4 -35
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/pagination/src/components/pager.js +17 -216
- package/lib/components/pagination/src/components/pager.js.map +1 -1
- package/lib/components/pagination/src/components/pager2.js +216 -17
- package/lib/components/pagination/src/components/pager2.js.map +1 -1
- package/lib/components/pagination/src/pagination.js +1 -1
- package/lib/components/scrollbar/index.js +1 -1
- package/lib/components/scrollbar/src/bar2.js +1 -1
- package/lib/components/scrollbar/src/thumb.js +11 -130
- package/lib/components/scrollbar/src/thumb.js.map +1 -1
- package/lib/components/scrollbar/src/thumb2.js +130 -11
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/space/src/use-space.js +7 -8
- package/lib/components/space/src/use-space.js.map +1 -1
- package/lib/components/tour/index.d.ts +9 -9
- package/lib/components/tour/src/helper.d.ts +1 -1
- package/lib/components/tour/src/helper.js +19 -6
- package/lib/components/tour/src/helper.js.map +1 -1
- package/lib/components/tour/src/step.d.ts +1 -1
- package/lib/components/tour/src/step.js +1 -1
- package/lib/components/tour/src/step.js.map +1 -1
- package/lib/components/tour/src/step.vue.d.ts +3 -3
- package/lib/components/tour/src/tour.vue.d.ts +3 -3
- package/lib/components/tour/src/types.d.ts +1 -1
- package/lib/index.js +2 -2
- 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/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helper.mjs","sources":["../../../../../../packages/components/tour/src/helper.ts"],"sourcesContent":["import {\n camelize,\n computed,\n isVNode,\n onBeforeUnmount,\n onMounted,\n ref,\n unref,\n watch,\n watchEffect,\n} from 'vue'\nimport {\n arrow,\n autoUpdate,\n computePosition,\n detectOverflow,\n flip,\n offset as offsetMiddelware,\n shift,\n} from '@floating-ui/dom'\nimport { hasOwn, isArray, isClient, keysOf } from '@element-plus/utils'\n\nimport type {\n CSSProperties,\n Component,\n ComputedRef,\n InjectionKey,\n Ref,\n SetupContext,\n VNode,\n} from 'vue'\nimport type { UseNamespaceReturn } from '@element-plus/hooks'\nimport type { PosInfo, TourGap, TourMask } from './types'\nimport type {\n ComputePositionReturn,\n Middleware,\n Placement,\n Strategy,\n VirtualElement,\n} from '@floating-ui/dom'\n\nexport const useTarget = (\n target: Ref<HTMLElement | null | undefined>,\n open: Ref<boolean>,\n gap: Ref<TourGap>,\n mergedMask: Ref<TourMask>,\n scrollIntoViewOptions: Ref<boolean | ScrollIntoViewOptions>\n) => {\n const posInfo: Ref<PosInfo | null> = ref(null)\n\n const updatePosInfo = () => {\n if (!target.value || !open.value) {\n posInfo.value = null\n return\n }\n if (!isInViewPort(target.value) && open.value) {\n target.value.scrollIntoView(scrollIntoViewOptions.value)\n }\n const { left, top, width, height } = target.value.getBoundingClientRect()\n posInfo.value = {\n left,\n top,\n width,\n height,\n radius: 0,\n }\n }\n\n onMounted(() => {\n watch(\n [open, target],\n () => {\n updatePosInfo()\n },\n {\n immediate: true,\n }\n )\n window.addEventListener('resize', updatePosInfo)\n })\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', updatePosInfo)\n })\n\n const getGapOffset = (index: number) =>\n (isArray(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) ??\n 6\n\n const mergedPosInfo = computed(() => {\n if (!posInfo.value) return posInfo.value\n\n const gapOffsetX = getGapOffset(0)\n const gapOffsetY = getGapOffset(1)\n const gapRadius = gap.value?.radius || 2\n\n return {\n left: posInfo.value.left - gapOffsetX,\n top: posInfo.value.top - gapOffsetY,\n width: posInfo.value.width + gapOffsetX * 2,\n height: posInfo.value.height + gapOffsetY * 2,\n radius: gapRadius,\n }\n })\n\n const triggerTarget = computed(() => {\n if (!mergedMask.value || !target.value || !window.DOMRect) {\n return target.value || undefined\n }\n\n return {\n getBoundingClientRect() {\n return window.DOMRect.fromRect({\n width: mergedPosInfo.value?.width || 0,\n height: mergedPosInfo.value?.height || 0,\n x: mergedPosInfo.value?.left || 0,\n y: mergedPosInfo.value?.top || 0,\n })\n },\n }\n })\n\n return {\n mergedPosInfo,\n triggerTarget,\n }\n}\n\nexport interface TourContext {\n current: Ref<number>\n total: ComputedRef<number>\n showClose: Ref<boolean>\n closeIcon: Ref<string | Component>\n mergedType: Ref<'default' | 'primary' | undefined>\n ns: UseNamespaceReturn\n slots: SetupContext['slots']\n updateModelValue(modelValue: boolean): void\n onClose(): void\n onFinish(): void\n onChange(): void\n}\n\nexport const tourKey: InjectionKey<TourContext> = Symbol('ElTour')\n\nfunction isInViewPort(element: HTMLElement) {\n const viewWidth = window.innerWidth || document.documentElement.clientWidth\n const viewHeight = window.innerHeight || document.documentElement.clientHeight\n const { top, right, bottom, left } = element.getBoundingClientRect()\n\n return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight\n}\n\nconst isSameProps = (a: Record<string, any>, b: Record<string, any>) => {\n if (Object.keys(a).length !== Object.keys(b).length) return false\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n return true\n}\n\nexport function isSameSteps(a: any[], b: any[]) {\n if (a.length !== b.length) return false\n for (const [index] of a.entries()) {\n if (isSameProps(a[index], b[index])) {\n return false\n }\n }\n return true\n}\n\nexport const getNormalizedProps = (node: VNode, booleanKeys: string[]) => {\n if (!isVNode(node)) {\n return {}\n }\n\n const raw = node.props || {}\n const type = (node.type as any)?.props || {}\n const props: Record<string, any> = {}\n Object.keys(type).forEach((key) => {\n if (hasOwn(type[key], 'default')) {\n props[key] = type[key].default\n }\n })\n\n Object.keys(raw).forEach((key) => {\n const cameKey = camelize(key)\n props[cameKey] = raw[key]\n if (booleanKeys.includes(cameKey) && props[cameKey] === '') {\n props[cameKey] = true\n }\n })\n\n return props\n}\n\nexport const useFloating = (\n referenceRef: Ref<HTMLElement | VirtualElement | null>,\n contentRef: Ref<HTMLElement | null>,\n arrowRef: Ref<HTMLElement | null>,\n placement: Ref<Placement | undefined>,\n strategy: Ref<Strategy>,\n offset: Ref<number>,\n zIndex: Ref<number>,\n showArrow: Ref<boolean>\n) => {\n const x = ref<number>()\n const y = ref<number>()\n const middlewareData = ref<ComputePositionReturn['middlewareData']>({})\n\n const states = {\n x,\n y,\n placement,\n strategy,\n middlewareData,\n } as const\n\n const middleware = computed(() => {\n const _middleware: Middleware[] = [\n offsetMiddelware(unref(offset)),\n flip(),\n shift(),\n overflowMiddleware(),\n ]\n\n if (unref(showArrow) && unref(arrowRef)) {\n _middleware.push(\n arrow({\n element: unref(arrowRef)!,\n })\n )\n }\n return _middleware\n })\n\n const update = async () => {\n if (!isClient) return\n\n const referenceEl = unref(referenceRef)\n const contentEl = unref(contentRef)\n if (!referenceEl || !contentEl) return\n\n const data = await computePosition(referenceEl, contentEl, {\n placement: unref(placement),\n strategy: unref(strategy),\n middleware: unref(middleware),\n })\n\n keysOf(states).forEach((key) => {\n states[key].value = data[key]\n })\n }\n\n const contentStyle = computed<CSSProperties>(() => {\n if (!unref(referenceRef)) {\n return {\n position: 'fixed',\n top: '50%',\n left: '50%',\n transform: 'translate3d(-50%, -50%, 0)',\n maxWidth: '100vw',\n zIndex: unref(zIndex),\n }\n }\n\n const { overflow } = unref(middlewareData)\n\n return {\n position: unref(strategy),\n zIndex: unref(zIndex),\n top: unref(y) != null ? `${unref(y)}px` : '',\n left: unref(x) != null ? `${unref(x)}px` : '',\n maxWidth: overflow?.maxWidth ? `${overflow?.maxWidth}px` : '',\n }\n })\n\n const arrowStyle = computed<CSSProperties>(() => {\n if (!unref(showArrow)) return {}\n\n const { arrow } = unref(middlewareData)\n return {\n left: arrow?.x != null ? `${arrow?.x}px` : '',\n top: arrow?.y != null ? `${arrow?.y}px` : '',\n }\n })\n\n let cleanup: any\n onMounted(() => {\n cleanup = autoUpdate(unref(referenceRef)!, unref(contentRef)!, update)\n\n watchEffect(() => {\n update()\n })\n })\n\n onBeforeUnmount(() => {\n cleanup && cleanup()\n })\n\n return {\n update,\n contentStyle,\n arrowStyle,\n }\n}\n\nconst overflowMiddleware = (): Middleware => {\n return {\n name: 'overflow',\n async fn(state) {\n const overflow = await detectOverflow(state)\n let overWidth = 0\n if (overflow.left > 0) overWidth = overflow.left\n if (overflow.right > 0) overWidth = overflow.right\n const floatingWidth = state.rects.floating.width\n return {\n data: {\n maxWidth: floatingWidth - overWidth,\n },\n }\n },\n }\n}\n"],"names":["offset","offsetMiddelware"],"mappings":";;;;;;;AAqBY,MAAC,SAAS,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,qBAAqB,KAAK;AACnF,EAAE,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,EAAE,MAAM,aAAa,GAAG,MAAM;AAC9B,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AACtC,MAAM,OAAO,CAAC,KAAK,GAAG,IAAI,CAAC;AAC3B,MAAM,OAAO;AACb,KAAK;AACL,IAAI,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;AACnD,MAAM,MAAM,CAAC,KAAK,CAAC,cAAc,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAC/D,KAAK;AACL,IAAI,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAAC,KAAK,CAAC,qBAAqB,EAAE,CAAC;AAC9E,IAAI,OAAO,CAAC,KAAK,GAAG;AACpB,MAAM,IAAI;AACV,MAAM,GAAG;AACT,MAAM,KAAK;AACX,MAAM,MAAM;AACZ,MAAM,MAAM,EAAE,CAAC;AACf,KAAK,CAAC;AACN,GAAG,CAAC;AACJ,EAAE,SAAS,CAAC,MAAM;AAClB,IAAI,KAAK,CAAC,CAAC,IAAI,EAAE,MAAM,CAAC,EAAE,MAAM;AAChC,MAAM,aAAa,EAAE,CAAC;AACtB,KAAK,EAAE;AACP,MAAM,SAAS,EAAE,IAAI;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ACL,EAAE,eAAe,CAAC,MAAM;AACxB,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;AACzB,GAAG,CAAC,CAAC;AACL,EAAE,OAAO;AACT,IAAI,MAAM;AACV,IAAI,YAAY;AAChB,IAAI,UAAU;AACd,GAAG,CAAC;AACJ,EAAE;AACF,MAAM,kBAAkB,GAAG,MAAM;AACjC,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,UAAU;AACpB,IAAI,MAAM,EAAE,CAAC,KAAK,EAAE;AACpB,MAAM,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,KAAK,CAAC,CAAC;AACnD,MAAM,IAAI,SAAS,GAAG,CAAC,CAAC;AACxB,MAAM,IAAI,QAAQ,CAAC,IAAI,GAAG,CAAC;AAC3B,QAAQ,SAAS,GAAG,QAAQ,CAAC,IAAI,CAAC;AAClC,MAAM,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC;AAC5B,QAAQ,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC;AACnC,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AACvD,MAAM,OAAO;AACb,QAAQ,IAAI,EAAE;AACd,UAAU,QAAQ,EAAE,aAAa,GAAG,SAAS;AAC7C,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"helper.mjs","sources":["../../../../../../packages/components/tour/src/helper.ts"],"sourcesContent":["import {\n camelize,\n computed,\n isVNode,\n onBeforeUnmount,\n onMounted,\n ref,\n unref,\n watch,\n watchEffect,\n} from 'vue'\nimport {\n arrow,\n autoUpdate,\n computePosition,\n detectOverflow,\n flip,\n offset as offsetMiddelware,\n shift,\n} from '@floating-ui/dom'\nimport {\n hasOwn,\n isArray,\n isClient,\n isFunction,\n isString,\n keysOf,\n} from '@element-plus/utils'\n\nimport type {\n CSSProperties,\n Component,\n ComputedRef,\n InjectionKey,\n Ref,\n SetupContext,\n VNode,\n} from 'vue'\nimport type { UseNamespaceReturn } from '@element-plus/hooks'\nimport type { PosInfo, TourGap, TourMask } from './types'\nimport type {\n ComputePositionReturn,\n Middleware,\n Placement,\n Strategy,\n VirtualElement,\n} from '@floating-ui/dom'\n\nexport const useTarget = (\n target: Ref<\n string | HTMLElement | (() => HTMLElement | null) | null | undefined\n >,\n open: Ref<boolean>,\n gap: Ref<TourGap>,\n mergedMask: Ref<TourMask>,\n scrollIntoViewOptions: Ref<boolean | ScrollIntoViewOptions>\n) => {\n const posInfo: Ref<PosInfo | null> = ref(null)\n\n const getTargetEl = () => {\n let targetEl: HTMLElement | null | undefined\n if (isString(target.value)) {\n targetEl = document.querySelector<HTMLElement>(target.value)\n } else if (isFunction(target.value)) {\n targetEl = target.value()\n } else {\n targetEl = target.value\n }\n return targetEl\n }\n\n const updatePosInfo = () => {\n const targetEl = getTargetEl()\n if (!targetEl || !open.value) {\n posInfo.value = null\n return\n }\n if (!isInViewPort(targetEl) && open.value) {\n targetEl.scrollIntoView(scrollIntoViewOptions.value)\n }\n const { left, top, width, height } = targetEl.getBoundingClientRect()\n posInfo.value = {\n left,\n top,\n width,\n height,\n radius: 0,\n }\n }\n\n onMounted(() => {\n watch(\n [open, target],\n () => {\n updatePosInfo()\n },\n {\n immediate: true,\n }\n )\n window.addEventListener('resize', updatePosInfo)\n })\n\n onBeforeUnmount(() => {\n window.removeEventListener('resize', updatePosInfo)\n })\n\n const getGapOffset = (index: number) =>\n (isArray(gap.value.offset) ? gap.value.offset[index] : gap.value.offset) ??\n 6\n\n const mergedPosInfo = computed(() => {\n if (!posInfo.value) return posInfo.value\n\n const gapOffsetX = getGapOffset(0)\n const gapOffsetY = getGapOffset(1)\n const gapRadius = gap.value?.radius || 2\n\n return {\n left: posInfo.value.left - gapOffsetX,\n top: posInfo.value.top - gapOffsetY,\n width: posInfo.value.width + gapOffsetX * 2,\n height: posInfo.value.height + gapOffsetY * 2,\n radius: gapRadius,\n }\n })\n\n const triggerTarget = computed(() => {\n const targetEl = getTargetEl()\n if (!mergedMask.value || !targetEl || !window.DOMRect) {\n return targetEl || undefined\n }\n\n return {\n getBoundingClientRect() {\n return window.DOMRect.fromRect({\n width: mergedPosInfo.value?.width || 0,\n height: mergedPosInfo.value?.height || 0,\n x: mergedPosInfo.value?.left || 0,\n y: mergedPosInfo.value?.top || 0,\n })\n },\n }\n })\n\n return {\n mergedPosInfo,\n triggerTarget,\n }\n}\n\nexport interface TourContext {\n current: Ref<number>\n total: ComputedRef<number>\n showClose: Ref<boolean>\n closeIcon: Ref<string | Component>\n mergedType: Ref<'default' | 'primary' | undefined>\n ns: UseNamespaceReturn\n slots: SetupContext['slots']\n updateModelValue(modelValue: boolean): void\n onClose(): void\n onFinish(): void\n onChange(): void\n}\n\nexport const tourKey: InjectionKey<TourContext> = Symbol('ElTour')\n\nfunction isInViewPort(element: HTMLElement) {\n const viewWidth = window.innerWidth || document.documentElement.clientWidth\n const viewHeight = window.innerHeight || document.documentElement.clientHeight\n const { top, right, bottom, left } = element.getBoundingClientRect()\n\n return top >= 0 && left >= 0 && right <= viewWidth && bottom <= viewHeight\n}\n\nconst isSameProps = (a: Record<string, any>, b: Record<string, any>) => {\n if (Object.keys(a).length !== Object.keys(b).length) return false\n for (const key in a) {\n if (a[key] !== b[key]) {\n return false\n }\n }\n return true\n}\n\nexport function isSameSteps(a: any[], b: any[]) {\n if (a.length !== b.length) return false\n for (const [index] of a.entries()) {\n if (isSameProps(a[index], b[index])) {\n return false\n }\n }\n return true\n}\n\nexport const getNormalizedProps = (node: VNode, booleanKeys: string[]) => {\n if (!isVNode(node)) {\n return {}\n }\n\n const raw = node.props || {}\n const type = (node.type as any)?.props || {}\n const props: Record<string, any> = {}\n Object.keys(type).forEach((key) => {\n if (hasOwn(type[key], 'default')) {\n props[key] = type[key].default\n }\n })\n\n Object.keys(raw).forEach((key) => {\n const cameKey = camelize(key)\n props[cameKey] = raw[key]\n if (booleanKeys.includes(cameKey) && props[cameKey] === '') {\n props[cameKey] = true\n }\n })\n\n return props\n}\n\nexport const useFloating = (\n referenceRef: Ref<HTMLElement | VirtualElement | null>,\n contentRef: Ref<HTMLElement | null>,\n arrowRef: Ref<HTMLElement | null>,\n placement: Ref<Placement | undefined>,\n strategy: Ref<Strategy>,\n offset: Ref<number>,\n zIndex: Ref<number>,\n showArrow: Ref<boolean>\n) => {\n const x = ref<number>()\n const y = ref<number>()\n const middlewareData = ref<ComputePositionReturn['middlewareData']>({})\n\n const states = {\n x,\n y,\n placement,\n strategy,\n middlewareData,\n } as const\n\n const middleware = computed(() => {\n const _middleware: Middleware[] = [\n offsetMiddelware(unref(offset)),\n flip(),\n shift(),\n overflowMiddleware(),\n ]\n\n if (unref(showArrow) && unref(arrowRef)) {\n _middleware.push(\n arrow({\n element: unref(arrowRef)!,\n })\n )\n }\n return _middleware\n })\n\n const update = async () => {\n if (!isClient) return\n\n const referenceEl = unref(referenceRef)\n const contentEl = unref(contentRef)\n if (!referenceEl || !contentEl) return\n\n const data = await computePosition(referenceEl, contentEl, {\n placement: unref(placement),\n strategy: unref(strategy),\n middleware: unref(middleware),\n })\n\n keysOf(states).forEach((key) => {\n states[key].value = data[key]\n })\n }\n\n const contentStyle = computed<CSSProperties>(() => {\n if (!unref(referenceRef)) {\n return {\n position: 'fixed',\n top: '50%',\n left: '50%',\n transform: 'translate3d(-50%, -50%, 0)',\n maxWidth: '100vw',\n zIndex: unref(zIndex),\n }\n }\n\n const { overflow } = unref(middlewareData)\n\n return {\n position: unref(strategy),\n zIndex: unref(zIndex),\n top: unref(y) != null ? `${unref(y)}px` : '',\n left: unref(x) != null ? `${unref(x)}px` : '',\n maxWidth: overflow?.maxWidth ? `${overflow?.maxWidth}px` : '',\n }\n })\n\n const arrowStyle = computed<CSSProperties>(() => {\n if (!unref(showArrow)) return {}\n\n const { arrow } = unref(middlewareData)\n return {\n left: arrow?.x != null ? `${arrow?.x}px` : '',\n top: arrow?.y != null ? `${arrow?.y}px` : '',\n }\n })\n\n let cleanup: any\n onMounted(() => {\n cleanup = autoUpdate(unref(referenceRef)!, unref(contentRef)!, update)\n\n watchEffect(() => {\n update()\n })\n })\n\n onBeforeUnmount(() => {\n cleanup && cleanup()\n })\n\n return {\n update,\n contentStyle,\n arrowStyle,\n }\n}\n\nconst overflowMiddleware = (): Middleware => {\n return {\n name: 'overflow',\n async fn(state) {\n const overflow = await detectOverflow(state)\n let overWidth = 0\n if (overflow.left > 0) overWidth = overflow.left\n if (overflow.right > 0) overWidth = overflow.right\n const floatingWidth = state.rects.floating.width\n return {\n data: {\n maxWidth: floatingWidth - overWidth,\n },\n }\n },\n }\n}\n"],"names":["offset","offsetMiddelware"],"mappings":";;;;;;;AA4BY,MAAC,SAAS,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,UAAU,EAAE,qBAAqB,KAAK;AACnF,EAAE,MAAM,OAAO,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC;AAC5B,EAAE,MAAM,WAAW,GAAG,MAAM;AAC5B,IAAI,IAAI,QAAQ,CAAC;AACjB,IAAI,IAAI,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AAChC,MAAM,QAAQ,GAAG,QAAQ,CAAC,aAAa,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AACtD,KAAK,MAAM,IAAI,UAAU,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE;AACzC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,EAAE,CAAC;AAChC,KAAK,MAAM;AACX,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC;AAC9B,KAAK;AACL,IAAI,OAAO,QAAQ,CAAC;AACpB,GAAG,CAAC;AACJ,EAAE,MAAM,aAAa,GAAG,MAAM;AAC9B,IAAI,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;AACnC,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,IAAI,CAAC,KAAK,EAAE;AAClC,MAAM,OAAO,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MAAM,IAAI,QAAQ,CAAC,KAAK,GAAG,CAAC;AAC5B,QAAQ,SAAS,GAAG,QAAQ,CAAC,KAAK,CAAC;AACnC,MAAM,MAAM,aAAa,GAAG,KAAK,CAAC,KAAK,CAAC,QAAQ,CAAC,KAAK,CAAC;AACvD,MAAM,OAAO;AACb,QAAQ,IAAI,EAAE;AACd,UAAU,QAAQ,EAAE,aAAa,GAAG,SAAS;AAC7C,SAAS;AACT,OAAO,CAAC;AACR,KAAK;AACL,GAAG,CAAC;AACJ,CAAC;;;;"}
|
|
@@ -2,7 +2,7 @@ import type { CSSProperties, ExtractPropTypes } from 'vue';
|
|
|
2
2
|
import type { TourBtnProps, TourMask } from './types';
|
|
3
3
|
export declare const tourStepProps: {
|
|
4
4
|
target: {
|
|
5
|
-
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => HTMLElement) | (() => HTMLElement | null) | ((new (...args: any[]) => HTMLElement) | (() => HTMLElement | null))[], unknown, unknown>>;
|
|
5
|
+
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null) | ((new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null))[], unknown, unknown>>;
|
|
6
6
|
readonly required: false;
|
|
7
7
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
8
8
|
__epPropKey: true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"step.mjs","sources":["../../../../../../packages/components/tour/src/step.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@element-plus/utils'\nimport { tourContentProps } from './content'\nimport type { CSSProperties, ExtractPropTypes } from 'vue'\nimport type { TourBtnProps, TourMask } from './types'\n\nexport const tourStepProps = buildProps({\n /**\n * @description get the element the guide card points to. empty makes it show in center of screen\n */\n target: {\n type: definePropType
|
|
1
|
+
{"version":3,"file":"step.mjs","sources":["../../../../../../packages/components/tour/src/step.ts"],"sourcesContent":["import { buildProps, definePropType, iconPropType } from '@element-plus/utils'\nimport { tourContentProps } from './content'\nimport type { CSSProperties, ExtractPropTypes } from 'vue'\nimport type { TourBtnProps, TourMask } from './types'\n\nexport const tourStepProps = buildProps({\n /**\n * @description get the element the guide card points to. empty makes it show in center of screen\n */\n target: {\n type: definePropType<\n string | HTMLElement | (() => HTMLElement | null) | null\n >([String, Object, Function]),\n },\n /**\n * @description the title of the tour content\n */\n title: String,\n /**\n * @description description\n */\n description: String,\n /**\n * @description whether to show a close button\n */\n showClose: {\n type: Boolean,\n default: true,\n },\n /**\n * @description custom close icon, default is Close\n */\n closeIcon: {\n type: iconPropType,\n },\n /**\n * @description whether to show the arrow\n */\n showArrow: {\n type: Boolean,\n default: true,\n },\n /**\n * @description position of the guide card relative to the target element\n */\n placement: tourContentProps.placement,\n /**\n * @description whether to enable masking, change mask style and fill color by pass custom props\n */\n mask: {\n type: definePropType<TourMask>([Boolean, Object]),\n },\n /**\n * @description custom style for content\n */\n contentStyle: {\n type: definePropType<CSSProperties>([Object]),\n },\n /**\n * @description properties of the previous button\n */\n prevButtonProps: {\n type: definePropType<TourBtnProps>(Object),\n },\n /**\n * @description properties of the Next button\n */\n nextButtonProps: {\n type: definePropType<TourBtnProps>(Object),\n },\n /**\n * @description support pass custom scrollIntoView options\n */\n scrollIntoViewOptions: {\n type: definePropType<boolean | ScrollIntoViewOptions>([Boolean, Object]),\n },\n /**\n * @description type, affects the background color and text color\n */\n type: {\n type: definePropType<'defalut' | 'primary'>(String),\n },\n})\n\nexport type TourStepProps = ExtractPropTypes<typeof tourStepProps>\n\nexport const tourStepEmits = {\n close: () => true,\n}\nexport type TourStepEmits = typeof tourStepEmits\n"],"names":[],"mappings":";;;;;AAEY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AACpD,GAAG;AACH,EAAE,KAAK,EAAE,MAAM;AACf,EAAE,WAAW,EAAE,MAAM;AACrB,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,YAAY;AACtB,GAAG;AACH,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,SAAS,EAAE,gBAAgB,CAAC,SAAS;AACvC,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3C,GAAG;AACH,EAAE,YAAY,EAAE;AAChB,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC;AAClC,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,EAAE,qBAAqB,EAAE;AACzB,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;AAC3C,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,GAAG;AACH,CAAC,EAAE;AACS,MAAC,aAAa,GAAG;AAC7B,EAAE,KAAK,EAAE,MAAM,IAAI;AACnB;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
target: {
|
|
3
|
-
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => HTMLElement) | (() => HTMLElement | null) | ((new (...args: any[]) => HTMLElement) | (() => HTMLElement | null))[], unknown, unknown>>;
|
|
3
|
+
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null) | ((new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null))[], unknown, unknown>>;
|
|
4
4
|
readonly required: false;
|
|
5
5
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
6
6
|
__epPropKey: true;
|
|
@@ -55,7 +55,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
55
55
|
}, {
|
|
56
56
|
props: Readonly<import("@vue/shared").LooseRequired<Readonly<import("vue").ExtractPropTypes<{
|
|
57
57
|
target: {
|
|
58
|
-
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => HTMLElement) | (() => HTMLElement | null) | ((new (...args: any[]) => HTMLElement) | (() => HTMLElement | null))[], unknown, unknown>>;
|
|
58
|
+
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null) | ((new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null))[], unknown, unknown>>;
|
|
59
59
|
readonly required: false;
|
|
60
60
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
61
61
|
__epPropKey: true;
|
|
@@ -483,7 +483,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
483
483
|
close: () => boolean;
|
|
484
484
|
}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
485
485
|
target: {
|
|
486
|
-
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => HTMLElement) | (() => HTMLElement | null) | ((new (...args: any[]) => HTMLElement) | (() => HTMLElement | null))[], unknown, unknown>>;
|
|
486
|
+
readonly type: import("vue").PropType<import("@element-plus/nightly/es/utils").EpPropMergeType<(new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null) | ((new (...args: any[]) => (string | HTMLElement | (() => HTMLElement | null) | null) & {}) | (() => string | HTMLElement | (() => HTMLElement | null) | null))[], unknown, unknown>>;
|
|
487
487
|
readonly required: false;
|
|
488
488
|
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
489
489
|
__epPropKey: true;
|
|
@@ -108,7 +108,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
108
108
|
cssVarBlockName: (name: string) => string;
|
|
109
109
|
};
|
|
110
110
|
steps: import("vue").Ref<{
|
|
111
|
-
target?: HTMLElement | null | undefined;
|
|
111
|
+
target?: string | HTMLElement | (() => HTMLElement | null) | null | undefined;
|
|
112
112
|
showArrow?: boolean | undefined;
|
|
113
113
|
placement?: import("@floating-ui/core").Placement | undefined;
|
|
114
114
|
contentStyle?: {
|
|
@@ -3184,7 +3184,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
3184
3184
|
current: import("vue").Ref<number> | import("vue").WritableComputedRef<number>;
|
|
3185
3185
|
total: import("vue").ComputedRef<number>;
|
|
3186
3186
|
currentStep: import("vue").ComputedRef<{
|
|
3187
|
-
target?: HTMLElement | null | undefined;
|
|
3187
|
+
target?: string | HTMLElement | (() => HTMLElement | null) | null | undefined;
|
|
3188
3188
|
showArrow?: boolean | undefined;
|
|
3189
3189
|
placement?: import("@floating-ui/core").Placement | undefined;
|
|
3190
3190
|
contentStyle?: {
|
|
@@ -6257,7 +6257,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
6257
6257
|
behavior?: ScrollBehavior | undefined;
|
|
6258
6258
|
} | undefined;
|
|
6259
6259
|
}>;
|
|
6260
|
-
currentTarget: import("vue").ComputedRef<HTMLElement | null | undefined>;
|
|
6260
|
+
currentTarget: import("vue").ComputedRef<string | HTMLElement | (() => HTMLElement | null) | null | undefined>;
|
|
6261
6261
|
kls: import("vue").ComputedRef<string[]>;
|
|
6262
6262
|
mergedPlacement: import("vue").ComputedRef<"top" | "bottom" | "right" | "left" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right-start" | "right-end" | "left-start" | "left-end">;
|
|
6263
6263
|
mergedContentStyle: import("vue").ComputedRef<import("vue").CSSProperties | undefined>;
|
|
@@ -22,7 +22,7 @@ export interface PosInfo {
|
|
|
22
22
|
radius: number;
|
|
23
23
|
}
|
|
24
24
|
export interface UsedTourStepProps {
|
|
25
|
-
target?: HTMLElement | null;
|
|
25
|
+
target?: string | HTMLElement | (() => HTMLElement | null) | null;
|
|
26
26
|
showArrow?: boolean;
|
|
27
27
|
placement?: Placement;
|
|
28
28
|
contentStyle?: CSSProperties;
|
package/es/index.mjs
CHANGED
|
@@ -99,7 +99,7 @@ export { linkEmits, linkProps } from './components/link/src/link.mjs';
|
|
|
99
99
|
export { ElLink } from './components/link/index.mjs';
|
|
100
100
|
export { menuEmits, menuProps } from './components/menu/src/menu.mjs';
|
|
101
101
|
export { menuItemEmits, menuItemProps } from './components/menu/src/menu-item.mjs';
|
|
102
|
-
export { menuItemGroupProps } from './components/menu/src/menu-item-
|
|
102
|
+
export { menuItemGroupProps } from './components/menu/src/menu-item-group2.mjs';
|
|
103
103
|
export { subMenuProps } from './components/menu/src/sub-menu.mjs';
|
|
104
104
|
export { ElMenu, ElMenuItem, ElMenuItemGroup, ElSubMenu } from './components/menu/index.mjs';
|
|
105
105
|
export { overlayEmits, overlayProps } from './components/overlay/src/overlay.mjs';
|
|
@@ -136,7 +136,7 @@ export { rowContextKey } from './components/row/src/constants.mjs';
|
|
|
136
136
|
export { ElRow } from './components/row/index.mjs';
|
|
137
137
|
export { BAR_MAP, GAP, renderThumbStyle } from './components/scrollbar/src/util.mjs';
|
|
138
138
|
export { scrollbarEmits, scrollbarProps } from './components/scrollbar/src/scrollbar.mjs';
|
|
139
|
-
export { thumbProps } from './components/scrollbar/src/
|
|
139
|
+
export { thumbProps } from './components/scrollbar/src/thumb.mjs';
|
|
140
140
|
export { scrollbarContextKey } from './components/scrollbar/src/constants.mjs';
|
|
141
141
|
export { ElScrollbar } from './components/scrollbar/index.mjs';
|
|
142
142
|
export { selectGroupKey, selectKey } from './components/select/src/token.mjs';
|
package/es/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "0.0.
|
|
1
|
+
export declare const version = "0.0.20240119";
|
package/es/version.mjs
CHANGED
package/es/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.
|
|
1
|
+
{"version":3,"file":"version.mjs","sources":["../../../packages/element-plus/version.ts"],"sourcesContent":["export const version = '0.0.20240119'\n"],"names":[],"mappings":"AAAY,MAAC,OAAO,GAAG;;;;"}
|
package/lib/components/index.js
CHANGED
|
@@ -138,7 +138,7 @@ var inputNumber = require('./input-number/src/input-number.js');
|
|
|
138
138
|
var link = require('./link/src/link.js');
|
|
139
139
|
var menu = require('./menu/src/menu.js');
|
|
140
140
|
var menuItem = require('./menu/src/menu-item.js');
|
|
141
|
-
var menuItemGroup = require('./menu/src/menu-item-
|
|
141
|
+
var menuItemGroup = require('./menu/src/menu-item-group2.js');
|
|
142
142
|
var subMenu = require('./menu/src/sub-menu.js');
|
|
143
143
|
var overlay = require('./overlay/src/overlay.js');
|
|
144
144
|
var pageHeader = require('./page-header/src/page-header.js');
|
|
@@ -164,7 +164,7 @@ var row = require('./row/src/row.js');
|
|
|
164
164
|
var constants$c = require('./row/src/constants.js');
|
|
165
165
|
var util = require('./scrollbar/src/util.js');
|
|
166
166
|
var scrollbar = require('./scrollbar/src/scrollbar.js');
|
|
167
|
-
var thumb = require('./scrollbar/src/
|
|
167
|
+
var thumb = require('./scrollbar/src/thumb.js');
|
|
168
168
|
var constants$d = require('./scrollbar/src/constants.js');
|
|
169
169
|
var token = require('./select/src/token.js');
|
|
170
170
|
var token$1 = require('./select-v2/src/token.js');
|
|
@@ -5,10 +5,10 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
require('../../utils/index.js');
|
|
6
6
|
var menu = require('./src/menu.js');
|
|
7
7
|
var menuItem$1 = require('./src/menu-item2.js');
|
|
8
|
-
var menuItemGroup$1 = require('./src/menu-item-
|
|
8
|
+
var menuItemGroup$1 = require('./src/menu-item-group.js');
|
|
9
9
|
var subMenu = require('./src/sub-menu.js');
|
|
10
10
|
var menuItem = require('./src/menu-item.js');
|
|
11
|
-
var menuItemGroup = require('./src/menu-item-
|
|
11
|
+
var menuItemGroup = require('./src/menu-item-group2.js');
|
|
12
12
|
require('./src/types.js');
|
|
13
13
|
require('./src/instance.js');
|
|
14
14
|
var install = require('../../utils/vue/install.js');
|
|
@@ -2,9 +2,40 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
var vue = require('vue');
|
|
6
|
+
require('../../../hooks/index.js');
|
|
7
|
+
var menuItemGroup = require('./menu-item-group2.js');
|
|
8
|
+
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
9
|
+
var index = require('../../../hooks/use-namespace/index.js');
|
|
8
10
|
|
|
9
|
-
|
|
11
|
+
const COMPONENT_NAME = "ElMenuItemGroup";
|
|
12
|
+
const _sfc_main = vue.defineComponent({
|
|
13
|
+
name: COMPONENT_NAME,
|
|
14
|
+
props: menuItemGroup.menuItemGroupProps,
|
|
15
|
+
setup() {
|
|
16
|
+
const ns = index.useNamespace("menu-item-group");
|
|
17
|
+
return {
|
|
18
|
+
ns
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
23
|
+
return vue.openBlock(), vue.createElementBlock("li", {
|
|
24
|
+
class: vue.normalizeClass(_ctx.ns.b())
|
|
25
|
+
}, [
|
|
26
|
+
vue.createElementVNode("div", {
|
|
27
|
+
class: vue.normalizeClass(_ctx.ns.e("title"))
|
|
28
|
+
}, [
|
|
29
|
+
!_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
30
|
+
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
31
|
+
], 64)) : vue.renderSlot(_ctx.$slots, "title", { key: 1 })
|
|
32
|
+
], 2),
|
|
33
|
+
vue.createElementVNode("ul", null, [
|
|
34
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
35
|
+
])
|
|
36
|
+
], 2);
|
|
37
|
+
}
|
|
38
|
+
var MenuItemGroup = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "menu-item-group.vue"]]);
|
|
39
|
+
|
|
40
|
+
exports["default"] = MenuItemGroup;
|
|
10
41
|
//# sourceMappingURL=menu-item-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item-group.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.
|
|
1
|
+
{"version":3,"file":"menu-item-group.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.vue"],"sourcesContent":["<template>\n <li :class=\"ns.b()\">\n <div :class=\"ns.e('title')\">\n <template v-if=\"!$slots.title\">{{ title }}</template>\n <slot v-else name=\"title\" />\n </div>\n <ul>\n <slot />\n </ul>\n </li>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { menuItemGroupProps } from './menu-item-group'\n\nconst COMPONENT_NAME = 'ElMenuItemGroup'\n\nexport default defineComponent({\n name: COMPONENT_NAME,\n\n props: menuItemGroupProps,\n\n setup() {\n const ns = useNamespace('menu-item-group')\n\n return {\n ns,\n }\n },\n})\n</script>\n"],"names":["defineComponent","menuItemGroupProps","useNamespace","_createElementBlock","_normalizeClass","_createElementVNode","_Fragment","_createTextVNode","_toDisplayString","_renderSlot"],"mappings":";;;;;;;;;;AAiBA,MAAM,cAAiB,GAAA,iBAAA,CAAA;AAEvB,MAAK,YAAaA,mBAAa,CAAA;AAAA,EAC7B,IAAM,EAAA,cAAA;AAAA,EAEN,KAAO,EAAAC,gCAAA;AAAA,EAEP,KAAQ,GAAA;AACN,IAAM,MAAA,EAAA,GAAKC,mBAAa,iBAAiB,CAAA,CAAA;AAEzC,IAAO,OAAA;AAAA,MACL,EAAA;AAAA,KACF,CAAA;AAAA,GACF;AACF,CAAC,CAAA,CAAA;;0BA9BCC,sBAQK,CAAA,IAAA,EAAA;AAAA,IARA,KAAA,EAAKC,kBAAE,CAAA,IAAA,CAAA,EAAA,CAAG,CAAC,EAAA,CAAA;AAAA,GAAA,EAAA;IACdC,sBAGM,CAAA,KAAA,EAAA;AAAA,MAHA,KAAA,EAAKD,kBAAE,CAAA,IAAA,CAAA,EAAA,CAAG,CAAC,CAAA,OAAA,CAAA,CAAA;AAAA,KAAA,EAAA;AACE,MAAA,CAAA,IAAA,CAAA,MAAA,CAAO,0BAAxBD,sBAAqD,CAAAG,YAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,EAAA;AAAA,QAAAC,mBAAA,CAAAC,mBAAA,CAAnB,IAAK,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA;AAAA,OAAA,EAAA,EAAA,CAAA,IACvCC,cAA4B,CAAA,IAAA,CAAA,MAAA,EAAA,OAAA,EAAA,EAAA,GAAA,EAAA,CAAA,EAAA,CAAA;AAAA,KAAA,EAAA,CAAA,CAAA;IAE9BJ,sBAEK,CAAA,IAAA,EAAA,IAAA,EAAA;AAAA,MADHI,cAAQ,CAAA,IAAA,CAAA,MAAA,EAAA,SAAA,CAAA;AAAA,KAAA,CAAA;;;;;;;"}
|
|
@@ -2,40 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
var pluginVue_exportHelper = require('../../../_virtual/plugin-vue_export-helper.js');
|
|
9
|
-
var index = require('../../../hooks/use-namespace/index.js');
|
|
5
|
+
const menuItemGroupProps = {
|
|
6
|
+
title: String
|
|
7
|
+
};
|
|
10
8
|
|
|
11
|
-
|
|
12
|
-
const _sfc_main = vue.defineComponent({
|
|
13
|
-
name: COMPONENT_NAME,
|
|
14
|
-
props: menuItemGroup.menuItemGroupProps,
|
|
15
|
-
setup() {
|
|
16
|
-
const ns = index.useNamespace("menu-item-group");
|
|
17
|
-
return {
|
|
18
|
-
ns
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
});
|
|
22
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
23
|
-
return vue.openBlock(), vue.createElementBlock("li", {
|
|
24
|
-
class: vue.normalizeClass(_ctx.ns.b())
|
|
25
|
-
}, [
|
|
26
|
-
vue.createElementVNode("div", {
|
|
27
|
-
class: vue.normalizeClass(_ctx.ns.e("title"))
|
|
28
|
-
}, [
|
|
29
|
-
!_ctx.$slots.title ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
|
|
30
|
-
vue.createTextVNode(vue.toDisplayString(_ctx.title), 1)
|
|
31
|
-
], 64)) : vue.renderSlot(_ctx.$slots, "title", { key: 1 })
|
|
32
|
-
], 2),
|
|
33
|
-
vue.createElementVNode("ul", null, [
|
|
34
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
35
|
-
])
|
|
36
|
-
], 2);
|
|
37
|
-
}
|
|
38
|
-
var MenuItemGroup = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["render", _sfc_render], ["__file", "menu-item-group.vue"]]);
|
|
39
|
-
|
|
40
|
-
exports["default"] = MenuItemGroup;
|
|
9
|
+
exports.menuItemGroupProps = menuItemGroupProps;
|
|
41
10
|
//# sourceMappingURL=menu-item-group2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu-item-group2.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.
|
|
1
|
+
{"version":3,"file":"menu-item-group2.js","sources":["../../../../../../packages/components/menu/src/menu-item-group.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const menuItemGroupProps = {\n title: String,\n} as const\nexport type MenuItemGroupProps = ExtractPropTypes<typeof menuItemGroupProps>\n"],"names":[],"mappings":";;;;AAAY,MAAC,kBAAkB,GAAG;AAClC,EAAE,KAAK,EAAE,MAAM;AACf;;;;"}
|
|
@@ -2,223 +2,24 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
var
|
|
7
|
-
require('../../../../hooks/index.js');
|
|
8
|
-
var pager = require('./pager2.js');
|
|
9
|
-
var pluginVue_exportHelper = require('../../../../_virtual/plugin-vue_export-helper.js');
|
|
10
|
-
var index = require('../../../../hooks/use-namespace/index.js');
|
|
11
|
-
var index$1 = require('../../../../hooks/use-locale/index.js');
|
|
5
|
+
require('../../../../utils/index.js');
|
|
6
|
+
var runtime = require('../../../../utils/vue/props/runtime.js');
|
|
12
7
|
|
|
13
|
-
const
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
8
|
+
const paginationPagerProps = runtime.buildProps({
|
|
9
|
+
currentPage: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 1
|
|
12
|
+
},
|
|
13
|
+
pageCount: {
|
|
14
|
+
type: Number,
|
|
15
|
+
required: true
|
|
16
|
+
},
|
|
17
|
+
pagerCount: {
|
|
18
|
+
type: Number,
|
|
19
|
+
default: 7
|
|
20
|
+
},
|
|
21
|
+
disabled: Boolean
|
|
21
22
|
});
|
|
22
|
-
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
23
|
-
...__default__,
|
|
24
|
-
props: pager.paginationPagerProps,
|
|
25
|
-
emits: ["change"],
|
|
26
|
-
setup(__props, { emit }) {
|
|
27
|
-
const props = __props;
|
|
28
|
-
const nsPager = index.useNamespace("pager");
|
|
29
|
-
const nsIcon = index.useNamespace("icon");
|
|
30
|
-
const { t } = index$1.useLocale();
|
|
31
|
-
const showPrevMore = vue.ref(false);
|
|
32
|
-
const showNextMore = vue.ref(false);
|
|
33
|
-
const quickPrevHover = vue.ref(false);
|
|
34
|
-
const quickNextHover = vue.ref(false);
|
|
35
|
-
const quickPrevFocus = vue.ref(false);
|
|
36
|
-
const quickNextFocus = vue.ref(false);
|
|
37
|
-
const pagers = vue.computed(() => {
|
|
38
|
-
const pagerCount = props.pagerCount;
|
|
39
|
-
const halfPagerCount = (pagerCount - 1) / 2;
|
|
40
|
-
const currentPage = Number(props.currentPage);
|
|
41
|
-
const pageCount = Number(props.pageCount);
|
|
42
|
-
let showPrevMore2 = false;
|
|
43
|
-
let showNextMore2 = false;
|
|
44
|
-
if (pageCount > pagerCount) {
|
|
45
|
-
if (currentPage > pagerCount - halfPagerCount) {
|
|
46
|
-
showPrevMore2 = true;
|
|
47
|
-
}
|
|
48
|
-
if (currentPage < pageCount - halfPagerCount) {
|
|
49
|
-
showNextMore2 = true;
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
const array = [];
|
|
53
|
-
if (showPrevMore2 && !showNextMore2) {
|
|
54
|
-
const startPage = pageCount - (pagerCount - 2);
|
|
55
|
-
for (let i = startPage; i < pageCount; i++) {
|
|
56
|
-
array.push(i);
|
|
57
|
-
}
|
|
58
|
-
} else if (!showPrevMore2 && showNextMore2) {
|
|
59
|
-
for (let i = 2; i < pagerCount; i++) {
|
|
60
|
-
array.push(i);
|
|
61
|
-
}
|
|
62
|
-
} else if (showPrevMore2 && showNextMore2) {
|
|
63
|
-
const offset = Math.floor(pagerCount / 2) - 1;
|
|
64
|
-
for (let i = currentPage - offset; i <= currentPage + offset; i++) {
|
|
65
|
-
array.push(i);
|
|
66
|
-
}
|
|
67
|
-
} else {
|
|
68
|
-
for (let i = 2; i < pageCount; i++) {
|
|
69
|
-
array.push(i);
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
return array;
|
|
73
|
-
});
|
|
74
|
-
const prevMoreKls = vue.computed(() => [
|
|
75
|
-
"more",
|
|
76
|
-
"btn-quickprev",
|
|
77
|
-
nsIcon.b(),
|
|
78
|
-
nsPager.is("disabled", props.disabled)
|
|
79
|
-
]);
|
|
80
|
-
const nextMoreKls = vue.computed(() => [
|
|
81
|
-
"more",
|
|
82
|
-
"btn-quicknext",
|
|
83
|
-
nsIcon.b(),
|
|
84
|
-
nsPager.is("disabled", props.disabled)
|
|
85
|
-
]);
|
|
86
|
-
const tabindex = vue.computed(() => props.disabled ? -1 : 0);
|
|
87
|
-
vue.watchEffect(() => {
|
|
88
|
-
const halfPagerCount = (props.pagerCount - 1) / 2;
|
|
89
|
-
showPrevMore.value = false;
|
|
90
|
-
showNextMore.value = false;
|
|
91
|
-
if (props.pageCount > props.pagerCount) {
|
|
92
|
-
if (props.currentPage > props.pagerCount - halfPagerCount) {
|
|
93
|
-
showPrevMore.value = true;
|
|
94
|
-
}
|
|
95
|
-
if (props.currentPage < props.pageCount - halfPagerCount) {
|
|
96
|
-
showNextMore.value = true;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
function onMouseEnter(forward = false) {
|
|
101
|
-
if (props.disabled)
|
|
102
|
-
return;
|
|
103
|
-
if (forward) {
|
|
104
|
-
quickPrevHover.value = true;
|
|
105
|
-
} else {
|
|
106
|
-
quickNextHover.value = true;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
function onFocus(forward = false) {
|
|
110
|
-
if (forward) {
|
|
111
|
-
quickPrevFocus.value = true;
|
|
112
|
-
} else {
|
|
113
|
-
quickNextFocus.value = true;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
function onEnter(e) {
|
|
117
|
-
const target = e.target;
|
|
118
|
-
if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("number")) {
|
|
119
|
-
const newPage = Number(target.textContent);
|
|
120
|
-
if (newPage !== props.currentPage) {
|
|
121
|
-
emit("change", newPage);
|
|
122
|
-
}
|
|
123
|
-
} else if (target.tagName.toLowerCase() === "li" && Array.from(target.classList).includes("more")) {
|
|
124
|
-
onPagerClick(e);
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
function onPagerClick(event) {
|
|
128
|
-
const target = event.target;
|
|
129
|
-
if (target.tagName.toLowerCase() === "ul" || props.disabled) {
|
|
130
|
-
return;
|
|
131
|
-
}
|
|
132
|
-
let newPage = Number(target.textContent);
|
|
133
|
-
const pageCount = props.pageCount;
|
|
134
|
-
const currentPage = props.currentPage;
|
|
135
|
-
const pagerCountOffset = props.pagerCount - 2;
|
|
136
|
-
if (target.className.includes("more")) {
|
|
137
|
-
if (target.className.includes("quickprev")) {
|
|
138
|
-
newPage = currentPage - pagerCountOffset;
|
|
139
|
-
} else if (target.className.includes("quicknext")) {
|
|
140
|
-
newPage = currentPage + pagerCountOffset;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
if (!Number.isNaN(+newPage)) {
|
|
144
|
-
if (newPage < 1) {
|
|
145
|
-
newPage = 1;
|
|
146
|
-
}
|
|
147
|
-
if (newPage > pageCount) {
|
|
148
|
-
newPage = pageCount;
|
|
149
|
-
}
|
|
150
|
-
}
|
|
151
|
-
if (newPage !== currentPage) {
|
|
152
|
-
emit("change", newPage);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return (_ctx, _cache) => {
|
|
156
|
-
return vue.openBlock(), vue.createElementBlock("ul", {
|
|
157
|
-
class: vue.normalizeClass(vue.unref(nsPager).b()),
|
|
158
|
-
onClick: onPagerClick,
|
|
159
|
-
onKeyup: vue.withKeys(onEnter, ["enter"])
|
|
160
|
-
}, [
|
|
161
|
-
_ctx.pageCount > 0 ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
162
|
-
key: 0,
|
|
163
|
-
class: vue.normalizeClass([[
|
|
164
|
-
vue.unref(nsPager).is("active", _ctx.currentPage === 1),
|
|
165
|
-
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
166
|
-
], "number"]),
|
|
167
|
-
"aria-current": _ctx.currentPage === 1,
|
|
168
|
-
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager: 1 }),
|
|
169
|
-
tabindex: vue.unref(tabindex)
|
|
170
|
-
}, " 1 ", 10, _hoisted_2)) : vue.createCommentVNode("v-if", true),
|
|
171
|
-
showPrevMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
172
|
-
key: 1,
|
|
173
|
-
class: vue.normalizeClass(vue.unref(prevMoreKls)),
|
|
174
|
-
tabindex: vue.unref(tabindex),
|
|
175
|
-
"aria-label": vue.unref(t)("el.pagination.prevPages", { pager: _ctx.pagerCount - 2 }),
|
|
176
|
-
onMouseenter: _cache[0] || (_cache[0] = ($event) => onMouseEnter(true)),
|
|
177
|
-
onMouseleave: _cache[1] || (_cache[1] = ($event) => quickPrevHover.value = false),
|
|
178
|
-
onFocus: _cache[2] || (_cache[2] = ($event) => onFocus(true)),
|
|
179
|
-
onBlur: _cache[3] || (_cache[3] = ($event) => quickPrevFocus.value = false)
|
|
180
|
-
}, [
|
|
181
|
-
(quickPrevHover.value || quickPrevFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowLeft), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
|
|
182
|
-
], 42, _hoisted_3)) : vue.createCommentVNode("v-if", true),
|
|
183
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(pagers), (pager) => {
|
|
184
|
-
return vue.openBlock(), vue.createElementBlock("li", {
|
|
185
|
-
key: pager,
|
|
186
|
-
class: vue.normalizeClass([[
|
|
187
|
-
vue.unref(nsPager).is("active", _ctx.currentPage === pager),
|
|
188
|
-
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
189
|
-
], "number"]),
|
|
190
|
-
"aria-current": _ctx.currentPage === pager,
|
|
191
|
-
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager }),
|
|
192
|
-
tabindex: vue.unref(tabindex)
|
|
193
|
-
}, vue.toDisplayString(pager), 11, _hoisted_4);
|
|
194
|
-
}), 128)),
|
|
195
|
-
showNextMore.value ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
196
|
-
key: 2,
|
|
197
|
-
class: vue.normalizeClass(vue.unref(nextMoreKls)),
|
|
198
|
-
tabindex: vue.unref(tabindex),
|
|
199
|
-
"aria-label": vue.unref(t)("el.pagination.nextPages", { pager: _ctx.pagerCount - 2 }),
|
|
200
|
-
onMouseenter: _cache[4] || (_cache[4] = ($event) => onMouseEnter()),
|
|
201
|
-
onMouseleave: _cache[5] || (_cache[5] = ($event) => quickNextHover.value = false),
|
|
202
|
-
onFocus: _cache[6] || (_cache[6] = ($event) => onFocus()),
|
|
203
|
-
onBlur: _cache[7] || (_cache[7] = ($event) => quickNextFocus.value = false)
|
|
204
|
-
}, [
|
|
205
|
-
(quickNextHover.value || quickNextFocus.value) && !_ctx.disabled ? (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.DArrowRight), { key: 0 })) : (vue.openBlock(), vue.createBlock(vue.unref(iconsVue.MoreFilled), { key: 1 }))
|
|
206
|
-
], 42, _hoisted_5)) : vue.createCommentVNode("v-if", true),
|
|
207
|
-
_ctx.pageCount > 1 ? (vue.openBlock(), vue.createElementBlock("li", {
|
|
208
|
-
key: 3,
|
|
209
|
-
class: vue.normalizeClass([[
|
|
210
|
-
vue.unref(nsPager).is("active", _ctx.currentPage === _ctx.pageCount),
|
|
211
|
-
vue.unref(nsPager).is("disabled", _ctx.disabled)
|
|
212
|
-
], "number"]),
|
|
213
|
-
"aria-current": _ctx.currentPage === _ctx.pageCount,
|
|
214
|
-
"aria-label": vue.unref(t)("el.pagination.currentPage", { pager: _ctx.pageCount }),
|
|
215
|
-
tabindex: vue.unref(tabindex)
|
|
216
|
-
}, vue.toDisplayString(_ctx.pageCount), 11, _hoisted_6)) : vue.createCommentVNode("v-if", true)
|
|
217
|
-
], 42, _hoisted_1);
|
|
218
|
-
};
|
|
219
|
-
}
|
|
220
|
-
});
|
|
221
|
-
var Pager = /* @__PURE__ */ pluginVue_exportHelper["default"](_sfc_main, [["__file", "pager.vue"]]);
|
|
222
23
|
|
|
223
|
-
exports
|
|
24
|
+
exports.paginationPagerProps = paginationPagerProps;
|
|
224
25
|
//# sourceMappingURL=pager.js.map
|