From 025d7d3f0d44ce94e3f03dc5e0e78d244946b32b Mon Sep 17 00:00:00 2001
From: zernonia <59365435+zernonia@users.noreply.github.com>
Date: Tue, 29 Oct 2024 12:29:45 +0800
Subject: [PATCH 1/7] fix(Select): arrow is throwing content context injection
error (#1398)
---
packages/radix-vue/src/Select/SelectArrow.vue | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/packages/radix-vue/src/Select/SelectArrow.vue b/packages/radix-vue/src/Select/SelectArrow.vue
index 0c7004353..b50dbde73 100644
--- a/packages/radix-vue/src/Select/SelectArrow.vue
+++ b/packages/radix-vue/src/Select/SelectArrow.vue
@@ -6,7 +6,7 @@ export interface SelectArrowProps extends PopperArrowProps {}
From eb4b1c4929ae42242a31c7e6e1fe013867f20a83 Mon Sep 17 00:00:00 2001
From: Stefan Vojvodic
Date: Wed, 30 Oct 2024 02:57:22 +0100
Subject: [PATCH 2/7] fix(Listbox): handle currentElement not in dom on
focusout (#1399)
---
packages/radix-vue/src/Listbox/ListboxRoot.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/radix-vue/src/Listbox/ListboxRoot.vue b/packages/radix-vue/src/Listbox/ListboxRoot.vue
index 7b56ce3d7..e4b1d03fd 100644
--- a/packages/radix-vue/src/Listbox/ListboxRoot.vue
+++ b/packages/radix-vue/src/Listbox/ListboxRoot.vue
@@ -334,7 +334,7 @@ provideListboxRootContext({
@focusout="async (event: FocusEvent) => {
const target = (event.relatedTarget || event.target) as HTMLElement | null
await nextTick()
- if (highlightedElement && !currentElement.contains(target)) {
+ if (highlightedElement && currentElement && !currentElement.contains(target)) {
onLeave(event)
}
}"
From adb96cd6ee1d9acb6cddb6c9e30f421d2dba3e04 Mon Sep 17 00:00:00 2001
From: Jungzl <13jungzl@gmail.com>
Date: Wed, 30 Oct 2024 14:27:52 +0800
Subject: [PATCH 3/7] docs: component preview not showing on Windows (#1401)
---
docs/.vitepress/plugins/ComponentPreview.ts | 2 ++
1 file changed, 2 insertions(+)
diff --git a/docs/.vitepress/plugins/ComponentPreview.ts b/docs/.vitepress/plugins/ComponentPreview.ts
index 87007b14e..286805cb3 100644
--- a/docs/.vitepress/plugins/ComponentPreview.ts
+++ b/docs/.vitepress/plugins/ComponentPreview.ts
@@ -49,6 +49,8 @@ export default function (md: MarkdownRenderer) {
const { realPath, path: _path } = state.env as MarkdownEnv
const childFiles = readdirSync(resolve(dirname(realPath ?? _path), pathName), { withFileTypes: false, recursive: true })
+ .map(file => typeof file === 'string' ? file.split(/[/\\]/).join('/') : file)
+
const groupedFiles = childFiles.reduce((prev, curr) => {
if (typeof curr !== 'string')
return prev
From 762f451ec8885e5ff217abf757445b696d9dec3c Mon Sep 17 00:00:00 2001
From: Joris Gallot <70059224+joris-gallot@users.noreply.github.com>
Date: Fri, 1 Nov 2024 05:03:09 +0100
Subject: [PATCH 4/7] fix(Listbox): filter doesn't navigate left/right within
input (#1409)
---
packages/radix-vue/src/Listbox/ListboxFilter.vue | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/packages/radix-vue/src/Listbox/ListboxFilter.vue b/packages/radix-vue/src/Listbox/ListboxFilter.vue
index 122da2349..f8cc7a88c 100644
--- a/packages/radix-vue/src/Listbox/ListboxFilter.vue
+++ b/packages/radix-vue/src/Listbox/ListboxFilter.vue
@@ -57,7 +57,7 @@ onMounted(() => {
:disabled="rootContext.disabled.value ? '' : undefined"
:data-disabled="rootContext.disabled.value ? '' : undefined"
type="text"
- @keydown.down.up.left.right.home.end.prevent="rootContext.onKeydownNavigation"
+ @keydown.down.up.home.end.prevent="rootContext.onKeydownNavigation"
@keydown.enter="rootContext.onKeydownEnter"
@input="(event: InputEvent) => {
modelValue = (event.target as HTMLInputElement).value
From 2f8342a775ec298d370760cd623f98a2d5ec4750 Mon Sep 17 00:00:00 2001
From: Eduard Predescu
Date: Fri, 1 Nov 2024 06:04:58 +0200
Subject: [PATCH 5/7] docs: update usage of parseStringToDateValue (#1410)
---
docs/content/guides/dates.md | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/docs/content/guides/dates.md b/docs/content/guides/dates.md
index b06e36d38..6ab0c8c83 100644
--- a/docs/content/guides/dates.md
+++ b/docs/content/guides/dates.md
@@ -75,7 +75,7 @@ const date = new CalendarDate(1995, 8, 18)
const minDate = new CalendarDate(1995, 8, 1)
const maxDate = new CalendarDate(1995, 8, 31)
-parseStringToDateValue('1995-08-18') // returns a DateValue object
+parseStringToDateValue('1995-08-18', date) // returns a DateValue object
toDate(date) // returns a Date object
isCalendarDateTime(date) // returns false
isZonedDateTime(date) // returns false
From fdb13b15356219f03a83fe0a08f22fd7343b8a52 Mon Sep 17 00:00:00 2001
From: Andrew Kazakov
Date: Thu, 7 Nov 2024 13:36:17 +0300
Subject: [PATCH 6/7] fix(Pagination): ignore clicks if pagination button is
disabled (#1415)
---
.../src/Pagination/Pagination.test.ts | 68 +++++++++++++++++++
.../src/Pagination/PaginationFirst.vue | 7 +-
.../src/Pagination/PaginationLast.vue | 7 +-
.../src/Pagination/PaginationListItem.vue | 8 ++-
.../src/Pagination/PaginationNext.vue | 7 +-
.../src/Pagination/PaginationPrev.vue | 7 +-
.../src/Pagination/story/_Pagination.vue | 37 ++++++----
7 files changed, 118 insertions(+), 23 deletions(-)
diff --git a/packages/radix-vue/src/Pagination/Pagination.test.ts b/packages/radix-vue/src/Pagination/Pagination.test.ts
index d2506f0d9..8d140af7d 100644
--- a/packages/radix-vue/src/Pagination/Pagination.test.ts
+++ b/packages/radix-vue/src/Pagination/Pagination.test.ts
@@ -56,6 +56,74 @@ describe('given default Pagination', () => {
})
})
+const ALL_PAGINATION_BUTTONS_AS_A_PROPS = {
+ first: { as: 'a' },
+ prev: { as: 'a' },
+ listItem: { as: 'a' },
+ next: { as: 'a' },
+ last: { as: 'a' },
+}
+
+describe('given Pagination with as buttons', () => {
+ let wrapper: VueWrapper>
+
+ beforeEach(() => {
+ document.body.innerHTML = ''
+ wrapper = mount(Pagination, { attachTo: document.body, props: { ...ALL_PAGINATION_BUTTONS_AS_A_PROPS } })
+ })
+
+ it('should pass axe accessibility tests', async () => {
+ expect(await axe(wrapper.element)).toHaveNoViolations()
+ })
+
+ it('should not unselect page 1 after clicking on Prev Page trigger', async () => {
+ await wrapper.find('[aria-label="Previous Page"]').trigger('click')
+ expect(wrapper.find('[aria-label="Page 1"]').attributes('data-selected')).toBe('true')
+ })
+
+ it('should not unselect last page after clicking on Next Page trigger', async () => {
+ await wrapper.find('[aria-label="Last Page"]').trigger('click')
+ const lastPageLabel = wrapper.find('[data-selected="true"]').attributes('aria-label')
+ await wrapper.find('[aria-label="Next Page"]').trigger('click')
+ expect(wrapper.find('[data-selected="true"]').attributes('aria-label')).toBe(lastPageLabel)
+ })
+})
+
+describe('given Pagination with as buttons and disabled', () => {
+ let wrapper: VueWrapper>
+
+ const INITIAL_PAGE = 2 // Do not set to first or last page
+
+ beforeEach(async () => {
+ document.body.innerHTML = ''
+ wrapper = mount(Pagination, { attachTo: document.body, props: { ...ALL_PAGINATION_BUTTONS_AS_A_PROPS } })
+ await wrapper.find(`[aria-label="Page ${INITIAL_PAGE}"]`).trigger('click')
+ wrapper.setProps({ root: { disabled: true } })
+ })
+
+ it('should pass axe accessibility tests', async () => {
+ expect(await axe(wrapper.element)).toHaveNoViolations()
+ })
+
+ it('should ignore clicking on First Page trigger', async () => {
+ await wrapper.find('[aria-label="First Page"]').trigger('click')
+
+ expect(wrapper.find('[data-selected="true"]').attributes('aria-label')).toBe(`Page ${INITIAL_PAGE}`)
+ })
+
+ it('should ignore clicking on Last Page trigger', async () => {
+ await wrapper.find('[aria-label="Last Page"]').trigger('click')
+
+ expect(wrapper.find('[data-selected="true"]').attributes('aria-label')).toBe(`Page ${INITIAL_PAGE}`)
+ })
+
+ it('should ignore clicking on any non-selected page', async () => {
+ await wrapper.find('[aria-label="Page 1"]').trigger('click')
+
+ expect(wrapper.find('[data-selected="true"]').attributes('aria-label')).toBe(`Page ${INITIAL_PAGE}`)
+ })
+})
+
describe('given show-edges Pagination', () => {
let wrapper: VueWrapper>
diff --git a/packages/radix-vue/src/Pagination/PaginationFirst.vue b/packages/radix-vue/src/Pagination/PaginationFirst.vue
index 453ff6504..83ba07038 100644
--- a/packages/radix-vue/src/Pagination/PaginationFirst.vue
+++ b/packages/radix-vue/src/Pagination/PaginationFirst.vue
@@ -6,6 +6,7 @@ export interface PaginationFirstProps extends PrimitiveProps {}
@@ -20,8 +23,8 @@ useForwardExpose()
v-bind="props"
aria-label="First Page"
:type="as === 'button' ? 'button' : undefined"
- :disabled="rootContext.page.value === 1 || rootContext.disabled.value"
- @click="rootContext.onPageChange(1)"
+ :disabled
+ @click="!disabled && rootContext.onPageChange(1)"
>
First page
diff --git a/packages/radix-vue/src/Pagination/PaginationLast.vue b/packages/radix-vue/src/Pagination/PaginationLast.vue
index 39c9c93be..0b5aca033 100644
--- a/packages/radix-vue/src/Pagination/PaginationLast.vue
+++ b/packages/radix-vue/src/Pagination/PaginationLast.vue
@@ -6,6 +6,7 @@ export interface PaginationLastProps extends PrimitiveProps {}
@@ -20,8 +23,8 @@ useForwardExpose()
v-bind="props"
aria-label="Last Page"
:type="as === 'button' ? 'button' : undefined"
- :disabled="rootContext.page.value === rootContext.pageCount.value || rootContext.disabled.value"
- @click="rootContext.onPageChange(rootContext.pageCount.value)"
+ :disabled
+ @click="!disabled && rootContext.onPageChange(rootContext.pageCount.value)"
>
Last page
diff --git a/packages/radix-vue/src/Pagination/PaginationListItem.vue b/packages/radix-vue/src/Pagination/PaginationListItem.vue
index b9102bfd0..e90baabfa 100644
--- a/packages/radix-vue/src/Pagination/PaginationListItem.vue
+++ b/packages/radix-vue/src/Pagination/PaginationListItem.vue
@@ -9,8 +9,8 @@ export interface PaginationListItemProps extends PrimitiveProps {
@@ -27,9 +29,9 @@ const isSelected = computed(() => rootContext.page.value === props.value)
:aria-label="`Page ${value}`"
:aria-current="isSelected ? 'page' : undefined"
:data-selected="isSelected ? 'true' : undefined"
- :disabled="rootContext.disabled.value"
+ :disabled
:type="as === 'button' ? 'button' : undefined"
- @click="rootContext.onPageChange(value)"
+ @click="!disabled && rootContext.onPageChange(value)"
>
{{ value }}
diff --git a/packages/radix-vue/src/Pagination/PaginationNext.vue b/packages/radix-vue/src/Pagination/PaginationNext.vue
index 63bbd8302..0117b0652 100644
--- a/packages/radix-vue/src/Pagination/PaginationNext.vue
+++ b/packages/radix-vue/src/Pagination/PaginationNext.vue
@@ -6,6 +6,7 @@ export interface PaginationNextProps extends PrimitiveProps {}
@@ -20,8 +23,8 @@ const rootContext = injectPaginationRootContext()
v-bind="props"
aria-label="Next Page"
:type="as === 'button' ? 'button' : undefined"
- :disabled="rootContext.page.value === rootContext.pageCount.value || rootContext.disabled.value"
- @click="rootContext.onPageChange(rootContext.page.value + 1)"
+ :disabled
+ @click="!disabled && rootContext.onPageChange(rootContext.page.value + 1)"
>
Next page
diff --git a/packages/radix-vue/src/Pagination/PaginationPrev.vue b/packages/radix-vue/src/Pagination/PaginationPrev.vue
index dd98e773d..584b96b01 100644
--- a/packages/radix-vue/src/Pagination/PaginationPrev.vue
+++ b/packages/radix-vue/src/Pagination/PaginationPrev.vue
@@ -6,6 +6,7 @@ export interface PaginationPrevProps extends PrimitiveProps {}
@@ -20,8 +23,8 @@ const rootContext = injectPaginationRootContext()
v-bind="props"
aria-label="Previous Page"
:type="as === 'button' ? 'button' : undefined"
- :disabled="rootContext.page.value === 1 || rootContext.disabled?.value"
- @click="rootContext.onPageChange(rootContext.page.value - 1)"
+ :disabled
+ @click="!disabled && rootContext.onPageChange(rootContext.page.value - 1)"
>
Prev page
diff --git a/packages/radix-vue/src/Pagination/story/_Pagination.vue b/packages/radix-vue/src/Pagination/story/_Pagination.vue
index 2037e0731..f9d25aabd 100644
--- a/packages/radix-vue/src/Pagination/story/_Pagination.vue
+++ b/packages/radix-vue/src/Pagination/story/_Pagination.vue
@@ -1,28 +1,40 @@
-
+
-
-
+
+
{{ page.value }}
@@ -31,12 +43,13 @@ const props = withDefaults(defineProps<{
:key="page.type"
:index="index"
class="border rounded px-4 py-2 "
+ v-bind="props.ellipsis"
>
…
-
-
+
+
From 2fc67a7fa0a1497d7af95cd4195f7b996de2e375 Mon Sep 17 00:00:00 2001
From: zernonia
Date: Fri, 8 Nov 2024 11:24:23 +0800
Subject: [PATCH 7/7] chore: release v1.9.9
---
docs/package.json | 2 +-
package.json | 2 +-
packages/plugins/package.json | 2 +-
packages/radix-vue/package.json | 2 +-
4 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/docs/package.json b/docs/package.json
index 7247bfb63..2fde021de 100644
--- a/docs/package.json
+++ b/docs/package.json
@@ -1,7 +1,7 @@
{
"name": "docs",
"type": "module",
- "version": "1.9.8",
+ "version": "1.9.9",
"scripts": {
"docs:dev": "vitepress dev",
"docs:build": "vitepress build",
diff --git a/package.json b/package.json
index bee425f6c..f1097a2b5 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "radix-vue",
- "version": "1.9.8",
+ "version": "1.9.9",
"private": true,
"packageManager": "pnpm@9.4.0",
"license": "MIT",
diff --git a/packages/plugins/package.json b/packages/plugins/package.json
index 25236c8f5..96518491e 100644
--- a/packages/plugins/package.json
+++ b/packages/plugins/package.json
@@ -1,7 +1,7 @@
{
"name": "plugins",
"type": "module",
- "version": "1.9.8",
+ "version": "1.9.9",
"description": "Nuxt module for Radix Vue",
"license": "MIT",
"keywords": [
diff --git a/packages/radix-vue/package.json b/packages/radix-vue/package.json
index 2aa737c9f..cbf7ecd48 100644
--- a/packages/radix-vue/package.json
+++ b/packages/radix-vue/package.json
@@ -1,7 +1,7 @@
{
"name": "radix-vue",
"type": "module",
- "version": "1.9.8",
+ "version": "1.9.9",
"description": "Vue port for Radix UI Primitives.",
"author": "Radix Vue Contributors (https://github.com/radix-vue)",
"license": "MIT",