reka-ui 2.5.1 → 2.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Calendar/CalendarCellTrigger.cjs +20 -62
- package/dist/Calendar/CalendarCellTrigger.cjs.map +1 -1
- package/dist/Calendar/CalendarCellTrigger.js +21 -63
- package/dist/Calendar/CalendarCellTrigger.js.map +1 -1
- package/dist/Calendar/CalendarRoot.cjs +0 -1
- package/dist/Calendar/CalendarRoot.cjs.map +1 -1
- package/dist/Calendar/CalendarRoot.js +0 -1
- package/dist/Calendar/CalendarRoot.js.map +1 -1
- package/dist/Combobox/ComboboxCancel.cjs +1 -0
- package/dist/Combobox/ComboboxCancel.cjs.map +1 -1
- package/dist/Combobox/ComboboxCancel.js +1 -0
- package/dist/Combobox/ComboboxCancel.js.map +1 -1
- package/dist/Combobox/ComboboxRoot.cjs +12 -4
- package/dist/Combobox/ComboboxRoot.cjs.map +1 -1
- package/dist/Combobox/ComboboxRoot.js +12 -4
- package/dist/Combobox/ComboboxRoot.js.map +1 -1
- package/dist/Listbox/ListboxContent.cjs +1 -1
- package/dist/Listbox/ListboxContent.cjs.map +1 -1
- package/dist/Listbox/ListboxContent.js +1 -1
- package/dist/Listbox/ListboxContent.js.map +1 -1
- package/dist/Listbox/ListboxItem.cjs +2 -3
- package/dist/Listbox/ListboxItem.cjs.map +1 -1
- package/dist/Listbox/ListboxItem.js +2 -3
- package/dist/Listbox/ListboxItem.js.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.cjs.map +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js +1 -1
- package/dist/NavigationMenu/NavigationMenuTrigger.js.map +1 -1
- package/dist/PinInput/PinInputInput.cjs +1 -1
- package/dist/PinInput/PinInputInput.cjs.map +1 -1
- package/dist/PinInput/PinInputInput.js +1 -1
- package/dist/PinInput/PinInputInput.js.map +1 -1
- package/dist/PinInput/PinInputRoot.cjs +2 -1
- package/dist/PinInput/PinInputRoot.cjs.map +1 -1
- package/dist/PinInput/PinInputRoot.js +2 -1
- package/dist/PinInput/PinInputRoot.js.map +1 -1
- package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs +20 -62
- package/dist/RangeCalendar/RangeCalendarCellTrigger.cjs.map +1 -1
- package/dist/RangeCalendar/RangeCalendarCellTrigger.js +21 -63
- package/dist/RangeCalendar/RangeCalendarCellTrigger.js.map +1 -1
- package/dist/RangeCalendar/RangeCalendarRoot.cjs +0 -1
- package/dist/RangeCalendar/RangeCalendarRoot.cjs.map +1 -1
- package/dist/RangeCalendar/RangeCalendarRoot.js +0 -1
- package/dist/RangeCalendar/RangeCalendarRoot.js.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbar.cjs.map +1 -1
- package/dist/ScrollArea/ScrollAreaScrollbar.js.map +1 -1
- package/dist/Select/BubbleSelect.cjs +10 -1
- package/dist/Select/BubbleSelect.cjs.map +1 -1
- package/dist/Select/BubbleSelect.js +10 -1
- package/dist/Select/BubbleSelect.js.map +1 -1
- package/dist/TagsInput/TagsInputItem.cjs +1 -1
- package/dist/TagsInput/TagsInputItem.js +1 -1
- package/dist/Toast/ToastProvider.cjs +6 -1
- package/dist/Toast/ToastProvider.cjs.map +1 -1
- package/dist/Toast/ToastProvider.js +6 -1
- package/dist/Toast/ToastProvider.js.map +1 -1
- package/dist/Toast/ToastRootImpl.cjs +6 -3
- package/dist/Toast/ToastRootImpl.cjs.map +1 -1
- package/dist/Toast/ToastRootImpl.js +6 -3
- package/dist/Toast/ToastRootImpl.js.map +1 -1
- package/dist/constant/components.cjs +2 -0
- package/dist/constant/components.cjs.map +1 -1
- package/dist/constant/components.js +2 -0
- package/dist/constant/components.js.map +1 -1
- package/dist/constant.d.cts +1 -1
- package/dist/constant.d.cts.map +1 -1
- package/dist/constant.d.ts +1 -1
- package/dist/constant.d.ts.map +1 -1
- package/dist/index.cjs +4 -3
- package/dist/index.d.cts +836 -807
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +112 -83
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -4
- package/dist/index2.d.cts.map +1 -1
- package/dist/shared/useDirection.cjs +5 -0
- package/dist/shared/useDirection.cjs.map +1 -1
- package/dist/shared/useDirection.js +5 -0
- package/dist/shared/useDirection.js.map +1 -1
- package/dist/shared/useGraceArea.cjs +1 -1
- package/dist/shared/useGraceArea.cjs.map +1 -1
- package/dist/shared/useGraceArea.js +1 -1
- package/dist/shared/useGraceArea.js.map +1 -1
- package/dist/shared/useLocale.cjs +5 -0
- package/dist/shared/useLocale.cjs.map +1 -1
- package/dist/shared/useLocale.js +5 -0
- package/dist/shared/useLocale.js.map +1 -1
- package/package.json +4 -4
- package/src/Calendar/CalendarCellTrigger.vue +25 -93
- package/src/Calendar/CalendarRoot.vue +0 -1
- package/src/Combobox/ComboboxCancel.vue +3 -0
- package/src/Combobox/ComboboxRoot.vue +10 -2
- package/src/ContextMenu/ContextMenuRoot.vue +1 -1
- package/src/Listbox/ListboxContent.vue +1 -1
- package/src/Listbox/ListboxItem.vue +2 -4
- package/src/NavigationMenu/NavigationMenuTrigger.vue +6 -2
- package/src/PinInput/PinInputInput.vue +1 -1
- package/src/PinInput/PinInputRoot.vue +2 -1
- package/src/RangeCalendar/RangeCalendarCellTrigger.vue +25 -91
- package/src/RangeCalendar/RangeCalendarRoot.vue +0 -1
- package/src/ScrollArea/ScrollAreaScrollbar.vue +2 -2
- package/src/Select/BubbleSelect.vue +11 -0
- package/src/TagsInput/TagsInputRoot.vue +1 -1
- package/src/Toast/ToastProvider.vue +8 -1
- package/src/Toast/ToastRootImpl.vue +9 -2
- package/src/index.ts +2 -0
- package/src/shared/useDirection.ts +5 -0
- package/src/shared/useGraceArea.ts +1 -1
- package/src/shared/useLocale.ts +5 -0
- package/dist/Calendar/utils.cjs +0 -15
- package/dist/Calendar/utils.cjs.map +0 -1
- package/dist/Calendar/utils.js +0 -9
- package/dist/Calendar/utils.js.map +0 -1
- package/src/Calendar/utils.ts +0 -5
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
isToday,
|
|
10
10
|
} from '@internationalized/date'
|
|
11
11
|
import { computed, nextTick } from 'vue'
|
|
12
|
-
import {
|
|
13
|
-
import { getDaysInMonth, isBetweenInclusive, parseStringToDateValue, toDate } from '@/date'
|
|
12
|
+
import { isBetweenInclusive, toDate } from '@/date'
|
|
14
13
|
import { useKbd } from '@/shared'
|
|
15
14
|
|
|
16
15
|
export interface RangeCalendarCellTriggerProps extends PrimitiveProps {
|
|
@@ -179,117 +178,52 @@ function handleArrowKey(e: KeyboardEvent) {
|
|
|
179
178
|
const sign = rootContext.dir.value === 'rtl' ? -1 : 1
|
|
180
179
|
switch (e.code) {
|
|
181
180
|
case kbd.ARROW_RIGHT:
|
|
182
|
-
shiftFocus(
|
|
181
|
+
shiftFocus(props.day, sign)
|
|
183
182
|
break
|
|
184
183
|
case kbd.ARROW_LEFT:
|
|
185
|
-
shiftFocus(
|
|
184
|
+
shiftFocus(props.day, -sign)
|
|
186
185
|
break
|
|
187
186
|
case kbd.ARROW_UP:
|
|
188
|
-
shiftFocus(
|
|
187
|
+
shiftFocus(props.day, -indexIncrementation)
|
|
189
188
|
break
|
|
190
189
|
case kbd.ARROW_DOWN:
|
|
191
|
-
shiftFocus(
|
|
190
|
+
shiftFocus(props.day, indexIncrementation)
|
|
192
191
|
break
|
|
193
192
|
case kbd.ENTER:
|
|
194
193
|
case kbd.SPACE_CODE:
|
|
195
194
|
changeDate(e, props.day)
|
|
196
195
|
}
|
|
197
196
|
|
|
198
|
-
function shiftFocus(
|
|
199
|
-
const
|
|
200
|
-
if (!allCollectionItems.length)
|
|
201
|
-
return
|
|
202
|
-
|
|
203
|
-
const index = allCollectionItems.indexOf(node)
|
|
204
|
-
const newIndex = index + add
|
|
205
|
-
|
|
206
|
-
if (newIndex >= 0 && newIndex < allCollectionItems.length) {
|
|
207
|
-
const newDate = allCollectionItems[newIndex].getAttribute('data-value')
|
|
208
|
-
const newDateValue = parseStringToDateValue(newDate!, rootContext.placeholder.value)
|
|
209
|
-
const minValue = rootContext.minValue.value
|
|
210
|
-
const maxValue = rootContext.maxValue.value
|
|
211
|
-
if ((minValue && newDateValue.compare(minValue) < 0) || (maxValue && newDateValue.compare(maxValue) > 0))
|
|
212
|
-
return
|
|
197
|
+
function shiftFocus(day: DateValue, add: number) {
|
|
198
|
+
const candidateDayValue = day.add({ days: add })
|
|
213
199
|
|
|
214
|
-
|
|
215
|
-
shiftFocus(allCollectionItems[newIndex], add)
|
|
216
|
-
}
|
|
217
|
-
rootContext.onPlaceholderChange(newDateValue)
|
|
218
|
-
allCollectionItems[newIndex].focus()
|
|
200
|
+
if ((rootContext.minValue.value && candidateDayValue.compare(rootContext.minValue.value) < 0) || (rootContext.maxValue.value && candidateDayValue.compare(rootContext.maxValue.value) > 0))
|
|
219
201
|
return
|
|
220
|
-
}
|
|
221
202
|
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
const newCollectionItems: HTMLElement[] = getSelectableCells(parentElement)
|
|
228
|
-
if (!newCollectionItems.length)
|
|
203
|
+
const candidateDay = parentElement.querySelector<HTMLElement>(`[data-value='${candidateDayValue.toString()}']:not([data-outside-view])`)
|
|
204
|
+
// If the date is not found it means we must change the page
|
|
205
|
+
if (!candidateDay) {
|
|
206
|
+
if (add > 0) {
|
|
207
|
+
if (rootContext.isNextButtonDisabled())
|
|
229
208
|
return
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
if (newCollectionItems[computedIndex].hasAttribute('data-disabled')) {
|
|
235
|
-
shiftFocus(newCollectionItems[computedIndex], add)
|
|
236
|
-
}
|
|
237
|
-
const newDate = newCollectionItems[computedIndex].getAttribute('data-value')
|
|
238
|
-
rootContext.onPlaceholderChange(parseStringToDateValue(newDate!, rootContext.placeholder.value))
|
|
239
|
-
newCollectionItems[
|
|
240
|
-
computedIndex
|
|
241
|
-
].focus()
|
|
209
|
+
rootContext.nextPage()
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
if (rootContext.isPrevButtonDisabled())
|
|
242
213
|
return
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
const newDate = newCollectionItems[computedIndex].getAttribute('data-value')
|
|
249
|
-
rootContext.onPlaceholderChange(parseStringToDateValue(newDate!, rootContext.placeholder.value))
|
|
250
|
-
newCollectionItems[
|
|
251
|
-
computedIndex
|
|
252
|
-
].focus()
|
|
214
|
+
rootContext.prevPage()
|
|
215
|
+
}
|
|
216
|
+
nextTick(() => {
|
|
217
|
+
shiftFocus(day, add)
|
|
253
218
|
})
|
|
254
219
|
return
|
|
255
220
|
}
|
|
256
221
|
|
|
257
|
-
if (
|
|
258
|
-
|
|
259
|
-
return
|
|
260
|
-
rootContext.nextPage()
|
|
261
|
-
nextTick(() => {
|
|
262
|
-
const newCollectionItems: HTMLElement[] = getSelectableCells(parentElement)
|
|
263
|
-
if (!newCollectionItems.length)
|
|
264
|
-
return
|
|
265
|
-
|
|
266
|
-
if (!rootContext.pagedNavigation.value && rootContext.numberOfMonths.value > 1) {
|
|
267
|
-
// Placeholder is set to first month of the new page
|
|
268
|
-
const numberOfDays = getDaysInMonth(
|
|
269
|
-
rootContext.placeholder.value.add({ months: rootContext.numberOfMonths.value - 1 }),
|
|
270
|
-
)
|
|
271
|
-
|
|
272
|
-
const computedIndex = newIndex - allCollectionItems.length + (newCollectionItems.length - numberOfDays)
|
|
273
|
-
|
|
274
|
-
if (newCollectionItems[computedIndex].hasAttribute('data-disabled')) {
|
|
275
|
-
shiftFocus(newCollectionItems[computedIndex], add)
|
|
276
|
-
}
|
|
277
|
-
const newDate = newCollectionItems[computedIndex].getAttribute('data-value')
|
|
278
|
-
rootContext.onPlaceholderChange(parseStringToDateValue(newDate!, rootContext.placeholder.value))
|
|
279
|
-
newCollectionItems[computedIndex].focus()
|
|
280
|
-
return
|
|
281
|
-
}
|
|
282
|
-
|
|
283
|
-
const computedIndex = newIndex - allCollectionItems.length
|
|
284
|
-
if (newCollectionItems[computedIndex].hasAttribute('data-disabled')) {
|
|
285
|
-
shiftFocus(newCollectionItems[computedIndex], add)
|
|
286
|
-
}
|
|
287
|
-
|
|
288
|
-
const newDate = newCollectionItems[computedIndex].getAttribute('data-value')
|
|
289
|
-
rootContext.onPlaceholderChange(parseStringToDateValue(newDate!, rootContext.placeholder.value))
|
|
290
|
-
newCollectionItems[computedIndex].focus()
|
|
291
|
-
})
|
|
222
|
+
if (candidateDay && candidateDay.hasAttribute('data-disabled')) {
|
|
223
|
+
return shiftFocus(candidateDayValue, add)
|
|
292
224
|
}
|
|
225
|
+
rootContext.onPlaceholderChange(candidateDayValue)
|
|
226
|
+
candidateDay?.focus()
|
|
293
227
|
}
|
|
294
228
|
}
|
|
295
229
|
</script>
|
|
@@ -13,7 +13,7 @@ export interface ScrollAreaScrollbarProps extends PrimitiveProps {
|
|
|
13
13
|
forceMount?: boolean
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export interface
|
|
16
|
+
export interface ScrollAreaScrollbarContext {
|
|
17
17
|
as: Ref<PrimitiveProps['as']>
|
|
18
18
|
orientation: Ref<'vertical' | 'horizontal'>
|
|
19
19
|
forceMount?: Ref<boolean>
|
|
@@ -22,7 +22,7 @@ export interface ScrollAreaScollbarContext {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const [injectScrollAreaScrollbarContext, provideScrollAreaScrollbarContext]
|
|
25
|
-
= createContext<
|
|
25
|
+
= createContext<ScrollAreaScrollbarContext>('ScrollAreaScrollbar')
|
|
26
26
|
</script>
|
|
27
27
|
|
|
28
28
|
<script setup lang="ts">
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { ref, watch } from 'vue'
|
|
3
3
|
import { VisuallyHidden } from '@/VisuallyHidden'
|
|
4
|
+
import { injectSelectRootContext } from './SelectRoot.vue'
|
|
4
5
|
|
|
5
6
|
interface BubbleSelectProps {
|
|
6
7
|
autocomplete?: string
|
|
@@ -16,6 +17,7 @@ interface BubbleSelectProps {
|
|
|
16
17
|
|
|
17
18
|
const props = defineProps<BubbleSelectProps>()
|
|
18
19
|
const selectElement = ref<HTMLElement>()
|
|
20
|
+
const rootContext = injectSelectRootContext()
|
|
19
21
|
|
|
20
22
|
// This would bubble "change" event to form, with the target as Select element.
|
|
21
23
|
watch(() => props.value, (cur, prev) => {
|
|
@@ -32,6 +34,14 @@ watch(() => props.value, (cur, prev) => {
|
|
|
32
34
|
}
|
|
33
35
|
})
|
|
34
36
|
|
|
37
|
+
/**
|
|
38
|
+
* Form autofill will trigger an `input` event on the `select` element.
|
|
39
|
+
* We listen to that event and update our internal state to support it.
|
|
40
|
+
*/
|
|
41
|
+
function handleInput(event: Event) {
|
|
42
|
+
rootContext.onValueChange((event.target as HTMLSelectElement).value)
|
|
43
|
+
}
|
|
44
|
+
|
|
35
45
|
/**
|
|
36
46
|
* We purposefully use a `select` here to support form autofill as much
|
|
37
47
|
* as possible.
|
|
@@ -49,6 +59,7 @@ watch(() => props.value, (cur, prev) => {
|
|
|
49
59
|
<select
|
|
50
60
|
ref="selectElement"
|
|
51
61
|
v-bind="props"
|
|
62
|
+
@input="handleInput"
|
|
52
63
|
>
|
|
53
64
|
<slot />
|
|
54
65
|
</select>
|
|
@@ -5,7 +5,7 @@ import type { Direction, FormFieldProps } from '@/shared/types'
|
|
|
5
5
|
import { computed, ref, toRefs } from 'vue'
|
|
6
6
|
import { createContext, useArrowNavigation, useDirection, useFormControl, useForwardExpose } from '@/shared'
|
|
7
7
|
|
|
8
|
-
export type AcceptableInputValue = string | Record<string, any>
|
|
8
|
+
export type AcceptableInputValue = string | number | bigint | Record<string, any>
|
|
9
9
|
|
|
10
10
|
export interface TagsInputRootProps<T = AcceptableInputValue> extends PrimitiveProps, FormFieldProps {
|
|
11
11
|
/** The controlled value of the tags input. Can be bind as `v-model`. */
|
|
@@ -7,6 +7,7 @@ import { createContext } from '@/shared'
|
|
|
7
7
|
type ToastProviderContext = {
|
|
8
8
|
label: Ref<string>
|
|
9
9
|
duration: Ref<number>
|
|
10
|
+
disableSwipe: Ref<boolean>
|
|
10
11
|
swipeDirection: Ref<SwipeDirection>
|
|
11
12
|
swipeThreshold: Ref<number>
|
|
12
13
|
toastCount: Ref<number>
|
|
@@ -30,6 +31,11 @@ export interface ToastProviderProps {
|
|
|
30
31
|
* @defaultValue 5000
|
|
31
32
|
*/
|
|
32
33
|
duration?: number
|
|
34
|
+
/**
|
|
35
|
+
* Whether to disable the ability to swipe to close the toast.
|
|
36
|
+
* @defaultValue false
|
|
37
|
+
*/
|
|
38
|
+
disableSwipe?: boolean
|
|
33
39
|
/**
|
|
34
40
|
* Direction of pointer swipe that should close the toast.
|
|
35
41
|
* @defaultValue 'right'
|
|
@@ -59,7 +65,7 @@ const props = withDefaults(defineProps<ToastProviderProps>(), {
|
|
|
59
65
|
swipeDirection: 'right',
|
|
60
66
|
swipeThreshold: 50,
|
|
61
67
|
})
|
|
62
|
-
const { label, duration, swipeDirection, swipeThreshold } = toRefs(props)
|
|
68
|
+
const { label, duration, disableSwipe, swipeDirection, swipeThreshold } = toRefs(props)
|
|
63
69
|
useCollection({ isProvider: true })
|
|
64
70
|
|
|
65
71
|
const viewport = ref<HTMLElement>()
|
|
@@ -75,6 +81,7 @@ if (props.label && typeof props.label === 'string' && !props.label.trim()) {
|
|
|
75
81
|
provideToastProviderContext({
|
|
76
82
|
label,
|
|
77
83
|
duration,
|
|
84
|
+
disableSwipe,
|
|
78
85
|
swipeDirection,
|
|
79
86
|
swipeThreshold,
|
|
80
87
|
toastCount,
|
|
@@ -203,12 +203,17 @@ provideToastRootContext({ onClose: handleClose })
|
|
|
203
203
|
:as-child="asChild"
|
|
204
204
|
:data-state="open ? 'open' : 'closed'"
|
|
205
205
|
:data-swipe-direction="providerContext.swipeDirection.value"
|
|
206
|
-
:style="
|
|
206
|
+
:style="providerContext.disableSwipe.value
|
|
207
|
+
? undefined
|
|
208
|
+
: { userSelect: 'none', touchAction: 'none' }"
|
|
207
209
|
@pointerdown.left="(event: PointerEvent) => {
|
|
210
|
+
if (providerContext.disableSwipe.value) return;
|
|
211
|
+
|
|
208
212
|
pointerStartRef = { x: event.clientX, y: event.clientY };
|
|
209
213
|
}"
|
|
210
214
|
@pointermove="(event: PointerEvent) => {
|
|
211
|
-
if (!pointerStartRef) return;
|
|
215
|
+
if (providerContext.disableSwipe.value || !pointerStartRef) return;
|
|
216
|
+
|
|
212
217
|
const x = event.clientX - pointerStartRef.x;
|
|
213
218
|
const y = event.clientY - pointerStartRef.y;
|
|
214
219
|
const hasSwipeMoveStarted = Boolean(swipeDeltaRef);
|
|
@@ -237,6 +242,8 @@ provideToastRootContext({ onClose: handleClose })
|
|
|
237
242
|
}
|
|
238
243
|
}"
|
|
239
244
|
@pointerup="(event: PointerEvent) => {
|
|
245
|
+
if (providerContext.disableSwipe.value) return;
|
|
246
|
+
|
|
240
247
|
const delta = swipeDeltaRef;
|
|
241
248
|
const target = event.target as HTMLElement;
|
|
242
249
|
if (target.hasPointerCapture(event.pointerId)) {
|
package/src/index.ts
CHANGED
|
@@ -43,12 +43,14 @@ export {
|
|
|
43
43
|
type Formatter,
|
|
44
44
|
useBodyScrollLock,
|
|
45
45
|
useDateFormatter,
|
|
46
|
+
useDirection,
|
|
46
47
|
useEmitAsProps,
|
|
47
48
|
useFilter,
|
|
48
49
|
useForwardExpose,
|
|
49
50
|
useForwardProps,
|
|
50
51
|
useForwardPropsEmits,
|
|
51
52
|
useId,
|
|
53
|
+
useLocale,
|
|
52
54
|
useStateMachine,
|
|
53
55
|
withDefault,
|
|
54
56
|
} from './shared'
|
|
@@ -3,6 +3,11 @@ import type { Direction } from './types'
|
|
|
3
3
|
import { computed, ref } from 'vue'
|
|
4
4
|
import { injectConfigProviderContext } from '@/ConfigProvider/ConfigProvider.vue'
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* The `useDirection` function provides a way to access the current direction in your application.
|
|
8
|
+
* @param {Ref<Direction | undefined>} [dir] - An optional ref containing the direction (ltr or rtl).
|
|
9
|
+
* @returns computed value that combines with the resolved direction.
|
|
10
|
+
*/
|
|
6
11
|
export function useDirection(dir?: Ref<Direction | undefined>) {
|
|
7
12
|
const context = injectConfigProviderContext({
|
|
8
13
|
dir: ref('ltr'),
|
|
@@ -44,7 +44,7 @@ export function useGraceArea(triggerElement: Ref<HTMLElement | undefined>, conta
|
|
|
44
44
|
watchEffect((cleanupFn) => {
|
|
45
45
|
if (pointerGraceArea.value) {
|
|
46
46
|
const handleTrackPointerGrace = (event: PointerEvent) => {
|
|
47
|
-
if (!pointerGraceArea.value || !(event.target instanceof
|
|
47
|
+
if (!pointerGraceArea.value || !(event.target instanceof Element))
|
|
48
48
|
return
|
|
49
49
|
|
|
50
50
|
const target = event.target
|
package/src/shared/useLocale.ts
CHANGED
|
@@ -2,6 +2,11 @@ import type { Ref } from 'vue'
|
|
|
2
2
|
import { computed, ref } from 'vue'
|
|
3
3
|
import { injectConfigProviderContext } from '@/ConfigProvider/ConfigProvider.vue'
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* The `useLocale` function provides a way to access the current locale in your application.
|
|
7
|
+
* @param {Ref<string | undefined>} [locale] - An optional ref containing the locale.
|
|
8
|
+
* @returns A computed ref holding the resolved locale.
|
|
9
|
+
*/
|
|
5
10
|
export function useLocale(locale?: Ref<string | undefined>) {
|
|
6
11
|
const context = injectConfigProviderContext({
|
|
7
12
|
locale: ref('en'),
|
package/dist/Calendar/utils.cjs
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
//#region src/Calendar/utils.ts
|
|
3
|
-
const SELECTOR = "[data-reka-calendar-cell-trigger]:not([data-outside-view]):not([data-outside-visible-view])";
|
|
4
|
-
function getSelectableCells(calendar) {
|
|
5
|
-
return Array.from(calendar.querySelectorAll(SELECTOR)) ?? [];
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
//#endregion
|
|
9
|
-
Object.defineProperty(exports, 'getSelectableCells', {
|
|
10
|
-
enumerable: true,
|
|
11
|
-
get: function () {
|
|
12
|
-
return getSelectableCells;
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
//# sourceMappingURL=utils.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.cjs","names":["calendar: HTMLElement"],"sources":["../../src/Calendar/utils.ts"],"sourcesContent":[],"mappings":";;AAAA,MAAa,WACT;AACJ,SAAgB,mBAAmBA,UAAsC;AACvE,QAAO,MAAM,KAAK,SAAS,iBAAiB,SAAS,CAAC,IAAI,CAAE;AAC7D"}
|
package/dist/Calendar/utils.js
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//#region src/Calendar/utils.ts
|
|
2
|
-
const SELECTOR = "[data-reka-calendar-cell-trigger]:not([data-outside-view]):not([data-outside-visible-view])";
|
|
3
|
-
function getSelectableCells(calendar) {
|
|
4
|
-
return Array.from(calendar.querySelectorAll(SELECTOR)) ?? [];
|
|
5
|
-
}
|
|
6
|
-
|
|
7
|
-
//#endregion
|
|
8
|
-
export { getSelectableCells };
|
|
9
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","names":["calendar: HTMLElement"],"sources":["../../src/Calendar/utils.ts"],"sourcesContent":[],"mappings":";AAAA,MAAa,WACT;AACJ,SAAgB,mBAAmBA,UAAsC;AACvE,QAAO,MAAM,KAAK,SAAS,iBAAiB,SAAS,CAAC,IAAI,CAAE;AAC7D"}
|
package/src/Calendar/utils.ts
DELETED