@agile-plus/headless 0.1.2 → 0.2.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/README.md +24 -17
- package/dist/index.cjs +4163 -223
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +33 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +4258 -216
- package/dist/index.js.map +1 -1
- package/dist/types-BxsQI7P5.d.cts +93 -0
- package/dist/types-BxsQI7P5.d.ts +93 -0
- package/dist/types-zpeY0yvD.d.cts +73 -0
- package/dist/types-zpeY0yvD.d.ts +73 -0
- package/dist/useAccordion/index.cjs +149 -0
- package/dist/useAccordion/index.cjs.map +1 -0
- package/dist/useAccordion/index.d.cts +119 -0
- package/dist/useAccordion/index.d.ts +119 -0
- package/dist/useAccordion/index.js +128 -0
- package/dist/useAccordion/index.js.map +1 -0
- package/dist/useAvatar/index.cjs +135 -0
- package/dist/useAvatar/index.cjs.map +1 -0
- package/dist/useAvatar/index.d.cts +120 -0
- package/dist/useAvatar/index.d.ts +120 -0
- package/dist/useAvatar/index.js +106 -0
- package/dist/useAvatar/index.js.map +1 -0
- package/dist/useCheckbox/index.cjs +3 -1
- package/dist/useCheckbox/index.cjs.map +1 -1
- package/dist/useCheckbox/index.js +3 -1
- package/dist/useCheckbox/index.js.map +1 -1
- package/dist/useCollapsible/index.cjs +10 -0
- package/dist/useCollapsible/index.cjs.map +1 -1
- package/dist/useCollapsible/index.js +11 -1
- package/dist/useCollapsible/index.js.map +1 -1
- package/dist/useDatePicker/index.cjs +684 -0
- package/dist/useDatePicker/index.cjs.map +1 -0
- package/dist/useDatePicker/index.d.cts +191 -0
- package/dist/useDatePicker/index.d.ts +191 -0
- package/dist/useDatePicker/index.js +671 -0
- package/dist/useDatePicker/index.js.map +1 -0
- package/dist/useDateRangePicker/index.cjs +614 -0
- package/dist/useDateRangePicker/index.cjs.map +1 -0
- package/dist/useDateRangePicker/index.d.cts +159 -0
- package/dist/useDateRangePicker/index.d.ts +159 -0
- package/dist/useDateRangePicker/index.js +601 -0
- package/dist/useDateRangePicker/index.js.map +1 -0
- package/dist/useDialog/index.cjs.map +1 -1
- package/dist/useDialog/index.js.map +1 -1
- package/dist/useDropdownMenu/index.cjs +468 -0
- package/dist/useDropdownMenu/index.cjs.map +1 -0
- package/dist/useDropdownMenu/index.d.cts +73 -0
- package/dist/useDropdownMenu/index.d.ts +73 -0
- package/dist/useDropdownMenu/index.js +441 -0
- package/dist/useDropdownMenu/index.js.map +1 -0
- package/dist/useEllipsis/index.cjs +181 -0
- package/dist/useEllipsis/index.cjs.map +1 -0
- package/dist/useEllipsis/index.d.cts +67 -0
- package/dist/useEllipsis/index.d.ts +67 -0
- package/dist/useEllipsis/index.js +162 -0
- package/dist/useEllipsis/index.js.map +1 -0
- package/dist/useFloating/index.cjs +177 -0
- package/dist/useFloating/index.cjs.map +1 -0
- package/dist/useFloating/index.d.cts +21 -0
- package/dist/useFloating/index.d.ts +21 -0
- package/dist/useFloating/index.js +150 -0
- package/dist/useFloating/index.js.map +1 -0
- package/dist/useFormControl/index.cjs +5 -0
- package/dist/useFormControl/index.cjs.map +1 -1
- package/dist/useFormControl/index.js +5 -0
- package/dist/useFormControl/index.js.map +1 -1
- package/dist/useInput/index.cjs +192 -0
- package/dist/useInput/index.cjs.map +1 -0
- package/dist/useInput/index.d.cts +41 -0
- package/dist/useInput/index.d.ts +41 -0
- package/dist/useInput/index.js +165 -0
- package/dist/useInput/index.js.map +1 -0
- package/dist/useKeepMounted/index.cjs +44 -0
- package/dist/useKeepMounted/index.cjs.map +1 -0
- package/dist/useKeepMounted/index.d.cts +45 -0
- package/dist/useKeepMounted/index.d.ts +45 -0
- package/dist/useKeepMounted/index.js +17 -0
- package/dist/useKeepMounted/index.js.map +1 -0
- package/dist/useMenu/index.cjs +438 -0
- package/dist/useMenu/index.cjs.map +1 -0
- package/dist/useMenu/index.d.cts +134 -0
- package/dist/useMenu/index.d.ts +134 -0
- package/dist/useMenu/index.js +419 -0
- package/dist/useMenu/index.js.map +1 -0
- package/dist/usePagination/index.cjs +113 -0
- package/dist/usePagination/index.cjs.map +1 -0
- package/dist/usePagination/index.d.cts +139 -0
- package/dist/usePagination/index.d.ts +139 -0
- package/dist/usePagination/index.js +95 -0
- package/dist/usePagination/index.js.map +1 -0
- package/dist/usePopover/index.cjs +312 -0
- package/dist/usePopover/index.cjs.map +1 -0
- package/dist/usePopover/index.d.cts +71 -0
- package/dist/usePopover/index.d.ts +71 -0
- package/dist/usePopover/index.js +285 -0
- package/dist/usePopover/index.js.map +1 -0
- package/dist/useSelect/index.cjs +729 -0
- package/dist/useSelect/index.cjs.map +1 -0
- package/dist/useSelect/index.d.cts +193 -0
- package/dist/useSelect/index.d.ts +193 -0
- package/dist/useSelect/index.js +710 -0
- package/dist/useSelect/index.js.map +1 -0
- package/dist/useSplitter/index.cjs +558 -0
- package/dist/useSplitter/index.cjs.map +1 -0
- package/dist/useSplitter/index.d.cts +307 -0
- package/dist/useSplitter/index.d.ts +307 -0
- package/dist/useSplitter/index.js +541 -0
- package/dist/useSplitter/index.js.map +1 -0
- package/dist/useSwitch/index.cjs +4 -1
- package/dist/useSwitch/index.cjs.map +1 -1
- package/dist/useSwitch/index.js +4 -1
- package/dist/useSwitch/index.js.map +1 -1
- package/dist/useTable/index.cjs +308 -0
- package/dist/useTable/index.cjs.map +1 -0
- package/dist/useTable/index.d.cts +242 -0
- package/dist/useTable/index.d.ts +242 -0
- package/dist/useTable/index.js +301 -0
- package/dist/useTable/index.js.map +1 -0
- package/dist/useTabs/index.cjs +13 -4
- package/dist/useTabs/index.cjs.map +1 -1
- package/dist/useTabs/index.d.cts +5 -1
- package/dist/useTabs/index.d.ts +5 -1
- package/dist/useTabs/index.js +13 -4
- package/dist/useTabs/index.js.map +1 -1
- package/dist/useTextControl-Dcq0GFmg.d.cts +63 -0
- package/dist/useTextControl-Dcq0GFmg.d.ts +63 -0
- package/dist/useTextarea/index.cjs +186 -0
- package/dist/useTextarea/index.cjs.map +1 -0
- package/dist/useTextarea/index.d.cts +30 -0
- package/dist/useTextarea/index.d.ts +30 -0
- package/dist/useTextarea/index.js +159 -0
- package/dist/useTextarea/index.js.map +1 -0
- package/dist/useToast/index.cjs +27 -20
- package/dist/useToast/index.cjs.map +1 -1
- package/dist/useToast/index.js +27 -20
- package/dist/useToast/index.js.map +1 -1
- package/dist/useToastViewport/index.cjs +1 -3
- package/dist/useToastViewport/index.cjs.map +1 -1
- package/dist/useToastViewport/index.js +1 -3
- package/dist/useToastViewport/index.js.map +1 -1
- package/dist/useTooltip/index.cjs +357 -0
- package/dist/useTooltip/index.cjs.map +1 -0
- package/dist/useTooltip/index.d.cts +81 -0
- package/dist/useTooltip/index.d.ts +81 -0
- package/dist/useTooltip/index.js +338 -0
- package/dist/useTooltip/index.js.map +1 -0
- package/dist/useVirtualList/index.cjs +308 -0
- package/dist/useVirtualList/index.cjs.map +1 -0
- package/dist/useVirtualList/index.d.cts +31 -0
- package/dist/useVirtualList/index.d.ts +31 -0
- package/dist/useVirtualList/index.js +288 -0
- package/dist/useVirtualList/index.js.map +1 -0
- package/dist/useVirtualTree/index.cjs +520 -0
- package/dist/useVirtualTree/index.cjs.map +1 -0
- package/dist/useVirtualTree/index.d.cts +146 -0
- package/dist/useVirtualTree/index.d.ts +146 -0
- package/dist/useVirtualTree/index.js +511 -0
- package/dist/useVirtualTree/index.js.map +1 -0
- package/package.json +121 -2
- package/src/index.ts +38 -0
- package/src/useAccordion/index.ts +7 -0
- package/src/useAccordion/types.ts +118 -0
- package/src/useAccordion/useAccordion.ts +130 -0
- package/src/useAvatar/index.ts +14 -0
- package/src/useAvatar/types.ts +90 -0
- package/src/useAvatar/useAvatar.ts +39 -0
- package/src/useAvatar/useAvatarFallback.ts +62 -0
- package/src/useAvatar/useAvatarImage.ts +78 -0
- package/src/useCheckbox/useCheckbox.ts +4 -1
- package/src/useCollapsible/useCollapsible.ts +22 -1
- package/src/useDatePicker/index.ts +9 -0
- package/src/useDatePicker/types.ts +177 -0
- package/src/useDatePicker/useDatePicker.ts +688 -0
- package/src/useDateRangePicker/index.ts +8 -0
- package/src/useDateRangePicker/types.ts +146 -0
- package/src/useDateRangePicker/useDateRangePicker.ts +618 -0
- package/src/useDropdownMenu/index.ts +3 -0
- package/src/useDropdownMenu/types.ts +61 -0
- package/src/useDropdownMenu/useDropdownMenu.ts +322 -0
- package/src/useEllipsis/index.ts +3 -0
- package/src/useEllipsis/types.ts +51 -0
- package/src/useEllipsis/useEllipsis.ts +169 -0
- package/src/useFloating/index.ts +3 -0
- package/src/useFloating/types.ts +79 -0
- package/src/useFloating/useFloating.ts +199 -0
- package/src/useFormControl/useFormControl.ts +13 -0
- package/src/useInput/index.ts +3 -0
- package/src/useInput/types.ts +29 -0
- package/src/useInput/useInput.ts +40 -0
- package/src/useKeepMounted/index.ts +3 -0
- package/src/useKeepMounted/types.ts +29 -0
- package/src/useKeepMounted/useKeepMounted.ts +34 -0
- package/src/useMenu/index.ts +9 -0
- package/src/useMenu/types.ts +126 -0
- package/src/useMenu/useMenu.ts +504 -0
- package/src/usePagination/index.ts +3 -0
- package/src/usePagination/types.ts +137 -0
- package/src/usePagination/usePagination.ts +109 -0
- package/src/usePopover/index.ts +3 -0
- package/src/usePopover/types.ts +65 -0
- package/src/usePopover/usePopover.ts +157 -0
- package/src/useSelect/index.ts +9 -0
- package/src/useSelect/types.ts +184 -0
- package/src/useSelect/useSelect.ts +713 -0
- package/src/useSplitter/index.ts +10 -0
- package/src/useSplitter/types.ts +336 -0
- package/src/useSplitter/useSplitter.ts +648 -0
- package/src/useSplitter/useSplitterPanel.ts +106 -0
- package/src/useSwitch/useSwitch.ts +6 -1
- package/src/useTable/index.ts +3 -0
- package/src/useTable/types.ts +282 -0
- package/src/useTable/useTable.ts +407 -0
- package/src/useTabs/types.ts +5 -1
- package/src/useTabs/useTabs.ts +30 -6
- package/src/useTextarea/index.ts +3 -0
- package/src/useTextarea/types.ts +17 -0
- package/src/useTextarea/useTextarea.ts +34 -0
- package/src/useToast/useToast.ts +43 -26
- package/src/useToastViewport/useToastViewport.ts +10 -9
- package/src/useTooltip/index.ts +3 -0
- package/src/useTooltip/types.ts +72 -0
- package/src/useTooltip/useTooltip.ts +240 -0
- package/src/useVirtualList/index.ts +8 -0
- package/src/useVirtualList/types.ts +95 -0
- package/src/useVirtualList/useVirtualList.ts +478 -0
- package/src/useVirtualTree/index.ts +3 -0
- package/src/useVirtualTree/types.ts +179 -0
- package/src/useVirtualTree/useVirtualTree.ts +342 -0
- package/src/utils/useFocusTrap.ts +2 -0
- package/src/utils/useTextControl.ts +191 -0
|
@@ -0,0 +1,688 @@
|
|
|
1
|
+
import { computed, onScopeDispose, ref, toValue, useId, watch } from 'vue';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
addMonths,
|
|
5
|
+
formatDate,
|
|
6
|
+
getCalendarGrid,
|
|
7
|
+
getDecadeLabel,
|
|
8
|
+
getMonthGrid,
|
|
9
|
+
getWeekdayLabels,
|
|
10
|
+
getYearGrid,
|
|
11
|
+
isSameDay,
|
|
12
|
+
isSameMonth,
|
|
13
|
+
parseDate,
|
|
14
|
+
resolveDateMove,
|
|
15
|
+
resolveDatePickerKeyIntent,
|
|
16
|
+
startOfDay,
|
|
17
|
+
} from '@agile-plus/primitives/date';
|
|
18
|
+
|
|
19
|
+
import { useControllable } from '../utils/useControllable';
|
|
20
|
+
import { useFormResetListener } from '../utils/useFormResetListener';
|
|
21
|
+
import { isBrowser } from '../utils/env';
|
|
22
|
+
import { useFloating } from '../useFloating';
|
|
23
|
+
|
|
24
|
+
import type { CSSProperties } from 'vue';
|
|
25
|
+
|
|
26
|
+
import type { DateCell, DateCellState, DateMove, DatePanel } from '@agile-plus/primitives/date';
|
|
27
|
+
|
|
28
|
+
import type {
|
|
29
|
+
DatePickerTimePart,
|
|
30
|
+
DatePickerTimeParts,
|
|
31
|
+
DatePickerViewUnit,
|
|
32
|
+
UseDatePickerOptions,
|
|
33
|
+
UseDatePickerReturn,
|
|
34
|
+
} from './types';
|
|
35
|
+
|
|
36
|
+
/** 面板与输入框之间的缺省间距,与 Select 的视觉留白一致。 */
|
|
37
|
+
const DEFAULT_OFFSET = 4;
|
|
38
|
+
|
|
39
|
+
/** 面板与视口边缘的缺省留白。 */
|
|
40
|
+
const DEFAULT_PADDING = 8;
|
|
41
|
+
|
|
42
|
+
const DEFAULT_VALUE_FORMAT = 'YYYY-MM-DD';
|
|
43
|
+
|
|
44
|
+
const DEFAULT_DATETIME_FORMAT = 'YYYY-MM-DD HH:mm:ss';
|
|
45
|
+
|
|
46
|
+
const HOURS_PER_DAY = 24;
|
|
47
|
+
|
|
48
|
+
const MINUTES_PER_HOUR = 60;
|
|
49
|
+
|
|
50
|
+
const SECONDS_PER_MINUTE = 60;
|
|
51
|
+
|
|
52
|
+
const DEFAULT_FIRST_DAY_OF_WEEK = 1;
|
|
53
|
+
|
|
54
|
+
const DAYS_PER_WEEK = 7;
|
|
55
|
+
|
|
56
|
+
/**
|
|
57
|
+
* DatePicker 的 Vue 适配。
|
|
58
|
+
*
|
|
59
|
+
* 五块职责:**选中值与开合**(两个独立的受控状态)、**面板与焦点日期**(三个
|
|
60
|
+
* 面板共享一个展示月)、**输入草稿**(手动编辑与回显分离)、**键盘导航**(规则
|
|
61
|
+
* 全部下沉 primitives)、**定位与表单接入**。
|
|
62
|
+
*
|
|
63
|
+
* 焦点模型与 Select 相同:焦点**始终留在输入框**上,面板通过 aria-activedescendant
|
|
64
|
+
* 指向焦点格,而不是把焦点移进浮层。因此不需要焦点陷阱,Tab 天然能走出组件;
|
|
65
|
+
* 代价是格子不可聚焦,指针按下必须 preventDefault,否则点击格子会把焦点从输入框
|
|
66
|
+
* 抢走并触发 blur 提交。
|
|
67
|
+
*
|
|
68
|
+
* 输入草稿只在编辑期间存在:blur / Enter / 外部点击时提交,合法则写值、非法则
|
|
69
|
+
* 回退到选中值的格式化文本;Escape 关闭时丢弃草稿。提交与回退都不经过额外的
|
|
70
|
+
* watch,displayText 直接从「草稿 ?? 选中值」派生。
|
|
71
|
+
*/
|
|
72
|
+
export function useDatePicker(options: UseDatePickerOptions = {}): UseDatePickerReturn {
|
|
73
|
+
const uid = useId();
|
|
74
|
+
const triggerId = `date-picker-trigger-${uid}`;
|
|
75
|
+
const contentId = `date-picker-content-${uid}`;
|
|
76
|
+
|
|
77
|
+
const showTime = computed(() => toValue(options.showTime) === true);
|
|
78
|
+
|
|
79
|
+
// 格式缺省是唯一真源:showTime 打开时日期与时间一起存储 / 显示,消费者显式
|
|
80
|
+
// 给了格式则以消费者为准(比如只要 HH:mm 的精度)。格式与 showTime 都要响应式
|
|
81
|
+
// 读取:演练场 / 受控用法会在运行中切换它们。
|
|
82
|
+
const valueFormat = computed(
|
|
83
|
+
() =>
|
|
84
|
+
toValue(options.valueFormat) ??
|
|
85
|
+
(showTime.value ? DEFAULT_DATETIME_FORMAT : DEFAULT_VALUE_FORMAT)
|
|
86
|
+
);
|
|
87
|
+
|
|
88
|
+
const format = computed(
|
|
89
|
+
() =>
|
|
90
|
+
toValue(options.format) ?? (showTime.value ? DEFAULT_DATETIME_FORMAT : DEFAULT_VALUE_FORMAT)
|
|
91
|
+
);
|
|
92
|
+
|
|
93
|
+
const valueState = useControllable<string | null>({
|
|
94
|
+
value: () => toValue(options.modelValue),
|
|
95
|
+
defaultValue: options.defaultValue ?? null,
|
|
96
|
+
onChange: (next) => options.onValueChange?.(next),
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
const openState = useControllable<boolean>({
|
|
100
|
+
value: () => toValue(options.open),
|
|
101
|
+
defaultValue: options.defaultOpen ?? false,
|
|
102
|
+
onChange: (next) => options.onOpenChange?.(next),
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
const value = valueState.value;
|
|
106
|
+
const isOpen = openState.value;
|
|
107
|
+
|
|
108
|
+
const isDisabled = computed(() => toValue(options.disabled) === true);
|
|
109
|
+
|
|
110
|
+
const firstDayOfWeek = computed(() => {
|
|
111
|
+
const raw = toValue(options.firstDayOfWeek) ?? DEFAULT_FIRST_DAY_OF_WEEK;
|
|
112
|
+
|
|
113
|
+
return ((raw % DAYS_PER_WEEK) + DAYS_PER_WEEK) % DAYS_PER_WEEK;
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
const selectedDate = computed<Date | null>(() => {
|
|
117
|
+
const current = value.value;
|
|
118
|
+
|
|
119
|
+
if (current === null || current === '') return null;
|
|
120
|
+
|
|
121
|
+
return parseDate(current, valueFormat.value);
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
const panel = ref<DatePanel>('date');
|
|
125
|
+
const panelDate = ref(startOfMonth(selectedDate.value ?? new Date()));
|
|
126
|
+
const focusedDate = ref(startOfDay(selectedDate.value ?? new Date()));
|
|
127
|
+
|
|
128
|
+
const draft = ref<string | null>(null);
|
|
129
|
+
|
|
130
|
+
// close() 交还焦点会再触发一次 focus;不拦掉它,Escape 关闭会立刻重新打开。
|
|
131
|
+
let skipFocusOpen = false;
|
|
132
|
+
|
|
133
|
+
const floating = useFloating({
|
|
134
|
+
placement: options.placement ?? 'bottom-start',
|
|
135
|
+
offset: options.offset ?? DEFAULT_OFFSET,
|
|
136
|
+
flip: options.flip,
|
|
137
|
+
shift: options.shift,
|
|
138
|
+
padding: options.padding ?? DEFAULT_PADDING,
|
|
139
|
+
strategy: options.strategy,
|
|
140
|
+
open: isOpen,
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
const displayText = computed(() => {
|
|
144
|
+
if (draft.value !== null) return draft.value;
|
|
145
|
+
|
|
146
|
+
return selectedDate.value ? formatDate(selectedDate.value, format.value) : '';
|
|
147
|
+
});
|
|
148
|
+
|
|
149
|
+
const dateCells = computed<DateCell[]>(() =>
|
|
150
|
+
getCalendarGrid({
|
|
151
|
+
year: panelDate.value.getFullYear(),
|
|
152
|
+
month: panelDate.value.getMonth(),
|
|
153
|
+
firstDayOfWeek: firstDayOfWeek.value,
|
|
154
|
+
})
|
|
155
|
+
);
|
|
156
|
+
|
|
157
|
+
const monthCells = computed<DateCell[]>(() => getMonthGrid(panelDate.value.getFullYear()));
|
|
158
|
+
|
|
159
|
+
const yearCells = computed<DateCell[]>(() => getYearGrid(panelDate.value.getFullYear()));
|
|
160
|
+
|
|
161
|
+
const weekdayLabels = computed(() => getWeekdayLabels(firstDayOfWeek.value));
|
|
162
|
+
|
|
163
|
+
const headerLabel = computed(() => formatDate(panelDate.value, 'YYYY年 M月'));
|
|
164
|
+
|
|
165
|
+
const decadeLabel = computed(() => getDecadeLabel(panelDate.value.getFullYear()));
|
|
166
|
+
|
|
167
|
+
function isDateDisabled(date: Date): boolean {
|
|
168
|
+
if (isDisabled.value) return true;
|
|
169
|
+
|
|
170
|
+
return options.disabledDate ? options.disabledDate(startOfDay(date)) : false;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
const isTodayDisabled = computed(() => isDateDisabled(new Date()));
|
|
174
|
+
|
|
175
|
+
function getCellState(date: Date): DateCellState {
|
|
176
|
+
const selected = selectedDate.value;
|
|
177
|
+
|
|
178
|
+
return {
|
|
179
|
+
selected: selected !== null && isSameDay(selected, date),
|
|
180
|
+
disabled: isDateDisabled(date),
|
|
181
|
+
today: isSameDay(new Date(), date),
|
|
182
|
+
inMonth: isSameMonth(panelDate.value, date),
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
function startOfMonth(date: Date): Date {
|
|
187
|
+
return new Date(date.getFullYear(), date.getMonth(), 1);
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** 焦点与展示月一起移动:键盘导航走到哪个月,面板就翻到哪个月。 */
|
|
191
|
+
function syncView(date: Date): void {
|
|
192
|
+
focusedDate.value = startOfDay(date);
|
|
193
|
+
panelDate.value = startOfMonth(date);
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
function getCellId(date: Date, kind: DatePanel): string {
|
|
197
|
+
// 月份 / 年代格子的日期是「月首 / 年首」,焦点日期必须先归一到同一格,
|
|
198
|
+
// 否则 aria-activedescendant 指向一个不存在的 id。
|
|
199
|
+
const normalized =
|
|
200
|
+
kind === 'month'
|
|
201
|
+
? startOfMonth(date)
|
|
202
|
+
: kind === 'year'
|
|
203
|
+
? new Date(date.getFullYear(), 0, 1)
|
|
204
|
+
: date;
|
|
205
|
+
|
|
206
|
+
return `date-picker-cell-${uid}-${kind}-${formatDate(normalized, DEFAULT_VALUE_FORMAT)}`;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
function open(): void {
|
|
210
|
+
if (isDisabled.value) return;
|
|
211
|
+
|
|
212
|
+
panel.value = 'date';
|
|
213
|
+
syncView(selectedDate.value ?? new Date());
|
|
214
|
+
openState.set(true);
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function close(): void {
|
|
218
|
+
const content = floating.floatingRef.value;
|
|
219
|
+
const active = isBrowser ? document.activeElement : null;
|
|
220
|
+
|
|
221
|
+
// 清理必须同步做:同一 tick 内 open→close 时 watch 的新旧值相同会被跳过,
|
|
222
|
+
// 只靠 watch 清理会让草稿与子面板状态泄漏到下一次打开。
|
|
223
|
+
draft.value = null;
|
|
224
|
+
panel.value = 'date';
|
|
225
|
+
openState.set(false);
|
|
226
|
+
|
|
227
|
+
// 焦点曾在面板内才交还输入框;外部点击关闭时不抢焦点。
|
|
228
|
+
if (content && active instanceof Node && content.contains(active)) {
|
|
229
|
+
skipFocusOpen = true;
|
|
230
|
+
floating.referenceRef.value?.focus();
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
function selectDate(date: Date): void {
|
|
235
|
+
if (isDateDisabled(date)) return;
|
|
236
|
+
|
|
237
|
+
// showTime 时日期与时间分两步选:换日期保留已选时间,面板不关,等「确定」。
|
|
238
|
+
const next = showTime.value ? withSelectedTime(date) : startOfDay(date);
|
|
239
|
+
|
|
240
|
+
valueState.set(formatDate(next, valueFormat.value));
|
|
241
|
+
|
|
242
|
+
if (!showTime.value) close();
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** 日期部分取入参、时间部分取当前选中值;未选过时间则落零点。 */
|
|
246
|
+
function withSelectedTime(date: Date): Date {
|
|
247
|
+
const next = startOfDay(date);
|
|
248
|
+
const current = selectedDate.value;
|
|
249
|
+
|
|
250
|
+
if (current) {
|
|
251
|
+
next.setHours(current.getHours(), current.getMinutes(), current.getSeconds());
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
return next;
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
const timeParts = computed<DatePickerTimeParts>(() => {
|
|
258
|
+
const current = selectedDate.value;
|
|
259
|
+
|
|
260
|
+
return {
|
|
261
|
+
hour: current?.getHours() ?? 0,
|
|
262
|
+
minute: current?.getMinutes() ?? 0,
|
|
263
|
+
second: current?.getSeconds() ?? 0,
|
|
264
|
+
};
|
|
265
|
+
});
|
|
266
|
+
|
|
267
|
+
function setTimePart(part: DatePickerTimePart, amount: number): void {
|
|
268
|
+
if (isDisabled.value) return;
|
|
269
|
+
|
|
270
|
+
const limit =
|
|
271
|
+
part === 'hour' ? HOURS_PER_DAY : part === 'minute' ? MINUTES_PER_HOUR : SECONDS_PER_MINUTE;
|
|
272
|
+
|
|
273
|
+
if (!Number.isInteger(amount) || amount < 0 || amount >= limit) return;
|
|
274
|
+
|
|
275
|
+
// 先选时间后选日期也成立:日期部分缺省落今天,与「此刻」的日期语义一致。
|
|
276
|
+
const next = new Date(selectedDate.value ?? startOfDay(new Date()));
|
|
277
|
+
|
|
278
|
+
if (part === 'hour') next.setHours(amount);
|
|
279
|
+
else if (part === 'minute') next.setMinutes(amount);
|
|
280
|
+
else next.setSeconds(amount);
|
|
281
|
+
|
|
282
|
+
valueState.set(formatDate(next, valueFormat.value));
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
function confirm(): void {
|
|
286
|
+
commitInput();
|
|
287
|
+
close();
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
function goNow(): void {
|
|
291
|
+
if (isDisabled.value) return;
|
|
292
|
+
|
|
293
|
+
valueState.set(formatDate(new Date(), valueFormat.value));
|
|
294
|
+
close();
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
function getTimeListProps(part: DatePickerTimePart): Record<string, unknown> {
|
|
298
|
+
const label = part === 'hour' ? '选择小时' : part === 'minute' ? '选择分钟' : '选择秒';
|
|
299
|
+
|
|
300
|
+
return { role: 'listbox', 'aria-label': label, 'data-part': `time-${part}` };
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
function getTimeOptionProps(part: DatePickerTimePart, amount: number): Record<string, unknown> {
|
|
304
|
+
const isSelected = timeParts.value[part] === amount;
|
|
305
|
+
|
|
306
|
+
return {
|
|
307
|
+
role: 'option',
|
|
308
|
+
'aria-selected': isSelected,
|
|
309
|
+
'data-selected': isSelected ? '' : undefined,
|
|
310
|
+
'data-value': amount,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
function clear(): void {
|
|
315
|
+
draft.value = null;
|
|
316
|
+
valueState.set(null);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
function goToday(): void {
|
|
320
|
+
selectDate(new Date());
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
function setPanel(next: DatePanel): void {
|
|
324
|
+
panel.value = next;
|
|
325
|
+
|
|
326
|
+
// 进入子面板时焦点落到当前展示月:头部按钮切换的是「看哪个月 / 年」,
|
|
327
|
+
// 焦点跟着视图走,读屏播报的才是眼前这一格。
|
|
328
|
+
if (next !== 'date') focusedDate.value = panelDate.value;
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
function shiftView(unit: DatePickerViewUnit, delta: -1 | 1): void {
|
|
332
|
+
const months = unit === 'month' ? 1 : unit === 'year' ? 12 : 120;
|
|
333
|
+
|
|
334
|
+
panelDate.value = addMonths(panelDate.value, delta * months);
|
|
335
|
+
focusedDate.value = addMonths(focusedDate.value, delta * months);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
function moveFocus(move: DateMove): void {
|
|
339
|
+
syncView(resolveDateMove(focusedDate.value, move));
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
/** 月份面板确认:展示月切到焦点月,回到日期面板。 */
|
|
343
|
+
function commitMonth(date: Date): void {
|
|
344
|
+
syncView(date);
|
|
345
|
+
panel.value = 'date';
|
|
346
|
+
}
|
|
347
|
+
|
|
348
|
+
/** 年代面板确认:保留当前月,只换年,下钻到月份面板。 */
|
|
349
|
+
function commitYear(date: Date): void {
|
|
350
|
+
const current = focusedDate.value;
|
|
351
|
+
const next = addMonths(new Date(date.getFullYear(), 0, current.getDate()), current.getMonth());
|
|
352
|
+
|
|
353
|
+
syncView(next);
|
|
354
|
+
panel.value = 'month';
|
|
355
|
+
}
|
|
356
|
+
|
|
357
|
+
function commitFocused(): void {
|
|
358
|
+
if (panel.value === 'date') {
|
|
359
|
+
selectDate(focusedDate.value);
|
|
360
|
+
|
|
361
|
+
// showTime 时 selectDate 不关面板,Enter 的语义是「确认整个值」,补一次关闭。
|
|
362
|
+
if (showTime.value) close();
|
|
363
|
+
} else if (panel.value === 'month') commitMonth(focusedDate.value);
|
|
364
|
+
else commitYear(focusedDate.value);
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
/**
|
|
368
|
+
* 提交输入草稿:空文本清空值,合法日期写值,非法文本静默回退。
|
|
369
|
+
*
|
|
370
|
+
* 回退不需要额外动作——草稿置 null 后 displayText 自动落回选中值的格式化文本。
|
|
371
|
+
*/
|
|
372
|
+
function commitInput(): void {
|
|
373
|
+
if (draft.value === null) return;
|
|
374
|
+
|
|
375
|
+
const text = draft.value.trim();
|
|
376
|
+
|
|
377
|
+
draft.value = null;
|
|
378
|
+
|
|
379
|
+
if (text === '') {
|
|
380
|
+
valueState.set(null);
|
|
381
|
+
|
|
382
|
+
return;
|
|
383
|
+
}
|
|
384
|
+
|
|
385
|
+
const parsed = parseDate(text, format.value);
|
|
386
|
+
|
|
387
|
+
if (!parsed || isDateDisabled(parsed)) return;
|
|
388
|
+
|
|
389
|
+
valueState.set(formatDate(parsed, valueFormat.value));
|
|
390
|
+
|
|
391
|
+
if (isOpen.value) syncView(parsed);
|
|
392
|
+
}
|
|
393
|
+
|
|
394
|
+
function onInputInput(event: Event): void {
|
|
395
|
+
if (isDisabled.value) return;
|
|
396
|
+
|
|
397
|
+
const target = event.target;
|
|
398
|
+
|
|
399
|
+
if (target instanceof HTMLInputElement) draft.value = target.value;
|
|
400
|
+
}
|
|
401
|
+
|
|
402
|
+
function onInputBlur(): void {
|
|
403
|
+
commitInput();
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
function onInputFocus(): void {
|
|
407
|
+
if (skipFocusOpen) {
|
|
408
|
+
skipFocusOpen = false;
|
|
409
|
+
|
|
410
|
+
return;
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
if (!isDisabled.value && !isOpen.value) open();
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
function onInputClick(): void {
|
|
417
|
+
if (!isDisabled.value && !isOpen.value) open();
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
function onInputKeydown(event: KeyboardEvent): void {
|
|
421
|
+
if (isDisabled.value) return;
|
|
422
|
+
|
|
423
|
+
// 关闭态的 Enter 只在有草稿时接管(提交文本),否则交还浏览器做表单提交。
|
|
424
|
+
if (!isOpen.value && event.key === 'Enter' && draft.value !== null) {
|
|
425
|
+
event.preventDefault();
|
|
426
|
+
commitInput();
|
|
427
|
+
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
const intent = resolveDatePickerKeyIntent({
|
|
432
|
+
key: event.key,
|
|
433
|
+
open: isOpen.value,
|
|
434
|
+
panel: panel.value,
|
|
435
|
+
focusedDate: focusedDate.value,
|
|
436
|
+
firstDayOfWeek: firstDayOfWeek.value,
|
|
437
|
+
hasModifierKey: event.ctrlKey || event.altKey || event.metaKey,
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
if (intent.kind === 'none') return;
|
|
441
|
+
|
|
442
|
+
if (intent.kind === 'tab-out') {
|
|
443
|
+
close();
|
|
444
|
+
|
|
445
|
+
return;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
event.preventDefault();
|
|
449
|
+
|
|
450
|
+
if (intent.kind === 'open') open();
|
|
451
|
+
else if (intent.kind === 'close') close();
|
|
452
|
+
else if (intent.kind === 'move') moveFocus(intent.move);
|
|
453
|
+
else if (intent.kind === 'commit') {
|
|
454
|
+
if (draft.value !== null) {
|
|
455
|
+
commitInput();
|
|
456
|
+
close();
|
|
457
|
+
} else {
|
|
458
|
+
commitFocused();
|
|
459
|
+
}
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
function onCellPointerDown(event: PointerEvent): void {
|
|
464
|
+
// 焦点必须留在输入框:格子一旦抢走焦点,blur 会先提交草稿,combobox 模型即被破坏。
|
|
465
|
+
event.preventDefault();
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
function onCellClick(date: Date, kind: DatePanel): void {
|
|
469
|
+
if (isDisabled.value) return;
|
|
470
|
+
|
|
471
|
+
if (kind === 'date') selectDate(date);
|
|
472
|
+
else if (kind === 'month') commitMonth(date);
|
|
473
|
+
else commitYear(date);
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
function getTriggerProps(): Record<string, unknown> {
|
|
477
|
+
const labelledby = toValue(options.ariaLabelledby);
|
|
478
|
+
const describedby = toValue(options.ariaDescribedby);
|
|
479
|
+
|
|
480
|
+
return {
|
|
481
|
+
id: triggerId,
|
|
482
|
+
role: 'combobox',
|
|
483
|
+
'aria-haspopup': 'dialog',
|
|
484
|
+
'aria-expanded': isOpen.value,
|
|
485
|
+
'aria-controls': contentId,
|
|
486
|
+
// 面板被 portal 到 body,不是输入框的 DOM 后代;打开时显式声明所有权,
|
|
487
|
+
// 否则读屏拒绝播报 aria-activedescendant 指向的格子。与 Select 同一条约束。
|
|
488
|
+
'aria-owns': isOpen.value ? contentId : undefined,
|
|
489
|
+
'aria-activedescendant': isOpen.value ? getCellId(focusedDate.value, panel.value) : undefined,
|
|
490
|
+
'aria-autocomplete': 'none',
|
|
491
|
+
'aria-disabled': isDisabled.value || undefined,
|
|
492
|
+
'aria-labelledby': labelledby || undefined,
|
|
493
|
+
'aria-describedby': describedby || undefined,
|
|
494
|
+
'data-state': isOpen.value ? 'open' : 'closed',
|
|
495
|
+
'data-disabled': isDisabled.value ? '' : undefined,
|
|
496
|
+
disabled: isDisabled.value || undefined,
|
|
497
|
+
autocomplete: 'off',
|
|
498
|
+
name: toValue(options.name),
|
|
499
|
+
form: toValue(options.form),
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
|
|
503
|
+
function getContentProps(): Record<string, unknown> {
|
|
504
|
+
return {
|
|
505
|
+
id: contentId,
|
|
506
|
+
role: 'dialog',
|
|
507
|
+
'aria-labelledby': toValue(options.ariaLabelledby) || triggerId,
|
|
508
|
+
tabindex: -1,
|
|
509
|
+
'data-state': isOpen.value ? 'open' : 'closed',
|
|
510
|
+
'data-panel': panel.value,
|
|
511
|
+
};
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
function getGridProps(kind: DatePanel): Record<string, unknown> {
|
|
515
|
+
const label =
|
|
516
|
+
kind === 'date'
|
|
517
|
+
? headerLabel.value
|
|
518
|
+
: kind === 'month'
|
|
519
|
+
? '选择月份'
|
|
520
|
+
: `${decadeLabel.value} 选择年份`;
|
|
521
|
+
|
|
522
|
+
return { role: 'grid', 'aria-label': label };
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function getCellProps(date: Date, kind: DatePanel): Record<string, unknown> {
|
|
526
|
+
const selected = selectedDate.value;
|
|
527
|
+
const focused = focusedDate.value;
|
|
528
|
+
|
|
529
|
+
const isSelected =
|
|
530
|
+
kind === 'date'
|
|
531
|
+
? selected !== null && isSameDay(selected, date)
|
|
532
|
+
: kind === 'month'
|
|
533
|
+
? selected !== null && isSameMonth(selected, date)
|
|
534
|
+
: selected !== null && selected.getFullYear() === date.getFullYear();
|
|
535
|
+
|
|
536
|
+
const isFocused =
|
|
537
|
+
kind === 'date'
|
|
538
|
+
? isSameDay(focused, date)
|
|
539
|
+
: kind === 'month'
|
|
540
|
+
? isSameMonth(focused, date)
|
|
541
|
+
: focused.getFullYear() === date.getFullYear();
|
|
542
|
+
|
|
543
|
+
const state = kind === 'date' ? getCellState(date) : null;
|
|
544
|
+
const isDisabledCell = state ? state.disabled : false;
|
|
545
|
+
|
|
546
|
+
let isOutside = false;
|
|
547
|
+
|
|
548
|
+
if (state) {
|
|
549
|
+
isOutside = !state.inMonth;
|
|
550
|
+
} else if (kind === 'year') {
|
|
551
|
+
// 年代网格的首尾补齐格属于相邻年代,边界按「当前展示年代」而不是格子自身年代算。
|
|
552
|
+
const decadeStart = Math.floor(panelDate.value.getFullYear() / 10) * 10;
|
|
553
|
+
|
|
554
|
+
isOutside = date.getFullYear() < decadeStart || date.getFullYear() >= decadeStart + 10;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
return {
|
|
558
|
+
id: getCellId(date, kind),
|
|
559
|
+
role: 'gridcell',
|
|
560
|
+
'aria-selected': isSelected,
|
|
561
|
+
'aria-disabled': isDisabledCell || undefined,
|
|
562
|
+
// 日期格子只渲染「几号」,读屏需要完整日期才有意义;月 / 年格子的文本自足。
|
|
563
|
+
'aria-label': kind === 'date' ? formatDate(date, 'YYYY年M月D日') : undefined,
|
|
564
|
+
'data-focused': isFocused ? '' : undefined,
|
|
565
|
+
'data-selected': isSelected ? '' : undefined,
|
|
566
|
+
'data-disabled': isDisabledCell ? '' : undefined,
|
|
567
|
+
'data-today': state?.today ? '' : undefined,
|
|
568
|
+
'data-outside': isOutside ? '' : undefined,
|
|
569
|
+
'data-value': formatDate(date, DEFAULT_VALUE_FORMAT),
|
|
570
|
+
};
|
|
571
|
+
}
|
|
572
|
+
|
|
573
|
+
function setTriggerElement(node: unknown): void {
|
|
574
|
+
floating.referenceRef.value = node instanceof HTMLElement ? node : null;
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
function setContentElement(node: unknown): void {
|
|
578
|
+
floating.floatingRef.value = node instanceof HTMLElement ? node : null;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function handleDocumentPointerDown(event: PointerEvent): void {
|
|
582
|
+
const target = event.target;
|
|
583
|
+
|
|
584
|
+
if (!(target instanceof Node)) return;
|
|
585
|
+
|
|
586
|
+
const trigger = floating.referenceRef.value;
|
|
587
|
+
const content = floating.floatingRef.value;
|
|
588
|
+
|
|
589
|
+
if (trigger?.contains(target) || content?.contains(target)) return;
|
|
590
|
+
|
|
591
|
+
// 外部点击与 blur 一样是「结束编辑」:先提交草稿再关闭,手动输入不因点别处而丢。
|
|
592
|
+
commitInput();
|
|
593
|
+
close();
|
|
594
|
+
}
|
|
595
|
+
|
|
596
|
+
watch(
|
|
597
|
+
isOpen,
|
|
598
|
+
(open) => {
|
|
599
|
+
if (!isBrowser) return;
|
|
600
|
+
|
|
601
|
+
document.removeEventListener('pointerdown', handleDocumentPointerDown, true);
|
|
602
|
+
|
|
603
|
+
if (open) {
|
|
604
|
+
document.addEventListener('pointerdown', handleDocumentPointerDown, true);
|
|
605
|
+
} else {
|
|
606
|
+
// 受控模式下外部直接翻 open 也要清理编辑态,与 close() 的语义保持一致。
|
|
607
|
+
draft.value = null;
|
|
608
|
+
panel.value = 'date';
|
|
609
|
+
}
|
|
610
|
+
},
|
|
611
|
+
{ immediate: true }
|
|
612
|
+
);
|
|
613
|
+
|
|
614
|
+
// 与 Select 同一条规则:reset 还原到「挂载时的值」,且必须走 set 通知外部——
|
|
615
|
+
// 受控模式下 replace 不写内部状态,v-model 的值会永远停在用户改过的地方。
|
|
616
|
+
const initialValue = value.value;
|
|
617
|
+
|
|
618
|
+
useFormResetListener(
|
|
619
|
+
floating.referenceRef,
|
|
620
|
+
() => {
|
|
621
|
+
valueState.set(initialValue);
|
|
622
|
+
draft.value = null;
|
|
623
|
+
panel.value = 'date';
|
|
624
|
+
syncView(
|
|
625
|
+
initialValue ? (parseDate(initialValue, valueFormat.value) ?? new Date()) : new Date()
|
|
626
|
+
);
|
|
627
|
+
},
|
|
628
|
+
options.form
|
|
629
|
+
);
|
|
630
|
+
|
|
631
|
+
const contentStyle = computed<CSSProperties>(() => ({ ...floating.floatingStyle.value }));
|
|
632
|
+
|
|
633
|
+
onScopeDispose(() => {
|
|
634
|
+
if (isBrowser) document.removeEventListener('pointerdown', handleDocumentPointerDown, true);
|
|
635
|
+
});
|
|
636
|
+
|
|
637
|
+
return {
|
|
638
|
+
value,
|
|
639
|
+
setValue: valueState.set,
|
|
640
|
+
selectedDate,
|
|
641
|
+
isOpen,
|
|
642
|
+
open,
|
|
643
|
+
close,
|
|
644
|
+
panel: computed(() => panel.value),
|
|
645
|
+
setPanel,
|
|
646
|
+
panelDate: computed(() => panelDate.value),
|
|
647
|
+
focusedDate: computed(() => focusedDate.value),
|
|
648
|
+
dateCells,
|
|
649
|
+
monthCells,
|
|
650
|
+
yearCells,
|
|
651
|
+
weekdayLabels,
|
|
652
|
+
headerLabel,
|
|
653
|
+
decadeLabel,
|
|
654
|
+
displayText,
|
|
655
|
+
isTodayDisabled,
|
|
656
|
+
isDateDisabled,
|
|
657
|
+
getCellState,
|
|
658
|
+
selectDate,
|
|
659
|
+
clear,
|
|
660
|
+
goToday,
|
|
661
|
+
showTime,
|
|
662
|
+
timeParts,
|
|
663
|
+
setTimePart,
|
|
664
|
+
confirm,
|
|
665
|
+
goNow,
|
|
666
|
+
getTimeListProps,
|
|
667
|
+
getTimeOptionProps,
|
|
668
|
+
moveFocus,
|
|
669
|
+
commitFocused,
|
|
670
|
+
shiftView,
|
|
671
|
+
onInputInput,
|
|
672
|
+
onInputKeydown,
|
|
673
|
+
onInputBlur,
|
|
674
|
+
onInputFocus,
|
|
675
|
+
onInputClick,
|
|
676
|
+
onCellPointerDown,
|
|
677
|
+
onCellClick,
|
|
678
|
+
getTriggerProps,
|
|
679
|
+
getContentProps,
|
|
680
|
+
getGridProps,
|
|
681
|
+
getCellProps,
|
|
682
|
+
getCellId,
|
|
683
|
+
setTriggerElement,
|
|
684
|
+
setContentElement,
|
|
685
|
+
floating,
|
|
686
|
+
contentStyle,
|
|
687
|
+
};
|
|
688
|
+
}
|