@sprawlify/primitives 0.0.107 → 0.0.109
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/{date-utils-DCaRa_Ry.mjs → date-utils-BqOQP2-U.mjs} +19 -1
- package/dist/{date-utils-BuJkKL09.cjs → date-utils-Dz9DZPcZ.cjs} +24 -0
- package/dist/date-utils.cjs +2 -1
- package/dist/date-utils.d.cts +2 -1
- package/dist/date-utils.d.mts +2 -2
- package/dist/date-utils.mjs +2 -2
- package/dist/{index-ClVRyKIt.d.mts → index-6cEVkXqi.d.mts} +2 -1
- package/dist/{index-DHp3-EkH.d.mts → index-fMh0VDkR.d.mts} +1 -0
- package/dist/machines/accordion/index.d.cts +1 -1
- package/dist/machines/accordion/index.d.mts +1 -1
- package/dist/machines/angle-slider/index.d.cts +1 -1
- package/dist/machines/angle-slider/index.d.mts +1 -1
- package/dist/machines/bottom-sheet/index.d.cts +1 -1
- package/dist/machines/bottom-sheet/index.d.mts +1 -1
- package/dist/machines/carousel/index.d.cts +1 -1
- package/dist/machines/carousel/index.d.mts +1 -1
- package/dist/machines/cascade-select/index.cjs +1 -1
- package/dist/machines/cascade-select/index.d.cts +3 -3
- package/dist/machines/cascade-select/index.d.mts +3 -3
- package/dist/machines/cascade-select/index.mjs +1 -1
- package/dist/machines/checkbox/index.d.cts +1 -1
- package/dist/machines/checkbox/index.d.mts +1 -1
- package/dist/machines/clipboard/index.d.cts +1 -1
- package/dist/machines/clipboard/index.d.mts +1 -1
- package/dist/machines/collapsible/index.d.cts +1 -1
- package/dist/machines/collapsible/index.d.mts +1 -1
- package/dist/machines/color-picker/index.cjs +1 -1
- package/dist/machines/color-picker/index.d.cts +2 -2
- package/dist/machines/color-picker/index.d.mts +2 -2
- package/dist/machines/color-picker/index.mjs +1 -1
- package/dist/machines/combobox/index.cjs +1 -1
- package/dist/machines/combobox/index.d.cts +2 -2
- package/dist/machines/combobox/index.d.mts +2 -2
- package/dist/machines/combobox/index.mjs +1 -1
- package/dist/machines/date-picker/index.cjs +68 -8
- package/dist/machines/date-picker/index.d.cts +27 -4
- package/dist/machines/date-picker/index.d.mts +28 -5
- package/dist/machines/date-picker/index.mjs +68 -8
- package/dist/machines/dialog/index.cjs +1 -1
- package/dist/machines/dialog/index.d.cts +1 -1
- package/dist/machines/dialog/index.d.mts +1 -1
- package/dist/machines/dialog/index.mjs +1 -1
- package/dist/machines/dropdown-menu/index.cjs +1 -1
- package/dist/machines/dropdown-menu/index.d.cts +2 -2
- package/dist/machines/dropdown-menu/index.d.mts +2 -2
- package/dist/machines/dropdown-menu/index.mjs +1 -1
- package/dist/machines/editable/index.d.cts +1 -1
- package/dist/machines/editable/index.d.mts +1 -1
- package/dist/machines/file-upload/index.d.cts +1 -1
- package/dist/machines/file-upload/index.d.mts +1 -1
- package/dist/machines/floating-panel/index.d.cts +1 -1
- package/dist/machines/floating-panel/index.d.mts +1 -1
- package/dist/machines/hover-card/index.cjs +1 -1
- package/dist/machines/hover-card/index.d.cts +2 -2
- package/dist/machines/hover-card/index.d.mts +2 -2
- package/dist/machines/hover-card/index.mjs +1 -1
- package/dist/machines/listbox/index.d.cts +1 -1
- package/dist/machines/listbox/index.d.mts +1 -1
- package/dist/machines/marquee/index.d.cts +3 -3
- package/dist/machines/marquee/index.d.mts +3 -3
- package/dist/machines/navigation-menu/index.d.cts +1 -1
- package/dist/machines/navigation-menu/index.d.mts +1 -1
- package/dist/machines/number-input/index.d.cts +1 -1
- package/dist/machines/number-input/index.d.mts +1 -1
- package/dist/machines/password-input/index.d.cts +1 -1
- package/dist/machines/password-input/index.d.mts +1 -1
- package/dist/machines/popover/index.cjs +1 -1
- package/dist/machines/popover/index.d.cts +2 -2
- package/dist/machines/popover/index.d.mts +2 -2
- package/dist/machines/popover/index.mjs +1 -1
- package/dist/machines/progress/index.d.cts +1 -1
- package/dist/machines/progress/index.d.mts +1 -1
- package/dist/machines/radio-group/index.d.cts +1 -1
- package/dist/machines/radio-group/index.d.mts +1 -1
- package/dist/machines/rating-group/index.d.cts +1 -1
- package/dist/machines/rating-group/index.d.mts +1 -1
- package/dist/machines/select/index.cjs +1 -1
- package/dist/machines/select/index.d.cts +2 -2
- package/dist/machines/select/index.d.mts +2 -2
- package/dist/machines/select/index.mjs +1 -1
- package/dist/machines/signature-pad/index.d.cts +1 -1
- package/dist/machines/signature-pad/index.d.mts +1 -1
- package/dist/machines/slider/index.d.cts +1 -1
- package/dist/machines/slider/index.d.mts +1 -1
- package/dist/machines/steps/index.d.cts +1 -1
- package/dist/machines/steps/index.d.mts +1 -1
- package/dist/machines/tabs/index.d.cts +1 -1
- package/dist/machines/tabs/index.d.mts +1 -1
- package/dist/machines/tags-input/index.d.cts +1 -1
- package/dist/machines/tags-input/index.d.mts +1 -1
- package/dist/machines/timer/index.d.cts +1 -1
- package/dist/machines/timer/index.d.mts +1 -1
- package/dist/machines/toast/index.d.cts +1 -1
- package/dist/machines/toast/index.d.mts +1 -1
- package/dist/machines/tooltip/index.cjs +1 -1
- package/dist/machines/tooltip/index.d.cts +2 -2
- package/dist/machines/tooltip/index.d.mts +2 -2
- package/dist/machines/tooltip/index.mjs +1 -1
- package/dist/machines/tour/index.cjs +1 -1
- package/dist/machines/tour/index.d.cts +2 -2
- package/dist/machines/tour/index.d.mts +2 -2
- package/dist/machines/tour/index.mjs +1 -1
- package/dist/{popper-3Bdh0pfy.mjs → popper-BDy37WA0.mjs} +42 -11
- package/dist/{popper-Bca_O70s.cjs → popper-Cx3KHzeT.cjs} +42 -11
- package/dist/popper.cjs +1 -1
- package/dist/popper.d.cts +1 -1
- package/dist/popper.d.mts +1 -1
- package/dist/popper.mjs +1 -1
- package/dist/{types-DEn9MoSw.d.cts → types-CZAtqGqH.d.cts} +1 -0
- package/package.json +1 -1
|
@@ -4,11 +4,11 @@ const require_create_anatomy = require("../../create-anatomy-BnwEmNnc.cjs");
|
|
|
4
4
|
const require_dom_query = require("../../dom-query-Bd63cRVF.cjs");
|
|
5
5
|
const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
6
6
|
const require_core = require("../../core-nBg9RC_y.cjs");
|
|
7
|
-
const require_date_utils = require("../../date-utils-
|
|
7
|
+
const require_date_utils = require("../../date-utils-Dz9DZPcZ.cjs");
|
|
8
8
|
require("../../interact-outside-Cx4J0EBf.cjs");
|
|
9
9
|
const require_dismissable = require("../../dismissable-ChwcJMHk.cjs");
|
|
10
10
|
const require_live_region = require("../../live-region-TGReV9nm.cjs");
|
|
11
|
-
const require_popper = require("../../popper-
|
|
11
|
+
const require_popper = require("../../popper-Cx3KHzeT.cjs");
|
|
12
12
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
13
13
|
let _internationalized_date = require("@internationalized/date");
|
|
14
14
|
//#region src/machines/date-picker/date-picker.anatomy.ts
|
|
@@ -130,7 +130,11 @@ const defaultTranslations = {
|
|
|
130
130
|
content: "calendar",
|
|
131
131
|
monthSelect: "Select month",
|
|
132
132
|
yearSelect: "Select year",
|
|
133
|
-
clearTrigger: "Clear selected dates"
|
|
133
|
+
clearTrigger: "Clear selected dates",
|
|
134
|
+
weekColumnHeader: "Wk",
|
|
135
|
+
weekNumberCell(weekNumber) {
|
|
136
|
+
return `Week ${weekNumber}`;
|
|
137
|
+
}
|
|
134
138
|
};
|
|
135
139
|
function viewToNumber(view, fallback) {
|
|
136
140
|
if (!view) return fallback || 0;
|
|
@@ -228,7 +232,10 @@ function connect(service, normalize) {
|
|
|
228
232
|
const focused = state.matches("focused");
|
|
229
233
|
const open = state.matches("open");
|
|
230
234
|
const isRangePicker = prop("selectionMode") === "range";
|
|
235
|
+
const isMultiPicker = prop("selectionMode") === "multiple";
|
|
231
236
|
const isDateUnavailableFn = prop("isDateUnavailable");
|
|
237
|
+
const maxSelectedDates = prop("maxSelectedDates");
|
|
238
|
+
const isMaxSelected = isMultiPicker && maxSelectedDates != null && selectedValue.length >= maxSelectedDates;
|
|
232
239
|
const currentPlacement = context.get("currentPlacement");
|
|
233
240
|
const popperStyles = require_popper.getPlacementStyles({
|
|
234
241
|
...prop("positioning"),
|
|
@@ -328,10 +335,11 @@ function connect(service, normalize) {
|
|
|
328
335
|
const isInHoveredRange = hasHoveredRange && isDateWithinRange(value, hoveredRangeValue);
|
|
329
336
|
const isFirstInHoveredRange = hasHoveredRange && require_date_utils.isDateEqual(value, hoveredRangeValue[0]);
|
|
330
337
|
const isLastInHoveredRange = hasHoveredRange && require_date_utils.isDateEqual(value, hoveredRangeValue[1]);
|
|
338
|
+
const isSelected = selectedValue.some((date) => require_date_utils.isDateEqual(value, date));
|
|
331
339
|
const cellState = {
|
|
332
340
|
invalid: require_date_utils.isDateOutsideRange(value, min, max),
|
|
333
|
-
disabled: disabled || !outsideDaySelectable && isOutsideRange || require_date_utils.isDateOutsideRange(value, min, max),
|
|
334
|
-
selected:
|
|
341
|
+
disabled: disabled || !outsideDaySelectable && isOutsideRange || require_date_utils.isDateOutsideRange(value, min, max) || isMaxSelected && !isSelected,
|
|
342
|
+
selected: isSelected,
|
|
335
343
|
unavailable: require_date_utils.isDateUnavailable(value, isDateUnavailableFn, locale, min, max) && !disabled,
|
|
336
344
|
outsideRange: isOutsideRange,
|
|
337
345
|
today: (0, _internationalized_date.isToday)(value, timeZone),
|
|
@@ -367,11 +375,18 @@ function connect(service, normalize) {
|
|
|
367
375
|
readOnly,
|
|
368
376
|
inline: !!prop("inline"),
|
|
369
377
|
numOfMonths: prop("numOfMonths"),
|
|
378
|
+
showWeekNumbers: !!prop("showWeekNumbers"),
|
|
370
379
|
selectionMode: prop("selectionMode"),
|
|
380
|
+
maxSelectedDates,
|
|
381
|
+
isMaxSelected,
|
|
371
382
|
view: context.get("view"),
|
|
372
383
|
getRangePresetValue(preset) {
|
|
373
384
|
return require_date_utils.getDateRangePreset(preset, locale, timeZone);
|
|
374
385
|
},
|
|
386
|
+
getWeekNumber(week) {
|
|
387
|
+
const firstDay = week[0];
|
|
388
|
+
return firstDay ? require_date_utils.getWeekOfYear(firstDay, locale) : 0;
|
|
389
|
+
},
|
|
375
390
|
getDaysInWeek(week, from = startValue) {
|
|
376
391
|
return require_date_utils.getDaysInWeek(week, from, locale, startOfWeek);
|
|
377
392
|
},
|
|
@@ -409,7 +424,7 @@ function connect(service, normalize) {
|
|
|
409
424
|
selectToday() {
|
|
410
425
|
send({
|
|
411
426
|
type: "VALUE.SET",
|
|
412
|
-
value: require_date_utils.constrainValue(require_date_utils.getTodayDate(timeZone), min, max)
|
|
427
|
+
value: [require_date_utils.constrainValue(require_date_utils.getTodayDate(timeZone), min, max)]
|
|
413
428
|
});
|
|
414
429
|
},
|
|
415
430
|
setValue(values) {
|
|
@@ -418,8 +433,29 @@ function connect(service, normalize) {
|
|
|
418
433
|
value: values.map((date) => require_date_utils.constrainValue(date, min, max))
|
|
419
434
|
});
|
|
420
435
|
},
|
|
421
|
-
|
|
422
|
-
|
|
436
|
+
setTime(time, index = 0) {
|
|
437
|
+
const values = Array.from(selectedValue);
|
|
438
|
+
let dateValue = values[index];
|
|
439
|
+
if (!dateValue) return;
|
|
440
|
+
if (!("hour" in dateValue)) dateValue = (0, _internationalized_date.toCalendarDateTime)(dateValue);
|
|
441
|
+
dateValue = dateValue.set({
|
|
442
|
+
hour: time.hour ?? ("hour" in dateValue ? dateValue.hour : 0),
|
|
443
|
+
minute: time.minute ?? ("minute" in dateValue ? dateValue.minute : 0),
|
|
444
|
+
second: time.second ?? ("second" in dateValue ? dateValue.second : 0),
|
|
445
|
+
millisecond: time.millisecond ?? ("millisecond" in dateValue ? dateValue.millisecond : 0)
|
|
446
|
+
});
|
|
447
|
+
values[index] = require_date_utils.constrainValue(dateValue, min, max);
|
|
448
|
+
send({
|
|
449
|
+
type: "VALUE.SET",
|
|
450
|
+
value: values
|
|
451
|
+
});
|
|
452
|
+
},
|
|
453
|
+
clearValue(options = {}) {
|
|
454
|
+
const { focus = true } = options;
|
|
455
|
+
send({
|
|
456
|
+
type: "VALUE.CLEAR",
|
|
457
|
+
focus
|
|
458
|
+
});
|
|
423
459
|
},
|
|
424
460
|
setFocusedValue(value) {
|
|
425
461
|
send({
|
|
@@ -692,6 +728,28 @@ function connect(service, normalize) {
|
|
|
692
728
|
"data-view": view
|
|
693
729
|
});
|
|
694
730
|
},
|
|
731
|
+
getWeekNumberHeaderCellProps(props = {}) {
|
|
732
|
+
const { view = "day" } = props;
|
|
733
|
+
return normalize.element({
|
|
734
|
+
...parts.tableCell.attrs,
|
|
735
|
+
scope: "col",
|
|
736
|
+
"aria-label": translations.weekColumnHeader,
|
|
737
|
+
"data-view": view,
|
|
738
|
+
"data-disabled": require_dom_query.dataAttr(disabled)
|
|
739
|
+
});
|
|
740
|
+
},
|
|
741
|
+
getWeekNumberCellProps(props) {
|
|
742
|
+
const { weekIndex, week } = props;
|
|
743
|
+
const weekNumber = week[0] ? require_date_utils.getWeekOfYear(week[0], locale) : 0;
|
|
744
|
+
return normalize.element({
|
|
745
|
+
...parts.tableCell.attrs,
|
|
746
|
+
role: "rowheader",
|
|
747
|
+
"aria-label": translations.weekNumberCell?.(weekNumber),
|
|
748
|
+
"data-view": "day",
|
|
749
|
+
"data-week-index": weekIndex,
|
|
750
|
+
"data-disabled": require_dom_query.dataAttr(disabled)
|
|
751
|
+
});
|
|
752
|
+
},
|
|
695
753
|
getDayTableCellState,
|
|
696
754
|
getDayTableCellProps(props) {
|
|
697
755
|
const { value } = props;
|
|
@@ -2202,6 +2260,7 @@ const props = require_create_props.createProps()([
|
|
|
2202
2260
|
"isDateUnavailable",
|
|
2203
2261
|
"locale",
|
|
2204
2262
|
"max",
|
|
2263
|
+
"maxSelectedDates",
|
|
2205
2264
|
"min",
|
|
2206
2265
|
"name",
|
|
2207
2266
|
"numOfMonths",
|
|
@@ -2217,6 +2276,7 @@ const props = require_create_props.createProps()([
|
|
|
2217
2276
|
"readOnly",
|
|
2218
2277
|
"required",
|
|
2219
2278
|
"selectionMode",
|
|
2279
|
+
"showWeekNumbers",
|
|
2220
2280
|
"startOfWeek",
|
|
2221
2281
|
"timeZone",
|
|
2222
2282
|
"translations",
|
|
@@ -4,11 +4,11 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { a as DateRangePreset, o as DateValue } from "../../types-MFO-RQR7.cjs";
|
|
5
5
|
import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-DzWGFhcS.cjs";
|
|
6
6
|
import { t as LiveRegion } from "../../index-BO-Z3fhz.cjs";
|
|
7
|
-
import { c as Placement, d as PositioningOptions } from "../../types-
|
|
7
|
+
import { c as Placement, d as PositioningOptions } from "../../types-CZAtqGqH.cjs";
|
|
8
8
|
import { Calendar, CalendarDate, CalendarDateTime, DateDuration, DateFormatter, ZonedDateTime } from "@internationalized/date";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/date-picker/date-picker.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "trigger" | "label" | "input" | "control" | "positioner" | "table" | "view" | "clearTrigger" | "nextTrigger" | "prevTrigger" | "monthSelect" | "presetTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewControl" | "viewTrigger" | "yearSelect">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/date-picker/date-picker.types.d.ts
|
|
14
14
|
type DateView = "day" | "month" | "year";
|
|
@@ -35,6 +35,12 @@ interface OpenChangeDetails {
|
|
|
35
35
|
open: boolean;
|
|
36
36
|
value: DateValue[];
|
|
37
37
|
}
|
|
38
|
+
interface Time {
|
|
39
|
+
hour?: number;
|
|
40
|
+
minute?: number;
|
|
41
|
+
second?: number;
|
|
42
|
+
millisecond?: number;
|
|
43
|
+
}
|
|
38
44
|
interface LocaleDetails {
|
|
39
45
|
locale: string;
|
|
40
46
|
timeZone: string;
|
|
@@ -56,6 +62,8 @@ interface IntlTranslations {
|
|
|
56
62
|
month: string;
|
|
57
63
|
day: string;
|
|
58
64
|
};
|
|
65
|
+
weekColumnHeader?: string | undefined;
|
|
66
|
+
weekNumberCell?: ((weekNumber: number) => string) | undefined;
|
|
59
67
|
}
|
|
60
68
|
type ElementIds = Partial<{
|
|
61
69
|
root: string;
|
|
@@ -99,6 +107,7 @@ interface DatePickerProps extends DirectionProperty, CommonProperties {
|
|
|
99
107
|
numOfMonths?: number | undefined;
|
|
100
108
|
startOfWeek?: number | undefined;
|
|
101
109
|
fixedWeeks?: boolean | undefined;
|
|
110
|
+
showWeekNumbers?: boolean | undefined;
|
|
102
111
|
onValueChange?: ((details: ValueChangeDetails) => void) | undefined;
|
|
103
112
|
onFocusChange?: ((details: FocusChangeDetails) => void) | undefined;
|
|
104
113
|
onViewChange?: ((details: ViewChangeDetails) => void) | undefined;
|
|
@@ -106,6 +115,7 @@ interface DatePickerProps extends DirectionProperty, CommonProperties {
|
|
|
106
115
|
onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
|
|
107
116
|
isDateUnavailable?: ((date: DateValue, locale: string) => boolean) | undefined;
|
|
108
117
|
selectionMode?: SelectionMode | undefined;
|
|
118
|
+
maxSelectedDates?: number | undefined;
|
|
109
119
|
format?: ((date: DateValue, details: LocaleDetails) => string) | undefined;
|
|
110
120
|
parse?: ((value: string, details: LocaleDetails) => DateValue | undefined) | undefined;
|
|
111
121
|
placeholder?: string | undefined;
|
|
@@ -197,6 +207,10 @@ interface DayTableCellProps {
|
|
|
197
207
|
disabled?: boolean | undefined;
|
|
198
208
|
visibleRange?: VisibleRange | undefined;
|
|
199
209
|
}
|
|
210
|
+
interface WeekNumberCellProps {
|
|
211
|
+
weekIndex: number;
|
|
212
|
+
week: DateValue[];
|
|
213
|
+
}
|
|
200
214
|
interface DayTableCellState {
|
|
201
215
|
invalid: boolean;
|
|
202
216
|
disabled: boolean;
|
|
@@ -269,8 +283,12 @@ interface DatePickerApi<T extends PropTypes = PropTypes> {
|
|
|
269
283
|
readOnly: boolean;
|
|
270
284
|
inline: boolean;
|
|
271
285
|
numOfMonths: number;
|
|
286
|
+
showWeekNumbers: boolean;
|
|
272
287
|
selectionMode: SelectionMode;
|
|
288
|
+
maxSelectedDates: number | undefined;
|
|
289
|
+
isMaxSelected: boolean;
|
|
273
290
|
view: DateView;
|
|
291
|
+
getWeekNumber: (week: DateValue[]) => number;
|
|
274
292
|
getDaysInWeek: (week: number, from?: DateValue) => DateValue[];
|
|
275
293
|
getOffset: (duration: DateDuration) => DateValueOffset;
|
|
276
294
|
getRangePresetValue: (value: DateRangePreset) => DateValue[];
|
|
@@ -288,8 +306,11 @@ interface DatePickerApi<T extends PropTypes = PropTypes> {
|
|
|
288
306
|
focusedValueAsString: string;
|
|
289
307
|
selectToday: VoidFunction;
|
|
290
308
|
setValue: (values: DateValue[]) => void;
|
|
309
|
+
setTime: (time: Time, index?: number) => void;
|
|
291
310
|
setFocusedValue: (value: DateValue) => void;
|
|
292
|
-
clearValue:
|
|
311
|
+
clearValue: (options?: {
|
|
312
|
+
focus?: boolean;
|
|
313
|
+
}) => void;
|
|
293
314
|
setOpen: (open: boolean) => void;
|
|
294
315
|
focusMonth: (month: number) => void;
|
|
295
316
|
focusYear: (year: number) => void;
|
|
@@ -316,6 +337,8 @@ interface DatePickerApi<T extends PropTypes = PropTypes> {
|
|
|
316
337
|
getTableHeaderProps: (props?: TableProps) => T["element"];
|
|
317
338
|
getTableBodyProps: (props?: TableProps) => T["element"];
|
|
318
339
|
getTableRowProps: (props?: TableProps) => T["element"];
|
|
340
|
+
getWeekNumberHeaderCellProps: (props?: TableProps) => T["element"];
|
|
341
|
+
getWeekNumberCellProps: (props: WeekNumberCellProps) => T["element"];
|
|
319
342
|
getDayTableCellProps: (props: DayTableCellProps) => T["element"];
|
|
320
343
|
getDayTableCellTriggerProps: (props: DayTableCellProps) => T["element"];
|
|
321
344
|
getMonthTableCellProps: (props: TableCellProps) => T["element"];
|
|
@@ -359,4 +382,4 @@ declare const splitTableCellProps: <Props extends TableCellProps>(props: Props)
|
|
|
359
382
|
declare const viewProps: "view"[];
|
|
360
383
|
declare const splitViewProps: <Props extends ViewProps>(props: Props) => [ViewProps, Omit<Props, "view">];
|
|
361
384
|
//#endregion
|
|
362
|
-
export { type DatePickerApi as Api, type Calendar, type CalendarDate, type CalendarDateTime, type Cell, type DateDuration, type DateFormatter, type DateRangePreset, type DateValue, type DateValueOffset, type DateView, type DayTableCellProps, type DayTableCellState, type ElementIds, type FocusChangeDetails, type FocusOutsideEvent, type InputProps, type InteractOutsideEvent, type IntlTranslations, type LabelProps, type LocaleDetails, type DatePickerMachine as Machine, type MonthFormatOptions, type MonthGridProps, type MonthGridValue, type OpenChangeDetails, type PointerDownOutsideEvent, type PositioningOptions, type PresetTriggerProps, type PresetTriggerValue, type DatePickerProps as Props, type Range, type SelectionMode, type DatePickerService as Service, type TableCellProps, type TableCellState, type TableProps, type ValueChangeDetails, type ViewChangeDetails, type ViewProps, type VisibleRange, type VisibleRangeChangeDetails, type VisibleRangeText, type WeekDay, type YearGridProps, type YearGridValue, type ZonedDateTime, anatomy, connect, inputProps, machine, parse, presetTriggerProps, props, splitInputProps, splitPresetTriggerProps, splitProps, splitTableCellProps, splitTableProps, splitViewProps, tableCellProps, tableProps, viewProps };
|
|
385
|
+
export { type DatePickerApi as Api, type Calendar, type CalendarDate, type CalendarDateTime, type Cell, type DateDuration, type DateFormatter, type DateRangePreset, type DateValue, type DateValueOffset, type DateView, type DayTableCellProps, type DayTableCellState, type ElementIds, type FocusChangeDetails, type FocusOutsideEvent, type InputProps, type InteractOutsideEvent, type IntlTranslations, type LabelProps, type LocaleDetails, type DatePickerMachine as Machine, type MonthFormatOptions, type MonthGridProps, type MonthGridValue, type OpenChangeDetails, type PointerDownOutsideEvent, type PositioningOptions, type PresetTriggerProps, type PresetTriggerValue, type DatePickerProps as Props, type Range, type SelectionMode, type DatePickerService as Service, type TableCellProps, type TableCellState, type TableProps, type ValueChangeDetails, type ViewChangeDetails, type ViewProps, type VisibleRange, type VisibleRangeChangeDetails, type VisibleRangeText, type WeekDay, type WeekNumberCellProps, type YearGridProps, type YearGridValue, type ZonedDateTime, anatomy, connect, inputProps, machine, parse, presetTriggerProps, props, splitInputProps, splitPresetTriggerProps, splitProps, splitTableCellProps, splitTableProps, splitViewProps, tableCellProps, tableProps, viewProps };
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { n as AnatomyInstance } from "../../create-anatomy-BedZVdg0.mjs";
|
|
2
2
|
import { p as Machine, y as Service } from "../../types-DUM9rzfD.mjs";
|
|
3
3
|
import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as CommonProperties, x as PropTypes } from "../../index-BVFlU3b9.mjs";
|
|
4
|
-
import {
|
|
4
|
+
import { Q as DateValue, Z as DateRangePreset } from "../../index-6cEVkXqi.mjs";
|
|
5
5
|
import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-CGNNiDyE.mjs";
|
|
6
6
|
import { t as LiveRegion } from "../../index-1L40UHp8.mjs";
|
|
7
|
-
import { p as PositioningOptions, u as Placement } from "../../index-
|
|
7
|
+
import { p as PositioningOptions, u as Placement } from "../../index-fMh0VDkR.mjs";
|
|
8
8
|
import { Calendar, CalendarDate, CalendarDateTime, DateDuration, DateFormatter, ZonedDateTime } from "@internationalized/date";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/date-picker/date-picker.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
11
|
+
declare const anatomy: AnatomyInstance<"root" | "content" | "trigger" | "label" | "input" | "control" | "positioner" | "table" | "view" | "clearTrigger" | "nextTrigger" | "prevTrigger" | "monthSelect" | "presetTrigger" | "rangeText" | "tableBody" | "tableCell" | "tableCellTrigger" | "tableHead" | "tableHeader" | "tableRow" | "viewControl" | "viewTrigger" | "yearSelect">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/date-picker/date-picker.types.d.ts
|
|
14
14
|
type DateView = "day" | "month" | "year";
|
|
@@ -35,6 +35,12 @@ interface OpenChangeDetails {
|
|
|
35
35
|
open: boolean;
|
|
36
36
|
value: DateValue[];
|
|
37
37
|
}
|
|
38
|
+
interface Time {
|
|
39
|
+
hour?: number;
|
|
40
|
+
minute?: number;
|
|
41
|
+
second?: number;
|
|
42
|
+
millisecond?: number;
|
|
43
|
+
}
|
|
38
44
|
interface LocaleDetails {
|
|
39
45
|
locale: string;
|
|
40
46
|
timeZone: string;
|
|
@@ -56,6 +62,8 @@ interface IntlTranslations {
|
|
|
56
62
|
month: string;
|
|
57
63
|
day: string;
|
|
58
64
|
};
|
|
65
|
+
weekColumnHeader?: string | undefined;
|
|
66
|
+
weekNumberCell?: ((weekNumber: number) => string) | undefined;
|
|
59
67
|
}
|
|
60
68
|
type ElementIds = Partial<{
|
|
61
69
|
root: string;
|
|
@@ -99,6 +107,7 @@ interface DatePickerProps extends DirectionProperty, CommonProperties {
|
|
|
99
107
|
numOfMonths?: number | undefined;
|
|
100
108
|
startOfWeek?: number | undefined;
|
|
101
109
|
fixedWeeks?: boolean | undefined;
|
|
110
|
+
showWeekNumbers?: boolean | undefined;
|
|
102
111
|
onValueChange?: ((details: ValueChangeDetails) => void) | undefined;
|
|
103
112
|
onFocusChange?: ((details: FocusChangeDetails) => void) | undefined;
|
|
104
113
|
onViewChange?: ((details: ViewChangeDetails) => void) | undefined;
|
|
@@ -106,6 +115,7 @@ interface DatePickerProps extends DirectionProperty, CommonProperties {
|
|
|
106
115
|
onOpenChange?: ((details: OpenChangeDetails) => void) | undefined;
|
|
107
116
|
isDateUnavailable?: ((date: DateValue, locale: string) => boolean) | undefined;
|
|
108
117
|
selectionMode?: SelectionMode | undefined;
|
|
118
|
+
maxSelectedDates?: number | undefined;
|
|
109
119
|
format?: ((date: DateValue, details: LocaleDetails) => string) | undefined;
|
|
110
120
|
parse?: ((value: string, details: LocaleDetails) => DateValue | undefined) | undefined;
|
|
111
121
|
placeholder?: string | undefined;
|
|
@@ -197,6 +207,10 @@ interface DayTableCellProps {
|
|
|
197
207
|
disabled?: boolean | undefined;
|
|
198
208
|
visibleRange?: VisibleRange | undefined;
|
|
199
209
|
}
|
|
210
|
+
interface WeekNumberCellProps {
|
|
211
|
+
weekIndex: number;
|
|
212
|
+
week: DateValue[];
|
|
213
|
+
}
|
|
200
214
|
interface DayTableCellState {
|
|
201
215
|
invalid: boolean;
|
|
202
216
|
disabled: boolean;
|
|
@@ -269,8 +283,12 @@ interface DatePickerApi<T extends PropTypes = PropTypes> {
|
|
|
269
283
|
readOnly: boolean;
|
|
270
284
|
inline: boolean;
|
|
271
285
|
numOfMonths: number;
|
|
286
|
+
showWeekNumbers: boolean;
|
|
272
287
|
selectionMode: SelectionMode;
|
|
288
|
+
maxSelectedDates: number | undefined;
|
|
289
|
+
isMaxSelected: boolean;
|
|
273
290
|
view: DateView;
|
|
291
|
+
getWeekNumber: (week: DateValue[]) => number;
|
|
274
292
|
getDaysInWeek: (week: number, from?: DateValue) => DateValue[];
|
|
275
293
|
getOffset: (duration: DateDuration) => DateValueOffset;
|
|
276
294
|
getRangePresetValue: (value: DateRangePreset) => DateValue[];
|
|
@@ -288,8 +306,11 @@ interface DatePickerApi<T extends PropTypes = PropTypes> {
|
|
|
288
306
|
focusedValueAsString: string;
|
|
289
307
|
selectToday: VoidFunction;
|
|
290
308
|
setValue: (values: DateValue[]) => void;
|
|
309
|
+
setTime: (time: Time, index?: number) => void;
|
|
291
310
|
setFocusedValue: (value: DateValue) => void;
|
|
292
|
-
clearValue:
|
|
311
|
+
clearValue: (options?: {
|
|
312
|
+
focus?: boolean;
|
|
313
|
+
}) => void;
|
|
293
314
|
setOpen: (open: boolean) => void;
|
|
294
315
|
focusMonth: (month: number) => void;
|
|
295
316
|
focusYear: (year: number) => void;
|
|
@@ -316,6 +337,8 @@ interface DatePickerApi<T extends PropTypes = PropTypes> {
|
|
|
316
337
|
getTableHeaderProps: (props?: TableProps) => T["element"];
|
|
317
338
|
getTableBodyProps: (props?: TableProps) => T["element"];
|
|
318
339
|
getTableRowProps: (props?: TableProps) => T["element"];
|
|
340
|
+
getWeekNumberHeaderCellProps: (props?: TableProps) => T["element"];
|
|
341
|
+
getWeekNumberCellProps: (props: WeekNumberCellProps) => T["element"];
|
|
319
342
|
getDayTableCellProps: (props: DayTableCellProps) => T["element"];
|
|
320
343
|
getDayTableCellTriggerProps: (props: DayTableCellProps) => T["element"];
|
|
321
344
|
getMonthTableCellProps: (props: TableCellProps) => T["element"];
|
|
@@ -359,4 +382,4 @@ declare const splitTableCellProps: <Props extends TableCellProps>(props: Props)
|
|
|
359
382
|
declare const viewProps: "view"[];
|
|
360
383
|
declare const splitViewProps: <Props extends ViewProps>(props: Props) => [ViewProps, Omit<Props, "view">];
|
|
361
384
|
//#endregion
|
|
362
|
-
export { type DatePickerApi as Api, type Calendar, type CalendarDate, type CalendarDateTime, type Cell, type DateDuration, type DateFormatter, type DateRangePreset, type DateValue, type DateValueOffset, type DateView, type DayTableCellProps, type DayTableCellState, type ElementIds, type FocusChangeDetails, type FocusOutsideEvent, type InputProps, type InteractOutsideEvent, type IntlTranslations, type LabelProps, type LocaleDetails, type DatePickerMachine as Machine, type MonthFormatOptions, type MonthGridProps, type MonthGridValue, type OpenChangeDetails, type PointerDownOutsideEvent, type PositioningOptions, type PresetTriggerProps, type PresetTriggerValue, type DatePickerProps as Props, type Range, type SelectionMode, type DatePickerService as Service, type TableCellProps, type TableCellState, type TableProps, type ValueChangeDetails, type ViewChangeDetails, type ViewProps, type VisibleRange, type VisibleRangeChangeDetails, type VisibleRangeText, type WeekDay, type YearGridProps, type YearGridValue, type ZonedDateTime, anatomy, connect, inputProps, machine, parse, presetTriggerProps, props, splitInputProps, splitPresetTriggerProps, splitProps, splitTableCellProps, splitTableProps, splitViewProps, tableCellProps, tableProps, viewProps };
|
|
385
|
+
export { type DatePickerApi as Api, type Calendar, type CalendarDate, type CalendarDateTime, type Cell, type DateDuration, type DateFormatter, type DateRangePreset, type DateValue, type DateValueOffset, type DateView, type DayTableCellProps, type DayTableCellState, type ElementIds, type FocusChangeDetails, type FocusOutsideEvent, type InputProps, type InteractOutsideEvent, type IntlTranslations, type LabelProps, type LocaleDetails, type DatePickerMachine as Machine, type MonthFormatOptions, type MonthGridProps, type MonthGridValue, type OpenChangeDetails, type PointerDownOutsideEvent, type PositioningOptions, type PresetTriggerProps, type PresetTriggerValue, type DatePickerProps as Props, type Range, type SelectionMode, type DatePickerService as Service, type TableCellProps, type TableCellState, type TableProps, type ValueChangeDetails, type ViewChangeDetails, type ViewProps, type VisibleRange, type VisibleRangeChangeDetails, type VisibleRangeText, type WeekDay, type WeekNumberCellProps, type YearGridProps, type YearGridValue, type ZonedDateTime, anatomy, connect, inputProps, machine, parse, presetTriggerProps, props, splitInputProps, splitPresetTriggerProps, splitProps, splitTableCellProps, splitTableProps, splitViewProps, tableCellProps, tableProps, viewProps };
|
|
@@ -2,11 +2,11 @@ import { t as createAnatomy } from "../../create-anatomy-Dr0evdYy.mjs";
|
|
|
2
2
|
import { C as queryAll, D as disableTextSelection, O as restoreTextSelection, S as query, W as raf, _t as isComposingEvent, bn as ariaAttr, ct as setElementValue, ft as getEventKey, gt as getNativeEvent, xn as dataAttr } from "../../dom-query-s2ESLR2U.mjs";
|
|
3
3
|
import { N as isValueWithinRange, Y as match, g as clampValue, ht as chunk, u as createSplitProps } from "../../utils-VVoZ_v29.mjs";
|
|
4
4
|
import { a as createMachine, i as createGuards, s as memo } from "../../core-BmIEKqtP.mjs";
|
|
5
|
-
import { A as
|
|
5
|
+
import { A as getDayFormatter, F as isDateOutsideRange, G as constrainValue, I as isDateUnavailable, L as isNextRangeInvalid, M as getEndDate, N as getUnitDuration, O as formatSelectedDate, P as isDateEqual, R as isPreviousRangeInvalid, S as getMonthNames, T as getWeekOfYear, _ as getYearsRange, g as getDecadeRange, i as getNextPage, j as getMonthFormatter, l as getPreviousSection, n as parseDateString, o as getNextSection, p as getTodayDate, r as getAdjustedDateFn, s as getPreviousPage, t as getDateRangePreset, w as getWeekDays, x as getMonthDays, y as getDaysInWeek, z as alignDate } from "../../date-utils-BqOQP2-U.mjs";
|
|
6
6
|
import "../../interact-outside-2qkUnl4N.mjs";
|
|
7
7
|
import { n as trackDismissableElement } from "../../dismissable-DWfZGIA7.mjs";
|
|
8
8
|
import { t as createLiveRegion } from "../../live-region-TgEDzvS4.mjs";
|
|
9
|
-
import { n as getPlacement, t as getPlacementStyles } from "../../popper-
|
|
9
|
+
import { n as getPlacement, t as getPlacementStyles } from "../../popper-BDy37WA0.mjs";
|
|
10
10
|
import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
11
11
|
import { CalendarDate, DateFormatter, isEqualDay, isEqualMonth, isEqualYear, isToday, isWeekend, parseDate, toCalendarDateTime, toZoned } from "@internationalized/date";
|
|
12
12
|
//#region src/machines/date-picker/date-picker.anatomy.ts
|
|
@@ -128,7 +128,11 @@ const defaultTranslations = {
|
|
|
128
128
|
content: "calendar",
|
|
129
129
|
monthSelect: "Select month",
|
|
130
130
|
yearSelect: "Select year",
|
|
131
|
-
clearTrigger: "Clear selected dates"
|
|
131
|
+
clearTrigger: "Clear selected dates",
|
|
132
|
+
weekColumnHeader: "Wk",
|
|
133
|
+
weekNumberCell(weekNumber) {
|
|
134
|
+
return `Week ${weekNumber}`;
|
|
135
|
+
}
|
|
132
136
|
};
|
|
133
137
|
function viewToNumber(view, fallback) {
|
|
134
138
|
if (!view) return fallback || 0;
|
|
@@ -226,7 +230,10 @@ function connect(service, normalize) {
|
|
|
226
230
|
const focused = state.matches("focused");
|
|
227
231
|
const open = state.matches("open");
|
|
228
232
|
const isRangePicker = prop("selectionMode") === "range";
|
|
233
|
+
const isMultiPicker = prop("selectionMode") === "multiple";
|
|
229
234
|
const isDateUnavailableFn = prop("isDateUnavailable");
|
|
235
|
+
const maxSelectedDates = prop("maxSelectedDates");
|
|
236
|
+
const isMaxSelected = isMultiPicker && maxSelectedDates != null && selectedValue.length >= maxSelectedDates;
|
|
230
237
|
const currentPlacement = context.get("currentPlacement");
|
|
231
238
|
const popperStyles = getPlacementStyles({
|
|
232
239
|
...prop("positioning"),
|
|
@@ -326,10 +333,11 @@ function connect(service, normalize) {
|
|
|
326
333
|
const isInHoveredRange = hasHoveredRange && isDateWithinRange(value, hoveredRangeValue);
|
|
327
334
|
const isFirstInHoveredRange = hasHoveredRange && isDateEqual(value, hoveredRangeValue[0]);
|
|
328
335
|
const isLastInHoveredRange = hasHoveredRange && isDateEqual(value, hoveredRangeValue[1]);
|
|
336
|
+
const isSelected = selectedValue.some((date) => isDateEqual(value, date));
|
|
329
337
|
const cellState = {
|
|
330
338
|
invalid: isDateOutsideRange(value, min, max),
|
|
331
|
-
disabled: disabled || !outsideDaySelectable && isOutsideRange || isDateOutsideRange(value, min, max),
|
|
332
|
-
selected:
|
|
339
|
+
disabled: disabled || !outsideDaySelectable && isOutsideRange || isDateOutsideRange(value, min, max) || isMaxSelected && !isSelected,
|
|
340
|
+
selected: isSelected,
|
|
333
341
|
unavailable: isDateUnavailable(value, isDateUnavailableFn, locale, min, max) && !disabled,
|
|
334
342
|
outsideRange: isOutsideRange,
|
|
335
343
|
today: isToday(value, timeZone),
|
|
@@ -365,11 +373,18 @@ function connect(service, normalize) {
|
|
|
365
373
|
readOnly,
|
|
366
374
|
inline: !!prop("inline"),
|
|
367
375
|
numOfMonths: prop("numOfMonths"),
|
|
376
|
+
showWeekNumbers: !!prop("showWeekNumbers"),
|
|
368
377
|
selectionMode: prop("selectionMode"),
|
|
378
|
+
maxSelectedDates,
|
|
379
|
+
isMaxSelected,
|
|
369
380
|
view: context.get("view"),
|
|
370
381
|
getRangePresetValue(preset) {
|
|
371
382
|
return getDateRangePreset(preset, locale, timeZone);
|
|
372
383
|
},
|
|
384
|
+
getWeekNumber(week) {
|
|
385
|
+
const firstDay = week[0];
|
|
386
|
+
return firstDay ? getWeekOfYear(firstDay, locale) : 0;
|
|
387
|
+
},
|
|
373
388
|
getDaysInWeek(week, from = startValue) {
|
|
374
389
|
return getDaysInWeek(week, from, locale, startOfWeek);
|
|
375
390
|
},
|
|
@@ -407,7 +422,7 @@ function connect(service, normalize) {
|
|
|
407
422
|
selectToday() {
|
|
408
423
|
send({
|
|
409
424
|
type: "VALUE.SET",
|
|
410
|
-
value: constrainValue(getTodayDate(timeZone), min, max)
|
|
425
|
+
value: [constrainValue(getTodayDate(timeZone), min, max)]
|
|
411
426
|
});
|
|
412
427
|
},
|
|
413
428
|
setValue(values) {
|
|
@@ -416,8 +431,29 @@ function connect(service, normalize) {
|
|
|
416
431
|
value: values.map((date) => constrainValue(date, min, max))
|
|
417
432
|
});
|
|
418
433
|
},
|
|
419
|
-
|
|
420
|
-
|
|
434
|
+
setTime(time, index = 0) {
|
|
435
|
+
const values = Array.from(selectedValue);
|
|
436
|
+
let dateValue = values[index];
|
|
437
|
+
if (!dateValue) return;
|
|
438
|
+
if (!("hour" in dateValue)) dateValue = toCalendarDateTime(dateValue);
|
|
439
|
+
dateValue = dateValue.set({
|
|
440
|
+
hour: time.hour ?? ("hour" in dateValue ? dateValue.hour : 0),
|
|
441
|
+
minute: time.minute ?? ("minute" in dateValue ? dateValue.minute : 0),
|
|
442
|
+
second: time.second ?? ("second" in dateValue ? dateValue.second : 0),
|
|
443
|
+
millisecond: time.millisecond ?? ("millisecond" in dateValue ? dateValue.millisecond : 0)
|
|
444
|
+
});
|
|
445
|
+
values[index] = constrainValue(dateValue, min, max);
|
|
446
|
+
send({
|
|
447
|
+
type: "VALUE.SET",
|
|
448
|
+
value: values
|
|
449
|
+
});
|
|
450
|
+
},
|
|
451
|
+
clearValue(options = {}) {
|
|
452
|
+
const { focus = true } = options;
|
|
453
|
+
send({
|
|
454
|
+
type: "VALUE.CLEAR",
|
|
455
|
+
focus
|
|
456
|
+
});
|
|
421
457
|
},
|
|
422
458
|
setFocusedValue(value) {
|
|
423
459
|
send({
|
|
@@ -690,6 +726,28 @@ function connect(service, normalize) {
|
|
|
690
726
|
"data-view": view
|
|
691
727
|
});
|
|
692
728
|
},
|
|
729
|
+
getWeekNumberHeaderCellProps(props = {}) {
|
|
730
|
+
const { view = "day" } = props;
|
|
731
|
+
return normalize.element({
|
|
732
|
+
...parts.tableCell.attrs,
|
|
733
|
+
scope: "col",
|
|
734
|
+
"aria-label": translations.weekColumnHeader,
|
|
735
|
+
"data-view": view,
|
|
736
|
+
"data-disabled": dataAttr(disabled)
|
|
737
|
+
});
|
|
738
|
+
},
|
|
739
|
+
getWeekNumberCellProps(props) {
|
|
740
|
+
const { weekIndex, week } = props;
|
|
741
|
+
const weekNumber = week[0] ? getWeekOfYear(week[0], locale) : 0;
|
|
742
|
+
return normalize.element({
|
|
743
|
+
...parts.tableCell.attrs,
|
|
744
|
+
role: "rowheader",
|
|
745
|
+
"aria-label": translations.weekNumberCell?.(weekNumber),
|
|
746
|
+
"data-view": "day",
|
|
747
|
+
"data-week-index": weekIndex,
|
|
748
|
+
"data-disabled": dataAttr(disabled)
|
|
749
|
+
});
|
|
750
|
+
},
|
|
693
751
|
getDayTableCellState,
|
|
694
752
|
getDayTableCellProps(props) {
|
|
695
753
|
const { value } = props;
|
|
@@ -2200,6 +2258,7 @@ const props = createProps()([
|
|
|
2200
2258
|
"isDateUnavailable",
|
|
2201
2259
|
"locale",
|
|
2202
2260
|
"max",
|
|
2261
|
+
"maxSelectedDates",
|
|
2203
2262
|
"min",
|
|
2204
2263
|
"name",
|
|
2205
2264
|
"numOfMonths",
|
|
@@ -2215,6 +2274,7 @@ const props = createProps()([
|
|
|
2215
2274
|
"readOnly",
|
|
2216
2275
|
"required",
|
|
2217
2276
|
"selectionMode",
|
|
2277
|
+
"showWeekNumbers",
|
|
2218
2278
|
"startOfWeek",
|
|
2219
2279
|
"timeZone",
|
|
2220
2280
|
"translations",
|
|
@@ -130,7 +130,7 @@ const machine = require_core.createMachine({
|
|
|
130
130
|
modal,
|
|
131
131
|
trapFocus: modal,
|
|
132
132
|
preventScroll: modal,
|
|
133
|
-
closeOnInteractOutside: !alertDialog,
|
|
133
|
+
closeOnInteractOutside: modal && !alertDialog,
|
|
134
134
|
closeOnEscape: true,
|
|
135
135
|
restoreFocus: true,
|
|
136
136
|
initialFocusEl,
|
|
@@ -5,7 +5,7 @@ import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOuts
|
|
|
5
5
|
import { r as PersistentElementOptions, t as DismissableElementHandlers } from "../../dismissable-layer-ZgyqN8AD.cjs";
|
|
6
6
|
|
|
7
7
|
//#region src/machines/dialog/dialog.anatomy.d.ts
|
|
8
|
-
declare const anatomy: AnatomyInstance<"
|
|
8
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "backdrop" | "positioner" | "title" | "description" | "closeTrigger">;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/machines/dialog/dialog.types.d.ts
|
|
11
11
|
interface OpenChangeDetails {
|
|
@@ -5,7 +5,7 @@ import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOuts
|
|
|
5
5
|
import { r as PersistentElementOptions, t as DismissableElementHandlers } from "../../dismissable-layer-h14gHVbJ.mjs";
|
|
6
6
|
|
|
7
7
|
//#region src/machines/dialog/dialog.anatomy.d.ts
|
|
8
|
-
declare const anatomy: AnatomyInstance<"
|
|
8
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "backdrop" | "positioner" | "title" | "description" | "closeTrigger">;
|
|
9
9
|
//#endregion
|
|
10
10
|
//#region src/machines/dialog/dialog.types.d.ts
|
|
11
11
|
interface OpenChangeDetails {
|
|
@@ -129,7 +129,7 @@ const machine = createMachine({
|
|
|
129
129
|
modal,
|
|
130
130
|
trapFocus: modal,
|
|
131
131
|
preventScroll: modal,
|
|
132
|
-
closeOnInteractOutside: !alertDialog,
|
|
132
|
+
closeOnInteractOutside: modal && !alertDialog,
|
|
133
133
|
closeOnEscape: true,
|
|
134
134
|
restoreFocus: true,
|
|
135
135
|
initialFocusEl,
|
|
@@ -5,7 +5,7 @@ const require_utils = require("../../utils-ByNiZU8f.cjs");
|
|
|
5
5
|
const require_core = require("../../core-nBg9RC_y.cjs");
|
|
6
6
|
require("../../interact-outside-Cx4J0EBf.cjs");
|
|
7
7
|
const require_dismissable = require("../../dismissable-ChwcJMHk.cjs");
|
|
8
|
-
const require_popper = require("../../popper-
|
|
8
|
+
const require_popper = require("../../popper-Cx3KHzeT.cjs");
|
|
9
9
|
const require_rect_utils = require("../../rect-utils-D3RkAaHK.cjs");
|
|
10
10
|
const require_create_props = require("../../create-props-DP39rHnH.cjs");
|
|
11
11
|
//#region src/machines/dropdown-menu/dropdown-menu.anatomy.ts
|
|
@@ -4,11 +4,11 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { n as TypeaheadState } from "../../typeahead-DMooWbbX.cjs";
|
|
5
5
|
import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-DzWGFhcS.cjs";
|
|
6
6
|
import { t as DismissableElementHandlers } from "../../dismissable-layer-ZgyqN8AD.cjs";
|
|
7
|
-
import { c as Placement, d as PositioningOptions } from "../../types-
|
|
7
|
+
import { c as Placement, d as PositioningOptions } from "../../types-CZAtqGqH.cjs";
|
|
8
8
|
import { a as Point } from "../../types-CLXYEgfm.cjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/dropdown-menu/dropdown-menu.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"
|
|
11
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "indicator" | "item" | "itemIndicator" | "positioner" | "itemText" | "itemGroup" | "itemGroupLabel" | "arrow" | "arrowTip" | "separator" | "triggerItem">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/dropdown-menu/dropdown-menu.types.d.ts
|
|
14
14
|
interface OpenChangeDetails {
|
|
@@ -4,11 +4,11 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { n as TypeaheadState } from "../../typeahead-Bbeb1fAR.mjs";
|
|
5
5
|
import { c as PointerDownOutsideEvent, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-CGNNiDyE.mjs";
|
|
6
6
|
import { t as DismissableElementHandlers } from "../../dismissable-layer-h14gHVbJ.mjs";
|
|
7
|
-
import { p as PositioningOptions, u as Placement } from "../../index-
|
|
7
|
+
import { p as PositioningOptions, u as Placement } from "../../index-fMh0VDkR.mjs";
|
|
8
8
|
import { a as Point } from "../../types-DU764tY_.mjs";
|
|
9
9
|
|
|
10
10
|
//#region src/machines/dropdown-menu/dropdown-menu.anatomy.d.ts
|
|
11
|
-
declare const anatomy: AnatomyInstance<"
|
|
11
|
+
declare const anatomy: AnatomyInstance<"content" | "trigger" | "indicator" | "item" | "itemIndicator" | "positioner" | "itemText" | "itemGroup" | "itemGroupLabel" | "arrow" | "arrowTip" | "separator" | "triggerItem">;
|
|
12
12
|
//#endregion
|
|
13
13
|
//#region src/machines/dropdown-menu/dropdown-menu.types.d.ts
|
|
14
14
|
interface OpenChangeDetails {
|
|
@@ -4,7 +4,7 @@ import { G as cast, Ot as prev, Tt as next, ft as isEqual, tt as hasProp, u as c
|
|
|
4
4
|
import { a as createMachine, c as mergeProps, i as createGuards } from "../../core-BmIEKqtP.mjs";
|
|
5
5
|
import "../../interact-outside-2qkUnl4N.mjs";
|
|
6
6
|
import { n as trackDismissableElement } from "../../dismissable-DWfZGIA7.mjs";
|
|
7
|
-
import { n as getPlacement, r as getPlacementSide, t as getPlacementStyles } from "../../popper-
|
|
7
|
+
import { n as getPlacement, r as getPlacementSide, t as getPlacementStyles } from "../../popper-BDy37WA0.mjs";
|
|
8
8
|
import { i as isPointInPolygon, r as getElementPolygon } from "../../rect-utils-B5xqFvKC.mjs";
|
|
9
9
|
import { t as createProps } from "../../create-props-DFW8DUsC.mjs";
|
|
10
10
|
//#region src/machines/dropdown-menu/dropdown-menu.anatomy.ts
|
|
@@ -4,7 +4,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-DzWGFhcS.cjs";
|
|
5
5
|
|
|
6
6
|
//#region src/machines/editable/editable.anatomy.d.ts
|
|
7
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
7
|
+
declare const anatomy: AnatomyInstance<"root" | "area" | "label" | "preview" | "input" | "control" | "submitTrigger" | "cancelTrigger" | "editTrigger">;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/machines/editable/editable.types.d.ts
|
|
10
10
|
interface ValueChangeDetails {
|
|
@@ -4,7 +4,7 @@ import { b as NormalizeProps, g as RequiredBy, r as DirectionProperty, t as Comm
|
|
|
4
4
|
import { c as PointerDownOutsideEvent, i as InteractOutsideHandlers, n as FocusOutsideEvent, r as InteractOutsideEvent } from "../../index-CGNNiDyE.mjs";
|
|
5
5
|
|
|
6
6
|
//#region src/machines/editable/editable.anatomy.d.ts
|
|
7
|
-
declare const anatomy: AnatomyInstance<"root" | "
|
|
7
|
+
declare const anatomy: AnatomyInstance<"root" | "area" | "label" | "preview" | "input" | "control" | "submitTrigger" | "cancelTrigger" | "editTrigger">;
|
|
8
8
|
//#endregion
|
|
9
9
|
//#region src/machines/editable/editable.types.d.ts
|
|
10
10
|
interface ValueChangeDetails {
|