@planningcenter/tapestry 4.3.0-rc.6 → 4.3.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/components/date-picker/DatePicker.d.ts +9 -1
- package/dist/components/date-picker/DatePicker.d.ts.map +1 -1
- package/dist/components/date-picker/DatePicker.js +44 -7
- package/dist/components/date-picker/DatePicker.js.map +1 -1
- package/dist/ext/@internationalized/date/dist/private/queries.js +18 -2
- package/dist/ext/@internationalized/date/dist/private/queries.js.map +1 -1
- package/dist/reactRender.css +1230 -1230
- package/dist/reactRender.css.map +1 -1
- package/dist/reactRenderLegacy.css +1230 -1230
- package/dist/reactRenderLegacy.css.map +1 -1
- package/package.json +2 -2
|
@@ -8,6 +8,8 @@ import { type DatePickerProps as AriaDatePickerProps } from "react-aria-componen
|
|
|
8
8
|
export type DatePickerSize = "md" | "lg";
|
|
9
9
|
export type DatePickerDateValue = DateValue | string;
|
|
10
10
|
export interface DatePickerProps {
|
|
11
|
+
/** If `true`, always shows leading zeros in the year segment for years less than 1000. Defaults to true. */
|
|
12
|
+
alwaysShowFourDigitYear?: boolean;
|
|
11
13
|
/** The initial value for uncontrolled usage. Accepts a DateValue or ISO date string. */
|
|
12
14
|
defaultValue?: DatePickerDateValue | null;
|
|
13
15
|
/** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */
|
|
@@ -16,6 +18,12 @@ export interface DatePickerProps {
|
|
|
16
18
|
disabled?: boolean;
|
|
17
19
|
/** Sets the first day of the week in the calendar. Defaults to locale-appropriate value. */
|
|
18
20
|
firstDayOfWeek?: "fri" | "mon" | "sat" | "sun" | "thu" | "tue" | "wed";
|
|
21
|
+
/**
|
|
22
|
+
* Called on blur with the current complete value, if any, so it can be
|
|
23
|
+
* normalized (e.g. correcting a 2-digit year to 4 digits). If the returned
|
|
24
|
+
* value differs from the current one, the field updates to match.
|
|
25
|
+
*/
|
|
26
|
+
formatDateOnBlur?: (date: DateValue) => DateValue;
|
|
19
27
|
/** If `true`, the `label` text is rendered as an `aria-label` instead of a visible label element. */
|
|
20
28
|
hideLabel?: boolean;
|
|
21
29
|
/** Whether the input is in an invalid state. */
|
|
@@ -62,7 +70,7 @@ export type DatePickerElementProps = CombineAriaPropsWithCustomProps<AriaDatePic
|
|
|
62
70
|
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-datepicker--docs | Storybook Documentation}
|
|
63
71
|
* @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}
|
|
64
72
|
*/
|
|
65
|
-
export declare function DatePicker({ className, defaultValue, description, disabled, firstDayOfWeek, hideLabel, invalid, isDateUnavailable, label, max, min, onChange, readOnly, required, size, value, ...restProps }: DatePickerElementProps): React.JSX.Element;
|
|
73
|
+
export declare function DatePicker({ className, defaultValue, description, disabled, firstDayOfWeek, formatDateOnBlur, hideLabel, invalid, isDateUnavailable, label, max, min, onBlur, onChange, readOnly, required, size, value, alwaysShowFourDigitYear, ...restProps }: DatePickerElementProps): React.JSX.Element;
|
|
66
74
|
export declare namespace DatePicker {
|
|
67
75
|
var displayName: string;
|
|
68
76
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,aAAa,CAAA;AAEpB,OAAO,EAEL,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"DatePicker.d.ts","sourceRoot":"","sources":["../../../src/components/date-picker/DatePicker.tsx"],"names":[],"mappings":"AAAA,OAAO,mBAAmB,CAAA;AAC1B,OAAO,oBAAoB,CAAA;AAC3B,OAAO,aAAa,CAAA;AAEpB,OAAO,EAEL,KAAK,SAAS,EAKf,MAAM,yBAAyB,CAAA;AAEhC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAA;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AAO,CAAA;IAClB,mCAAmC;IACnC,IAAI,CAAC,EAAE,cAAc,CAAA;IACrB,oEAAoE;IACpE,KAAK,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;CACnC;AAED,KAAK,yBAAyB,GAC1B,UAAU,GACV,aAAa,GACb,aAAa,GACb,cAAc,GACd,WAAW,GACX,cAAc,GACd,kBAAkB,GAClB,qBAAqB,GACrB,yBAAyB,GACzB,MAAM,CAAA;AAEV,KAAK,4BAA4B,GAAG,QAAQ,GAAG,MAAM,GAAG,cAAc,CAAA;AAEtE,MAAM,MAAM,sBAAsB,GAAG,+BAA+B,CAClE,mBAAmB,CAAC,SAAS,CAAC,EAC9B,eAAe,EACf,yBAAyB,EACzB,4BAA4B,CAC7B,CAAA;AA2PD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,UAAU,CAAC,EACzB,SAAS,EACT,YAAY,EACZ,WAAW,EACX,QAAQ,EACR,cAAc,EACd,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,iBAAiB,EACjB,KAAK,EACL,GAAG,EACH,GAAG,EACH,MAAM,EACN,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,IAAW,EACX,KAAK,EACL,uBAA8B,EAC9B,GAAG,SAAS,EACb,EAAE,sBAAsB,qBAwHxB;yBA7Ie,UAAU"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { CalendarDate as $2aaf608024c21ca1$export$99faa760c7908e4f } from './../../ext/@internationalized/date/dist/private/CalendarDate.js';
|
|
2
|
-
import { today as $ad063034c8620db8$export$d0bdf45af03a6ea3, getLocalTimeZone as $ad063034c8620db8$export$aa8b41735afcabd2 } from './../../ext/@internationalized/date/dist/private/queries.js';
|
|
2
|
+
import { today as $ad063034c8620db8$export$d0bdf45af03a6ea3, getLocalTimeZone as $ad063034c8620db8$export$aa8b41735afcabd2, isSameDay as $ad063034c8620db8$export$ea39ec197993aef0 } from './../../ext/@internationalized/date/dist/private/queries.js';
|
|
3
3
|
import { parseDate as $58246871e4652552$export$6b862160d295c8e } from './../../ext/@internationalized/date/dist/private/string.js';
|
|
4
4
|
import Icon from '../../utilities/Icon.js';
|
|
5
5
|
import classNames from 'classnames';
|
|
@@ -93,6 +93,19 @@ function DatePickerCalendarBody({ activeOverlay, setActiveOverlay, }) {
|
|
|
93
93
|
React.createElement(CalendarGridHeader, { className: "tds-date-picker-calendar-grid-header" }, (day) => (React.createElement(CalendarHeaderCell, { className: "tds-date-picker-calendar-header-cell" }, day))),
|
|
94
94
|
React.createElement(CalendarGridBody, { className: "tds-date-picker-calendar-grid-body" }, (date) => (React.createElement(CalendarCell, { className: "tds-date-picker-calendar-cell-button", date: date })))))));
|
|
95
95
|
}
|
|
96
|
+
function useValue({ defaultValue, onChange, value, }) {
|
|
97
|
+
const [uncontrolledValue, setUncontrolledValue] = useState(() => toCalendarDate(defaultValue) ?? null);
|
|
98
|
+
if (value !== undefined) {
|
|
99
|
+
return [toCalendarDate(value) ?? null, (...args) => onChange?.(...args)];
|
|
100
|
+
}
|
|
101
|
+
return [
|
|
102
|
+
uncontrolledValue,
|
|
103
|
+
(value) => {
|
|
104
|
+
onChange?.(value);
|
|
105
|
+
setUncontrolledValue(value);
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
}
|
|
96
109
|
/**
|
|
97
110
|
* A date picker allows a user to select a particular date.
|
|
98
111
|
* The input supports keyboard entry of individual day, month, and year segments;
|
|
@@ -113,9 +126,7 @@ function DatePickerCalendarBody({ activeOverlay, setActiveOverlay, }) {
|
|
|
113
126
|
* @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-datepicker--docs | Storybook Documentation}
|
|
114
127
|
* @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}
|
|
115
128
|
*/
|
|
116
|
-
function DatePicker({ className, defaultValue, description, disabled, firstDayOfWeek, hideLabel, invalid, isDateUnavailable, label, max, min, onChange, readOnly, required, size = "md", value, ...restProps }) {
|
|
117
|
-
const convertedValue = toCalendarDate(value);
|
|
118
|
-
const convertedDefaultValue = toCalendarDate(defaultValue);
|
|
129
|
+
function DatePicker({ className, defaultValue, description, disabled, firstDayOfWeek, formatDateOnBlur, hideLabel, invalid, isDateUnavailable, label, max, min, onBlur, onChange, readOnly, required, size = "md", value, alwaysShowFourDigitYear = true, ...restProps }) {
|
|
119
130
|
const convertedMin = toCalendarDate(min) ?? undefined;
|
|
120
131
|
const convertedMax = toCalendarDate(max) ?? undefined;
|
|
121
132
|
const combinedClassName = classNames("tds-field tds-date-picker", {
|
|
@@ -123,15 +134,41 @@ function DatePicker({ className, defaultValue, description, disabled, firstDayOf
|
|
|
123
134
|
"tds-field--lg": size === "lg",
|
|
124
135
|
}, className);
|
|
125
136
|
const [activeOverlay, setActiveOverlay] = useState(null);
|
|
126
|
-
|
|
137
|
+
const [computedValue, setComputedValue] = useValue({
|
|
138
|
+
defaultValue,
|
|
139
|
+
onChange,
|
|
140
|
+
value,
|
|
141
|
+
});
|
|
142
|
+
return (React.createElement(DatePicker$1, { ...restProps, "aria-label": hideLabel ? label : undefined, className: combinedClassName, isDateUnavailable: isDateUnavailable, isDisabled: disabled, isReadOnly: readOnly, isRequired: required, maxValue: convertedMax, minValue: convertedMin, onBlur: (event) => {
|
|
143
|
+
onBlur?.(event);
|
|
144
|
+
if (!formatDateOnBlur || !computedValue)
|
|
145
|
+
return;
|
|
146
|
+
const formattedValue = formatDateOnBlur(computedValue);
|
|
147
|
+
if ($ad063034c8620db8$export$ea39ec197993aef0(formattedValue, computedValue))
|
|
148
|
+
return;
|
|
149
|
+
setComputedValue(formattedValue);
|
|
150
|
+
}, onChange: (newValue) => {
|
|
151
|
+
setComputedValue(newValue);
|
|
152
|
+
}, onOpenChange: (isOpen) => {
|
|
127
153
|
if (!isOpen)
|
|
128
154
|
setActiveOverlay(null);
|
|
129
|
-
}, value:
|
|
155
|
+
}, value: computedValue },
|
|
130
156
|
!hideLabel && React.createElement(Label, { className: "tds-field-label" }, label),
|
|
131
157
|
React.createElement(Group, { "aria-invalid": invalid || undefined, className: "tds-field-control tds-date-picker-field" },
|
|
132
158
|
React.createElement(DateInput, { className: "tds-date-picker-input" }, (segment) => (React.createElement(DateSegment, { "aria-invalid": invalid || undefined, className: segment.type === "literal"
|
|
133
159
|
? "tds-field-date-segment-separator"
|
|
134
|
-
: "tds-field-date-segment", segment: segment
|
|
160
|
+
: "tds-field-date-segment", segment: segment.type === "year" &&
|
|
161
|
+
!segment.isPlaceholder &&
|
|
162
|
+
segment.value != null &&
|
|
163
|
+
alwaysShowFourDigitYear
|
|
164
|
+
? {
|
|
165
|
+
...segment,
|
|
166
|
+
text: new Intl.NumberFormat(undefined, {
|
|
167
|
+
minimumIntegerDigits: 4,
|
|
168
|
+
useGrouping: false,
|
|
169
|
+
}).format(segment.value),
|
|
170
|
+
}
|
|
171
|
+
: segment }))),
|
|
135
172
|
React.createElement(Button, { className: "tds-btn tds-btn--infield tds-date-picker-button" },
|
|
136
173
|
React.createElement(Icon, { "aria-hidden": true, symbol: "general#calendar" }))),
|
|
137
174
|
React.createElement(Popover, { className: classNames("tds-date-picker-popover", {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.js","sources":["../../../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport {\n CalendarDate,\n type DateValue,\n getLocalTimeZone,\n parseDate,\n today as todayCalendar,\n} from \"@internationalized/date\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport classNames from \"classnames\"\nimport React, { type ReactNode, useContext, useState } from \"react\"\nimport { CalendarStateContext } from \"react-aria-components/Calendar\"\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DateInput,\n DatePicker as AriaDatePicker,\n type DatePickerProps as AriaDatePickerProps,\n DateSegment,\n Group,\n Label,\n Popover,\n Text,\n} from \"react-aria-components/DatePicker\"\nimport { Dialog } from \"react-aria-components/Dialog\"\nimport { ListBox, ListBoxItem } from \"react-aria-components/ListBox\"\n\nconst _today = todayCalendar(getLocalTimeZone())\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i)\nconst YEARS = Array.from({ length: 131 }, (_, i) => _today.year - 100 + i)\nconst shortMonthFormatter = new Intl.DateTimeFormat(undefined, {\n month: \"short\",\n})\nconst longMonthFormatter = new Intl.DateTimeFormat(undefined, { month: \"long\" })\n\nexport type DatePickerSize = \"md\" | \"lg\"\n\nexport type DatePickerDateValue = DateValue | string\n\nfunction toCalendarDate(\n input: DatePickerDateValue | null | undefined\n): DateValue | null | undefined {\n if (input === null) return null\n if (input === undefined) return undefined\n\n if (typeof input === \"object\" && \"calendar\" in input) {\n return input\n }\n\n return parseDate(input)\n}\n\nexport interface DatePickerProps {\n /** The initial value for uncontrolled usage. Accepts a DateValue or ISO date string. */\n defaultValue?: DatePickerDateValue | null\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: ReactNode\n /** Disables the input and calendar button. */\n disabled?: boolean\n /** Sets the first day of the week in the calendar. Defaults to locale-appropriate value. */\n firstDayOfWeek?: \"fri\" | \"mon\" | \"sat\" | \"sun\" | \"thu\" | \"tue\" | \"wed\"\n /** If `true`, the `label` text is rendered as an `aria-label` instead of a visible label element. */\n hideLabel?: boolean\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** Callback that returns `true` for dates that should be visible but not selectable. */\n isDateUnavailable?: (date: DateValue) => boolean\n /** Accessible label for the field. */\n label: string\n /** Maximum selectable date. Accepts a DateValue or ISO date string. */\n max?: DatePickerDateValue\n /** Minimum selectable date. Accepts a DateValue or ISO date string. */\n min?: DatePickerDateValue\n /** Called when the selected date changes. */\n onChange?: (value: DateValue | null) => void\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /** The size of the date picker. */\n size?: DatePickerSize\n /** The controlled value. Accepts a DateValue or ISO date string. */\n value?: DatePickerDateValue | null\n}\n\ntype AriaDatePickerPropsToOmit =\n | \"children\"\n | \"defaultOpen\"\n | \"granularity\"\n | \"hideTimeZone\"\n | \"hourCycle\"\n | \"pageBehavior\"\n | \"placeholderValue\"\n | \"shouldCloseOnSelect\"\n | \"shouldForceLeadingZeros\"\n | \"slot\"\n\ntype AriaDatePickerPropsToInclude = \"isOpen\" | \"name\" | \"onOpenChange\"\n\nexport type DatePickerElementProps = CombineAriaPropsWithCustomProps<\n AriaDatePickerProps<DateValue>,\n DatePickerProps,\n AriaDatePickerPropsToOmit,\n AriaDatePickerPropsToInclude\n>\n\nfunction DatePickerOverlay({\n children,\n variant,\n}: {\n children: ReactNode\n variant: \"month\" | \"year\"\n}) {\n return (\n <div\n aria-label={`Select ${variant}`}\n aria-modal=\"true\"\n className={`tds-date-picker-overlay tds-date-picker-overlay--${variant}`}\n role=\"dialog\"\n >\n {children}\n </div>\n )\n}\n\nfunction DatePickerCalendarBody({\n activeOverlay,\n setActiveOverlay,\n}: {\n activeOverlay: \"month\" | \"year\" | null\n setActiveOverlay: (overlay: \"month\" | \"year\" | null) => void\n}) {\n // Read and drive Calendar's focused date through its state context. This\n // lets react-aria-components own the \"open to selected month\" behavior:\n // when the popover opens, Calendar mounts and auto-focuses the DatePicker's\n // current value (whether typed into the input segments or set via `value`).\n const state = useContext(CalendarStateContext)!\n const focusedDate = state.focusedDate\n const today = todayCalendar(getLocalTimeZone())\n\n function handleOverlaySelectionChange(\n keys: \"all\" | Set<number | string>,\n onSelect: (key: number) => void\n ) {\n if (keys === \"all\") return\n const [first] = Array.from(keys)\n if (first !== undefined) onSelect(Number(first))\n }\n\n function handleMonthSelect(monthIndex: number) {\n state.setFocusedDate(new CalendarDate(focusedDate.year, monthIndex + 1, 1))\n setActiveOverlay(null)\n }\n\n function handleYearSelect(year: number) {\n state.setFocusedDate(new CalendarDate(year, focusedDate.month, 1))\n setActiveOverlay(null)\n }\n\n return (\n <>\n <header className=\"tds-date-picker-calendar-header\">\n <div className=\"tds-date-picker-calendar-heading\">\n <Button\n aria-expanded={activeOverlay === \"month\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"month\" ? null : \"month\")\n }\n slot={null}\n >\n {longMonthFormatter.format(\n new Date(2000, focusedDate.month - 1, 1)\n )}\n </Button>\n <Button\n aria-expanded={activeOverlay === \"year\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"year\" ? null : \"year\")\n }\n slot={null}\n >\n {focusedDate.year}\n </Button>\n </div>\n {activeOverlay ? (\n <Button\n aria-label={`Close ${activeOverlay} picker`}\n className=\"tds-date-picker-calendar-nav\"\n onPress={() => setActiveOverlay(null)}\n slot={null}\n >\n <Icon aria-hidden symbol=\"general#x\" />\n </Button>\n ) : (\n <>\n <Button\n aria-label=\"Go to today\"\n className=\"tds-date-picker-calendar-nav tds-date-picker-calendar-nav--lg\"\n style={{\n visibility:\n focusedDate.month === today.month &&\n focusedDate.year === today.year\n ? \"hidden\"\n : undefined,\n }}\n onPress={() => {\n state.setFocusedDate(today)\n state.setFocused(true)\n }}\n slot={null}\n >\n {/* TODO: Add to icon library and use Icon once icon is decided on */}\n <svg\n aria-hidden\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"symbol\"\n >\n <path d=\"M13.444 14.222H2.556V5.667h10.888zm0-12.444h-.777V.222h-1.556v1.556H4.889V.222H3.333v1.556h-.777a1.55 1.55 0 0 0-1.548 1.555L1 14.222a1.555 1.555 0 0 0 1.556 1.556h10.888A1.56 1.56 0 0 0 15 14.222V3.333a1.56 1.56 0 0 0-1.556-1.555\" />\n <circle cx=\"8\" cy=\"9.75\" r=\"2.25\" />\n </svg>\n </Button>\n <Button\n aria-label=\"Previous month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"previous\"\n >\n <Icon aria-hidden symbol=\"general#left-chevron\" />\n </Button>\n <Button\n aria-label=\"Next month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"next\"\n >\n <Icon aria-hidden symbol=\"general#right-chevron\" />\n </Button>\n </>\n )}\n </header>\n <div className=\"tds-date-picker-calendar-body\">\n {activeOverlay === \"month\" && (\n <DatePickerOverlay variant=\"month\">\n <ListBox\n aria-label=\"Months\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleMonthSelect)\n }\n selectedKeys={[String(focusedDate.month - 1)]}\n selectionMode=\"single\"\n >\n {MONTHS.map((i) => {\n const date = new Date(2000, i, 1)\n const shortMonth = shortMonthFormatter.format(date)\n const longMonth = longMonthFormatter.format(date)\n\n return (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(i)}\n key={i}\n aria-label={longMonth}\n textValue={longMonth}\n >\n {shortMonth}\n </ListBoxItem>\n )\n })}\n </ListBox>\n </DatePickerOverlay>\n )}\n {activeOverlay === \"year\" && (\n <DatePickerOverlay variant=\"year\">\n <ListBox\n aria-label=\"Years\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleYearSelect)\n }\n selectedKeys={[String(focusedDate.year)]}\n selectionMode=\"single\"\n >\n {YEARS.map((year) => (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(year)}\n key={year}\n textValue={String(year)}\n >\n {year}\n </ListBoxItem>\n ))}\n </ListBox>\n </DatePickerOverlay>\n )}\n <CalendarGrid className=\"tds-date-picker-calendar-grid\">\n <CalendarGridHeader className=\"tds-date-picker-calendar-grid-header\">\n {(day) => (\n <CalendarHeaderCell className=\"tds-date-picker-calendar-header-cell\">\n {day}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody className=\"tds-date-picker-calendar-grid-body\">\n {(date) => (\n <CalendarCell\n className=\"tds-date-picker-calendar-cell-button\"\n date={date}\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n </>\n )\n}\n\n/**\n * A date picker allows a user to select a particular date.\n * The input supports keyboard entry of individual day, month, and year segments;\n * the calendar offers month and year quick-pick overlays plus a \"go to today\" shortcut.\n *\n * The date picker automatically displays the value and calendar from the user's locale,\n * and does not require a specific date format.\n *\n * Values are exchanged as `DateValue` from `@internationalized/date`, but\n * `value`, `defaultValue`, `min`, and `max` also accept ISO date strings\n * (`\"YYYY-MM-DD\"`) for convenience. Restrict the selectable range with\n * `min`/`max`, or mark individual dates as unavailable via `isDateUnavailable`.\n *\n * Renders uncontrolled when `value` is omitted: pass `defaultValue` to set\n * the initial date without managing state.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-datepicker--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport function DatePicker({\n className,\n defaultValue,\n description,\n disabled,\n firstDayOfWeek,\n hideLabel,\n invalid,\n isDateUnavailable,\n label,\n max,\n min,\n onChange,\n readOnly,\n required,\n size = \"md\",\n value,\n ...restProps\n}: DatePickerElementProps) {\n const convertedValue = toCalendarDate(value)\n const convertedDefaultValue = toCalendarDate(defaultValue)\n const convertedMin = toCalendarDate(min) ?? undefined\n const convertedMax = toCalendarDate(max) ?? undefined\n\n const combinedClassName = classNames(\n \"tds-field tds-date-picker\",\n {\n \"tds-date-picker--lg\": size === \"lg\",\n \"tds-field--lg\": size === \"lg\",\n },\n className\n )\n\n const [activeOverlay, setActiveOverlay] = useState<\"month\" | \"year\" | null>(\n null\n )\n\n return (\n <AriaDatePicker\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n defaultValue={convertedDefaultValue}\n isDateUnavailable={isDateUnavailable}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={convertedMax}\n minValue={convertedMin}\n onChange={onChange ?? undefined}\n onOpenChange={(isOpen) => {\n if (!isOpen) setActiveOverlay(null)\n }}\n value={convertedValue}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group\n aria-invalid={invalid || undefined}\n className=\"tds-field-control tds-date-picker-field\"\n >\n <DateInput className=\"tds-date-picker-input\">\n {(segment) => (\n <DateSegment\n aria-invalid={invalid || undefined}\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={segment}\n />\n )}\n </DateInput>\n <Button className=\"tds-btn tds-btn--infield tds-date-picker-button\">\n <Icon aria-hidden symbol=\"general#calendar\" />\n </Button>\n </Group>\n <Popover\n className={classNames(\"tds-date-picker-popover\", {\n \"tds-date-picker-popover--lg\": size === \"lg\",\n })}\n offset={2}\n >\n <Dialog>\n <Calendar\n className=\"tds-date-picker-calendar\"\n firstDayOfWeek={firstDayOfWeek}\n >\n <DatePickerCalendarBody\n activeOverlay={activeOverlay}\n setActiveOverlay={setActiveOverlay}\n />\n </Calendar>\n </Dialog>\n </Popover>\n {description && (\n <Text\n elementType=\"p\"\n className=\"tds-field-description\"\n slot=\"description\"\n >\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaDatePicker>\n )\n}\n\nDatePicker.displayName = \"DatePicker\"\n"],"names":["todayCalendar","getLocalTimeZone","parseDate","CalendarDate","AriaDatePicker"],"mappings":";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,EAAC,kBAAkB,EAAA,CAAG,CACvC,CACH;AACR,QAAA,KAAA,CAAA,aAAA,CAAC,OAAO,EAAA,EACN,SAAS,EAAE,UAAU,CAAC,yBAAyB,EAAE;gBAC/C,6BAA6B,EAAE,IAAI,KAAK,IAAI;aAC7C,CAAC,EACF,MAAM,EAAE,CAAC,EAAA;AAET,YAAA,KAAA,CAAA,aAAA,CAAC,MAAM,EAAA,IAAA;gBACL,KAAA,CAAA,aAAA,CAAC,QAAQ,IACP,SAAS,EAAC,0BAA0B,EACpC,cAAc,EAAE,cAAc,EAAA;AAE9B,oBAAA,KAAA,CAAA,aAAA,CAAC,sBAAsB,EAAA,EACrB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAAA,CAClC,CACO,CACJ,CACD;AACT,QAAA,WAAW,KACV,KAAA,CAAA,aAAA,CAAC,IAAI,IACH,WAAW,EAAC,GAAG,EACf,SAAS,EAAC,uBAAuB,EACjC,IAAI,EAAC,aAAa,EAAA;YAElB,KAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACc;AAErB;AAEA,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
1
|
+
{"version":3,"file":"DatePicker.js","sources":["../../../src/components/date-picker/DatePicker.tsx"],"sourcesContent":["import \"../button/btn.css\"\nimport \"../field/index.css\"\nimport \"./index.css\"\n\nimport {\n CalendarDate,\n type DateValue,\n getLocalTimeZone,\n isSameDay,\n parseDate,\n today as todayCalendar,\n} from \"@internationalized/date\"\nimport Icon from \"@utilities/Icon\"\nimport type { CombineAriaPropsWithCustomProps } from \"@utilities/reactAriaProps\"\nimport classNames from \"classnames\"\nimport React, { type ReactNode, useContext, useState } from \"react\"\nimport { CalendarStateContext } from \"react-aria-components/Calendar\"\nimport {\n Button,\n Calendar,\n CalendarCell,\n CalendarGrid,\n CalendarGridBody,\n CalendarGridHeader,\n CalendarHeaderCell,\n DateInput,\n DatePicker as AriaDatePicker,\n type DatePickerProps as AriaDatePickerProps,\n DateSegment,\n Group,\n Label,\n Popover,\n Text,\n} from \"react-aria-components/DatePicker\"\nimport { Dialog } from \"react-aria-components/Dialog\"\nimport { ListBox, ListBoxItem } from \"react-aria-components/ListBox\"\n\nconst _today = todayCalendar(getLocalTimeZone())\nconst MONTHS = Array.from({ length: 12 }, (_, i) => i)\nconst YEARS = Array.from({ length: 131 }, (_, i) => _today.year - 100 + i)\nconst shortMonthFormatter = new Intl.DateTimeFormat(undefined, {\n month: \"short\",\n})\nconst longMonthFormatter = new Intl.DateTimeFormat(undefined, { month: \"long\" })\n\nexport type DatePickerSize = \"md\" | \"lg\"\n\nexport type DatePickerDateValue = DateValue | string\n\nfunction toCalendarDate(\n input: DatePickerDateValue | null | undefined\n): DateValue | null | undefined {\n if (input === null) return null\n if (input === undefined) return undefined\n\n if (typeof input === \"object\" && \"calendar\" in input) {\n return input\n }\n\n return parseDate(input)\n}\n\nexport interface DatePickerProps {\n /** If `true`, always shows leading zeros in the year segment for years less than 1000. Defaults to true. */\n alwaysShowFourDigitYear?: boolean\n /** The initial value for uncontrolled usage. Accepts a DateValue or ISO date string. */\n defaultValue?: DatePickerDateValue | null\n /** Helper text displayed below the component. Styled as error text when `invalid` is `true`. */\n description?: ReactNode\n /** Disables the input and calendar button. */\n disabled?: boolean\n /** Sets the first day of the week in the calendar. Defaults to locale-appropriate value. */\n firstDayOfWeek?: \"fri\" | \"mon\" | \"sat\" | \"sun\" | \"thu\" | \"tue\" | \"wed\"\n /**\n * Called on blur with the current complete value, if any, so it can be\n * normalized (e.g. correcting a 2-digit year to 4 digits). If the returned\n * value differs from the current one, the field updates to match.\n */\n formatDateOnBlur?: (date: DateValue) => DateValue\n /** If `true`, the `label` text is rendered as an `aria-label` instead of a visible label element. */\n hideLabel?: boolean\n /** Whether the input is in an invalid state. */\n invalid?: boolean\n /** Callback that returns `true` for dates that should be visible but not selectable. */\n isDateUnavailable?: (date: DateValue) => boolean\n /** Accessible label for the field. */\n label: string\n /** Maximum selectable date. Accepts a DateValue or ISO date string. */\n max?: DatePickerDateValue\n /** Minimum selectable date. Accepts a DateValue or ISO date string. */\n min?: DatePickerDateValue\n /** Called when the selected date changes. */\n onChange?: (value: DateValue | null) => void\n /** If `true`, allows the value to be read but not changed. */\n readOnly?: boolean\n /** If `true`, appends an asterisk at the end of the label text. */\n required?: boolean\n /** The size of the date picker. */\n size?: DatePickerSize\n /** The controlled value. Accepts a DateValue or ISO date string. */\n value?: DatePickerDateValue | null\n}\n\ntype AriaDatePickerPropsToOmit =\n | \"children\"\n | \"defaultOpen\"\n | \"granularity\"\n | \"hideTimeZone\"\n | \"hourCycle\"\n | \"pageBehavior\"\n | \"placeholderValue\"\n | \"shouldCloseOnSelect\"\n | \"shouldForceLeadingZeros\"\n | \"slot\"\n\ntype AriaDatePickerPropsToInclude = \"isOpen\" | \"name\" | \"onOpenChange\"\n\nexport type DatePickerElementProps = CombineAriaPropsWithCustomProps<\n AriaDatePickerProps<DateValue>,\n DatePickerProps,\n AriaDatePickerPropsToOmit,\n AriaDatePickerPropsToInclude\n>\n\nfunction DatePickerOverlay({\n children,\n variant,\n}: {\n children: ReactNode\n variant: \"month\" | \"year\"\n}) {\n return (\n <div\n aria-label={`Select ${variant}`}\n aria-modal=\"true\"\n className={`tds-date-picker-overlay tds-date-picker-overlay--${variant}`}\n role=\"dialog\"\n >\n {children}\n </div>\n )\n}\n\nfunction DatePickerCalendarBody({\n activeOverlay,\n setActiveOverlay,\n}: {\n activeOverlay: \"month\" | \"year\" | null\n setActiveOverlay: (overlay: \"month\" | \"year\" | null) => void\n}) {\n // Read and drive Calendar's focused date through its state context. This\n // lets react-aria-components own the \"open to selected month\" behavior:\n // when the popover opens, Calendar mounts and auto-focuses the DatePicker's\n // current value (whether typed into the input segments or set via `value`).\n const state = useContext(CalendarStateContext)!\n const focusedDate = state.focusedDate\n const today = todayCalendar(getLocalTimeZone())\n\n function handleOverlaySelectionChange(\n keys: \"all\" | Set<number | string>,\n onSelect: (key: number) => void\n ) {\n if (keys === \"all\") return\n const [first] = Array.from(keys)\n if (first !== undefined) onSelect(Number(first))\n }\n\n function handleMonthSelect(monthIndex: number) {\n state.setFocusedDate(new CalendarDate(focusedDate.year, monthIndex + 1, 1))\n setActiveOverlay(null)\n }\n\n function handleYearSelect(year: number) {\n state.setFocusedDate(new CalendarDate(year, focusedDate.month, 1))\n setActiveOverlay(null)\n }\n\n return (\n <>\n <header className=\"tds-date-picker-calendar-header\">\n <div className=\"tds-date-picker-calendar-heading\">\n <Button\n aria-expanded={activeOverlay === \"month\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"month\" ? null : \"month\")\n }\n slot={null}\n >\n {longMonthFormatter.format(\n new Date(2000, focusedDate.month - 1, 1)\n )}\n </Button>\n <Button\n aria-expanded={activeOverlay === \"year\"}\n aria-haspopup=\"dialog\"\n className=\"tds-date-picker-calendar-overlay-trigger\"\n onPress={() =>\n setActiveOverlay(activeOverlay === \"year\" ? null : \"year\")\n }\n slot={null}\n >\n {focusedDate.year}\n </Button>\n </div>\n {activeOverlay ? (\n <Button\n aria-label={`Close ${activeOverlay} picker`}\n className=\"tds-date-picker-calendar-nav\"\n onPress={() => setActiveOverlay(null)}\n slot={null}\n >\n <Icon aria-hidden symbol=\"general#x\" />\n </Button>\n ) : (\n <>\n <Button\n aria-label=\"Go to today\"\n className=\"tds-date-picker-calendar-nav tds-date-picker-calendar-nav--lg\"\n style={{\n visibility:\n focusedDate.month === today.month &&\n focusedDate.year === today.year\n ? \"hidden\"\n : undefined,\n }}\n onPress={() => {\n state.setFocusedDate(today)\n state.setFocused(true)\n }}\n slot={null}\n >\n {/* TODO: Add to icon library and use Icon once icon is decided on */}\n <svg\n aria-hidden\n xmlns=\"http://www.w3.org/2000/svg\"\n fill=\"currentColor\"\n viewBox=\"0 0 16 16\"\n className=\"symbol\"\n >\n <path d=\"M13.444 14.222H2.556V5.667h10.888zm0-12.444h-.777V.222h-1.556v1.556H4.889V.222H3.333v1.556h-.777a1.55 1.55 0 0 0-1.548 1.555L1 14.222a1.555 1.555 0 0 0 1.556 1.556h10.888A1.56 1.56 0 0 0 15 14.222V3.333a1.56 1.56 0 0 0-1.556-1.555\" />\n <circle cx=\"8\" cy=\"9.75\" r=\"2.25\" />\n </svg>\n </Button>\n <Button\n aria-label=\"Previous month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"previous\"\n >\n <Icon aria-hidden symbol=\"general#left-chevron\" />\n </Button>\n <Button\n aria-label=\"Next month\"\n className=\"tds-date-picker-calendar-nav\"\n slot=\"next\"\n >\n <Icon aria-hidden symbol=\"general#right-chevron\" />\n </Button>\n </>\n )}\n </header>\n <div className=\"tds-date-picker-calendar-body\">\n {activeOverlay === \"month\" && (\n <DatePickerOverlay variant=\"month\">\n <ListBox\n aria-label=\"Months\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleMonthSelect)\n }\n selectedKeys={[String(focusedDate.month - 1)]}\n selectionMode=\"single\"\n >\n {MONTHS.map((i) => {\n const date = new Date(2000, i, 1)\n const shortMonth = shortMonthFormatter.format(date)\n const longMonth = longMonthFormatter.format(date)\n\n return (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(i)}\n key={i}\n aria-label={longMonth}\n textValue={longMonth}\n >\n {shortMonth}\n </ListBoxItem>\n )\n })}\n </ListBox>\n </DatePickerOverlay>\n )}\n {activeOverlay === \"year\" && (\n <DatePickerOverlay variant=\"year\">\n <ListBox\n aria-label=\"Years\"\n // eslint-disable-next-line jsx-a11y/no-autofocus -- focusing the active item on dialog open is required per ARIA authoring practices\n autoFocus\n className=\"tds-date-picker-overlay-list\"\n disallowEmptySelection\n escapeKeyBehavior=\"none\"\n layout=\"grid\"\n onSelectionChange={(keys) =>\n handleOverlaySelectionChange(keys, handleYearSelect)\n }\n selectedKeys={[String(focusedDate.year)]}\n selectionMode=\"single\"\n >\n {YEARS.map((year) => (\n <ListBoxItem\n className=\"tds-date-picker-overlay-cell\"\n id={String(year)}\n key={year}\n textValue={String(year)}\n >\n {year}\n </ListBoxItem>\n ))}\n </ListBox>\n </DatePickerOverlay>\n )}\n <CalendarGrid className=\"tds-date-picker-calendar-grid\">\n <CalendarGridHeader className=\"tds-date-picker-calendar-grid-header\">\n {(day) => (\n <CalendarHeaderCell className=\"tds-date-picker-calendar-header-cell\">\n {day}\n </CalendarHeaderCell>\n )}\n </CalendarGridHeader>\n <CalendarGridBody className=\"tds-date-picker-calendar-grid-body\">\n {(date) => (\n <CalendarCell\n className=\"tds-date-picker-calendar-cell-button\"\n date={date}\n />\n )}\n </CalendarGridBody>\n </CalendarGrid>\n </div>\n </>\n )\n}\n\nfunction useValue({\n defaultValue,\n onChange,\n value,\n}: Pick<DatePickerProps, \"defaultValue\" | \"onChange\" | \"value\">): [\n DateValue | null,\n (value: DateValue | null) => void,\n] {\n const [uncontrolledValue, setUncontrolledValue] = useState(\n () => toCalendarDate(defaultValue) ?? null\n )\n if (value !== undefined) {\n return [toCalendarDate(value) ?? null, (...args) => onChange?.(...args)]\n }\n return [\n uncontrolledValue,\n (value) => {\n onChange?.(value)\n setUncontrolledValue(value)\n },\n ]\n}\n\n/**\n * A date picker allows a user to select a particular date.\n * The input supports keyboard entry of individual day, month, and year segments;\n * the calendar offers month and year quick-pick overlays plus a \"go to today\" shortcut.\n *\n * The date picker automatically displays the value and calendar from the user's locale,\n * and does not require a specific date format.\n *\n * Values are exchanged as `DateValue` from `@internationalized/date`, but\n * `value`, `defaultValue`, `min`, and `max` also accept ISO date strings\n * (`\"YYYY-MM-DD\"`) for convenience. Restrict the selectable range with\n * `min`/`max`, or mark individual dates as unavailable via `isDateUnavailable`.\n *\n * Renders uncontrolled when `value` is omitted: pass `defaultValue` to set\n * the initial date without managing state.\n *\n * @component\n * @see {@link https://planningcenter.github.io/tapestry/?path=/docs/components-datepicker--docs | Storybook Documentation}\n * @see {@link https://github.com/planningcenter/tapestry/tree/main/packages/tapestry-migration-cli | Migration CLI: Available}\n */\nexport function DatePicker({\n className,\n defaultValue,\n description,\n disabled,\n firstDayOfWeek,\n formatDateOnBlur,\n hideLabel,\n invalid,\n isDateUnavailable,\n label,\n max,\n min,\n onBlur,\n onChange,\n readOnly,\n required,\n size = \"md\",\n value,\n alwaysShowFourDigitYear = true,\n ...restProps\n}: DatePickerElementProps) {\n const convertedMin = toCalendarDate(min) ?? undefined\n const convertedMax = toCalendarDate(max) ?? undefined\n\n const combinedClassName = classNames(\n \"tds-field tds-date-picker\",\n {\n \"tds-date-picker--lg\": size === \"lg\",\n \"tds-field--lg\": size === \"lg\",\n },\n className\n )\n\n const [activeOverlay, setActiveOverlay] = useState<\"month\" | \"year\" | null>(\n null\n )\n\n const [computedValue, setComputedValue] = useValue({\n defaultValue,\n onChange,\n value,\n })\n\n return (\n <AriaDatePicker\n {...restProps}\n aria-label={hideLabel ? label : undefined}\n className={combinedClassName}\n isDateUnavailable={isDateUnavailable}\n isDisabled={disabled}\n isReadOnly={readOnly}\n isRequired={required}\n maxValue={convertedMax}\n minValue={convertedMin}\n onBlur={(event) => {\n onBlur?.(event)\n if (!formatDateOnBlur || !computedValue) return\n\n const formattedValue = formatDateOnBlur(computedValue)\n if (isSameDay(formattedValue, computedValue)) return\n\n setComputedValue(formattedValue)\n }}\n onChange={(newValue) => {\n setComputedValue(newValue)\n }}\n onOpenChange={(isOpen) => {\n if (!isOpen) setActiveOverlay(null)\n }}\n value={computedValue}\n >\n {!hideLabel && <Label className=\"tds-field-label\">{label}</Label>}\n <Group\n aria-invalid={invalid || undefined}\n className=\"tds-field-control tds-date-picker-field\"\n >\n <DateInput className=\"tds-date-picker-input\">\n {(segment) => (\n <DateSegment\n aria-invalid={invalid || undefined}\n className={\n segment.type === \"literal\"\n ? \"tds-field-date-segment-separator\"\n : \"tds-field-date-segment\"\n }\n segment={\n segment.type === \"year\" &&\n !segment.isPlaceholder &&\n segment.value != null &&\n alwaysShowFourDigitYear\n ? {\n ...segment,\n text: new Intl.NumberFormat(undefined, {\n minimumIntegerDigits: 4,\n useGrouping: false,\n }).format(segment.value),\n }\n : segment\n }\n />\n )}\n </DateInput>\n <Button className=\"tds-btn tds-btn--infield tds-date-picker-button\">\n <Icon aria-hidden symbol=\"general#calendar\" />\n </Button>\n </Group>\n <Popover\n className={classNames(\"tds-date-picker-popover\", {\n \"tds-date-picker-popover--lg\": size === \"lg\",\n })}\n offset={2}\n >\n <Dialog>\n <Calendar\n className=\"tds-date-picker-calendar\"\n firstDayOfWeek={firstDayOfWeek}\n >\n <DatePickerCalendarBody\n activeOverlay={activeOverlay}\n setActiveOverlay={setActiveOverlay}\n />\n </Calendar>\n </Dialog>\n </Popover>\n {description && (\n <Text\n elementType=\"p\"\n className=\"tds-field-description\"\n slot=\"description\"\n >\n <Icon\n aria-hidden\n className=\"tds-field-description-invalid-icon\"\n symbol=\"general#exclamation-triangle\"\n />\n {description}\n </Text>\n )}\n </AriaDatePicker>\n )\n}\n\nDatePicker.displayName = \"DatePicker\"\n"],"names":["todayCalendar","getLocalTimeZone","parseDate","CalendarDate","AriaDatePicker","isSameDay"],"mappings":";;;;;;;;;;;AAqCA,MAAM,MAAM,GAAGA,yCAAa,CAACC,yCAAgB,EAAE,CAAC;AAChD,MAAM,MAAM,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AACtD,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE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Q,IACP,SAAS,EAAC,0BAA0B,EACpC,cAAc,EAAE,cAAc,EAAA;AAE9B,oBAAA,KAAA,CAAA,aAAA,CAAC,sBAAsB,EAAA,EACrB,aAAa,EAAE,aAAa,EAC5B,gBAAgB,EAAE,gBAAgB,EAAA,CAClC,CACO,CACJ,CACD;AACT,QAAA,WAAW,KACV,KAAA,CAAA,aAAA,CAAC,IAAI,IACH,WAAW,EAAC,GAAG,EACf,SAAS,EAAC,uBAAuB,EACjC,IAAI,EAAC,aAAa,EAAA;YAElB,KAAA,CAAA,aAAA,CAAC,IAAI,yBAEH,SAAS,EAAC,oCAAoC,EAC9C,MAAM,EAAC,8BAA8B,EAAA,CACrC;AACD,YAAA,WAAW,CACP,CACR,CACc;AAErB;AAEA,UAAU,CAAC,WAAW,GAAG,YAAY;;;;"}
|
|
@@ -1,5 +1,21 @@
|
|
|
1
|
-
import { toCalendarDate as $d07e34cce18680fd$export$93522d1a439f3617, fromAbsolute as $d07e34cce18680fd$export$1b96692a1ba042ac } from './conversion.js';
|
|
1
|
+
import { toCalendarDate as $d07e34cce18680fd$export$93522d1a439f3617, fromAbsolute as $d07e34cce18680fd$export$1b96692a1ba042ac, toCalendar as $d07e34cce18680fd$export$b4a036af3fc0b032 } from './conversion.js';
|
|
2
2
|
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
function $ad063034c8620db8$export$ea39ec197993aef0(a, b) {
|
|
16
|
+
b = ($d07e34cce18680fd$export$b4a036af3fc0b032)(b, a.calendar);
|
|
17
|
+
return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;
|
|
18
|
+
}
|
|
3
19
|
function $ad063034c8620db8$export$dbc69fd56b53d5e(a, b) {
|
|
4
20
|
return a.isEqual?.(b) ?? b.isEqual?.(a) ?? a.identifier === b.identifier;
|
|
5
21
|
}
|
|
@@ -28,5 +44,5 @@ function $ad063034c8620db8$export$6ab69b273755230b() {
|
|
|
28
44
|
return $ad063034c8620db8$var$localTimeZoneOverride;
|
|
29
45
|
}
|
|
30
46
|
|
|
31
|
-
export { $ad063034c8620db8$export$68781ddf31c0090f as compareDate, $ad063034c8620db8$export$c19a80a9721b80f6 as compareTime, $ad063034c8620db8$export$aa8b41735afcabd2 as getLocalTimeZone, $ad063034c8620db8$export$dbc69fd56b53d5e as isEqualCalendar, $ad063034c8620db8$export$6ab69b273755230b as isLocalTimeZoneOverridden, $ad063034c8620db8$export$461939dd4422153 as now, $ad063034c8620db8$export$d0bdf45af03a6ea3 as today };
|
|
47
|
+
export { $ad063034c8620db8$export$68781ddf31c0090f as compareDate, $ad063034c8620db8$export$c19a80a9721b80f6 as compareTime, $ad063034c8620db8$export$aa8b41735afcabd2 as getLocalTimeZone, $ad063034c8620db8$export$dbc69fd56b53d5e as isEqualCalendar, $ad063034c8620db8$export$6ab69b273755230b as isLocalTimeZoneOverridden, $ad063034c8620db8$export$ea39ec197993aef0 as isSameDay, $ad063034c8620db8$export$461939dd4422153 as now, $ad063034c8620db8$export$d0bdf45af03a6ea3 as today };
|
|
32
48
|
//# sourceMappingURL=queries.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","sources":["../../../../../../../../node_modules/@internationalized/date/dist/private/queries.mjs"],"sourcesContent":["import {fromAbsolute as $d07e34cce18680fd$export$1b96692a1ba042ac, toAbsolute as $d07e34cce18680fd$export$5107c82f94518f5c, toCalendar as $d07e34cce18680fd$export$b4a036af3fc0b032, toCalendarDate as $d07e34cce18680fd$export$93522d1a439f3617} from \"./conversion.mjs\";\nimport {weekStartData as $d2ca8165c9aa885a$export$7a5acbd77d414bd9} from \"./weekStartData.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\nfunction $ad063034c8620db8$export$ea39ec197993aef0(a, b) {\n b = (0, $d07e34cce18680fd$export$b4a036af3fc0b032)(b, a.calendar);\n return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\nfunction $ad063034c8620db8$export$a18c89cbd24170ff(a, b) {\n b = (0, $d07e34cce18680fd$export$b4a036af3fc0b032)(b, a.calendar);\n // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.\n a = $ad063034c8620db8$export$a5a3b454ada2268e(a);\n b = $ad063034c8620db8$export$a5a3b454ada2268e(b);\n return a.era === b.era && a.year === b.year && a.month === b.month;\n}\nfunction $ad063034c8620db8$export$5841f9eb9773f25f(a, b) {\n b = (0, $d07e34cce18680fd$export$b4a036af3fc0b032)(b, a.calendar);\n a = $ad063034c8620db8$export$f91e89d3d0406102(a);\n b = $ad063034c8620db8$export$f91e89d3d0406102(b);\n return a.era === b.era && a.year === b.year;\n}\nfunction $ad063034c8620db8$export$91b62ebf2ba703ee(a, b) {\n return $ad063034c8620db8$export$dbc69fd56b53d5e(a.calendar, b.calendar) && $ad063034c8620db8$export$ea39ec197993aef0(a, b);\n}\nfunction $ad063034c8620db8$export$5a8da0c44a3afdf2(a, b) {\n return $ad063034c8620db8$export$dbc69fd56b53d5e(a.calendar, b.calendar) && $ad063034c8620db8$export$a18c89cbd24170ff(a, b);\n}\nfunction $ad063034c8620db8$export$ea840f5a6dda8147(a, b) {\n return $ad063034c8620db8$export$dbc69fd56b53d5e(a.calendar, b.calendar) && $ad063034c8620db8$export$5841f9eb9773f25f(a, b);\n}\nfunction $ad063034c8620db8$export$dbc69fd56b53d5e(a, b) {\n return a.isEqual?.(b) ?? b.isEqual?.(a) ?? a.identifier === b.identifier;\n}\nfunction $ad063034c8620db8$export$629b0a497aa65267(date, timeZone) {\n return $ad063034c8620db8$export$ea39ec197993aef0(date, $ad063034c8620db8$export$d0bdf45af03a6ea3(timeZone));\n}\nconst $ad063034c8620db8$var$DAY_MAP = {\n sun: 0,\n mon: 1,\n tue: 2,\n wed: 3,\n thu: 4,\n fri: 5,\n sat: 6\n};\nfunction $ad063034c8620db8$export$2061056d06d7cdf7(date, locale, firstDayOfWeek) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let weekStart = firstDayOfWeek ? $ad063034c8620db8$var$DAY_MAP[firstDayOfWeek] : $ad063034c8620db8$var$getWeekStart(locale);\n let dayOfWeek = Math.ceil(julian + 1 - weekStart) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n return dayOfWeek;\n}\nfunction $ad063034c8620db8$export$461939dd4422153(timeZone) {\n return (0, $d07e34cce18680fd$export$1b96692a1ba042ac)(Date.now(), timeZone);\n}\nfunction $ad063034c8620db8$export$d0bdf45af03a6ea3(timeZone) {\n return (0, $d07e34cce18680fd$export$93522d1a439f3617)($ad063034c8620db8$export$461939dd4422153(timeZone));\n}\nfunction $ad063034c8620db8$export$68781ddf31c0090f(a, b) {\n return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);\n}\nfunction $ad063034c8620db8$export$c19a80a9721b80f6(a, b) {\n return $ad063034c8620db8$var$timeToMs(a) - $ad063034c8620db8$var$timeToMs(b);\n}\nfunction $ad063034c8620db8$var$timeToMs(a) {\n return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;\n}\nfunction $ad063034c8620db8$export$126c91c941de7e(a, timeZone) {\n let ms = (0, $d07e34cce18680fd$export$5107c82f94518f5c)(a, timeZone);\n let tomorrow = a.add({\n days: 1\n });\n let tomorrowMs = (0, $d07e34cce18680fd$export$5107c82f94518f5c)(tomorrow, timeZone);\n return (tomorrowMs - ms) / 3600000;\n}\nlet $ad063034c8620db8$var$localTimeZone = null;\nlet $ad063034c8620db8$var$localTimeZoneOverride = false;\nfunction $ad063034c8620db8$export$aa8b41735afcabd2() {\n if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;\n return $ad063034c8620db8$var$localTimeZone;\n}\nfunction $ad063034c8620db8$export$61a9d83ceb59a3dd(timeZone) {\n $ad063034c8620db8$var$localTimeZoneOverride = true;\n $ad063034c8620db8$var$localTimeZone = timeZone;\n}\nfunction $ad063034c8620db8$export$55753838ffe79333() {\n $ad063034c8620db8$var$localTimeZoneOverride = false;\n $ad063034c8620db8$var$localTimeZone = null;\n}\nfunction $ad063034c8620db8$export$6ab69b273755230b() {\n return $ad063034c8620db8$var$localTimeZoneOverride;\n}\nfunction $ad063034c8620db8$export$a5a3b454ada2268e(date) {\n // Use `subtract` instead of `set` so we don't get constrained in an era.\n return date.subtract({\n days: date.day - 1\n });\n}\nfunction $ad063034c8620db8$export$a2258d9c4118825c(date) {\n return date.add({\n days: date.calendar.getDaysInMonth(date) - date.day\n });\n}\nfunction $ad063034c8620db8$export$f91e89d3d0406102(date) {\n return $ad063034c8620db8$export$a5a3b454ada2268e(date.subtract({\n months: date.month - 1\n }));\n}\nfunction $ad063034c8620db8$export$8b7aa55c66d5569e(date) {\n return $ad063034c8620db8$export$a2258d9c4118825c(date.add({\n months: date.calendar.getMonthsInYear(date) - date.month\n }));\n}\nfunction $ad063034c8620db8$export$5412ac11713b72ad(date) {\n if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);\n return 1;\n}\nfunction $ad063034c8620db8$export$b2f4953d301981d5(date) {\n if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);\n return 1;\n}\nfunction $ad063034c8620db8$export$42c81a444fbfb5d4(date, locale, firstDayOfWeek) {\n let dayOfWeek = $ad063034c8620db8$export$2061056d06d7cdf7(date, locale, firstDayOfWeek);\n return date.subtract({\n days: dayOfWeek\n });\n}\nfunction $ad063034c8620db8$export$ef8b6d9133084f4e(date, locale, firstDayOfWeek) {\n return $ad063034c8620db8$export$42c81a444fbfb5d4(date, locale, firstDayOfWeek).add({\n days: 6\n });\n}\nconst $ad063034c8620db8$var$cachedRegions = new Map();\nconst $ad063034c8620db8$var$cachedWeekInfo = new Map();\nfunction $ad063034c8620db8$var$getRegion(locale) {\n // If the Intl.Locale API is available, use it to get the region for the locale.\n // @ts-ignore\n if (Intl.Locale) {\n // Constructing an Intl.Locale is expensive, so cache the result.\n let region = $ad063034c8620db8$var$cachedRegions.get(locale);\n if (!region) {\n // @ts-ignore\n region = new Intl.Locale(locale).maximize().region;\n if (region) $ad063034c8620db8$var$cachedRegions.set(locale, region);\n }\n return region;\n }\n // If not, just try splitting the string.\n // If the second part of the locale string is 'u',\n // then this is a unicode extension, so ignore it.\n // Otherwise, it should be the region.\n let part = locale.split('-')[1];\n return part === 'u' ? undefined : part;\n}\nfunction $ad063034c8620db8$var$getWeekStart(locale) {\n // TODO: use Intl.Locale for this once browsers support the weekInfo property\n // https://github.com/tc39/proposal-intl-locale-info\n let weekInfo = $ad063034c8620db8$var$cachedWeekInfo.get(locale);\n if (!weekInfo) {\n if (Intl.Locale) {\n // @ts-ignore\n let localeInst = new Intl.Locale(locale);\n if ('getWeekInfo' in localeInst) {\n // @ts-expect-error\n weekInfo = localeInst.getWeekInfo();\n if (weekInfo) {\n $ad063034c8620db8$var$cachedWeekInfo.set(locale, weekInfo);\n return weekInfo.firstDay;\n }\n }\n }\n let region = $ad063034c8620db8$var$getRegion(locale);\n if (locale.includes('-fw-')) {\n // pull the value for the attribute fw from strings such as en-US-u-ca-iso8601-fw-tue or en-US-u-ca-iso8601-fw-mon-nu-thai\n // where the fw attribute could be followed by another unicode locale extension or not\n let day = locale.split('-fw-')[1].split('-')[0];\n if (day === 'mon') weekInfo = {\n firstDay: 1\n };\n else if (day === 'tue') weekInfo = {\n firstDay: 2\n };\n else if (day === 'wed') weekInfo = {\n firstDay: 3\n };\n else if (day === 'thu') weekInfo = {\n firstDay: 4\n };\n else if (day === 'fri') weekInfo = {\n firstDay: 5\n };\n else if (day === 'sat') weekInfo = {\n firstDay: 6\n };\n else weekInfo = {\n firstDay: 0\n };\n } else if (locale.includes('-ca-iso8601')) weekInfo = {\n firstDay: 1\n };\n else weekInfo = {\n firstDay: region ? (0, $d2ca8165c9aa885a$export$7a5acbd77d414bd9)[region] || 0 : 0\n };\n $ad063034c8620db8$var$cachedWeekInfo.set(locale, weekInfo);\n }\n return weekInfo.firstDay;\n}\nfunction $ad063034c8620db8$export$ccc1b2479e7dd654(date, locale, firstDayOfWeek) {\n let days = date.calendar.getDaysInMonth(date);\n return Math.ceil(($ad063034c8620db8$export$2061056d06d7cdf7($ad063034c8620db8$export$a5a3b454ada2268e(date), locale, firstDayOfWeek) + days) / 7);\n}\nfunction $ad063034c8620db8$export$5c333a116e949cdd(a, b) {\n if (a && b) return a.compare(b) <= 0 ? a : b;\n return a || b;\n}\nfunction $ad063034c8620db8$export$a75f2bff57811055(a, b) {\n if (a && b) return a.compare(b) >= 0 ? a : b;\n return a || b;\n}\nconst $ad063034c8620db8$var$WEEKEND_DATA = {\n AF: [\n 4,\n 5\n ],\n AE: [\n 5,\n 6\n ],\n BH: [\n 5,\n 6\n ],\n DZ: [\n 5,\n 6\n ],\n EG: [\n 5,\n 6\n ],\n IL: [\n 5,\n 6\n ],\n IQ: [\n 5,\n 6\n ],\n IR: [\n 5,\n 5\n ],\n JO: [\n 5,\n 6\n ],\n KW: [\n 5,\n 6\n ],\n LY: [\n 5,\n 6\n ],\n OM: [\n 5,\n 6\n ],\n QA: [\n 5,\n 6\n ],\n SA: [\n 5,\n 6\n ],\n SD: [\n 5,\n 6\n ],\n SY: [\n 5,\n 6\n ],\n YE: [\n 5,\n 6\n ]\n};\nfunction $ad063034c8620db8$export$618d60ea299da42(date, locale) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n let region = $ad063034c8620db8$var$getRegion(locale);\n // Use Intl.Locale for this once weekInfo is supported.\n // https://github.com/tc39/proposal-intl-locale-info\n let [start, end] = $ad063034c8620db8$var$WEEKEND_DATA[region] || [\n 6,\n 0\n ];\n return dayOfWeek === start || dayOfWeek === end;\n}\nfunction $ad063034c8620db8$export$ee9d87258e1d19ed(date, locale) {\n return !$ad063034c8620db8$export$618d60ea299da42(date, locale);\n}\n\n\nexport {$ad063034c8620db8$export$ea39ec197993aef0 as isSameDay, $ad063034c8620db8$export$a18c89cbd24170ff as isSameMonth, $ad063034c8620db8$export$a5a3b454ada2268e as startOfMonth, $ad063034c8620db8$export$5841f9eb9773f25f as isSameYear, $ad063034c8620db8$export$f91e89d3d0406102 as startOfYear, $ad063034c8620db8$export$91b62ebf2ba703ee as isEqualDay, $ad063034c8620db8$export$dbc69fd56b53d5e as isEqualCalendar, $ad063034c8620db8$export$5a8da0c44a3afdf2 as isEqualMonth, $ad063034c8620db8$export$ea840f5a6dda8147 as isEqualYear, $ad063034c8620db8$export$629b0a497aa65267 as isToday, $ad063034c8620db8$export$d0bdf45af03a6ea3 as today, $ad063034c8620db8$export$2061056d06d7cdf7 as getDayOfWeek, $ad063034c8620db8$export$461939dd4422153 as now, $ad063034c8620db8$export$68781ddf31c0090f as compareDate, $ad063034c8620db8$export$c19a80a9721b80f6 as compareTime, $ad063034c8620db8$export$126c91c941de7e as getHoursInDay, $ad063034c8620db8$export$aa8b41735afcabd2 as getLocalTimeZone, $ad063034c8620db8$export$61a9d83ceb59a3dd as setLocalTimeZone, $ad063034c8620db8$export$55753838ffe79333 as resetLocalTimeZone, $ad063034c8620db8$export$6ab69b273755230b as isLocalTimeZoneOverridden, $ad063034c8620db8$export$a2258d9c4118825c as endOfMonth, $ad063034c8620db8$export$8b7aa55c66d5569e as endOfYear, $ad063034c8620db8$export$5412ac11713b72ad as getMinimumMonthInYear, $ad063034c8620db8$export$b2f4953d301981d5 as getMinimumDayInMonth, $ad063034c8620db8$export$42c81a444fbfb5d4 as startOfWeek, $ad063034c8620db8$export$ef8b6d9133084f4e as endOfWeek, $ad063034c8620db8$export$ccc1b2479e7dd654 as getWeeksInMonth, $ad063034c8620db8$export$5c333a116e949cdd as minDate, $ad063034c8620db8$export$a75f2bff57811055 as maxDate, $ad063034c8620db8$export$618d60ea299da42 as isWeekend, $ad063034c8620db8$export$ee9d87258e1d19ed as isWeekday};\n//# sourceMappingURL=queries.mjs.map\n"],"names":[],"mappings":";;AAyCA,SAAS,wCAAwC,CAAC,CAAC,EAAE,CAAC,EAAE;AACxD,IAAI,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;AAC5E;AAsBA,SAAS,wCAAwC,CAAC,QAAQ,EAAE;AAC5D,IAAI,OAAO,CAAI,yCAAyC,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC;AAC/E;AACA,SAAS,yCAAyC,CAAC,QAAQ,EAAE;AAC7D,IAAI,OAAO,CAAI,yCAAyC,EAAE,wCAAwC,CAAC,QAAQ,CAAC,CAAC;AAC7G;AACA,SAAS,yCAAyC,CAAC,CAAC,EAAE,CAAC,EAAE;AACzD,IAAI,OAAO,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC,CAAC;AAChE;AACA,SAAS,yCAAyC,CAAC,CAAC,EAAE,CAAC,EAAE;AACzD,IAAI,OAAO,8BAA8B,CAAC,CAAC,CAAC,GAAG,8BAA8B,CAAC,CAAC,CAAC;AAChF;AACA,SAAS,8BAA8B,CAAC,CAAC,EAAE;AAC3C,IAAI,OAAO,CAAC,CAAC,IAAI,GAAG,OAAO,GAAG,CAAC,CAAC,MAAM,GAAG,KAAK,GAAG,CAAC,CAAC,MAAM,GAAG,IAAI,GAAG,CAAC,CAAC,WAAW;AAChF;AASA,IAAI,mCAAmC,GAAG,IAAI;AAC9C,IAAI,2CAA2C,GAAG,KAAK;AACvD,SAAS,yCAAyC,GAAG;AACrD,IAAI,IAAI,mCAAmC,IAAI,IAAI,EAAE,mCAAmC,GAAG,IAAI,IAAI,CAAC,cAAc,EAAE,CAAC,eAAe,EAAE,CAAC,QAAQ;AAC/I,IAAI,OAAO,mCAAmC;AAC9C;AASA,SAAS,yCAAyC,GAAG;AACrD,IAAI,OAAO,2CAA2C;AACtD;;;;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"queries.js","sources":["../../../../../../../../node_modules/@internationalized/date/dist/private/queries.mjs"],"sourcesContent":["import {fromAbsolute as $d07e34cce18680fd$export$1b96692a1ba042ac, toAbsolute as $d07e34cce18680fd$export$5107c82f94518f5c, toCalendar as $d07e34cce18680fd$export$b4a036af3fc0b032, toCalendarDate as $d07e34cce18680fd$export$93522d1a439f3617} from \"./conversion.mjs\";\nimport {weekStartData as $d2ca8165c9aa885a$export$7a5acbd77d414bd9} from \"./weekStartData.mjs\";\n\n/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */ \n\nfunction $ad063034c8620db8$export$ea39ec197993aef0(a, b) {\n b = (0, $d07e34cce18680fd$export$b4a036af3fc0b032)(b, a.calendar);\n return a.era === b.era && a.year === b.year && a.month === b.month && a.day === b.day;\n}\nfunction $ad063034c8620db8$export$a18c89cbd24170ff(a, b) {\n b = (0, $d07e34cce18680fd$export$b4a036af3fc0b032)(b, a.calendar);\n // In the Japanese calendar, months can span multiple eras/years, so only compare the first of the month.\n a = $ad063034c8620db8$export$a5a3b454ada2268e(a);\n b = $ad063034c8620db8$export$a5a3b454ada2268e(b);\n return a.era === b.era && a.year === b.year && a.month === b.month;\n}\nfunction $ad063034c8620db8$export$5841f9eb9773f25f(a, b) {\n b = (0, $d07e34cce18680fd$export$b4a036af3fc0b032)(b, a.calendar);\n a = $ad063034c8620db8$export$f91e89d3d0406102(a);\n b = $ad063034c8620db8$export$f91e89d3d0406102(b);\n return a.era === b.era && a.year === b.year;\n}\nfunction $ad063034c8620db8$export$91b62ebf2ba703ee(a, b) {\n return $ad063034c8620db8$export$dbc69fd56b53d5e(a.calendar, b.calendar) && $ad063034c8620db8$export$ea39ec197993aef0(a, b);\n}\nfunction $ad063034c8620db8$export$5a8da0c44a3afdf2(a, b) {\n return $ad063034c8620db8$export$dbc69fd56b53d5e(a.calendar, b.calendar) && $ad063034c8620db8$export$a18c89cbd24170ff(a, b);\n}\nfunction $ad063034c8620db8$export$ea840f5a6dda8147(a, b) {\n return $ad063034c8620db8$export$dbc69fd56b53d5e(a.calendar, b.calendar) && $ad063034c8620db8$export$5841f9eb9773f25f(a, b);\n}\nfunction $ad063034c8620db8$export$dbc69fd56b53d5e(a, b) {\n return a.isEqual?.(b) ?? b.isEqual?.(a) ?? a.identifier === b.identifier;\n}\nfunction $ad063034c8620db8$export$629b0a497aa65267(date, timeZone) {\n return $ad063034c8620db8$export$ea39ec197993aef0(date, $ad063034c8620db8$export$d0bdf45af03a6ea3(timeZone));\n}\nconst $ad063034c8620db8$var$DAY_MAP = {\n sun: 0,\n mon: 1,\n tue: 2,\n wed: 3,\n thu: 4,\n fri: 5,\n sat: 6\n};\nfunction $ad063034c8620db8$export$2061056d06d7cdf7(date, locale, firstDayOfWeek) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let weekStart = firstDayOfWeek ? $ad063034c8620db8$var$DAY_MAP[firstDayOfWeek] : $ad063034c8620db8$var$getWeekStart(locale);\n let dayOfWeek = Math.ceil(julian + 1 - weekStart) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n return dayOfWeek;\n}\nfunction $ad063034c8620db8$export$461939dd4422153(timeZone) {\n return (0, $d07e34cce18680fd$export$1b96692a1ba042ac)(Date.now(), timeZone);\n}\nfunction $ad063034c8620db8$export$d0bdf45af03a6ea3(timeZone) {\n return (0, $d07e34cce18680fd$export$93522d1a439f3617)($ad063034c8620db8$export$461939dd4422153(timeZone));\n}\nfunction $ad063034c8620db8$export$68781ddf31c0090f(a, b) {\n return a.calendar.toJulianDay(a) - b.calendar.toJulianDay(b);\n}\nfunction $ad063034c8620db8$export$c19a80a9721b80f6(a, b) {\n return $ad063034c8620db8$var$timeToMs(a) - $ad063034c8620db8$var$timeToMs(b);\n}\nfunction $ad063034c8620db8$var$timeToMs(a) {\n return a.hour * 3600000 + a.minute * 60000 + a.second * 1000 + a.millisecond;\n}\nfunction $ad063034c8620db8$export$126c91c941de7e(a, timeZone) {\n let ms = (0, $d07e34cce18680fd$export$5107c82f94518f5c)(a, timeZone);\n let tomorrow = a.add({\n days: 1\n });\n let tomorrowMs = (0, $d07e34cce18680fd$export$5107c82f94518f5c)(tomorrow, timeZone);\n return (tomorrowMs - ms) / 3600000;\n}\nlet $ad063034c8620db8$var$localTimeZone = null;\nlet $ad063034c8620db8$var$localTimeZoneOverride = false;\nfunction $ad063034c8620db8$export$aa8b41735afcabd2() {\n if ($ad063034c8620db8$var$localTimeZone == null) $ad063034c8620db8$var$localTimeZone = new Intl.DateTimeFormat().resolvedOptions().timeZone;\n return $ad063034c8620db8$var$localTimeZone;\n}\nfunction $ad063034c8620db8$export$61a9d83ceb59a3dd(timeZone) {\n $ad063034c8620db8$var$localTimeZoneOverride = true;\n $ad063034c8620db8$var$localTimeZone = timeZone;\n}\nfunction $ad063034c8620db8$export$55753838ffe79333() {\n $ad063034c8620db8$var$localTimeZoneOverride = false;\n $ad063034c8620db8$var$localTimeZone = null;\n}\nfunction $ad063034c8620db8$export$6ab69b273755230b() {\n return $ad063034c8620db8$var$localTimeZoneOverride;\n}\nfunction $ad063034c8620db8$export$a5a3b454ada2268e(date) {\n // Use `subtract` instead of `set` so we don't get constrained in an era.\n return date.subtract({\n days: date.day - 1\n });\n}\nfunction $ad063034c8620db8$export$a2258d9c4118825c(date) {\n return date.add({\n days: date.calendar.getDaysInMonth(date) - date.day\n });\n}\nfunction $ad063034c8620db8$export$f91e89d3d0406102(date) {\n return $ad063034c8620db8$export$a5a3b454ada2268e(date.subtract({\n months: date.month - 1\n }));\n}\nfunction $ad063034c8620db8$export$8b7aa55c66d5569e(date) {\n return $ad063034c8620db8$export$a2258d9c4118825c(date.add({\n months: date.calendar.getMonthsInYear(date) - date.month\n }));\n}\nfunction $ad063034c8620db8$export$5412ac11713b72ad(date) {\n if (date.calendar.getMinimumMonthInYear) return date.calendar.getMinimumMonthInYear(date);\n return 1;\n}\nfunction $ad063034c8620db8$export$b2f4953d301981d5(date) {\n if (date.calendar.getMinimumDayInMonth) return date.calendar.getMinimumDayInMonth(date);\n return 1;\n}\nfunction $ad063034c8620db8$export$42c81a444fbfb5d4(date, locale, firstDayOfWeek) {\n let dayOfWeek = $ad063034c8620db8$export$2061056d06d7cdf7(date, locale, firstDayOfWeek);\n return date.subtract({\n days: dayOfWeek\n });\n}\nfunction $ad063034c8620db8$export$ef8b6d9133084f4e(date, locale, firstDayOfWeek) {\n return $ad063034c8620db8$export$42c81a444fbfb5d4(date, locale, firstDayOfWeek).add({\n days: 6\n });\n}\nconst $ad063034c8620db8$var$cachedRegions = new Map();\nconst $ad063034c8620db8$var$cachedWeekInfo = new Map();\nfunction $ad063034c8620db8$var$getRegion(locale) {\n // If the Intl.Locale API is available, use it to get the region for the locale.\n // @ts-ignore\n if (Intl.Locale) {\n // Constructing an Intl.Locale is expensive, so cache the result.\n let region = $ad063034c8620db8$var$cachedRegions.get(locale);\n if (!region) {\n // @ts-ignore\n region = new Intl.Locale(locale).maximize().region;\n if (region) $ad063034c8620db8$var$cachedRegions.set(locale, region);\n }\n return region;\n }\n // If not, just try splitting the string.\n // If the second part of the locale string is 'u',\n // then this is a unicode extension, so ignore it.\n // Otherwise, it should be the region.\n let part = locale.split('-')[1];\n return part === 'u' ? undefined : part;\n}\nfunction $ad063034c8620db8$var$getWeekStart(locale) {\n // TODO: use Intl.Locale for this once browsers support the weekInfo property\n // https://github.com/tc39/proposal-intl-locale-info\n let weekInfo = $ad063034c8620db8$var$cachedWeekInfo.get(locale);\n if (!weekInfo) {\n if (Intl.Locale) {\n // @ts-ignore\n let localeInst = new Intl.Locale(locale);\n if ('getWeekInfo' in localeInst) {\n // @ts-expect-error\n weekInfo = localeInst.getWeekInfo();\n if (weekInfo) {\n $ad063034c8620db8$var$cachedWeekInfo.set(locale, weekInfo);\n return weekInfo.firstDay;\n }\n }\n }\n let region = $ad063034c8620db8$var$getRegion(locale);\n if (locale.includes('-fw-')) {\n // pull the value for the attribute fw from strings such as en-US-u-ca-iso8601-fw-tue or en-US-u-ca-iso8601-fw-mon-nu-thai\n // where the fw attribute could be followed by another unicode locale extension or not\n let day = locale.split('-fw-')[1].split('-')[0];\n if (day === 'mon') weekInfo = {\n firstDay: 1\n };\n else if (day === 'tue') weekInfo = {\n firstDay: 2\n };\n else if (day === 'wed') weekInfo = {\n firstDay: 3\n };\n else if (day === 'thu') weekInfo = {\n firstDay: 4\n };\n else if (day === 'fri') weekInfo = {\n firstDay: 5\n };\n else if (day === 'sat') weekInfo = {\n firstDay: 6\n };\n else weekInfo = {\n firstDay: 0\n };\n } else if (locale.includes('-ca-iso8601')) weekInfo = {\n firstDay: 1\n };\n else weekInfo = {\n firstDay: region ? (0, $d2ca8165c9aa885a$export$7a5acbd77d414bd9)[region] || 0 : 0\n };\n $ad063034c8620db8$var$cachedWeekInfo.set(locale, weekInfo);\n }\n return weekInfo.firstDay;\n}\nfunction $ad063034c8620db8$export$ccc1b2479e7dd654(date, locale, firstDayOfWeek) {\n let days = date.calendar.getDaysInMonth(date);\n return Math.ceil(($ad063034c8620db8$export$2061056d06d7cdf7($ad063034c8620db8$export$a5a3b454ada2268e(date), locale, firstDayOfWeek) + days) / 7);\n}\nfunction $ad063034c8620db8$export$5c333a116e949cdd(a, b) {\n if (a && b) return a.compare(b) <= 0 ? a : b;\n return a || b;\n}\nfunction $ad063034c8620db8$export$a75f2bff57811055(a, b) {\n if (a && b) return a.compare(b) >= 0 ? a : b;\n return a || b;\n}\nconst $ad063034c8620db8$var$WEEKEND_DATA = {\n AF: [\n 4,\n 5\n ],\n AE: [\n 5,\n 6\n ],\n BH: [\n 5,\n 6\n ],\n DZ: [\n 5,\n 6\n ],\n EG: [\n 5,\n 6\n ],\n IL: [\n 5,\n 6\n ],\n IQ: [\n 5,\n 6\n ],\n IR: [\n 5,\n 5\n ],\n JO: [\n 5,\n 6\n ],\n KW: [\n 5,\n 6\n ],\n LY: [\n 5,\n 6\n ],\n OM: [\n 5,\n 6\n ],\n QA: [\n 5,\n 6\n ],\n SA: [\n 5,\n 6\n ],\n SD: [\n 5,\n 6\n ],\n SY: [\n 5,\n 6\n ],\n YE: [\n 5,\n 6\n ]\n};\nfunction $ad063034c8620db8$export$618d60ea299da42(date, locale) {\n let julian = date.calendar.toJulianDay(date);\n // If julian is negative, then julian % 7 will be negative, so we adjust\n // accordingly. Julian day 0 is Monday.\n let dayOfWeek = Math.ceil(julian + 1) % 7;\n if (dayOfWeek < 0) dayOfWeek += 7;\n let region = $ad063034c8620db8$var$getRegion(locale);\n // Use Intl.Locale for this once weekInfo is supported.\n // https://github.com/tc39/proposal-intl-locale-info\n let [start, end] = $ad063034c8620db8$var$WEEKEND_DATA[region] || [\n 6,\n 0\n ];\n return dayOfWeek === start || dayOfWeek === end;\n}\nfunction $ad063034c8620db8$export$ee9d87258e1d19ed(date, locale) {\n return !$ad063034c8620db8$export$618d60ea299da42(date, locale);\n}\n\n\nexport {$ad063034c8620db8$export$ea39ec197993aef0 as isSameDay, $ad063034c8620db8$export$a18c89cbd24170ff as isSameMonth, $ad063034c8620db8$export$a5a3b454ada2268e as startOfMonth, $ad063034c8620db8$export$5841f9eb9773f25f as isSameYear, $ad063034c8620db8$export$f91e89d3d0406102 as startOfYear, $ad063034c8620db8$export$91b62ebf2ba703ee as isEqualDay, $ad063034c8620db8$export$dbc69fd56b53d5e as isEqualCalendar, $ad063034c8620db8$export$5a8da0c44a3afdf2 as isEqualMonth, $ad063034c8620db8$export$ea840f5a6dda8147 as isEqualYear, $ad063034c8620db8$export$629b0a497aa65267 as isToday, $ad063034c8620db8$export$d0bdf45af03a6ea3 as today, $ad063034c8620db8$export$2061056d06d7cdf7 as getDayOfWeek, $ad063034c8620db8$export$461939dd4422153 as now, $ad063034c8620db8$export$68781ddf31c0090f as compareDate, $ad063034c8620db8$export$c19a80a9721b80f6 as compareTime, $ad063034c8620db8$export$126c91c941de7e as getHoursInDay, $ad063034c8620db8$export$aa8b41735afcabd2 as getLocalTimeZone, $ad063034c8620db8$export$61a9d83ceb59a3dd as setLocalTimeZone, $ad063034c8620db8$export$55753838ffe79333 as resetLocalTimeZone, $ad063034c8620db8$export$6ab69b273755230b as isLocalTimeZoneOverridden, $ad063034c8620db8$export$a2258d9c4118825c as endOfMonth, $ad063034c8620db8$export$8b7aa55c66d5569e as endOfYear, $ad063034c8620db8$export$5412ac11713b72ad as getMinimumMonthInYear, $ad063034c8620db8$export$b2f4953d301981d5 as getMinimumDayInMonth, $ad063034c8620db8$export$42c81a444fbfb5d4 as startOfWeek, $ad063034c8620db8$export$ef8b6d9133084f4e as endOfWeek, $ad063034c8620db8$export$ccc1b2479e7dd654 as getWeeksInMonth, $ad063034c8620db8$export$5c333a116e949cdd as minDate, $ad063034c8620db8$export$a75f2bff57811055 as maxDate, $ad063034c8620db8$export$618d60ea299da42 as isWeekend, $ad063034c8620db8$export$ee9d87258e1d19ed as isWeekday};\n//# sourceMappingURL=queries.mjs.map\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,SAAS,yCAAyC,CAAC,CAAC,EAAE,CAAC,EAAE;AACzD,IAAI,CAAC,GAAG,CAAI,yCAAyC,EAAE,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC;AACrE,IAAI,OAAO,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC,IAAI,KAAK,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,KAAK,CAAC,CAAC,GAAG;AACzF;AAuBA,SAAS,wCAAwC,CAAC,CAAC,EAAE,CAAC,EAAE;AACxD,IAAI,OAAO,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,OAAO,GAAG,CAAC,CAAC,IAAI,CAAC,CAAC,UAAU,KAAK,CAAC,CAAC,UAAU;AAC5E;AAsBA,SAAS,wCAAwC,CAAC,QAAQ,EAAE;AAC5D,IAAI,OAAO,CAAI,yCAAyC,EAAE,IAAI,CAAC,GAAG,EAAE,EAAE,QAAQ,CAAC;AAC/E;AACA,SAAS,yCAAyC,CAAC,QAAQ,EAAE;AAC7D,IAAI,OAAO,CAAI,yCAAyC,EAAE,wCAAwC,CAAC,QAAQ,CAAC,CAAC;AAC7G;AACA,SAAS,yCAAyC,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