@ember-formwright/power-calendar 0.0.0-stage → 1.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/CHANGELOG.md ADDED
@@ -0,0 +1,20 @@
1
+ # @ember-formwright/power-calendar
2
+
3
+ ## 1.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5db314e: New package: `date-picker` and `date-range` controls on ember-power-calendar 2. A button
8
+ trigger, named by the field's label, opens the calendar in an ember-basic-dropdown; values are
9
+ ISO `YYYY-MM-DD` strings (or `Date`s with `@storeDate`), and a range is `{ start, end }`. `@min`,
10
+ `@max`, `@locale`, `@disabledDates`, callouts and confirm-mode keyboard handling are supported.
11
+ Includes a `Date`/`Intl` date library for power-calendar (no moment or luxon), `formatDate` and
12
+ `formatDateRange` for inline display, a theme following the Formwright custom properties, and
13
+ `DatePickerHarness` at `@ember-formwright/power-calendar/test-support`.
14
+
15
+ ### Patch Changes
16
+
17
+ - Updated dependencies [aad9026]
18
+ - Updated dependencies [abc6560]
19
+ - @ember-formwright/ember@1.3.0
20
+ - @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,86 @@
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
+ Render `<BasicDropdownWormhole />` (from `ember-basic-dropdown/components/basic-dropdown-wormhole`)
21
+ once in your application template; calendars open into it. In tests, add
22
+ `<div id="ember-basic-dropdown-wormhole"></div>` next to `#ember-testing` in `tests/index.html`.
23
+
24
+ ```gts
25
+ <f.Field @for="checkIn" @control="date-picker" @label="Check-in" @min={{this.today}} />
26
+
27
+ {{! stores { start, end } once both ends are chosen }}
28
+ <f.Field @for="stay" @control="date-range" @label="Stay" />
29
+
30
+ {{! a Date, for @attr('date'); weekends off }}
31
+ <f.Field @for="shipsOn" @control="date-picker" @label="Ships on" @format={{formatDate}} as |field|>
32
+ <field.Control @storeDate={{true}} @disabledDates={{array "Sat" "Sun"}} />
33
+ </f.Field>
34
+ ```
35
+
36
+ A date-picker stores an ISO `YYYY-MM-DD` string, a date-range `{ start, end }` of them; with
37
+ `@storeDate`, `Date`s at local midnight. Both read either. The field's `@min`, `@max` and
38
+ `@locale` apply. `field.Control` also takes `@dateFormat` (`Intl.DateTimeFormat` options for
39
+ the trigger), `@disabledDates`, `@startOfWeek`, `@renderInPlace`, and for a range `@minRange`
40
+ and `@maxRange` (in days).
41
+
42
+ `formatDate(value, { locale, format })` and `formatDateRange(value, { locale, format })` turn a
43
+ stored value into text, for a field's `@format` in inline mode.
44
+
45
+ ## Testing
46
+
47
+ ```ts
48
+ import { DatePickerHarness } from '@ember-formwright/power-calendar/test-support'
49
+
50
+ class BookingForm extends FormHarness {
51
+ @field(DatePickerHarness) declare checkIn: DatePickerHarness
52
+ @field(DatePickerHarness) declare stay: DatePickerHarness
53
+ }
54
+
55
+ await booking.checkIn.select('2026-03-04') // opens, pages to March 2026, clicks the 4th
56
+ await booking.stay.selectRange('2026-03-04', '2026-03-09')
57
+ assert.strictEqual(booking.checkIn.text, 'Mar 4, 2026')
58
+ ```
59
+
60
+ It also has `open()`, `close()`, `isOpen`, `month`, `nextMonth()`, `previousMonth()`,
61
+ `day(isoDate)`, `isDayDisabled(isoDate)` and `trigger`.
62
+
63
+ ## Behaviour and known limits
64
+
65
+ - **Date library.** ember-power-calendar needs a registered date library.
66
+ `registerPowerCalendarControls()` registers one built on `Date` and `Intl`
67
+ (`nativeDateLibrary`), unless the app registered its own (moment, luxon) first.
68
+ - **Labels.** The trigger is a `<button>`, so `<label for>` points at it and clicking the label
69
+ focuses it. Its `aria-label` is the field's label followed by what it shows
70
+ ("Check-in: Mar 4, 2026").
71
+ - **Focus.** Opening the calendar focuses the selected day, else today. Choosing a day closes
72
+ it and focuses the trigger. Inline and confirm modes focus the trigger.
73
+ - **Callouts.** In `@inline @callout` forms the calendar renders in place, inside the popover,
74
+ so a click on a day doesn't close the callout.
75
+ - **Keyboard.** While the calendar is open, Enter and Escape belong to it and don't reach the
76
+ field: with `@requireConfirm` or `@inline`, Enter on a day doesn't commit, and the first
77
+ Escape closes the calendar instead of cancelling the edit.
78
+ - **Ranges.** The first click starts a range, the second ends it; the ends are put in order.
79
+ Nothing is stored until both are chosen, and closing the calendar in between keeps the old
80
+ range.
81
+ - **Time zones.** Values are calendar days in local time. ISO strings carry no zone; a string
82
+ with a time (`2026-03-04T10:00Z`) is read by its date part.
83
+ - **Readonly.** There is no read-only calendar; like `select`, readonly disables the trigger.
84
+ - **Native submit.** The trigger is a button with no value; the wrapper carries `data-fw-name`
85
+ with the field's path.
86
+ - **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,94 @@
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 } from '@ember-formwright/ember';
5
+ import { 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'] & {
12
+ /** Store `Date`s rather than ISO `YYYY-MM-DD` strings. */
13
+ storeDate?: boolean;
14
+ /** `Intl.DateTimeFormat` options for the trigger's text. Default `{ dateStyle: 'medium' }`. */
15
+ dateFormat?: Intl.DateTimeFormatOptions;
16
+ /** Days that can't be chosen: dates, or English weekday names ('Sat', 'Sun'). */
17
+ disabledDates?: Array<Date | string>;
18
+ /** First day of the week, 0 (Sunday) to 6. Default: the locale's. */
19
+ startOfWeek?: number;
20
+ /** Render the dropdown in place rather than in the wormhole. Forced in a callout. */
21
+ renderInPlace?: boolean;
22
+ /** date-range: the shortest and longest range, in days. Default: no limits. */
23
+ minRange?: number;
24
+ maxRange?: number;
25
+ };
26
+ }
27
+ /**
28
+ * A Formwright control: a button showing the date, opening an ember-power-calendar in an
29
+ * ember-basic-dropdown. It stores an ISO `YYYY-MM-DD` string (a `Date` with `@storeDate`),
30
+ * and reads either.
31
+ */
32
+ export declare class DatePickerControl extends Component<DatePickerControlSignature> {
33
+ /** The month shown, once the user has moved away from the value's. */
34
+ center: Date | null;
35
+ /** date-range: the start chosen before the end, kept here until the range is complete. */
36
+ pending: {
37
+ start: Date | null;
38
+ end: Date | null;
39
+ } | null;
40
+ get isRange(): boolean;
41
+ get selectedDate(): Date | undefined;
42
+ get selectedRange(): {
43
+ start: Date | null;
44
+ end: Date | null;
45
+ };
46
+ get currentCenter(): Date;
47
+ get text(): string;
48
+ /**
49
+ * The trigger's name: the label, then what it shows (the value, else the placeholder), so
50
+ * both are read out. Without a label, the button's text names it.
51
+ */
52
+ get ariaLabel(): string | undefined;
53
+ get disabled(): boolean;
54
+ /** Inside a callout the dropdown must stay inside the popover (the top layer). */
55
+ get renderInPlace(): boolean | undefined;
56
+ get minDate(): Date | undefined;
57
+ get maxDate(): Date | undefined;
58
+ get startOfWeek(): string | undefined;
59
+ get minRange(): number;
60
+ store(date: Date | null | undefined): DateValue | null;
61
+ onCenterChange: (value: NormalizeCalendarValue) => void;
62
+ onSelect: (dropdown: Dropdown, day: PowerCalendarDay) => void;
63
+ onSelectRange: (dropdown: Dropdown, value: NormalizeRangeActionValue) => void;
64
+ /** Closes the dropdown and puts focus back on the trigger. */
65
+ done(dropdown: Dropdown): void;
66
+ onClose: () => void;
67
+ /**
68
+ * While the dropdown is open, Enter and Escape belong to it: Enter chooses the focused day,
69
+ * Escape closes the dropdown. Neither reaches the field, which would commit or cancel.
70
+ */
71
+ onKeydown: (dropdown: Dropdown, event: KeyboardEvent) => void;
72
+ /** Makes our own `<button>` the dropdown's trigger, for positioning and outside clicks. */
73
+ registerTrigger: import("ember-modifier").FunctionBasedModifier<{
74
+ Args: {
75
+ Positional: [Dropdown];
76
+ Named: import("ember-modifier/-private/signature").EmptyObject;
77
+ };
78
+ Element: HTMLElement;
79
+ }>;
80
+ }
81
+ /** The same control, choosing a range: stores `{ start, end }` once both ends are chosen. */
82
+ export declare class DateRangeControl extends DatePickerControl {
83
+ get isRange(): boolean;
84
+ }
85
+ /**
86
+ * Makes `@control="date-picker"` and `@control="date-range"` available to every form, and
87
+ * gives ember-power-calendar a date library built on `Date` and `Intl` unless the app
88
+ * registered one. Call once, e.g. in app.ts.
89
+ */
90
+ export declare function registerPowerCalendarControls({ single, range, }?: {
91
+ single?: string;
92
+ range?: string;
93
+ }): void;
94
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.gts"],"names":[],"mappings":"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"}
@@ -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"}