reka-ui
Version:
Vue port for Radix UI Primitives.
1 lines • 18.2 kB
Source Map (JSON)
{"version":3,"file":"TimeFieldRoot.cjs","sources":["../../src/TimeField/TimeFieldRoot.vue"],"sourcesContent":["<script lang=\"ts\">\nimport { type DateValue, Time, getLocalTimeZone, isEqualDay, toCalendarDateTime, today } from '@internationalized/date'\n\nimport type { Ref } from 'vue'\nimport type { PrimitiveProps } from '@/Primitive'\nimport { type Formatter, createContext, isNullish, useDateFormatter, useDirection, useKbd, useLocale } from '@/shared'\nimport {\n type HourCycle,\n type SegmentPart,\n type SegmentValueObj,\n type TimeValue,\n createContent,\n getDefaultTime,\n getTimeFieldSegmentElements,\n initializeTimeSegmentValues,\n isSegmentNavigationKey,\n syncTimeSegmentValues,\n\n} from '@/shared/date'\nimport { isBefore } from '@/date'\nimport type { Direction, FormFieldProps } from '@/shared/types'\n\ntype TimeFieldRootContext = {\n locale: Ref<string>\n modelValue: Ref<DateValue | undefined>\n placeholder: Ref<DateValue>\n isInvalid: Ref<boolean>\n disabled: Ref<boolean>\n readonly: Ref<boolean>\n formatter: Formatter\n hourCycle: HourCycle\n segmentValues: Ref<SegmentValueObj>\n segmentContents: Ref<{ part: SegmentPart, value: string }[]>\n elements: Ref<Set<HTMLElement>>\n focusNext: () => void\n setFocusedElement: (el: HTMLElement) => void\n}\n\nexport interface TimeFieldRootProps extends PrimitiveProps, FormFieldProps {\n /** The default value for the calendar */\n defaultValue?: TimeValue\n /** The default placeholder date */\n defaultPlaceholder?: TimeValue\n /** The placeholder date, which is used to determine what time to display when no time is selected. This updates as the user navigates the field */\n placeholder?: TimeValue\n /** The controlled checked state of the field. Can be bound as `v-model`. */\n modelValue?: TimeValue | null\n /** The hour cycle used for formatting times. Defaults to the local preference */\n hourCycle?: HourCycle\n /** The granularity to use for formatting times. Defaults to minute if a Time is provided, otherwise defaults to minute. The field will render segments for each part of the date up to and including the specified granularity */\n granularity?: 'hour' | 'minute' | 'second'\n /** Whether or not to hide the time zone segment of the field */\n hideTimeZone?: boolean\n /** The maximum date that can be selected */\n maxValue?: TimeValue\n /** The minimum date that can be selected */\n minValue?: TimeValue\n /** The locale to use for formatting dates */\n locale?: string\n /** Whether or not the time field is disabled */\n disabled?: boolean\n /** Whether or not the time field is readonly */\n readonly?: boolean\n /** Id of the element */\n id?: string\n /** The reading direction of the time field when applicable. <br> If omitted, inherits globally from `ConfigProvider` or assumes LTR (left-to-right) reading mode. */\n dir?: Direction\n}\n\nexport type TimeFieldRootEmits = {\n /** Event handler called whenever the model value changes */\n 'update:modelValue': [date: TimeValue | undefined]\n /** Event handler called whenever the placeholder value changes */\n 'update:placeholder': [date: TimeValue]\n}\n\nexport const [injectTimeFieldRootContext, provideTimeFieldRootContext]\n = createContext<TimeFieldRootContext>('TimeFieldRoot')\n\nfunction convertValue(value: TimeValue, date: DateValue = today(getLocalTimeZone())) {\n if (value && 'day' in value) {\n return value\n }\n\n return toCalendarDateTime(date, value)\n}\n</script>\n\n<script setup lang=\"ts\">\nimport { computed, nextTick, onMounted, ref, toRefs, watch } from 'vue'\nimport { Primitive, usePrimitiveElement } from '@/Primitive'\nimport { useVModel } from '@vueuse/core'\nimport { VisuallyHidden } from '@/VisuallyHidden'\n\ndefineOptions({\n inheritAttrs: false,\n})\n\nconst props = withDefaults(defineProps<TimeFieldRootProps>(), {\n defaultValue: undefined,\n disabled: false,\n readonly: false,\n placeholder: undefined,\n isDateUnavailable: undefined,\n})\nconst emits = defineEmits<TimeFieldRootEmits>()\ndefineSlots<{\n default: (props: {\n /** The current time of the field */\n modelValue: TimeValue | undefined\n /** The time field segment contents */\n segments: { part: SegmentPart, value: string }[]\n /** Value if the input is invalid */\n isInvalid: boolean\n }) => any\n}>()\n\nconst { disabled, readonly, granularity, defaultValue, minValue, maxValue, dir: propDir, locale: propLocale } = toRefs(props)\nconst locale = useLocale(propLocale)\nconst dir = useDirection(propDir)\n\nconst formatter = useDateFormatter(locale.value)\nconst { primitiveElement, currentElement: parentElement }\n = usePrimitiveElement()\nconst segmentElements = ref<Set<HTMLElement>>(new Set())\n\nconst convertedMinValue = computed(() => minValue.value ? convertValue(minValue.value) : undefined)\nconst convertedMaxValue = computed(() => maxValue.value ? convertValue(maxValue.value) : undefined)\n\nonMounted(() => {\n getTimeFieldSegmentElements(parentElement.value).forEach(item => segmentElements.value.add(item as HTMLElement))\n})\n\nconst modelValue = useVModel(props, 'modelValue', emits, {\n defaultValue: defaultValue.value,\n passive: (props.modelValue === undefined) as false,\n}) as Ref<TimeValue>\n\nconst convertedModelValue = computed({\n get() {\n if (isNullish(modelValue.value))\n return modelValue.value\n return convertValue(modelValue.value)\n },\n set(newValue) {\n if (newValue)\n modelValue.value = modelValue.value && 'day' in modelValue.value ? newValue : new Time(newValue.hour, newValue.minute, newValue.second, modelValue.value?.millisecond)\n\n return newValue\n },\n})\n\nconst defaultDate = getDefaultTime({\n defaultPlaceholder: props.placeholder,\n defaultValue: modelValue.value,\n})\n\nconst placeholder = useVModel(props, 'placeholder', emits, {\n defaultValue: props.defaultPlaceholder ?? defaultDate.copy(),\n passive: (props.placeholder === undefined) as false,\n}) as Ref<TimeValue>\n\nconst convertedPlaceholder = computed({\n get() {\n return convertValue(placeholder.value)\n },\n set(newValue) {\n if (newValue)\n placeholder.value = 'day' in placeholder.value ? newValue.copy() : new Time(newValue.hour, newValue.minute, newValue.second, placeholder.value?.millisecond)\n return newValue\n },\n})\n\nconst inferredGranularity = computed(() => {\n if (granularity.value)\n return granularity.value\n\n return 'minute'\n})\n\nconst isInvalid = computed(() => {\n if (!modelValue.value)\n return false\n\n if (convertedMinValue.value && isBefore(convertedModelValue.value, convertedMinValue.value))\n return true\n\n if (convertedMaxValue.value && isBefore(convertedMaxValue.value, convertedModelValue.value))\n return true\n\n return false\n})\n\nconst initialSegments = initializeTimeSegmentValues(inferredGranularity.value)\n\nconst segmentValues = ref<SegmentValueObj>(modelValue.value ? { ...syncTimeSegmentValues({ value: convertedModelValue.value, formatter }) } : { ...initialSegments })\n\nconst allSegmentContent = computed(() => createContent({\n granularity: inferredGranularity.value,\n dateRef: convertedPlaceholder.value,\n formatter,\n hideTimeZone: props.hideTimeZone,\n hourCycle: props.hourCycle,\n segmentValues: segmentValues.value,\n locale,\n isTimeValue: true,\n}))\n\nconst segmentContents = computed(() => allSegmentContent.value.arr)\n\nconst editableSegmentContents = computed(() => segmentContents.value.filter(({ part }) => part !== 'literal'))\n\nwatch(locale, (value) => {\n if (formatter.getLocale() !== value) {\n formatter.setLocale(value)\n // Locale changed, so we need to clear the segment elements and re-get them (different order)\n // Get the focusable elements again on the next tick\n nextTick(() => {\n segmentElements.value.clear()\n getTimeFieldSegmentElements(parentElement.value).forEach(item => segmentElements.value.add(item as HTMLElement))\n })\n }\n})\n\nwatch(convertedModelValue, (_modelValue) => {\n if (!isNullish(_modelValue) && (!isEqualDay(convertedPlaceholder.value, _modelValue) || convertedPlaceholder.value.compare(_modelValue) !== 0))\n placeholder.value = _modelValue.copy()\n})\n\nwatch([convertedModelValue, locale], ([_modelValue]) => {\n if (!isNullish(_modelValue)) {\n segmentValues.value = { ...syncTimeSegmentValues({ value: _modelValue, formatter }) }\n }\n else if (Object.values(segmentValues.value).every(value => value === null) || isNullish(_modelValue)) {\n segmentValues.value = { ...initialSegments }\n }\n})\n\nconst currentFocusedElement = ref<HTMLElement | null>(null)\n\nconst currentSegmentIndex = computed(() =>\n Array.from(segmentElements.value).findIndex(el =>\n el.getAttribute('data-reka-time-field-segment')\n === currentFocusedElement.value?.getAttribute('data-reka-time-field-segment')))\n\nconst nextFocusableSegment = computed(() => {\n const sign = dir.value === 'rtl' ? -1 : 1\n const nextCondition = sign < 0 ? currentSegmentIndex.value < 0 : currentSegmentIndex.value > segmentElements.value.size - 1\n if (nextCondition)\n return null\n const segmentToFocus = Array.from(segmentElements.value)[currentSegmentIndex.value + sign]\n return segmentToFocus\n})\n\nconst prevFocusableSegment = computed(() => {\n const sign = dir.value === 'rtl' ? -1 : 1\n const prevCondition = sign > 0 ? currentSegmentIndex.value < 0 : currentSegmentIndex.value > segmentElements.value.size - 1\n if (prevCondition)\n return null\n\n const segmentToFocus = Array.from(segmentElements.value)[currentSegmentIndex.value - sign]\n return segmentToFocus\n})\n\nconst kbd = useKbd()\n\nfunction handleKeydown(e: KeyboardEvent) {\n if (!isSegmentNavigationKey(e.key))\n return\n if (e.key === kbd.ARROW_LEFT)\n prevFocusableSegment.value?.focus()\n if (e.key === kbd.ARROW_RIGHT)\n nextFocusableSegment.value?.focus()\n}\n\nfunction setFocusedElement(el: HTMLElement) {\n currentFocusedElement.value = el\n}\n\nprovideTimeFieldRootContext({\n locale,\n modelValue: convertedModelValue,\n placeholder: convertedPlaceholder,\n disabled,\n formatter,\n hourCycle: props.hourCycle,\n readonly,\n segmentValues,\n isInvalid,\n segmentContents: editableSegmentContents,\n elements: segmentElements,\n setFocusedElement,\n focusNext() {\n nextFocusableSegment.value?.focus()\n },\n})\n\ndefineExpose({\n /** Helper to set the focused element inside the DateField */\n setFocusedElement,\n})\n</script>\n\n<template>\n <Primitive\n v-bind=\"$attrs\"\n ref=\"primitiveElement\"\n role=\"group\"\n :aria-disabled=\"disabled ? true : undefined\"\n :data-disabled=\"disabled ? '' : undefined\"\n :data-readonly=\"readonly ? '' : undefined\"\n :data-invalid=\"isInvalid ? '' : undefined\"\n :dir=\"dir\"\n @keydown.left.right=\"handleKeydown\"\n >\n <slot\n :model-value=\"modelValue\"\n :segments=\"segmentContents\"\n :is-invalid=\"isInvalid\"\n />\n\n <VisuallyHidden\n :id=\"id\"\n as=\"input\"\n feature=\"focusable\"\n tabindex=\"-1\"\n :value=\"modelValue ? modelValue.toString() : ''\"\n :name=\"name\"\n :disabled=\"disabled\"\n :required=\"required\"\n @focus=\"Array.from(segmentElements)?.[0]?.focus()\"\n />\n </Primitive>\n</template>\n"],"names":["createContext","date","today","getLocalTimeZone","toCalendarDateTime","toRefs","useLocale","useDirection","useDateFormatter","usePrimitiveElement","ref","computed","onMounted","getTimeFieldSegmentElements","useVModel","isNullish","Time","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