VPagination.mjs.map 25 KB

1
  1. {"version":3,"file":"VPagination.mjs","names":["VBtn","useDisplay","makeBorderProps","makeComponentProps","provideDefaults","makeDensityProps","makeElevationProps","IconValue","useLocale","useRtl","useProxiedModel","useRefs","useResizeObserver","makeRoundedProps","makeSizeProps","makeTagProps","makeThemeProps","provideTheme","makeVariantProps","computed","nextTick","shallowRef","toRef","createRange","genericComponent","keyValues","propsFactory","useRender","makeVPaginationProps","activeColor","String","start","type","Number","default","modelValue","props","disabled","Boolean","length","validator","val","totalVisible","firstIcon","prevIcon","nextIcon","lastIcon","ariaLabel","pageAriaLabel","currentPageAriaLabel","firstAriaLabel","previousAriaLabel","nextAriaLabel","lastAriaLabel","ellipsis","showFirstLastPage","tag","variant","VPagination","name","emits","value","first","prev","next","last","setup","_ref","slots","emit","page","t","n","isRtl","themeClasses","width","maxButtons","undefined","scoped","resizeRef","entries","target","contentRect","firstItem","querySelector","totalWidth","itemWidth","offsetWidth","parseFloat","getComputedStyle","marginRight","getMax","parseInt","minButtons","Math","max","floor","toFixed","range","isNaN","MAX_SAFE_INTEGER","even","middle","left","right","rangeLength","rangeStart","ceil","setValue","e","event","preventDefault","refs","updateRef","VPaginationBtn","color","border","density","size","rounded","elevation","items","map","item","index","ref","isActive","key","icon","ariaCurrent","onClick","controls","prevDisabled","nextDisabled","ariaDisabled","updateFocus","currentIndex","$el","focus","onKeydown","_createVNode","class","style","_mergeProps"],"sources":["../../../src/components/VPagination/VPagination.tsx"],"sourcesContent":["// Styles\nimport './VPagination.sass'\n\n// Components\nimport { VBtn } from '../VBtn'\n\n// Composables\nimport { useDisplay } from '@/composables'\nimport { makeBorderProps } from '@/composables/border'\nimport { makeComponentProps } from '@/composables/component'\nimport { provideDefaults } from '@/composables/defaults'\nimport { makeDensityProps } from '@/composables/density'\nimport { makeElevationProps } from '@/composables/elevation'\nimport { IconValue } from '@/composables/icons'\nimport { useLocale, useRtl } from '@/composables/locale'\nimport { useProxiedModel } from '@/composables/proxiedModel'\nimport { useRefs } from '@/composables/refs'\nimport { useResizeObserver } from '@/composables/resizeObserver'\nimport { makeRoundedProps } from '@/composables/rounded'\nimport { makeSizeProps } from '@/composables/size'\nimport { makeTagProps } from '@/composables/tag'\nimport { makeThemeProps, provideTheme } from '@/composables/theme'\nimport { makeVariantProps } from '@/composables/variant'\n\n// Utilities\nimport { computed, nextTick, shallowRef, toRef } from 'vue'\nimport { createRange, genericComponent, keyValues, propsFactory, useRender } from '@/util'\n\n// Types\nimport type { ComponentPublicInstance } from 'vue'\n\ntype ItemSlot = {\n isActive: boolean\n key: string | number\n page: string\n props: Record<string, any>\n}\n\ntype ControlSlot = {\n icon: IconValue\n onClick: (e: Event) => void\n disabled: boolean\n ariaLabel: string\n ariaDisabled: boolean\n}\n\nexport type VPaginationSlots = {\n item: ItemSlot\n first: ControlSlot\n prev: ControlSlot\n next: ControlSlot\n last: ControlSlot\n}\n\nexport const makeVPaginationProps = propsFactory({\n activeColor: String,\n start: {\n type: [Number, String],\n default: 1,\n },\n modelValue: {\n type: Number,\n default: (props: any) => props.start as number,\n },\n disabled: Boolean,\n length: {\n type: [Number, String],\n default: 1,\n validator: (val: number) => val % 1 === 0,\n },\n totalVisible: [Number, String],\n firstIcon: {\n type: IconValue,\n default: '$first',\n },\n prevIcon: {\n type: IconValue,\n default: '$prev',\n },\n nextIcon: {\n type: IconValue,\n default: '$next',\n },\n lastIcon: {\n type: IconValue,\n default: '$last',\n },\n ariaLabel: {\n type: String,\n default: '$vuetify.pagination.ariaLabel.root',\n },\n pageAriaLabel: {\n type: String,\n default: '$vuetify.pagination.ariaLabel.page',\n },\n currentPageAriaLabel: {\n type: String,\n default: '$vuetify.pagination.ariaLabel.currentPage',\n },\n firstAriaLabel: {\n type: String,\n default: '$vuetify.pagination.ariaLabel.first',\n },\n previousAriaLabel: {\n type: String,\n default: '$vuetify.pagination.ariaLabel.previous',\n },\n nextAriaLabel: {\n type: String,\n default: '$vuetify.pagination.ariaLabel.next',\n },\n lastAriaLabel: {\n type: String,\n default: '$vuetify.pagination.ariaLabel.last',\n },\n ellipsis: {\n type: String,\n default: '...',\n },\n showFirstLastPage: Boolean,\n\n ...makeBorderProps(),\n ...makeComponentProps(),\n ...makeDensityProps(),\n ...makeElevationProps(),\n ...makeRoundedProps(),\n ...makeSizeProps(),\n ...makeTagProps({ tag: 'nav' }),\n ...makeThemeProps(),\n ...makeVariantProps({ variant: 'text' } as const),\n}, 'VPagination')\n\nexport const VPagination = genericComponent<VPaginationSlots>()({\n name: 'VPagination',\n\n props: makeVPaginationProps(),\n\n emits: {\n 'update:modelValue': (value: number) => true,\n first: (value: number) => true,\n prev: (value: number) => true,\n next: (value: number) => true,\n last: (value: number) => true,\n },\n\n setup (props, { slots, emit }) {\n const page = useProxiedModel(props, 'modelValue')\n const { t, n } = useLocale()\n const { isRtl } = useRtl()\n const { themeClasses } = provideTheme(props)\n const { width } = useDisplay()\n const maxButtons = shallowRef(-1)\n\n provideDefaults(undefined, { scoped: true })\n\n const { resizeRef } = useResizeObserver((entries: ResizeObserverEntry[]) => {\n if (!entries.length) return\n\n const { target, contentRect } = entries[0]\n\n const firstItem = target.querySelector('.v-pagination__list > *') as HTMLElement\n\n if (!firstItem) return\n\n const totalWidth = contentRect.width\n const itemWidth =\n firstItem.offsetWidth +\n parseFloat(getComputedStyle(firstItem).marginRight) * 2\n\n maxButtons.value = getMax(totalWidth, itemWidth)\n })\n\n const length = computed(() => parseInt(props.length, 10))\n const start = computed(() => parseInt(props.start, 10))\n\n const totalVisible = computed(() => {\n if (props.totalVisible) return parseInt(props.totalVisible, 10)\n else if (maxButtons.value >= 0) return maxButtons.value\n return getMax(width.value, 58)\n })\n\n function getMax (totalWidth: number, itemWidth: number) {\n const minButtons = props.showFirstLastPage ? 5 : 3\n return Math.max(0, Math.floor(\n // Round to two decimal places to avoid floating point errors\n +((totalWidth - itemWidth * minButtons) / itemWidth).toFixed(2)\n ))\n }\n\n const range = computed(() => {\n if (length.value <= 0 || isNaN(length.value) || length.value > Number.MAX_SAFE_INTEGER) return []\n\n if (totalVisible.value <= 1) return [page.value]\n\n if (length.value <= totalVisible.value) {\n return createRange(length.value, start.value)\n }\n\n const even = totalVisible.value % 2 === 0\n const middle = even ? totalVisible.value / 2 : Math.floor(totalVisible.value / 2)\n const left = even ? middle : middle + 1\n const right = length.value - middle\n\n if (left - page.value >= 0) {\n return [...createRange(Math.max(1, totalVisible.value - 1), start.value), props.ellipsis, length.value]\n } else if (page.value - right >= (even ? 1 : 0)) {\n const rangeLength = totalVisible.value - 1\n const rangeStart = length.value - rangeLength + start.value\n return [start.value, props.ellipsis, ...createRange(rangeLength, rangeStart)]\n } else {\n const rangeLength = Math.max(1, totalVisible.value - 3)\n const rangeStart = rangeLength === 1 ? page.value : page.value - Math.ceil(rangeLength / 2) + start.value\n return [start.value, props.ellipsis, ...createRange(rangeLength, rangeStart), props.ellipsis, length.value]\n }\n })\n\n // TODO: 'first' | 'prev' | 'next' | 'last' does not work here?\n function setValue (e: Event, value: number, event?: any) {\n e.preventDefault()\n page.value = value\n event && emit(event, value)\n }\n\n const { refs, updateRef } = useRefs<ComponentPublicInstance>()\n\n provideDefaults({\n VPaginationBtn: {\n color: toRef(props, 'color'),\n border: toRef(props, 'border'),\n density: toRef(props, 'density'),\n size: toRef(props, 'size'),\n variant: toRef(props, 'variant'),\n rounded: toRef(props, 'rounded'),\n elevation: toRef(props, 'elevation'),\n },\n })\n\n const items = computed(() => {\n return range.value.map((item, index) => {\n const ref = (e: any) => updateRef(e, index)\n\n if (typeof item === 'string') {\n return {\n isActive: false,\n key: `ellipsis-${index}`,\n page: item,\n props: {\n ref,\n ellipsis: true,\n icon: true,\n disabled: true,\n },\n }\n } else {\n const isActive = item === page.value\n return {\n isActive,\n key: item,\n page: n(item),\n props: {\n ref,\n ellipsis: false,\n icon: true,\n disabled: !!props.disabled || +props.length < 2,\n color: isActive ? props.activeColor : props.color,\n ariaCurrent: isActive,\n ariaLabel: t(isActive ? props.currentPageAriaLabel : props.pageAriaLabel, item),\n onClick: (e: Event) => setValue(e, item),\n },\n }\n }\n })\n })\n\n const controls = computed(() => {\n const prevDisabled = !!props.disabled || page.value <= start.value\n const nextDisabled = !!props.disabled || page.value >= start.value + length.value - 1\n\n return {\n first: props.showFirstLastPage ? {\n icon: isRtl.value ? props.lastIcon : props.firstIcon,\n onClick: (e: Event) => setValue(e, start.value, 'first'),\n disabled: prevDisabled,\n ariaLabel: t(props.firstAriaLabel),\n ariaDisabled: prevDisabled,\n } : undefined,\n prev: {\n icon: isRtl.value ? props.nextIcon : props.prevIcon,\n onClick: (e: Event) => setValue(e, page.value - 1, 'prev'),\n disabled: prevDisabled,\n ariaLabel: t(props.previousAriaLabel),\n ariaDisabled: prevDisabled,\n },\n next: {\n icon: isRtl.value ? props.prevIcon : props.nextIcon,\n onClick: (e: Event) => setValue(e, page.value + 1, 'next'),\n disabled: nextDisabled,\n ariaLabel: t(props.nextAriaLabel),\n ariaDisabled: nextDisabled,\n },\n last: props.showFirstLastPage ? {\n icon: isRtl.value ? props.firstIcon : props.lastIcon,\n onClick: (e: Event) => setValue(e, start.value + length.value - 1, 'last'),\n disabled: nextDisabled,\n ariaLabel: t(props.lastAriaLabel),\n ariaDisabled: nextDisabled,\n } : undefined,\n }\n })\n\n function updateFocus () {\n const currentIndex = page.value - start.value\n refs.value[currentIndex]?.$el.focus()\n }\n\n function onKeydown (e: KeyboardEvent) {\n if (e.key === keyValues.left && !props.disabled && page.value > +props.start) {\n page.value = page.value - 1\n nextTick(updateFocus)\n } else if (e.key === keyValues.right && !props.disabled && page.value < start.value + length.value - 1) {\n page.value = page.value + 1\n nextTick(updateFocus)\n }\n }\n\n useRender(() => (\n <props.tag\n ref={ resizeRef }\n class={[\n 'v-pagination',\n themeClasses.value,\n props.class,\n ]}\n style={ props.style }\n role=\"navigation\"\n aria-label={ t(props.ariaLabel) }\n onKeydown={ onKeydown }\n data-test=\"v-pagination-root\"\n >\n <ul class=\"v-pagination__list\">\n { props.showFirstLastPage && (\n <li key=\"first\" class=\"v-pagination__first\" data-test=\"v-pagination-first\">\n { slots.first ? slots.first(controls.value.first!) : (\n <VBtn _as=\"VPaginationBtn\" { ...controls.value.first } />\n )}\n </li>\n )}\n\n <li key=\"prev\" class=\"v-pagination__prev\" data-test=\"v-pagination-prev\">\n { slots.prev ? slots.prev(controls.value.prev) : (\n <VBtn _as=\"VPaginationBtn\" { ...controls.value.prev } />\n )}\n </li>\n\n { items.value.map((item, index) => (\n <li\n key={ item.key }\n class={[\n 'v-pagination__item',\n {\n 'v-pagination__item--is-active': item.isActive,\n },\n ]}\n data-test=\"v-pagination-item\"\n >\n { slots.item ? slots.item(item) : (\n <VBtn _as=\"VPaginationBtn\" { ...item.props }>{ item.page }</VBtn>\n )}\n </li>\n ))}\n\n <li\n key=\"next\"\n class=\"v-pagination__next\"\n data-test=\"v-pagination-next\"\n >\n { slots.next ? slots.next(controls.value.next) : (\n <VBtn _as=\"VPaginationBtn\" { ...controls.value.next } />\n )}\n </li>\n\n { props.showFirstLastPage && (\n <li\n key=\"last\"\n class=\"v-pagination__last\"\n data-test=\"v-pagination-last\"\n >\n { slots.last ? slots.last(controls.value.last!) : (\n <VBtn _as=\"VPaginationBtn\" { ...controls.value.last } />\n )}\n </li>\n )}\n </ul>\n </props.tag>\n ))\n\n return {}\n },\n})\n\nexport type VPagination = InstanceType<typeof VPagination>\n"],"mappings":";AAAA;AACA;;AAEA;AAAA,SACSA,IAAI,6BAEb;AAAA,SACSC,UAAU;AAAA,SACVC,eAAe;AAAA,SACfC,kBAAkB;AAAA,SAClBC,eAAe;AAAA,SACfC,gBAAgB;AAAA,SAChBC,kBAAkB;AAAA,SAClBC,SAAS;AAAA,SACTC,SAAS,EAAEC,MAAM;AAAA,SACjBC,eAAe;AAAA,SACfC,OAAO;AAAA,SACPC,iBAAiB;AAAA,SACjBC,gBAAgB;AAAA,SAChBC,aAAa;AAAA,SACbC,YAAY;AAAA,SACZC,cAAc,EAAEC,YAAY;AAAA,SAC5BC,gB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