@eagami/ui 5.35.0 → 5.36.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eagami/ui",
3
- "version": "5.35.0",
3
+ "version": "5.36.0",
4
4
  "description": "Lightweight, accessible, themeable Angular UI component library and icon set built on CSS custom properties",
5
5
  "author": "Michal Wiraszka <michal@eagami.com>",
6
6
  "license": "MIT",
@@ -3995,15 +3995,25 @@ interface ParsedTime {
3995
3995
  * configurable steps for minutes and seconds, optional seconds column, and
3996
3996
  * integrates with Angular forms via `ControlValueAccessor`.
3997
3997
  *
3998
- * Keyboard: Tab moves between the hour, minute, (seconds), and AM/PM columns.
3999
- * Each spinner accepts ArrowUp/ArrowDown to step by 1 (or by the configured
4000
- * step), PageUp/PageDown for a coarser bump, and digit keys to type a value
3998
+ * The field itself is a text input: a time can be typed by hand and is read
3999
+ * leniently on Enter or blur. Bare digits are a 24-hour clock ("5" is 05:00,
4000
+ * "1234" is 12:34, "123456" adds seconds), `:`, `.`, `h`, and spaces all
4001
+ * separate units ("17h30", "12.34"), and an AM/PM suffix reads the hour on
4002
+ * the 12-hour clock ("5pm" is 17:00). Text that parses to no time is
4003
+ * discarded and the field falls back to the current value; clearing the text
4004
+ * clears the value.
4005
+ *
4006
+ * Keyboard: ArrowDown opens the popover and moves into the hour column. Tab
4007
+ * moves between the hour, minute, (seconds), and AM/PM columns. Each spinner
4008
+ * accepts ArrowUp/ArrowDown to step by 1 (or by the configured step),
4009
+ * PageUp/PageDown for a coarser bump, and digit keys to type a value
4001
4010
  * directly. After typing two digits (or one digit that already maxes the
4002
4011
  * unit), focus auto-advances to the next column. Backspace clears the typed
4003
4012
  * buffer; Escape closes the popover.
4004
4013
  */
4005
4014
  declare class TimePickerComponent implements ControlValueAccessor {
4006
- protected readonly triggerEl: _angular_core.Signal<ElementRef<HTMLButtonElement> | undefined>;
4015
+ protected readonly triggerEl: _angular_core.Signal<ElementRef<HTMLElement> | undefined>;
4016
+ protected readonly inputEl: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
4007
4017
  protected readonly hoursEl: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
4008
4018
  protected readonly minutesEl: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
4009
4019
  protected readonly secondsEl: _angular_core.Signal<ElementRef<HTMLInputElement> | undefined>;
@@ -4032,6 +4042,8 @@ declare class TimePickerComponent implements ControlValueAccessor {
4032
4042
  /** Fires with the new value whenever the user changes the time. */
4033
4043
  readonly changed: _angular_core.OutputEmitterRef<string | null>;
4034
4044
  readonly isOpen: _angular_core.WritableSignal<boolean>;
4045
+ /** Raw text under edit in the field, or `null` while it mirrors the value. */
4046
+ readonly typedText: _angular_core.WritableSignal<string | null>;
4035
4047
  /** Typed-digit buffer for the currently focused column, or `null` when idle. */
4036
4048
  readonly editBuffer: _angular_core.WritableSignal<{
4037
4049
  unit: Unit;
@@ -4070,13 +4082,14 @@ declare class TimePickerComponent implements ControlValueAccessor {
4070
4082
  /** Localized text shown on the trigger. Falls back to placeholder when no value. */
4071
4083
  readonly displayValue: _angular_core.Signal<string | null>;
4072
4084
  readonly resolvedPlaceholder: _angular_core.Signal<string>;
4085
+ /** What the field's input shows: the text mid-edit, else the formatted value. */
4086
+ readonly triggerText: _angular_core.Signal<string>;
4073
4087
  readonly triggerClasses: _angular_core.Signal<{
4074
4088
  [x: string]: boolean;
4075
4089
  'ea-time-picker__trigger--error': boolean;
4076
4090
  'ea-time-picker__trigger--open': boolean;
4077
4091
  'ea-time-picker__trigger--disabled': boolean;
4078
4092
  'ea-time-picker__trigger--readonly': boolean;
4079
- 'ea-time-picker__trigger--placeholder': boolean;
4080
4093
  }>;
4081
4094
  readonly wrapperClasses: _angular_core.Signal<{
4082
4095
  [x: string]: boolean;
@@ -4089,7 +4102,12 @@ declare class TimePickerComponent implements ControlValueAccessor {
4089
4102
  registerOnTouched(fn: () => void): void;
4090
4103
  setDisabledState(isDisabled: boolean): void;
4091
4104
  constructor();
4092
- toggle(): void;
4105
+ /**
4106
+ * A click anywhere on the field opens the popover and leaves the focus in
4107
+ * the input, so the caret lands where it was aimed and typing can start
4108
+ * straight away. A click while open only moves the caret.
4109
+ */
4110
+ onTriggerClick(): void;
4093
4111
  /**
4094
4112
  * Push focus into the hours input once the popover surface has been
4095
4113
  * rendered. `afterNextRender` guarantees the DOM has been updated (and the
@@ -4101,6 +4119,14 @@ declare class TimePickerComponent implements ControlValueAccessor {
4101
4119
  onPopoverCloseRequested(): void;
4102
4120
  clear(event: Event): void;
4103
4121
  handleTriggerKeydown(event: KeyboardEvent): void;
4122
+ onTriggerInput(event: Event): void;
4123
+ onTriggerBlur(): void;
4124
+ /**
4125
+ * Reads the hand-typed text and commits what it says: a time updates the
4126
+ * value, emptied text clears it, and anything unreadable is dropped so the
4127
+ * field falls back to the value it already shows.
4128
+ */
4129
+ private commitTyped;
4104
4130
  /** Stepper button or keyboard arrow nudges one column up or down. */
4105
4131
  step(unit: Unit, direction: 1 | -1): void;
4106
4132
  /**
@@ -4122,7 +4148,7 @@ declare class TimePickerComponent implements ControlValueAccessor {
4122
4148
  /** Switches the AM/PM period in 12h mode by toggling the 12-hour offset. */
4123
4149
  togglePeriod(): void;
4124
4150
  handlePopoverKeydown(event: KeyboardEvent, unit: Unit): void;
4125
- /** Escape from anywhere inside the popover closes it and refocuses the trigger. */
4151
+ /** Escape from anywhere inside the popover closes it and refocuses the field. */
4126
4152
  onPopoverEscape(event: Event): void;
4127
4153
  /** Select-all on focus so the first keystroke replaces the current value. */
4128
4154
  onSpinnerFocus(event: FocusEvent): void;