Skip to content

Commit 6bed017

Browse files
committed
chore: update version
1 parent 1b1880f commit 6bed017

8 files changed

Lines changed: 122 additions & 34 deletions

File tree

.sync-upstream.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,10 @@
186186
"description": "@rc-component/input -> @v-c/input"
187187
}
188188
],
189-
"last_synced_commit": "6420856155747302e9381148853be784944db4d4",
190-
"last_synced_commit_short": "64208561",
189+
"last_synced_commit": "841fcc0c08c9cb52810a1968eed06e0e3a2fde26",
190+
"last_synced_commit_short": "841fcc0c",
191191
"last_synced_at": "2026-04-14T13:45:25Z",
192-
"last_synced_tag": "",
192+
"last_synced_tag": "@rc-component/input@1.3.0",
193193
"sync_count": 1
194194
},
195195
{
@@ -220,10 +220,10 @@
220220
"description": "@rc-component/mentions -> @v-c/mentions"
221221
}
222222
],
223-
"last_synced_commit": "17c9914d5113a2142a019cee9e72aa4789554297",
224-
"last_synced_commit_short": "17c9914d",
223+
"last_synced_commit": "4e54fe144c2d464470fb55eb5b4a2f0323ff368f",
224+
"last_synced_commit_short": "4e54fe14",
225225
"last_synced_at": "2026-04-14T13:45:25Z",
226-
"last_synced_tag": "@rc-component/mentions@1.6.0",
226+
"last_synced_tag": "@rc-component/mentions@1.9.0",
227227
"sync_count": 1
228228
},
229229
{
@@ -237,10 +237,10 @@
237237
"description": "@rc-component/menu -> @v-c/menu"
238238
}
239239
],
240-
"last_synced_commit": "27f1a78b1314bc6873beaf158e34df6a7edda399",
241-
"last_synced_commit_short": "27f1a78b",
240+
"last_synced_commit": "038c4b30e9a1482f124b71164a06467fa27df468",
241+
"last_synced_commit_short": "038c4b30",
242242
"last_synced_at": "2026-04-14T13:45:25Z",
243-
"last_synced_tag": "",
243+
"last_synced_tag": "@rc-component/menu@1.3.0",
244244
"sync_count": 1
245245
},
246246
{
@@ -339,10 +339,10 @@
339339
"description": "@rc-component/picker -> @v-c/picker"
340340
}
341341
],
342-
"last_synced_commit": "3afa103c7c2da79e61dacb2eb65829ec7fee1d69",
343-
"last_synced_commit_short": "3afa103c",
342+
"last_synced_commit": "738bcac43f1943b38e427fc0f73a4e73e29584c8",
343+
"last_synced_commit_short": "738bcac4",
344344
"last_synced_at": "2026-04-14T13:45:25Z",
345-
"last_synced_tag": "",
345+
"last_synced_tag": "@rc-component/picker@1.10.0",
346346
"sync_count": 1
347347
},
348348
{
@@ -560,10 +560,10 @@
560560
"description": "@rc-component/tabs -> @v-c/tabs"
561561
}
562562
],
563-
"last_synced_commit": "f64f80a12eddc1bdedeaf4ff9b789548dd51761e",
564-
"last_synced_commit_short": "f64f80a1",
563+
"last_synced_commit": "3732bf57df149c67f4ac394e4b0a302d855d15ed",
564+
"last_synced_commit_short": "3732bf57",
565565
"last_synced_at": "2026-04-14T13:45:25Z",
566-
"last_synced_tag": "@rc-component/tabs@1.8.0",
566+
"last_synced_tag": "@rc-component/tabs@1.9.0",
567567
"sync_count": 1
568568
},
569569
{
@@ -611,10 +611,10 @@
611611
"description": "@rc-component/tour -> @v-c/tour"
612612
}
613613
],
614-
"last_synced_commit": "fb6dd3989cf96d61405f48816b2b5217adbc6c9c",
615-
"last_synced_commit_short": "fb6dd398",
614+
"last_synced_commit": "344d438cabefa46fbbe03a9b118f9f00bd2221d9",
615+
"last_synced_commit_short": "344d438c",
616616
"last_synced_at": "2026-04-14T13:45:25Z",
617-
"last_synced_tag": "@rc-component/tour@2.3.0",
617+
"last_synced_tag": "@rc-component/tour@2.4.0",
618618
"sync_count": 1
619619
},
620620
{
@@ -628,10 +628,10 @@
628628
"description": "@rc-component/tree -> @v-c/tree"
629629
}
630630
],
631-
"last_synced_commit": "f4809f839e10b0b9768a8950e86d0876eb95ebec",
632-
"last_synced_commit_short": "f4809f83",
631+
"last_synced_commit": "ab5f4d3cc5e5f4af6322f868c2876f93de7fe737",
632+
"last_synced_commit_short": "ab5f4d3c",
633633
"last_synced_at": "2026-04-14T13:45:25Z",
634-
"last_synced_tag": "@rc-component/tree@1.3.0",
634+
"last_synced_tag": "@rc-component/tree@1.3.1",
635635
"sync_count": 1
636636
},
637637
{

packages/input/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@v-c/input",
33
"type": "module",
4-
"version": "1.1.0-rc.1",
4+
"version": "1.1.0-rc.2",
55
"description": "",
66
"publishConfig": {
77
"access": "public"

packages/input/tests/build-config.test.ts

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,23 @@
1-
import { resolve } from 'node:path'
1+
import { existsSync } from 'node:fs'
2+
import { dirname, resolve } from 'node:path'
23
import { normalizePath } from 'vite'
34
import { afterEach, describe, expect, it } from 'vitest'
45
// @ts-expect-error exported as part of the build path fix.
56
import { buildCommon, resolveBuildEntries, resolveBuildPaths } from '../../../scripts/build.common'
67

7-
const repoRoot = process.cwd()
8+
function findRepoRoot(start: string) {
9+
let current = start
10+
while (!existsSync(resolve(current, 'pnpm-workspace.yaml'))) {
11+
const parent = dirname(current)
12+
if (parent === current) {
13+
throw new Error('Unable to locate repository root')
14+
}
15+
current = parent
16+
}
17+
return current
18+
}
19+
20+
const repoRoot = findRepoRoot(process.cwd())
821
const packageRoot = resolve(repoRoot, 'packages/input')
922
const originalCwd = process.cwd()
1023

packages/notification/src/Notifications.tsx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,11 +42,6 @@ const Notifications = defineComponent<NotificationsProps>(
4242
const configList = shallowRef<NotificationListConfig[]>([])
4343

4444
const onNoticeClose = (key: Key) => {
45-
const config = configList.value.find(item => item.key === key)
46-
const closable = config?.closable
47-
const closableObj = closable && typeof closable === 'object' ? closable : null
48-
closableObj?.onClose?.()
49-
config?.onClose?.()
5045
configList.value = configList.value.filter(item => item.key !== key)
5146
}
5247

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
import { mount } from '@vue/test-utils'
2+
import { nextTick } from 'vue'
3+
import { afterEach, describe, expect, it, vi } from 'vitest'
4+
import Notifications from '../src/Notifications'
5+
6+
describe('notification', () => {
7+
afterEach(() => {
8+
document.body.innerHTML = ''
9+
})
10+
11+
it('calls close callbacks once when notice close button is clicked', async () => {
12+
const onClose = vi.fn()
13+
const closableOnClose = vi.fn()
14+
const wrapper = mount(Notifications, {
15+
props: {
16+
container: document.body,
17+
},
18+
attachTo: document.body,
19+
})
20+
21+
wrapper.vm.open({
22+
key: 'notice',
23+
title: 'Notice',
24+
duration: false,
25+
closable: {
26+
closeIcon: 'x',
27+
onClose: closableOnClose,
28+
},
29+
onClose,
30+
})
31+
32+
await nextTick()
33+
await nextTick()
34+
await document.querySelector<HTMLButtonElement>('.vc-notification-notice-close')!.click()
35+
await nextTick()
36+
37+
expect(closableOnClose).toHaveBeenCalledTimes(1)
38+
expect(onClose).toHaveBeenCalledTimes(1)
39+
})
40+
41+
it('does not call notice close callbacks when closed by api', async () => {
42+
const onClose = vi.fn()
43+
const closableOnClose = vi.fn()
44+
const wrapper = mount(Notifications, {
45+
props: {
46+
container: document.body,
47+
},
48+
attachTo: document.body,
49+
})
50+
51+
wrapper.vm.open({
52+
key: 'notice',
53+
title: 'Notice',
54+
duration: false,
55+
closable: {
56+
closeIcon: 'x',
57+
onClose: closableOnClose,
58+
},
59+
onClose,
60+
})
61+
62+
await nextTick()
63+
await nextTick()
64+
wrapper.vm.close('notice')
65+
await nextTick()
66+
67+
expect(closableOnClose).not.toHaveBeenCalled()
68+
expect(onClose).not.toHaveBeenCalled()
69+
})
70+
})

packages/notification/vitest.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import configShared from '../../vitest.config'
44
export default mergeConfig(
55
configShared,
66
defineProject({
7-
7+
test: {
8+
environment: 'jsdom',
9+
},
810
}),
911
)

packages/picker/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@v-c/picker",
33
"type": "module",
4-
"version": "1.1.0-rc.1",
4+
"version": "1.1.0-rc.2",
55
"description": "picker ui component for vue",
66
"publishConfig": {
77
"access": "public"

packages/picker/src/PickerInput/hooks/useRangeValue.ts

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type { ComputedRef, Ref } from 'vue'
1+
import type { ComputedRef, Ref, ShallowRef } from 'vue'
22
import type { GenerateConfig } from '../../generate'
33
import type { BaseInfo, FormatType, Locale } from '../../interface'
44
import { computed, ref, shallowRef, watch } from 'vue'
@@ -9,6 +9,13 @@ import useLockEffect from './useLockEffect'
99
const EMPTY_VALUE: any[] = []
1010

1111
type TriggerCalendarChange<ValueType extends object[]> = (calendarValues: ValueType) => void
12+
type UseInnerValueReturn<ValueType extends object[]> = readonly [
13+
ShallowRef<ValueType>,
14+
(val: ValueType) => void,
15+
Ref<ValueType>,
16+
TriggerCalendarChange<ValueType>,
17+
() => void,
18+
]
1219

1320
function useUtil<MergedValueType extends object[], DateType extends MergedValueType[number] = any>(
1421
generateConfig: Ref<GenerateConfig<DateType>>,
@@ -70,8 +77,9 @@ export function useInnerValue<ValueType extends DateType[], DateType extends obj
7077
info: BaseInfo,
7178
) => void,
7279
onOk?: (dates: ValueType) => void,
73-
) {
74-
const mergedValue = shallowRef((value.value === undefined ? defaultValue.value : value.value) || (EMPTY_VALUE as ValueType))
80+
): UseInnerValueReturn<ValueType> {
81+
const initialValue = ((value.value === undefined ? defaultValue.value : value.value) || EMPTY_VALUE) as ValueType
82+
const mergedValue = shallowRef(initialValue) as ShallowRef<ValueType>
7583

7684
watch(value, (value) => {
7785
mergedValue.value = value || (EMPTY_VALUE as ValueType)

0 commit comments

Comments
 (0)