@ember-formwright/power-calendar 0.0.0-stage → 2.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,54 @@
1
+ # @ember-formwright/power-calendar
2
+
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - 199233b: Fields type their control against their path. `@control` must be a control that stores what the
8
+ path holds, and a field takes only its control's args, typed for that path. `ControlSignature`
9
+ is split into the wiring every control gets and its own args, and registered names are declared
10
+ in `FormwrightControls` (or `FormwrightChoiceControls<T>`, for controls whose value follows the
11
+ path). The add-ons declare their default names. See MIGRATION.md.
12
+
13
+ ### Minor Changes
14
+
15
+ - 332f045: Built-in strings are translatable. Register a translator as `translator:main` (an object with
16
+ `locale` and `t(message, values)`) and Submit, Reset, the ✔ and ✘ buttons' names, the file
17
+ upload's prompts, the rich-text toolbar and the date picker's trigger name all go through it;
18
+ without one they stay English. Each package exports its messages at `./messages`, with ids
19
+ `formwright.<component>.<name>`, and `@ember-formwright/ember` exports `translate`, `format` and
20
+ the `Message` and `Translator` types.
21
+
22
+ Strings that couldn't be changed before take arguments, which win over the translator:
23
+ `@applyLabel` and `@cancelLabel` on fields; `@dropLabel`, `@dropHint`, `@retryLabel`,
24
+ `@removeLabel`, `@uploadingLabel` and `@rejectedLabel` on the file upload control;
25
+ `@toolbarLabel` and `@toolLabels` on the rich-text control.
26
+
27
+ `@ember-formwright/test-support` adds `registerTranslator` and `pseudoTranslator`, to check in a
28
+ test that every string goes through the translator.
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [332f045]
33
+ - Updated dependencies [199233b]
34
+ - @ember-formwright/ember@2.0.0
35
+ - @ember-formwright/test-support@2.0.0
36
+
37
+ ## 1.3.0
38
+
39
+ ### Minor Changes
40
+
41
+ - 5db314e: New package: `date-picker` and `date-range` controls on ember-power-calendar 2. A button
42
+ trigger, named by the field's label, opens the calendar in an ember-basic-dropdown; values are
43
+ ISO `YYYY-MM-DD` strings (or `Date`s with `@storeDate`), and a range is `{ start, end }`. `@min`,
44
+ `@max`, `@locale`, `@disabledDates`, callouts and confirm-mode keyboard handling are supported.
45
+ Includes a `Date`/`Intl` date library for power-calendar (no moment or luxon), `formatDate` and
46
+ `formatDateRange` for inline display, a theme following the Formwright custom properties, and
47
+ `DatePickerHarness` at `@ember-formwright/power-calendar/test-support`.
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [aad9026]
52
+ - Updated dependencies [abc6560]
53
+ - @ember-formwright/ember@1.3.0
54
+ - @ember-formwright/test-support@1.3.0
package/LICENSE.md ADDED
@@ -0,0 +1,9 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2020
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
6
+
7
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
8
+
9
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,89 @@
1
- # Temporary Holding Version
1
+ # @ember-formwright/power-calendar
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Date and date-range pickers for Formwright, powered by
4
+ [ember-power-calendar](https://ember-power-calendar.com) 2 and ember-basic-dropdown. Dates are
5
+ handled with the browser's `Date` and `Intl`: no moment or luxon needed.
6
+
7
+ ```bash
8
+ npm install @ember-formwright/ember @ember-formwright/power-calendar ember-power-calendar ember-basic-dropdown ember-concurrency
9
+ ```
10
+
11
+ ```ts
12
+ // app/app.ts
13
+ import { registerPowerCalendarControls } from '@ember-formwright/power-calendar'
14
+ import 'ember-basic-dropdown/styles'
15
+ import '@ember-formwright/power-calendar/theme.css' // optional; after the Formwright theme
16
+
17
+ registerPowerCalendarControls() // @control="date-picker" and @control="date-range"
18
+ ```
19
+
20
+ The package types these names for Glint: which paths each fits, and which args it takes. If
21
+ you register under other names, [declare them](https://joegaudet.com/ember-formwright/guide/controls/custom-controls.md).
22
+
23
+ Render `<BasicDropdownWormhole />` (from `ember-basic-dropdown/components/basic-dropdown-wormhole`)
24
+ once in your application template; calendars open into it. In tests, add
25
+ `<div id="ember-basic-dropdown-wormhole"></div>` next to `#ember-testing` in `tests/index.html`.
26
+
27
+ ```gts
28
+ <f.Field @for="checkIn" @control="date-picker" @label="Check-in" @min={{this.today}} />
29
+
30
+ {{! stores { start, end } once both ends are chosen }}
31
+ <f.Field @for="stay" @control="date-range" @label="Stay" />
32
+
33
+ {{! a Date, for @attr('date'); weekends off }}
34
+ <f.Field @for="shipsOn" @control="date-picker" @label="Ships on" @format={{formatDate}} as |field|>
35
+ <field.Control @storeDate={{true}} @disabledDates={{array "Sat" "Sun"}} />
36
+ </f.Field>
37
+ ```
38
+
39
+ A date-picker stores an ISO `YYYY-MM-DD` string, a date-range `{ start, end }` of them; with
40
+ `@storeDate`, `Date`s at local midnight. Both read either. The field's `@min`, `@max` and
41
+ `@locale` apply. `field.Control` also takes `@dateFormat` (`Intl.DateTimeFormat` options for
42
+ the trigger), `@disabledDates`, `@startOfWeek`, `@renderInPlace`, and for a range `@minRange`
43
+ and `@maxRange` (in days).
44
+
45
+ `formatDate(value, { locale, format })` and `formatDateRange(value, { locale, format })` turn a
46
+ stored value into text, for a field's `@format` in inline mode.
47
+
48
+ ## Testing
49
+
50
+ ```ts
51
+ import { DatePickerHarness } from '@ember-formwright/power-calendar/test-support'
52
+
53
+ class BookingForm extends FormHarness {
54
+ @field(DatePickerHarness) declare checkIn: DatePickerHarness
55
+ @field(DatePickerHarness) declare stay: DatePickerHarness
56
+ }
57
+
58
+ await booking.checkIn.select('2026-03-04') // opens, pages to March 2026, clicks the 4th
59
+ await booking.stay.selectRange('2026-03-04', '2026-03-09')
60
+ assert.strictEqual(booking.checkIn.text, 'Mar 4, 2026')
61
+ ```
62
+
63
+ It also has `open()`, `close()`, `isOpen`, `month`, `nextMonth()`, `previousMonth()`,
64
+ `day(isoDate)`, `isDayDisabled(isoDate)` and `trigger`.
65
+
66
+ ## Behaviour and known limits
67
+
68
+ - **Date library.** ember-power-calendar needs a registered date library.
69
+ `registerPowerCalendarControls()` registers one built on `Date` and `Intl`
70
+ (`nativeDateLibrary`), unless the app registered its own (moment, luxon) first.
71
+ - **Labels.** The trigger is a `<button>`, so `<label for>` points at it and clicking the label
72
+ focuses it. Its `aria-label` is the field's label followed by what it shows
73
+ ("Check-in: Mar 4, 2026").
74
+ - **Focus.** Opening the calendar focuses the selected day, else today. Choosing a day closes
75
+ it and focuses the trigger. Inline and confirm modes focus the trigger.
76
+ - **Callouts.** In `@inline @callout` forms the calendar renders in place, inside the popover,
77
+ so a click on a day doesn't close the callout.
78
+ - **Keyboard.** While the calendar is open, Enter and Escape belong to it and don't reach the
79
+ field: with `@requireConfirm` or `@inline`, Enter on a day doesn't commit, and the first
80
+ Escape closes the calendar instead of cancelling the edit.
81
+ - **Ranges.** The first click starts a range, the second ends it; the ends are put in order.
82
+ Nothing is stored until both are chosen, and closing the calendar in between keeps the old
83
+ range.
84
+ - **Time zones.** Values are calendar days in local time. ISO strings carry no zone; a string
85
+ with a time (`2026-03-04T10:00Z`) is read by its date part.
86
+ - **Readonly.** There is no read-only calendar; like `select`, readonly disables the trigger.
87
+ - **Native submit.** The trigger is a button with no value; the wrapper carries `data-fw-name`
88
+ with the field's path.
89
+ - **Ember and power-calendar versions.** Ember 6.12+ and ember-power-calendar 2 only.
package/addon-main.cjs ADDED
@@ -0,0 +1,4 @@
1
+ 'use strict'
2
+
3
+ const { addonV1Shim } = require('@embroider/addon-shim')
4
+ module.exports = addonV1Shim(__dirname)
@@ -0,0 +1,5 @@
1
+ import { type DateLibrary } from 'ember-power-calendar/utils';
2
+ export declare const nativeDateLibrary: DateLibrary;
3
+ /** Registers the native date library, unless the app registered one already. */
4
+ export declare function ensureDateLibrary(): void;
5
+ //# sourceMappingURL=date-library.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"date-library.d.ts","sourceRoot":"","sources":["../src/date-library.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyC,KAAK,WAAW,EAAE,MAAM,4BAA4B,CAAA;AA0LpG,eAAO,MAAM,iBAAiB,EAAE,WAkC/B,CAAA;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC"}
@@ -0,0 +1,37 @@
1
+ /** A stored date: an ISO `YYYY-MM-DD` string, or a `Date` with `@storeDate`. */
2
+ export type DateValue = string | Date;
3
+ /** A stored range. Either end may be empty. */
4
+ export interface DateRangeValue<V extends DateValue = DateValue> {
5
+ start: V | null;
6
+ end: V | null;
7
+ }
8
+ /**
9
+ * The calendar day a value stands for, as a local `Date` at midnight: from a `Date`, or from
10
+ * a string starting with `YYYY-MM-DD` (the time, if any, is ignored). Anything else is
11
+ * `undefined`.
12
+ */
13
+ export declare function toDate(value: unknown): Date | undefined;
14
+ /** A local `Date` as `YYYY-MM-DD`. */
15
+ export declare function toIsoDate(date: Date): string;
16
+ /** Both ends of a stored range, as dates. */
17
+ export declare function toDateRange(value: unknown): {
18
+ start: Date | undefined;
19
+ end: Date | undefined;
20
+ };
21
+ export interface FormatOptions {
22
+ /** A BCP 47 locale; default the browser's. */
23
+ locale?: string;
24
+ /** `Intl.DateTimeFormat` options; default `{ dateStyle: 'medium' }`. */
25
+ format?: Intl.DateTimeFormatOptions;
26
+ }
27
+ /**
28
+ * A stored date as text, e.g. "Mar 4, 2026"; empty for no date. Pass it to a field's
29
+ * `@format` for inline mode.
30
+ */
31
+ export declare function formatDate(value: unknown, options?: FormatOptions): string;
32
+ /**
33
+ * A stored range as text, e.g. "Mar 4 – 9, 2026"; one end with a dash when the other is
34
+ * empty, and empty for no range.
35
+ */
36
+ export declare function formatDateRange(value: unknown, options?: FormatOptions): string;
37
+ //# sourceMappingURL=dates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dates.d.ts","sourceRoot":"","sources":["../src/dates.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,IAAI,CAAA;AAErC,+CAA+C;AAC/C,MAAM,WAAW,cAAc,CAAC,CAAC,SAAS,SAAS,GAAG,SAAS;IAC7D,KAAK,EAAE,CAAC,GAAG,IAAI,CAAA;IACf,GAAG,EAAE,CAAC,GAAG,IAAI,CAAA;CACd;AAID;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,GAAG,SAAS,CAWvD;AAED,sCAAsC;AACtC,wBAAgB,SAAS,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAG5C;AAED,6CAA6C;AAC7C,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG;IAAE,KAAK,EAAE,IAAI,GAAG,SAAS,CAAC;IAAC,GAAG,EAAE,IAAI,GAAG,SAAS,CAAA;CAAE,CAG9F;AAED,MAAM,WAAW,aAAa;IAC5B,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,wEAAwE;IACxE,MAAM,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAA;CACpC;AAQD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAG9E;AAED;;;GAGG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,GAAE,aAAkB,GAAG,MAAM,CAOnF"}
@@ -0,0 +1,108 @@
1
+ import Component from '@glimmer/component';
2
+ import type { Dropdown } from 'ember-basic-dropdown/types';
3
+ import type { NormalizeCalendarValue, NormalizeRangeActionValue, PowerCalendarDay } from 'ember-power-calendar/utils';
4
+ import { type ControlSignature, type OwnArgs, type RangeArgs } from '@ember-formwright/ember';
5
+ import { type DateRangeValue, type DateValue } from './dates.ts';
6
+ export { formatDate, formatDateRange, toDate, toIsoDate, type DateRangeValue, type DateValue, type FormatOptions, } from './dates.ts';
7
+ export { nativeDateLibrary } from './date-library.ts';
8
+ export interface DatePickerControlSignature {
9
+ /** A wrapper around the trigger and its dropdown, carrying the control's hooks and attributes. */
10
+ Element: HTMLDivElement;
11
+ Args: ControlSignature['Args'] & Pick<RangeArgs, 'min' | 'max'> & {
12
+ /** Formats the trigger's text and names the weekdays. Default the browser's locale. */
13
+ locale?: string;
14
+ /** Store `Date`s rather than ISO `YYYY-MM-DD` strings. */
15
+ storeDate?: boolean;
16
+ /** `Intl.DateTimeFormat` options for the trigger's text. Default `{ dateStyle: 'medium' }`. */
17
+ dateFormat?: Intl.DateTimeFormatOptions;
18
+ /** Days that can't be chosen: dates, or English weekday names ('Sat', 'Sun'). */
19
+ disabledDates?: Array<Date | string>;
20
+ /** First day of the week, 0 (Sunday) to 6. Default: the locale's. */
21
+ startOfWeek?: number;
22
+ /** Render the dropdown in place rather than in the wormhole. Forced in a callout. */
23
+ renderInPlace?: boolean;
24
+ /** date-range: the shortest and longest range, in days. Default: no limits. */
25
+ minRange?: number;
26
+ maxRange?: number;
27
+ };
28
+ }
29
+ /**
30
+ * A Formwright control: a button showing the date, opening an ember-power-calendar in an
31
+ * ember-basic-dropdown. It stores an ISO `YYYY-MM-DD` string (a `Date` with `@storeDate`),
32
+ * and reads either.
33
+ */
34
+ export declare class DatePickerControl extends Component<DatePickerControlSignature> {
35
+ /** The month shown, once the user has moved away from the value's. */
36
+ center: Date | null;
37
+ /** date-range: the start chosen before the end, kept here until the range is complete. */
38
+ pending: {
39
+ start: Date | null;
40
+ end: Date | null;
41
+ } | null;
42
+ get isRange(): boolean;
43
+ get selectedDate(): Date | undefined;
44
+ get selectedRange(): {
45
+ start: Date | null;
46
+ end: Date | null;
47
+ };
48
+ get currentCenter(): Date;
49
+ get text(): string;
50
+ /**
51
+ * The trigger's name: the label, then what it shows (the value, else the placeholder), so
52
+ * both are read out. Without a label, the button's text names it.
53
+ */
54
+ get ariaLabel(): string | undefined;
55
+ get disabled(): boolean;
56
+ /** Inside a callout the dropdown must stay inside the popover (the top layer). */
57
+ get renderInPlace(): boolean | undefined;
58
+ get minDate(): Date | undefined;
59
+ get maxDate(): Date | undefined;
60
+ get startOfWeek(): string | undefined;
61
+ get minRange(): number;
62
+ store(date: Date | null | undefined): DateValue | null;
63
+ onCenterChange: (value: NormalizeCalendarValue) => void;
64
+ onSelect: (dropdown: Dropdown, day: PowerCalendarDay) => void;
65
+ onSelectRange: (dropdown: Dropdown, value: NormalizeRangeActionValue) => void;
66
+ /** Closes the dropdown and puts focus back on the trigger. */
67
+ done(dropdown: Dropdown): void;
68
+ onClose: () => void;
69
+ /**
70
+ * While the dropdown is open, Enter and Escape belong to it: Enter chooses the focused day,
71
+ * Escape closes the dropdown. Neither reaches the field, which would commit or cancel.
72
+ */
73
+ onKeydown: (dropdown: Dropdown, event: KeyboardEvent) => void;
74
+ /** Makes our own `<button>` the dropdown's trigger, for positioning and outside clicks. */
75
+ registerTrigger: import("ember-modifier").FunctionBasedModifier<{
76
+ Args: {
77
+ Positional: [Dropdown];
78
+ Named: import("ember-modifier/-private/signature").EmptyObject;
79
+ };
80
+ Element: HTMLElement;
81
+ }>;
82
+ }
83
+ /** The same control, choosing a range: stores `{ start, end }` once both ends are chosen. */
84
+ export declare class DateRangeControl extends DatePickerControl {
85
+ get isRange(): boolean;
86
+ }
87
+ /**
88
+ * Makes `@control="date-picker"` and `@control="date-range"` available to every form, and
89
+ * gives ember-power-calendar a date library built on `Date` and `Intl` unless the app
90
+ * registered one. Call once, e.g. in app.ts.
91
+ */
92
+ export declare function registerPowerCalendarControls({ single, range, }?: {
93
+ single?: string;
94
+ range?: string;
95
+ }): void;
96
+ type DatePickerArgs = OwnArgs<DatePickerControlSignature>;
97
+ declare module '@ember-formwright/ember' {
98
+ interface FormwrightChoiceControls<T> {
99
+ /**
100
+ * `registerPowerCalendarControls()`'s default names; declare yours if you pass others. A
101
+ * date picker stores an ISO date string, or a `Date` with `@storeDate`; once picked, a
102
+ * date is never cleared.
103
+ */
104
+ 'date-picker': ControlSignature<Extract<NonNullable<T>, DateValue>, DatePickerArgs, HTMLDivElement>;
105
+ 'date-range': ControlSignature<Extract<NonNullable<T>, DateRangeValue>, DatePickerArgs, HTMLDivElement>;
106
+ }
107
+ }
108
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.gts"],"names":[],"mappings":"AAmVA,OAAO,SAAS,MAAM,oBAAoB,CAAA;AAM1C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAA;AAG1D,OAAO,KAAK,EACV,sBAAsB,EACtB,yBAAyB,EACzB,gBAAgB,EACjB,MAAM,4BAA4B,CAAA;AACnC,OAAO,EAGL,KAAK,gBAAgB,EACrB,KAAK,OAAO,EACZ,KAAK,SAAS,EACf,MAAM,yBAAyB,CAAA;AAGhC,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,SAAS,EACf,MAAM,YAAY,CAAA;AAEnB,OAAO,EACL,UAAU,EACV,eAAe,EACf,MAAM,EACN,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,aAAa,GACnB,MAAM,YAAY,CAAA;AACnB,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAErD,MAA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AAC,WAAW,CAAC,CAAC,CAAC,EAAE,SAAS,CAAC,EAClC,cAAc,EACd,cAAc,CACf,CAAA;QACD,YAAY,EAAE,gBAAgB,CAC5B,OAAO,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,cAAc,CAAC,EACvC,cAAc,EACd,cAAc,CACf,CAAA;KACF;CACF"}
@@ -0,0 +1,9 @@
1
+ /** Every built-in string of @ember-formwright/power-calendar, for translation catalogs. */
2
+ export declare const messages: {
3
+ trigger: {
4
+ id: string;
5
+ message: string;
6
+ description: string;
7
+ };
8
+ };
9
+ //# sourceMappingURL=messages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"messages.d.ts","sourceRoot":"","sources":["../src/messages.ts"],"names":[],"mappings":"AAEA,2FAA2F;AAC3F,eAAO,MAAM,QAAQ;;;;;;CAOc,CAAA"}
@@ -0,0 +1,45 @@
1
+ import { FieldHarness } from '@ember-formwright/test-support';
2
+ /**
3
+ * Drives a `date-picker` or `date-range` field the way a user would: open the calendar,
4
+ * page to the month, click the day.
5
+ *
6
+ * class TripForm extends FormHarness {
7
+ * @field(DatePickerHarness) declare departure: DatePickerHarness
8
+ * @field(DatePickerHarness) declare stay: DatePickerHarness
9
+ * }
10
+ *
11
+ * await trip.departure.select('2026-03-04')
12
+ * await trip.stay.selectRange('2026-03-04', '2026-03-09')
13
+ * assert.strictEqual(trip.departure.text, 'Mar 4, 2026')
14
+ */
15
+ export declare class DatePickerHarness extends FieldHarness {
16
+ static controls: string[];
17
+ /** The button the field's label points at. */
18
+ get trigger(): HTMLButtonElement;
19
+ /** The value as the trigger shows it, e.g. "Mar 4, 2026"; empty when there is none. */
20
+ get text(): string;
21
+ get isOpen(): boolean;
22
+ /** The open calendar, which renders outside the field (or in place, in a callout). */
23
+ get calendar(): HTMLElement | null;
24
+ /** The month shown, e.g. "March 2026". */
25
+ get month(): string;
26
+ open(): Promise<void>;
27
+ /** Closes the calendar with Escape, as a keyboard user would. */
28
+ close(): Promise<void>;
29
+ nextMonth(): Promise<void>;
30
+ previousMonth(): Promise<void>;
31
+ /** Opens the calendar and pages to the month of `date` (`YYYY-MM-DD`). */
32
+ goTo(date: string): Promise<void>;
33
+ /** The day button for `date` (`YYYY-MM-DD`) in the month shown, if it is there. */
34
+ day(date: string): HTMLButtonElement | null;
35
+ /** Whether `date` can't be chosen (before `@min`, after `@max`, or in `@disabledDates`). */
36
+ isDayDisabled(date: string): Promise<boolean>;
37
+ /** Opens the calendar, pages to `date` (`YYYY-MM-DD`) and clicks it. */
38
+ select(date: string): Promise<void>;
39
+ /** date-range: chooses both ends. */
40
+ selectRange(start: string, end: string): Promise<void>;
41
+ private shownMonth;
42
+ private navButton;
43
+ private requireCalendar;
44
+ }
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/test-support/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAE7D;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAkB,SAAQ,YAAY;IACjD,OAAgB,QAAQ,WAAgC;IAExD,8CAA8C;IAC9C,IAAI,OAAO,IAAI,iBAAiB,CAE/B;IAED,uFAAuF;IACvF,IAAI,IAAI,IAAI,MAAM,CAOjB;IAED,IAAI,MAAM,IAAI,OAAO,CAEpB;IAED,sFAAsF;IACtF,IAAI,QAAQ,IAAI,WAAW,GAAG,IAAI,CAGjC;IAED,0CAA0C;IAC1C,IAAI,KAAK,IAAI,MAAM,CAIlB;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAI3B,iEAAiE;IAC3D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;IAItB,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;IAI1B,aAAa,IAAI,OAAO,CAAC,IAAI,CAAC;IAIpC,0EAA0E;IACpE,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAWvC,mFAAmF;IACnF,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,IAAI;IAM3C,4FAA4F;IACtF,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAKnD,wEAAwE;IAClE,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IASzC,qCAAqC;IAC/B,WAAW,CAAC,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAK5D,OAAO,CAAC,UAAU;IAKlB,OAAO,CAAC,SAAS;IAQjB,OAAO,CAAC,eAAe;CAKxB"}