frontile 0.18.0-beta.5 → 0.18.1
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/declarations/components/buttons/chip.d.ts +1 -1
- package/declarations/components/buttons/chip.d.ts.map +1 -1
- package/declarations/components/collections/dropdown/menu-context.d.ts +10 -0
- package/declarations/components/collections/dropdown/menu-context.d.ts.map +1 -1
- package/declarations/components/collections/dropdown/sub.d.ts +34 -0
- package/declarations/components/collections/dropdown/sub.d.ts.map +1 -1
- package/declarations/components/forms/autocomplete.d.ts +12 -12
- package/declarations/components/forms/date-input/clipboard.d.ts +34 -0
- package/declarations/components/forms/date-input/clipboard.d.ts.map +1 -0
- package/declarations/components/forms/date-input/date-input.d.ts +91 -0
- package/declarations/components/forms/date-input/date-input.d.ts.map +1 -0
- package/declarations/components/forms/date-input/segment-group.d.ts +130 -0
- package/declarations/components/forms/date-input/segment-group.d.ts.map +1 -0
- package/declarations/components/forms/date-input/segments.d.ts +137 -0
- package/declarations/components/forms/date-input/segments.d.ts.map +1 -0
- package/declarations/components/forms/date-input/types.d.ts +134 -0
- package/declarations/components/forms/date-input/types.d.ts.map +1 -0
- package/declarations/components/forms/date-input.d.ts +6 -0
- package/declarations/components/forms/date-input.d.ts.map +1 -0
- package/declarations/components/forms/date-picker/date-picker.d.ts +248 -15
- package/declarations/components/forms/date-picker/date-picker.d.ts.map +1 -1
- package/declarations/components/forms/date-picker/end-content.d.ts +33 -3
- package/declarations/components/forms/date-picker/end-content.d.ts.map +1 -1
- package/declarations/components/forms/date-picker/types.d.ts +30 -1
- package/declarations/components/forms/date-picker/types.d.ts.map +1 -1
- package/declarations/components/forms/field.d.ts +3 -0
- package/declarations/components/forms/field.d.ts.map +1 -1
- package/declarations/components/forms/index.d.ts +1 -0
- package/declarations/components/forms/index.d.ts.map +1 -1
- package/declarations/components/forms/input.d.ts +11 -11
- package/declarations/components/forms/native-select.d.ts +8 -8
- package/declarations/components/forms/select/select.d.ts +16 -16
- package/declarations/components/forms/textarea.d.ts +7 -7
- package/declarations/components/utilities/avatar.d.ts +35 -2
- package/declarations/components/utilities/avatar.d.ts.map +1 -1
- package/declarations/test-support.d.ts +30 -0
- package/declarations/test-support.d.ts.map +1 -1
- package/dist/components/buttons/chip.js.map +1 -1
- package/dist/components/collections/dropdown/menu-context.js.map +1 -1
- package/dist/components/collections/dropdown/sub.js +76 -11
- package/dist/components/collections/dropdown/sub.js.map +1 -1
- package/dist/components/forms/date-input/clipboard.js +162 -0
- package/dist/components/forms/date-input/clipboard.js.map +1 -0
- package/dist/components/forms/date-input/date-input.js +194 -0
- package/dist/components/forms/date-input/date-input.js.map +1 -0
- package/dist/components/forms/date-input/segment-group.js +271 -0
- package/dist/components/forms/date-input/segment-group.js.map +1 -0
- package/dist/components/forms/date-input/segments.js +379 -0
- package/dist/components/forms/date-input/segments.js.map +1 -0
- package/dist/components/forms/date-input/types.js +2 -0
- package/dist/components/forms/date-input/types.js.map +1 -0
- package/dist/components/forms/date-input.js +4 -0
- package/dist/components/forms/date-input.js.map +1 -0
- package/dist/components/forms/date-picker/date-picker.js +301 -14
- package/dist/components/forms/date-picker/date-picker.js.map +1 -1
- package/dist/components/forms/date-picker/end-content.js +17 -4
- package/dist/components/forms/date-picker/end-content.js.map +1 -1
- package/dist/components/forms/field.js +4 -1
- package/dist/components/forms/field.js.map +1 -1
- package/dist/components/forms/index.js +3 -0
- package/dist/components/forms/index.js.map +1 -1
- package/dist/components/utilities/avatar.js +30 -5
- package/dist/components/utilities/avatar.js.map +1 -1
- package/dist/forms.js +3 -0
- package/dist/forms.js.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/test-support.js +480 -1
- package/dist/test-support.js.map +1 -1
- package/package.json +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"segments.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-input/segments.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE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AI,EAAE,CAO1D;AAED,OAAO,EACL,UAAU,EACV,SAAS,EACT,YAAY,EACZ,cAAc,EACd,MAAM,EACN,UAAU,EACV,aAAa,EACb,YAAY,EACZ,WAAW,EACX,IAAI,EACJ,MAAM,EACN,QAAQ,EACR,WAAW,EACX,mBAAmB,EACnB,WAAW,EACX,cAAc,EACd,SAAS,EACT,SAAS,EACT,eAAe,EACf,eAAe,EACf,oBAAoB,EACpB,cAAc,EACf,CAAC"}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { ClassValue, DateInputSlots, SlotsToClasses, useStyles } from '@frontile/theme';
|
|
2
|
+
import type { FormControlSharedArgs } from '../form-control';
|
|
3
|
+
/** The resolved Tailwind Variants slot functions for this component. */
|
|
4
|
+
type DateInputClasses = ReturnType<ReturnType<typeof useStyles>['dateInput']>;
|
|
5
|
+
/** One resolved Tailwind Variants slot function, called as `slot(class=...)`. */
|
|
6
|
+
type SegmentSlotFn = (props?: {
|
|
7
|
+
class?: ClassValue;
|
|
8
|
+
}) => string;
|
|
9
|
+
/**
|
|
10
|
+
* The slots `SegmentGroup` renders, named structurally rather than by recipe.
|
|
11
|
+
* `DateInput` hands it `useStyles().dateInput(...)` and `DatePicker` hands it
|
|
12
|
+
* `useStyles().datePicker(...)`: two separate `tv()` calls, because tv() loses
|
|
13
|
+
* slot types across a two-level `extend` and so neither recipe can extend the
|
|
14
|
+
* other. Naming either one here would make the other a type error, so the
|
|
15
|
+
* group asks only for the three slots it actually uses -- which both recipes
|
|
16
|
+
* have.
|
|
17
|
+
*/
|
|
18
|
+
interface SegmentGroupClasses {
|
|
19
|
+
group: SegmentSlotFn;
|
|
20
|
+
segment: SegmentSlotFn;
|
|
21
|
+
literal: SegmentSlotFn;
|
|
22
|
+
}
|
|
23
|
+
/** The consumer overrides for those same three slots. */
|
|
24
|
+
type SegmentGroupUserClasses = SlotsToClasses<'group' | 'segment' | 'literal'>;
|
|
25
|
+
/** The editable units. Day granularity only -- see the spec's Out of scope. */
|
|
26
|
+
type SegmentType = 'year' | 'month' | 'day';
|
|
27
|
+
interface Segment {
|
|
28
|
+
kind: 'segment';
|
|
29
|
+
type: SegmentType;
|
|
30
|
+
/** `null` until the user has entered something. */
|
|
31
|
+
value: number | null;
|
|
32
|
+
min: number;
|
|
33
|
+
max: number;
|
|
34
|
+
/**
|
|
35
|
+
* Digits typed into this segment so far. Distinct from `value` because
|
|
36
|
+
* typing `0` must show `00` and wait, which no number can represent.
|
|
37
|
+
*/
|
|
38
|
+
buffer: string;
|
|
39
|
+
/**
|
|
40
|
+
* Whether `value` is the user's finished answer for this segment rather than
|
|
41
|
+
* a number they are still typing through. A year typed digit by digit passes
|
|
42
|
+
* through 2, 20 and 202 on its way to 2026, and none of those are a year
|
|
43
|
+
* anybody meant -- so an uncommitted segment composes no date at all. A
|
|
44
|
+
* segment commits when it can take no further digit, or when focus leaves it
|
|
45
|
+
* (which is what turns a typed `26` into 2026).
|
|
46
|
+
*/
|
|
47
|
+
isCommitted: boolean;
|
|
48
|
+
/** How many digits the segment shows when filled: 2, or 4 for a year. */
|
|
49
|
+
width: number;
|
|
50
|
+
/** Rendered when `value` is null: 'mm', 'dd', 'yyyy'. */
|
|
51
|
+
placeholder: string;
|
|
52
|
+
}
|
|
53
|
+
interface LiteralPart {
|
|
54
|
+
kind: 'literal';
|
|
55
|
+
text: string;
|
|
56
|
+
}
|
|
57
|
+
type Part = Segment | LiteralPart;
|
|
58
|
+
interface DateInputArgs extends FormControlSharedArgs {
|
|
59
|
+
/** The unique identifier for the control. */
|
|
60
|
+
id?: string;
|
|
61
|
+
/** The value submits under this name as `yyyy-MM-dd`. */
|
|
62
|
+
name?: string;
|
|
63
|
+
/**
|
|
64
|
+
* A `Date`, or the same `yyyy-MM-dd` string this component writes to its
|
|
65
|
+
* hidden input.
|
|
66
|
+
*
|
|
67
|
+
* The field keeps its own segments and syncs *from* this argument: setting
|
|
68
|
+
* it replaces what is displayed, while typing updates the field immediately
|
|
69
|
+
* rather than waiting for `@value` to come back. `undefined` is ignored,
|
|
70
|
+
* which is why a `<form.Field>`-bound input still honors `@defaultValue`
|
|
71
|
+
* before form data exists.
|
|
72
|
+
*/
|
|
73
|
+
value?: Date | string | null;
|
|
74
|
+
/** Seeds the value before any `@value` is supplied. */
|
|
75
|
+
defaultValue?: Date | string | null;
|
|
76
|
+
/**
|
|
77
|
+
* Fires with the composed `Date`, or `null` once a complete value is no
|
|
78
|
+
* longer complete. A partially typed date composes nothing and reports
|
|
79
|
+
* nothing.
|
|
80
|
+
*/
|
|
81
|
+
onChange?: (value: Date | null) => void;
|
|
82
|
+
/** Fires when focus leaves the field, not when it moves between segments. */
|
|
83
|
+
onBlur?: () => void;
|
|
84
|
+
/** @defaultValue navigator.language */
|
|
85
|
+
locale?: string;
|
|
86
|
+
/**
|
|
87
|
+
* Decides which segments appear, their order, and their literals.
|
|
88
|
+
*
|
|
89
|
+
* @defaultValue { year: 'numeric', month: '2-digit', day: '2-digit' }
|
|
90
|
+
*/
|
|
91
|
+
formatOptions?: Intl.DateTimeFormatOptions;
|
|
92
|
+
/** Where ArrowUp on an empty segment starts. @defaultValue today */
|
|
93
|
+
placeholderValue?: Date;
|
|
94
|
+
/** The earliest allowed date. A value before it marks the field invalid. */
|
|
95
|
+
minValue?: Date;
|
|
96
|
+
/** The latest allowed date. A value after it marks the field invalid. */
|
|
97
|
+
maxValue?: Date;
|
|
98
|
+
/**
|
|
99
|
+
* Marks individual dates disallowed. A value it returns `true` for marks
|
|
100
|
+
* the field invalid. Like `@minValue` and `@maxValue`, it never blocks a
|
|
101
|
+
* keystroke.
|
|
102
|
+
*/
|
|
103
|
+
isDateUnavailable?: (date: Date) => boolean;
|
|
104
|
+
/**
|
|
105
|
+
* Whether the value can be read and copied but not edited. The segments
|
|
106
|
+
* stay focusable and navigable.
|
|
107
|
+
*
|
|
108
|
+
* @defaultValue false
|
|
109
|
+
*/
|
|
110
|
+
isReadOnly?: boolean;
|
|
111
|
+
/**
|
|
112
|
+
* Whether a clear button appears at the end of the field once any segment
|
|
113
|
+
* holds a digit. Never rendered on a disabled or read-only field.
|
|
114
|
+
*
|
|
115
|
+
* @defaultValue false
|
|
116
|
+
*/
|
|
117
|
+
isClearable?: boolean;
|
|
118
|
+
/**
|
|
119
|
+
* The size of the field. Matches `Input`'s and `Select`'s `@inputSize`.
|
|
120
|
+
*
|
|
121
|
+
* @defaultValue 'md'
|
|
122
|
+
*/
|
|
123
|
+
inputSize?: 'sm' | 'md' | 'lg';
|
|
124
|
+
/**
|
|
125
|
+
* The accessible names of the segments, for localizing them.
|
|
126
|
+
*
|
|
127
|
+
* @defaultValue { year: 'year', month: 'month', day: 'day' }
|
|
128
|
+
*/
|
|
129
|
+
segmentLabels?: Partial<Record<SegmentType, string>>;
|
|
130
|
+
/** Per-slot class overrides. */
|
|
131
|
+
classes?: SlotsToClasses<DateInputSlots>;
|
|
132
|
+
}
|
|
133
|
+
export type { SegmentType, SegmentSlotFn, SegmentGroupClasses, SegmentGroupUserClasses, Segment, LiteralPart, Part, DateInputArgs, DateInputClasses };
|
|
134
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-input/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACd,cAAc,EACd,SAAS,EACV,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AAE7D,wEAAwE;AACxE,KAAK,gBAAgB,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,SAAS,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC;AAE9E,iFAAiF;AACjF,KAAK,aAAa,GAAG,CAAC,KAAK,CAAC,EAAE;IAAE,KAAK,CAAC,EAAE,UAAU,CAAA;CAAE,KAAK,MAAM,CAAC;AAEhE;;;;;;;;GAQG;AACH,UAAU,mBAAmB;IAC3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IACvC,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;;OAIG;IACH,aAAa,CAAC,EAAE,IAAI,CAAC,qBAAqB,CAAC;IAE3C,oEAAoE;IACpE,gBAAgB,CAAC,EAAE,IAAI,CAAC;IAExB,4EAA4E;IAC5E,QAAQ,CAAC,EAAE,IAAI,CAAC;IAEhB,yEAAyE;IACzE,QAAQ,CAAC,EAAE,IAAI,CAAC;IAEhB;;;;OAIG;IACH,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC;IAE5C;;;;;OAKG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IAErB;;;;;OAKG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB;;;;OAIG;IACH,SAAS,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAE/B;;;;OAIG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,CAAC;IAErD,gCAAgC;IAChC,OAAO,CAAC,EAAE,cAAc,CAAC,cAAc,CAAC,CAAC;CAC1C;AAED,YAAY,EACV,WAAW,EACX,aAAa,EACb,mBAAmB,EACnB,uBAAuB,EACvB,OAAO,EACP,WAAW,EACX,IAAI,EACJ,aAAa,EACb,gBAAgB,EACjB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date-input.d.ts","sourceRoot":"","sources":["../../../src/components/forms/date-input.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import Component from '@glimmer/component';
|
|
2
2
|
import { ControlBlurTracker } from '../../../-private/control-blur';
|
|
3
3
|
import type { CalendarMode, CalendarValue } from '../../collections/calendar/types';
|
|
4
|
+
import type { Part } from '../date-input/types';
|
|
4
5
|
import type { DatePickerArgs, DatePickerValueBlockArg, DatePickerCalendarArgs, DatePickerFooterArg } from './types';
|
|
5
6
|
interface DatePickerSignature<M extends CalendarMode = 'single'> {
|
|
6
7
|
Args: DatePickerArgs<M>;
|
|
@@ -12,11 +13,15 @@ interface DatePickerSignature<M extends CalendarMode = 'single'> {
|
|
|
12
13
|
Element: HTMLDivElement;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
|
-
* A date field:
|
|
16
|
-
* in a popover
|
|
17
|
-
*
|
|
16
|
+
* A date field: segments the value can be typed into, a calendar button that
|
|
17
|
+
* opens a calendar in a popover, and -- under `@isEditable={{false}}` -- the
|
|
18
|
+
* older button trigger showing the formatted value instead. `@mode="range"`
|
|
19
|
+
* switches both the calendar and the value shape to a `{ start, end }` range,
|
|
20
|
+
* and -- when editable -- renders two groups of segments with a separator
|
|
21
|
+
* between them.
|
|
18
22
|
*/
|
|
19
23
|
declare class DatePicker<M extends CalendarMode = 'single'> extends Component<DatePickerSignature<M>> {
|
|
24
|
+
#private;
|
|
20
25
|
triggerRef: import("../../utilities").Ref<HTMLButtonElement>;
|
|
21
26
|
containerRef: import("../../utilities").Ref<HTMLElement>;
|
|
22
27
|
/**
|
|
@@ -28,7 +33,44 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
|
|
|
28
33
|
*/
|
|
29
34
|
internalValue: CalendarValue<M> | null;
|
|
30
35
|
isOpen: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The segments, on the editable path. They are not a second source of truth
|
|
38
|
+
* for the value -- {@link internalValue} is -- but they cannot be derived
|
|
39
|
+
* from it either: mid-entry they hold digits that compose to no date at all,
|
|
40
|
+
* which no `Date` can represent. The calendar writes here through
|
|
41
|
+
* {@link commitValue}; typing writes there through {@link handlePartsChange}.
|
|
42
|
+
*/
|
|
43
|
+
private trackedParts;
|
|
44
|
+
/**
|
|
45
|
+
* The second group, in `@mode="range"` only. {@link trackedParts} is that
|
|
46
|
+
* mode's *start* group, so every path that writes one writes both.
|
|
47
|
+
*/
|
|
48
|
+
private trackedEndParts;
|
|
31
49
|
constructor(owner: unknown, args: DatePickerArgs<M>);
|
|
50
|
+
get parts(): Part[];
|
|
51
|
+
get endParts(): Part[];
|
|
52
|
+
private setParts;
|
|
53
|
+
private setEndParts;
|
|
54
|
+
/**
|
|
55
|
+
* Writes a value across the segments, whichever mode is in play.
|
|
56
|
+
*
|
|
57
|
+
* `onto` supplies the list each group is written into -- the current
|
|
58
|
+
* segments when a value moved, a freshly built row when the locale or the
|
|
59
|
+
* format changed. It is a function because range mode needs two independent
|
|
60
|
+
* lists and must not hand the same array to both groups.
|
|
61
|
+
*/
|
|
62
|
+
private writeParts;
|
|
63
|
+
/** Whether the value is typed rather than only picked. */
|
|
64
|
+
get isSegmented(): boolean;
|
|
65
|
+
/**
|
|
66
|
+
* The format the segments are built from. The editable default is numeric;
|
|
67
|
+
* `{ dateStyle: 'medium' }` -- this component's own button default --
|
|
68
|
+
* renders "Jan" and has no numeric segment to type into, so a textual
|
|
69
|
+
* format falls back to the numeric default rather than rendering a field
|
|
70
|
+
* nobody can type in.
|
|
71
|
+
*/
|
|
72
|
+
get segmentFormat(): Intl.DateTimeFormatOptions | undefined;
|
|
73
|
+
get placeholderValue(): Date;
|
|
32
74
|
get mode(): M;
|
|
33
75
|
get locale(): string;
|
|
34
76
|
/**
|
|
@@ -56,6 +98,19 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
|
|
|
56
98
|
};
|
|
57
99
|
Element: HTMLDivElement;
|
|
58
100
|
}>;
|
|
101
|
+
/**
|
|
102
|
+
* Rebuilds the segment order when the locale or format changes, carrying the
|
|
103
|
+
* current value across so switching en-US to en-GB reorders the field
|
|
104
|
+
* without emptying it. Reads no tracked state, so it runs on an argument
|
|
105
|
+
* change and never on a keystroke.
|
|
106
|
+
*/
|
|
107
|
+
syncSegmentFormat: import("ember-modifier").FunctionBasedModifier<{
|
|
108
|
+
Args: {
|
|
109
|
+
Positional: [string, Intl.DateTimeFormatOptions | undefined];
|
|
110
|
+
Named: import("ember-modifier/-private/signature").EmptyObject;
|
|
111
|
+
};
|
|
112
|
+
Element: HTMLDivElement;
|
|
113
|
+
}>;
|
|
59
114
|
get formatted(): string;
|
|
60
115
|
get isEmpty(): boolean;
|
|
61
116
|
get valueBlockArg(): DatePickerValueBlockArg<M>;
|
|
@@ -97,13 +152,89 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
|
|
|
97
152
|
* away -- closing would just make them reopen it.
|
|
98
153
|
*/
|
|
99
154
|
clear: () => void;
|
|
155
|
+
/**
|
|
156
|
+
* Whatever the field's own focusable thing is: the button trigger, or --
|
|
157
|
+
* when segmented -- the segment the user was last in, falling back to the
|
|
158
|
+
* first one. A recorded segment that has left the DOM is not one focus can
|
|
159
|
+
* go back to.
|
|
160
|
+
*/
|
|
161
|
+
private focusTarget;
|
|
162
|
+
private focusField;
|
|
100
163
|
/**
|
|
101
164
|
* Whether the selection is finished, and the popover should therefore close.
|
|
102
165
|
* A range with only its anchor set is not: the user still owes a second
|
|
103
166
|
* click, and closing would throw away the half they just made.
|
|
104
167
|
*/
|
|
105
168
|
private isComplete;
|
|
169
|
+
/**
|
|
170
|
+
* The one path a value change takes, whichever editor produced it.
|
|
171
|
+
*
|
|
172
|
+
* `writeParts` says whether the segments are that editor's output or its
|
|
173
|
+
* input. The calendar, the `:footer` block and the clear button are all
|
|
174
|
+
* *other* editors, and the segments have to be rewritten to show what they
|
|
175
|
+
* did. Typing is the segments themselves: rewriting them there would
|
|
176
|
+
* overwrite the buffer the user is still typing into, turning a half-typed
|
|
177
|
+
* year back into a padded one on every completed keystroke.
|
|
178
|
+
*/
|
|
179
|
+
private commitValue;
|
|
106
180
|
handleChange: (value: CalendarValue<M>) => void;
|
|
181
|
+
/**
|
|
182
|
+
* Whether an incoming value differs from what the segments already compose.
|
|
183
|
+
*
|
|
184
|
+
* Compared edge by edge in range mode rather than by identity: the two are
|
|
185
|
+
* distinct objects on every report, so an object comparison would always
|
|
186
|
+
* say "changed" and defeat the guard entirely.
|
|
187
|
+
*/
|
|
188
|
+
private segmentsWouldChange;
|
|
189
|
+
/**
|
|
190
|
+
* The segments changed. Only value *transitions* are reported: the four
|
|
191
|
+
* keystrokes that fill a month and a day compose no date at all, and report
|
|
192
|
+
* nothing. The popover is deliberately left alone -- typing never opened it,
|
|
193
|
+
* so completing a date by typing has nothing to close.
|
|
194
|
+
*/
|
|
195
|
+
handlePartsChange: (parts: Part[]) => void;
|
|
196
|
+
/**
|
|
197
|
+
* The two range groups report separately, but a range is one value: each
|
|
198
|
+
* one recomposes the whole thing and reports only what moved.
|
|
199
|
+
*/
|
|
200
|
+
handleStartParts: (parts: Part[]) => void;
|
|
201
|
+
handleEndParts: (parts: Part[]) => void;
|
|
202
|
+
/** Two dates pasted into the start group, which fill both. */
|
|
203
|
+
handleRangePaste: (start: Part[], end: Part[]) => void;
|
|
204
|
+
/**
|
|
205
|
+
* The range the two groups currently compose, or `null`.
|
|
206
|
+
*
|
|
207
|
+
* `DateRange.start` is a `Date`, not `Date | null`: a range is anchored at
|
|
208
|
+
* its start, and the half-open shape the calendar produces mid-selection is
|
|
209
|
+
* `{ start, end: null }` -- never the other way round. So segments that
|
|
210
|
+
* compose no start compose no range at all, however complete the end group
|
|
211
|
+
* is. That is what makes clearing the start report `null` rather than
|
|
212
|
+
* leaving a consumer holding a range the field no longer shows; the end's
|
|
213
|
+
* digits stay on screen, exactly as a half-typed single date's do.
|
|
214
|
+
*/
|
|
215
|
+
private rangeFromParts;
|
|
216
|
+
/**
|
|
217
|
+
* Reports the range only if it moved, which is the single-mode contract
|
|
218
|
+
* applied to two ends: the keystrokes that fill a month and a day compose
|
|
219
|
+
* nothing and report nothing, and either end changing is a change.
|
|
220
|
+
*/
|
|
221
|
+
private reportRange;
|
|
222
|
+
/**
|
|
223
|
+
* The start and end groups' accessible names. Two `role="group"`s cannot
|
|
224
|
+
* share one id or one name, and `FormControl`'s label can only be
|
|
225
|
+
* associated with one element -- so each group names itself, deriving from
|
|
226
|
+
* `@label` so that the visible label is contained in both names.
|
|
227
|
+
*/
|
|
228
|
+
get startLabel(): string;
|
|
229
|
+
get endLabel(): string;
|
|
230
|
+
/**
|
|
231
|
+
* The segment that last held focus, so that closing the calendar can hand
|
|
232
|
+
* focus back to where the user was. Recorded from the group's `focusin`
|
|
233
|
+
* rather than captured when the popover opens, because the calendar button
|
|
234
|
+
* is clicked *after* focus has already left the segment.
|
|
235
|
+
*/
|
|
236
|
+
private lastFocusedSegment;
|
|
237
|
+
handleSegmentFocusIn: (event: FocusEvent) => void;
|
|
107
238
|
/**
|
|
108
239
|
* Tells an enclosing `Form` the value moved.
|
|
109
240
|
*
|
|
@@ -136,112 +267,214 @@ declare class DatePicker<M extends CalendarMode = 'single'> extends Component<Da
|
|
|
136
267
|
get classes(): {
|
|
137
268
|
base: (slotProps?: ({
|
|
138
269
|
size?: "sm" | "md" | "lg" | undefined;
|
|
139
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
140
270
|
hasStartContent?: boolean | undefined;
|
|
141
271
|
hasEndContent?: boolean | undefined;
|
|
142
272
|
hasChips?: boolean | undefined;
|
|
143
273
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
274
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
275
|
+
isSegmented?: boolean | undefined;
|
|
276
|
+
isRange?: boolean | undefined;
|
|
144
277
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
145
278
|
innerContainer: (slotProps?: ({
|
|
146
279
|
size?: "sm" | "md" | "lg" | undefined;
|
|
147
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
148
280
|
hasStartContent?: boolean | undefined;
|
|
149
281
|
hasEndContent?: boolean | undefined;
|
|
150
282
|
hasChips?: boolean | undefined;
|
|
151
283
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
284
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
285
|
+
isSegmented?: boolean | undefined;
|
|
286
|
+
isRange?: boolean | undefined;
|
|
152
287
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
153
288
|
startContent: (slotProps?: ({
|
|
154
289
|
size?: "sm" | "md" | "lg" | undefined;
|
|
155
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
156
290
|
hasStartContent?: boolean | undefined;
|
|
157
291
|
hasEndContent?: boolean | undefined;
|
|
158
292
|
hasChips?: boolean | undefined;
|
|
159
293
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
294
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
295
|
+
isSegmented?: boolean | undefined;
|
|
296
|
+
isRange?: boolean | undefined;
|
|
160
297
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
161
298
|
endContent: (slotProps?: ({
|
|
162
299
|
size?: "sm" | "md" | "lg" | undefined;
|
|
163
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
164
300
|
hasStartContent?: boolean | undefined;
|
|
165
301
|
hasEndContent?: boolean | undefined;
|
|
166
302
|
hasChips?: boolean | undefined;
|
|
167
303
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
304
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
305
|
+
isSegmented?: boolean | undefined;
|
|
306
|
+
isRange?: boolean | undefined;
|
|
168
307
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
169
308
|
input: (slotProps?: ({
|
|
170
309
|
size?: "sm" | "md" | "lg" | undefined;
|
|
171
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
172
310
|
hasStartContent?: boolean | undefined;
|
|
173
311
|
hasEndContent?: boolean | undefined;
|
|
174
312
|
hasChips?: boolean | undefined;
|
|
175
313
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
314
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
315
|
+
isSegmented?: boolean | undefined;
|
|
316
|
+
isRange?: boolean | undefined;
|
|
176
317
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
177
318
|
} & {
|
|
178
|
-
|
|
319
|
+
separator: (slotProps?: ({
|
|
179
320
|
size?: "sm" | "md" | "lg" | undefined;
|
|
321
|
+
hasStartContent?: boolean | undefined;
|
|
322
|
+
hasEndContent?: boolean | undefined;
|
|
323
|
+
hasChips?: boolean | undefined;
|
|
324
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
180
325
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
326
|
+
isSegmented?: boolean | undefined;
|
|
327
|
+
isRange?: boolean | undefined;
|
|
328
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
329
|
+
calendarButton: (slotProps?: ({
|
|
330
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
181
331
|
hasStartContent?: boolean | undefined;
|
|
182
332
|
hasEndContent?: boolean | undefined;
|
|
183
333
|
hasChips?: boolean | undefined;
|
|
184
334
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
335
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
336
|
+
isSegmented?: boolean | undefined;
|
|
337
|
+
isRange?: boolean | undefined;
|
|
185
338
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
186
|
-
|
|
339
|
+
group: (slotProps?: ({
|
|
340
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
341
|
+
hasStartContent?: boolean | undefined;
|
|
342
|
+
hasEndContent?: boolean | undefined;
|
|
343
|
+
hasChips?: boolean | undefined;
|
|
344
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
345
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
346
|
+
isSegmented?: boolean | undefined;
|
|
347
|
+
isRange?: boolean | undefined;
|
|
348
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
349
|
+
segment: (slotProps?: ({
|
|
187
350
|
size?: "sm" | "md" | "lg" | undefined;
|
|
351
|
+
hasStartContent?: boolean | undefined;
|
|
352
|
+
hasEndContent?: boolean | undefined;
|
|
353
|
+
hasChips?: boolean | undefined;
|
|
354
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
188
355
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
356
|
+
isSegmented?: boolean | undefined;
|
|
357
|
+
isRange?: boolean | undefined;
|
|
358
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
359
|
+
literal: (slotProps?: ({
|
|
360
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
189
361
|
hasStartContent?: boolean | undefined;
|
|
190
362
|
hasEndContent?: boolean | undefined;
|
|
191
363
|
hasChips?: boolean | undefined;
|
|
192
364
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
365
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
366
|
+
isSegmented?: boolean | undefined;
|
|
367
|
+
isRange?: boolean | undefined;
|
|
368
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
369
|
+
base: (slotProps?: ({
|
|
370
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
371
|
+
hasStartContent?: boolean | undefined;
|
|
372
|
+
hasEndContent?: boolean | undefined;
|
|
373
|
+
hasChips?: boolean | undefined;
|
|
374
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
375
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
376
|
+
isSegmented?: boolean | undefined;
|
|
377
|
+
isRange?: boolean | undefined;
|
|
378
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
379
|
+
placeholder: (slotProps?: ({
|
|
380
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
381
|
+
hasStartContent?: boolean | undefined;
|
|
382
|
+
hasEndContent?: boolean | undefined;
|
|
383
|
+
hasChips?: boolean | undefined;
|
|
384
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
385
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
386
|
+
isSegmented?: boolean | undefined;
|
|
387
|
+
isRange?: boolean | undefined;
|
|
193
388
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
194
389
|
input: (slotProps?: ({
|
|
195
390
|
size?: "sm" | "md" | "lg" | undefined;
|
|
391
|
+
hasStartContent?: boolean | undefined;
|
|
392
|
+
hasEndContent?: boolean | undefined;
|
|
393
|
+
hasChips?: boolean | undefined;
|
|
394
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
196
395
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
396
|
+
isSegmented?: boolean | undefined;
|
|
397
|
+
isRange?: boolean | undefined;
|
|
398
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
399
|
+
innerContainer: (slotProps?: ({
|
|
400
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
197
401
|
hasStartContent?: boolean | undefined;
|
|
198
402
|
hasEndContent?: boolean | undefined;
|
|
199
403
|
hasChips?: boolean | undefined;
|
|
200
404
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
405
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
406
|
+
isSegmented?: boolean | undefined;
|
|
407
|
+
isRange?: boolean | undefined;
|
|
201
408
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
202
|
-
|
|
409
|
+
endContent: (slotProps?: ({
|
|
203
410
|
size?: "sm" | "md" | "lg" | undefined;
|
|
411
|
+
hasStartContent?: boolean | undefined;
|
|
412
|
+
hasEndContent?: boolean | undefined;
|
|
413
|
+
hasChips?: boolean | undefined;
|
|
414
|
+
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
204
415
|
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
416
|
+
isSegmented?: boolean | undefined;
|
|
417
|
+
isRange?: boolean | undefined;
|
|
418
|
+
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
419
|
+
calendar: (slotProps?: ({
|
|
420
|
+
size?: "sm" | "md" | "lg" | undefined;
|
|
205
421
|
hasStartContent?: boolean | undefined;
|
|
206
422
|
hasEndContent?: boolean | undefined;
|
|
207
423
|
hasChips?: boolean | undefined;
|
|
208
424
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
425
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
426
|
+
isSegmented?: boolean | undefined;
|
|
427
|
+
isRange?: boolean | undefined;
|
|
209
428
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
210
429
|
footer: (slotProps?: ({
|
|
211
430
|
size?: "sm" | "md" | "lg" | undefined;
|
|
212
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
213
431
|
hasStartContent?: boolean | undefined;
|
|
214
432
|
hasEndContent?: boolean | undefined;
|
|
215
433
|
hasChips?: boolean | undefined;
|
|
216
434
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
435
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
436
|
+
isSegmented?: boolean | undefined;
|
|
437
|
+
isRange?: boolean | undefined;
|
|
217
438
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
218
439
|
icon: (slotProps?: ({
|
|
219
440
|
size?: "sm" | "md" | "lg" | undefined;
|
|
220
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
221
441
|
hasStartContent?: boolean | undefined;
|
|
222
442
|
hasEndContent?: boolean | undefined;
|
|
223
443
|
hasChips?: boolean | undefined;
|
|
224
444
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
445
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
446
|
+
isSegmented?: boolean | undefined;
|
|
447
|
+
isRange?: boolean | undefined;
|
|
225
448
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
226
449
|
clearButton: (slotProps?: ({
|
|
227
450
|
size?: "sm" | "md" | "lg" | undefined;
|
|
228
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
229
451
|
hasStartContent?: boolean | undefined;
|
|
230
452
|
hasEndContent?: boolean | undefined;
|
|
231
453
|
hasChips?: boolean | undefined;
|
|
232
454
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
455
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
456
|
+
isSegmented?: boolean | undefined;
|
|
457
|
+
isRange?: boolean | undefined;
|
|
233
458
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
234
459
|
} & {
|
|
235
460
|
base: (slotProps?: ({
|
|
236
461
|
size?: "sm" | "md" | "lg" | undefined;
|
|
237
|
-
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
238
462
|
hasStartContent?: boolean | undefined;
|
|
239
463
|
hasEndContent?: boolean | undefined;
|
|
240
464
|
hasChips?: boolean | undefined;
|
|
241
465
|
startContentPointerEvents?: "none" | "auto" | undefined;
|
|
466
|
+
endContentPointerEvents?: "none" | "auto" | undefined;
|
|
467
|
+
isSegmented?: boolean | undefined;
|
|
468
|
+
isRange?: boolean | undefined;
|
|
242
469
|
} & import("tailwind-variants").ClassProp<import("tailwind-variants").ClassValue>) | undefined) => string;
|
|
243
470
|
};
|
|
244
471
|
get isRangeMode(): boolean;
|
|
472
|
+
/**
|
|
473
|
+
* The segmented field has no button trigger for a click to fall through to,
|
|
474
|
+
* and its calendar icon is a real button, so the cluster has to take pointer
|
|
475
|
+
* events. An explicit argument still wins.
|
|
476
|
+
*/
|
|
477
|
+
get endContentPointerEvents(): 'none' | 'auto';
|
|
245
478
|
/**
|
|
246
479
|
* The single-mode wire value, or `''` when there is nothing selected. Only
|
|
247
480
|
* read from the single-mode branch of the template, so it does not repeat
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"date-picker.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/date-picker.gts"],"names":[],"mappings":"AAs5BA,OAAO,SAAS,MAAM,oBAAoB,CAAC;AAqB3C,OAAO,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AASpE,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EAEd,MAAM,kCAAkC,CAAC;AAC1C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAChD,OAAO,KAAK,EACV,cAAc,EACd,uBAAuB,EACvB,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,SAAS,CAAC;AAEjB,UAAU,mBAAmB,CAAC,CAAC,SAAS,YAAY,GAAG,QAAQ;IAC7D,IAAI,EAAE,cAAc,CAAC,CAAC,CAAC,CAAC;IACxB,MAAM,EAAE;QACN,KAAK,EAAE,CAAC,uBAAuB,CAAC,CAAC,CAAC,CAAC,CAAC;QACpC,QAAQ,EAAE,CAAC,sBAAsB,CAAC,CAAC,CAAC,CAAC,CAAC;QACtC,MAAM,EAAE,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC,CAAC;KAClC,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;GAOG;AACH,cAAM,UAAU,CAAC,CAAC,SAAS,YAAY,GAAG,QAAQ,CAAE,SAAQ,SAAS,CACnE,mBAAmB,CAAC,CAAC,CAAC,CACvB;;IACC,UAAU,mDAA4B;IACtC,YAAY,6CAAsB;IAElC;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;MAOV;IAED,IAAI,WAAW,IAAI,OAAO,CAEzB;IAED;;;;OAIG;IACH,IAAI,uBAAuB,IAAI,MAAM,GAAG,MAAM,CAI7C;IAED;;;;OAIG;IACH,IAAI,SAAS,IAAI,MAAM,CAEtB;IAED,IAAI,cAAc,IAAI,MAAM,CAE3B;IAED,IAAI,YAAY,IAAI,MAAM,CAEzB;IAED,IACI,gBAAgB,IAAI,sBAAsB,CAAC,CAAC,CAAC,CAgBhD;IAED,IACI,cAAc,IAAI,mBAAmB,CAAC,CAAC,CAAC,CAU3C;CAoSF;AAED,OAAO,EAAE,UAAU,EAAE,KAAK,mBAAmB,EAAE,CAAC;AAChD,eAAe,UAAU,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { TOC } from '@ember/component/template-only';
|
|
2
|
+
import type { ModifierLike } from '@glint/template';
|
|
2
3
|
import type { SlotsToClasses, DatePickerSlots } from '@frontile/theme';
|
|
3
4
|
import type { DatePickerClasses } from './types';
|
|
4
5
|
interface DatePickerEndContentSignature {
|
|
@@ -7,6 +8,24 @@ interface DatePickerEndContentSignature {
|
|
|
7
8
|
userClasses?: SlotsToClasses<DatePickerSlots>;
|
|
8
9
|
isClearable: boolean;
|
|
9
10
|
onClear: () => void;
|
|
11
|
+
/**
|
|
12
|
+
* Whether the field is segmented. There is no button trigger on that path,
|
|
13
|
+
* so the calendar icon becomes the button that opens the popover -- the
|
|
14
|
+
* one thing a segmented field cannot do by clicking the value itself,
|
|
15
|
+
* because clicking a segment has to put the caret in it.
|
|
16
|
+
*/
|
|
17
|
+
isEditable?: boolean;
|
|
18
|
+
/**
|
|
19
|
+
* The popover's `trigger` modifier, for the calendar button. Required
|
|
20
|
+
* rather than optional because the calendar button is unreachable without
|
|
21
|
+
* it, and an unapplied modifier is a silent dead control.
|
|
22
|
+
*/
|
|
23
|
+
trigger: ModifierLike<{
|
|
24
|
+
Element: HTMLElement;
|
|
25
|
+
}>;
|
|
26
|
+
/** Names the calendar button, which has no text of its own. */
|
|
27
|
+
label?: string;
|
|
28
|
+
isDisabled?: boolean;
|
|
10
29
|
/**
|
|
11
30
|
* Defaults to `none` so clicks fall through to the trigger; content that
|
|
12
31
|
* needs its own events opts back in per element.
|
|
@@ -21,9 +40,20 @@ interface DatePickerEndContentSignature {
|
|
|
21
40
|
Element: HTMLDivElement;
|
|
22
41
|
}
|
|
23
42
|
/**
|
|
24
|
-
* The cluster at the end of the field
|
|
25
|
-
*
|
|
26
|
-
*
|
|
43
|
+
* The cluster at the end of the field.
|
|
44
|
+
*
|
|
45
|
+
* The segmented field shows the clear button *and* the calendar button: the
|
|
46
|
+
* calendar button is the only way to open the popover on that path, so
|
|
47
|
+
* swapping it out for a clear button would mean a clearable picker holding a
|
|
48
|
+
* value could not be picked from at all.
|
|
49
|
+
*
|
|
50
|
+
* The button-trigger path keeps the either/or it shipped with. There the
|
|
51
|
+
* trigger itself opens the popover and the calendar icon is decorative, so the
|
|
52
|
+
* clear button takes its place with nothing lost.
|
|
53
|
+
*
|
|
54
|
+
* Pointer events are off on that path so a click anywhere in the field still
|
|
55
|
+
* reaches the trigger; the clear button opts back in per element, and the
|
|
56
|
+
* segmented field turns them on for the whole cluster.
|
|
27
57
|
*/
|
|
28
58
|
declare const DatePickerEndContent: TOC<DatePickerEndContentSignature>;
|
|
29
59
|
export { DatePickerEndContent, type DatePickerEndContentSignature };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"end-content.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/end-content.gts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"end-content.d.ts","sourceRoot":"","sources":["../../../../src/components/forms/date-picker/end-content.gts"],"names":[],"mappings":"AAoHA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,gCAAgC,CAAC;AAE1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AACvE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAIjD,UAAU,6BAA6B;IACrC,IAAI,EAAE;QACJ,OAAO,EAAE,iBAAiB,CAAC;QAC3B,WAAW,CAAC,EAAE,cAAc,CAAC,eAAe,CAAC,CAAC;QAC9C,WAAW,EAAE,OAAO,CAAC;QACrB,OAAO,EAAE,MAAM,IAAI,CAAC;QAEpB;;;;;WAKG;QACH,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;;WAIG;QACH,OAAO,EAAE,YAAY,CAAC;YAAE,OAAO,EAAE,WAAW,CAAA;SAAE,CAAC,CAAC;QAEhD,+DAA+D;QAC/D,KAAK,CAAC,EAAE,MAAM,CAAC;QACf,UAAU,CAAC,EAAE,OAAO,CAAC;QAErB;;;;;;;;WAQG;QACH,uBAAuB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;KAC3C,CAAC;IACF,OAAO,EAAE,cAAc,CAAC;CACzB;AAED;;;;;;;;;;;;;;;GAeG;AACH,QAAA,MAAM,oBAAoB,EAAE,GAAG,CAAC,6BAA6B,CA0E3D,CAAC;AAEH,OAAO,EAAE,oBAAoB,EAAE,KAAK,6BAA6B,EAAE,CAAC"}
|