Skip to content

Commit ee48446

Browse files
chore(deps): update dependency reka-ui to v2.4.1 (v3) (#4586)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com> Co-authored-by: Benjamin Canac <[email protected]>
1 parent fb34cb9 commit ee48446

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+3527
-3526
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<script setup lang="ts">
2-
const open = ref(false)
32
const items = ref(['Backlog', 'Todo', 'In Progress', 'Done'])
43
const selected = ref('Backlog')
54
</script>
65

76
<template>
87
<UInputMenu
98
v-model="selected"
10-
v-model:open="open"
119
:items="items"
12-
@focus="open = true"
10+
open-on-focus
1311
/>
1412
</template>

docs/content/3.components/input-menu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -673,7 +673,7 @@ In this example, leveraging [`defineShortcuts`](/composables/define-shortcuts),
673673

674674
### Control open state on focus
675675

676-
You can also use the `@focus` directive to control the open state.
676+
You can use the `open-on-focus` or `open-on-click` props to open the menu when the input is focused or clicked.
677677

678678
::component-example
679679
---

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
"mlly": "^1.7.4",
144144
"ohash": "^2.0.11",
145145
"pathe": "^2.0.3",
146-
"reka-ui": "2.3.2",
146+
"reka-ui": "2.4.1",
147147
"scule": "^1.3.0",
148148
"tailwind-merge": "^3.3.1",
149149
"tailwind-variants": "^2.0.1",

pnpm-lock.yaml

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/runtime/components/InputMenu.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ interface _InputMenuItem {
3030
}
3131
export type InputMenuItem = _InputMenuItem | AcceptableValue | boolean
3232
33-
export interface InputMenuProps<T extends ArrayOrNested<InputMenuItem> = ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'open' | 'defaultOpen' | 'disabled' | 'name' | 'resetSearchTermOnBlur' | 'resetSearchTermOnSelect' | 'highlightOnHover'>, UseComponentIconsProps {
33+
export interface InputMenuProps<T extends ArrayOrNested<InputMenuItem> = ArrayOrNested<InputMenuItem>, VK extends GetItemKeys<T> | undefined = undefined, M extends boolean = false> extends Pick<ComboboxRootProps<T>, 'open' | 'defaultOpen' | 'disabled' | 'name' | 'resetSearchTermOnBlur' | 'resetSearchTermOnSelect' | 'highlightOnHover' | 'openOnClick' | 'openOnFocus'>, UseComponentIconsProps {
3434
/**
3535
* The element or component this component should render as.
3636
* @defaultValue 'div'
@@ -208,7 +208,7 @@ const { t } = useLocale()
208208
const appConfig = useAppConfig() as InputMenu['AppConfig']
209209
const { contains } = useFilter({ sensitivity: 'base' })
210210
211-
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'required', 'multiple', 'resetSearchTermOnBlur', 'resetSearchTermOnSelect', 'highlightOnHover', 'ignoreFilter'), emits)
211+
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'open', 'defaultOpen', 'required', 'multiple', 'resetSearchTermOnBlur', 'resetSearchTermOnSelect', 'highlightOnHover', 'openOnClick', 'openOnFocus'), emits)
212212
const portalProps = usePortal(toRef(() => props.portal))
213213
const contentProps = toRef(() => defu(props.content, { side: 'bottom', sideOffset: 8, collisionPadding: 8, position: 'popper' }) as ComboboxContentProps)
214214
const arrowProps = toRef(() => props.arrow as ComboboxArrowProps)

src/runtime/components/InputNumber.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import type { ComponentConfig } from '../types/utils'
77
88
type InputNumber = ComponentConfig<typeof theme, AppConfig, 'inputNumber'>
99
10-
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange'> {
10+
export interface InputNumberProps extends Pick<NumberFieldRootProps, 'modelValue' | 'defaultValue' | 'min' | 'max' | 'step' | 'stepSnapping' | 'disabled' | 'required' | 'id' | 'name' | 'formatOptions' | 'disableWheelChange' | 'invertWheelChange' | 'readonly'> {
1111
/**
1212
* The element or component this component should render as.
1313
* @defaultValue 'div'
@@ -98,7 +98,7 @@ defineSlots<InputNumberSlots>()
9898
const { t, code: codeLocale } = useLocale()
9999
const appConfig = useAppConfig() as InputNumber['AppConfig']
100100
101-
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'stepSnapping', 'formatOptions', 'disableWheelChange', 'invertWheelChange'), emits)
101+
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'modelValue', 'defaultValue', 'min', 'max', 'step', 'stepSnapping', 'formatOptions', 'disableWheelChange', 'invertWheelChange', 'readonly'), emits)
102102
103103
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField<InputNumberProps>(props)
104104
const { orientation, size: buttonGroupSize } = useButtonGroup<InputNumberProps>(props)

src/runtime/components/PinInput.vue

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import type { ComponentConfig } from '../types/utils'
88
type PinInput = ComponentConfig<typeof theme, AppConfig, 'pinInput'>
99
1010
type PinInputType = 'text' | 'number'
11+
type PinInputValue<Type extends PinInputType> = [Type] extends ['number'] ? number[] : string[]
1112
1213
export interface PinInputProps<T extends PinInputType = 'text'> extends Pick<PinInputRootProps<T>, 'defaultValue' | 'disabled' | 'id' | 'mask' | 'modelValue' | 'name' | 'otp' | 'placeholder' | 'required' | 'type'> {
1314
/**
@@ -46,7 +47,7 @@ export type PinInputEmits<T extends PinInputType = 'text'> = PinInputRootEmits<T
4647
4748
</script>
4849

49-
<script setup lang="ts" generic="T extends PinInputType = 'text'">
50+
<script setup lang="ts" generic="T extends PinInputType">
5051
import type { ComponentPublicInstance } from 'vue'
5152
import { ref, computed, onMounted } from 'vue'
5253
import { PinInputInput, PinInputRoot, useForwardPropsEmits } from 'reka-ui'
@@ -65,7 +66,7 @@ const emits = defineEmits<PinInputEmits<T>>()
6566
6667
const appConfig = useAppConfig() as PinInput['AppConfig']
6768
68-
const rootProps = useForwardPropsEmits(reactivePick(props, 'defaultValue', 'disabled', 'id', 'mask', 'modelValue', 'name', 'otp', 'required', 'type'), emits)
69+
const rootProps = useForwardPropsEmits(reactivePick(props, 'disabled', 'id', 'mask', 'name', 'otp', 'required', 'type'), emits)
6970
7071
const { emitFormInput, emitFormFocus, emitFormChange, emitFormBlur, size, color, id, name, highlight, disabled, ariaAttrs } = useFormField<PinInputProps>(props)
7172
@@ -116,6 +117,8 @@ defineExpose({
116117
:id="id"
117118
:name="name"
118119
:placeholder="placeholder"
120+
:model-value="(modelValue as PinInputValue<T>)"
121+
:default-value="(defaultValue as PinInputValue<T>[])"
119122
:class="ui.root({ class: [props.ui?.root, props.class] })"
120123
@update:model-value="emitFormInput()"
121124
@complete="onComplete"

0 commit comments

Comments
 (0)