Skip to content

Commit a6efa7a

Browse files
fix(components): remove locale / dir props proxy (#5432)
1 parent e93bfd4 commit a6efa7a

File tree

4 files changed

+3
-26
lines changed

4 files changed

+3
-26
lines changed

src/runtime/components/Calendar.vue

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ const props = withDefaults(defineProps<CalendarProps<R, M>>(), {
127127
const emits = defineEmits<CalendarEmits<R, M>>()
128128
defineSlots<CalendarSlots>()
129129
130-
const { code: locale, dir, t } = useLocale()
130+
const { dir, t } = useLocale()
131131
const appConfig = useAppConfig() as Calendar['AppConfig']
132132
133133
const rootProps = useForwardPropsEmits(reactiveOmit(props, 'range', 'modelValue', 'defaultValue', 'color', 'variant', 'size', 'monthControls', 'yearControls', 'class', 'ui'), emits)
@@ -160,8 +160,6 @@ const Calendar = computed(() => props.range ? RangeCalendar : SingleCalendar)
160160
v-bind="rootProps"
161161
:model-value="(modelValue as DateValue | DateValue[])"
162162
:default-value="(defaultValue as DateValue)"
163-
:locale="locale"
164-
:dir="dir"
165163
:class="ui.root({ class: [props.ui?.root, props.class] })"
166164
>
167165
<Calendar.Header :class="ui.header({ class: props.ui?.header })">

src/runtime/components/InputDate.vue

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ import { useAppConfig } from '#imports'
7575
import { useFieldGroup } from '../composables/useFieldGroup'
7676
import { useComponentIcons } from '../composables/useComponentIcons'
7777
import { useFormField } from '../composables/useFormField'
78-
import { useLocale } from '../composables/useLocale'
7978
import { tv } from '../utils/tv'
8079
import UIcon from './Icon.vue'
8180
import UAvatar from './Avatar.vue'
@@ -88,7 +87,6 @@ const props = withDefaults(defineProps<InputDateProps<R>>(), {
8887
const emits = defineEmits<InputDateEmits<R>>()
8988
const slots = defineSlots<InputDateSlots>()
9089
91-
const { code: locale, dir } = useLocale()
9290
const appConfig = useAppConfig() as InputDate['AppConfig']
9391
9492
const rootProps = useForwardPropsEmits(reactiveOmit(props, 'id', 'name', 'range', 'modelValue', 'defaultValue', 'color', 'variant', 'size', 'highlight', 'disabled', 'autofocus', 'autofocusDelay', 'icon', 'avatar', 'leading', 'leadingIcon', 'trailing', 'trailingIcon', 'loading', 'loadingIcon', 'separatorIcon', 'class', 'ui'), emits)
@@ -178,8 +176,6 @@ defineExpose({
178176
:default-value="(defaultValue as DateValue)"
179177
:name="name"
180178
:disabled="disabled"
181-
:locale="locale"
182-
:dir="dir"
183179
:class="ui.base({ class: [props.ui?.base, props.class] })"
184180
@update:model-value="onUpdate"
185181
@blur="onBlur"

src/runtime/components/InputNumber.vue

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ export interface InputNumberProps<T extends InputNumberValue = InputNumberValue>
5858
autofocus?: boolean
5959
autofocusDelay?: number
6060
modelModifiers?: Pick<ModelModifiers<T>, 'optional'>
61-
/**
62-
* The locale to use for formatting and parsing numbers.
63-
* @defaultValue UApp.locale.code
64-
*/
65-
locale?: string
6661
class?: any
6762
ui?: InputNumber['slots']
6863
}
@@ -102,15 +97,14 @@ defineSlots<InputNumberSlots>()
10297
10398
const modelValue = useVModel<InputNumberProps<T>, 'modelValue', 'update:modelValue'>(props, 'modelValue', emits, { defaultValue: props.defaultValue })
10499
105-
const { t, code: codeLocale } = useLocale()
100+
const { t } = useLocale()
106101
const appConfig = useAppConfig() as InputNumber['AppConfig']
107102
108103
const rootProps = useForwardPropsEmits(reactivePick(props, 'as', 'defaultValue', 'min', 'max', 'step', 'stepSnapping', 'formatOptions', 'disableWheelChange', 'invertWheelChange', 'readonly'), emits)
109104
110105
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField<InputNumberProps<T>>(props)
111106
const { orientation, size: fieldGroupSize } = useFieldGroup<InputNumberProps<T>>(props)
112107
113-
const locale = computed(() => props.locale || codeLocale.value)
114108
const inputSize = computed(() => fieldGroupSize.value || formGroupSize.value)
115109
116110
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.inputNumber || {}) })({
@@ -172,7 +166,6 @@ defineExpose({
172166
:class="ui.root({ class: [props.ui?.root, props.class] })"
173167
:name="name"
174168
:disabled="disabled"
175-
:locale="locale"
176169
@update:model-value="onUpdate"
177170
>
178171
<NumberFieldInput

src/runtime/components/InputTime.vue

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,6 @@ export interface InputTimeProps extends Omit<TimeFieldRootProps, 'as' | 'asChild
3131
highlight?: boolean
3232
autofocus?: boolean
3333
autofocusDelay?: number
34-
/**
35-
* The locale to use for formatting and parsing numbers.
36-
* @defaultValue UApp.locale.code
37-
*/
38-
locale?: string
3934
class?: any
4035
ui?: InputTime['slots']
4136
}
@@ -61,7 +56,6 @@ import { useAppConfig } from '#imports'
6156
import { useFieldGroup } from '../composables/useFieldGroup'
6257
import { useComponentIcons } from '../composables/useComponentIcons'
6358
import { useFormField } from '../composables/useFormField'
64-
import { useLocale } from '../composables/useLocale'
6559
import { tv } from '../utils/tv'
6660
import UIcon from './Icon.vue'
6761
import UAvatar from './Avatar.vue'
@@ -72,16 +66,14 @@ const props = withDefaults(defineProps<InputTimeProps>(), {
7266
const emits = defineEmits<InputTimeEmits>()
7367
const slots = defineSlots<InputTimeSlots>()
7468
75-
const { code: codeLocale, dir } = useLocale()
7669
const appConfig = useAppConfig() as InputTime['AppConfig']
7770
78-
const rootProps = useForwardPropsEmits(reactiveOmit(props, 'id', 'name', 'color', 'variant', 'size', 'highlight', 'disabled', 'autofocus', 'autofocusDelay', 'locale', 'icon', 'avatar', 'leading', 'leadingIcon', 'trailing', 'trailingIcon', 'loading', 'loadingIcon', 'class', 'ui'), emits)
71+
const rootProps = useForwardPropsEmits(reactiveOmit(props, 'id', 'name', 'color', 'variant', 'size', 'highlight', 'disabled', 'autofocus', 'autofocusDelay', 'icon', 'avatar', 'leading', 'leadingIcon', 'trailing', 'trailingIcon', 'loading', 'loadingIcon', 'class', 'ui'), emits)
7972
8073
const { emitFormBlur, emitFormFocus, emitFormChange, emitFormInput, id, color, size: formGroupSize, name, highlight, disabled, ariaAttrs } = useFormField<InputTimeProps>(props)
8174
const { orientation, size: fieldGroupSize } = useFieldGroup<InputTimeProps>(props)
8275
const { isLeading, isTrailing, leadingIconName, trailingIconName } = useComponentIcons(props)
8376
84-
const locale = computed(() => props.locale || codeLocale.value)
8577
const inputSize = computed(() => fieldGroupSize.value || formGroupSize.value)
8678
8779
const ui = computed(() => tv({ extend: tv(theme), ...(appConfig.ui?.inputTime || {}) })({
@@ -140,8 +132,6 @@ defineExpose({
140132
v-slot="{ segments }"
141133
:name="name"
142134
:disabled="disabled"
143-
:locale="locale"
144-
:dir="dir"
145135
:class="ui.base({ class: [props.ui?.base, props.class] })"
146136
@update:model-value="onUpdate"
147137
@blur="onBlur"

0 commit comments

Comments
 (0)