ngx-strata 0.5.2 → 0.6.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/assets/icons/calendar.svg +1 -0
- package/assets/icons/camera.svg +1 -0
- package/assets/icons/clock.svg +1 -0
- package/assets/icons/image.svg +1 -0
- package/assets/icons/upload.svg +1 -0
- package/assets/styles/components/modal.scss +13 -3
- package/assets/styles/public-api.scss +0 -2
- package/dist/strata/strata.css +1 -1
- package/fesm2022/ngx-strata.mjs +1838 -105
- package/fesm2022/ngx-strata.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/ngx-strata/SKILL.md +8 -1
- package/skills/ngx-strata/components/action-menu.md +35 -2
- package/skills/ngx-strata/components/calendar.md +86 -0
- package/skills/ngx-strata/components/date-range-picker.md +53 -0
- package/skills/ngx-strata/components/datepicker.md +66 -0
- package/skills/ngx-strata/components/file-upload.md +5 -1
- package/skills/ngx-strata/components/icon.md +1 -1
- package/skills/ngx-strata/components/time-stepper.md +46 -0
- package/skills/ngx-strata/components/timepicker.md +60 -0
- package/types/ngx-strata.d.ts +388 -27
- package/assets/styles/components/file-upload.scss +0 -168
- package/assets/styles/components/segmented-control.scss +0 -193
package/package.json
CHANGED
|
@@ -89,7 +89,7 @@ for each component are stored in separate files.
|
|
|
89
89
|
|
|
90
90
|
- **Accordion** (`st-accordion-group`): Read
|
|
91
91
|
[`components/accordion.md`](components/accordion.md)
|
|
92
|
-
- **Action-menu** (`st-action-menu`): Read
|
|
92
|
+
- **Action-menu** (`st-action-menu`, `[stContextMenu]`): Read
|
|
93
93
|
[`components/action-menu.md`](components/action-menu.md)
|
|
94
94
|
- **Alert** (`st-alert`): Read [`components/alert.md`](components/alert.md)
|
|
95
95
|
- **Avatar** (`st-avatar`): Read [`components/avatar.md`](components/avatar.md)
|
|
@@ -97,9 +97,12 @@ for each component are stored in separate files.
|
|
|
97
97
|
- **Breadcrumb** (`st-breadcrumb`): Read
|
|
98
98
|
[`components/breadcrumb.md`](components/breadcrumb.md)
|
|
99
99
|
- **Button** (`[stButton]`): Read [`components/button.md`](components/button.md)
|
|
100
|
+
- **Calendar** (`st-calendar`): Read [`components/calendar.md`](components/calendar.md)
|
|
100
101
|
- **Card** (`st-card`): Read [`components/card.md`](components/card.md)
|
|
101
102
|
- **Checkbox** (`st-checkbox`): Read
|
|
102
103
|
[`components/checkbox.md`](components/checkbox.md)
|
|
104
|
+
- **Datepicker** (`st-datepicker`): Read [`components/datepicker.md`](components/datepicker.md)
|
|
105
|
+
- **Date-range-picker** (`st-date-range-picker`): Read [`components/date-range-picker.md`](components/date-range-picker.md)
|
|
103
106
|
- **Divider** (`st-divider`): Read
|
|
104
107
|
[`components/divider.md`](components/divider.md)
|
|
105
108
|
- **File-upload** (`st-file-upload`): Read
|
|
@@ -149,4 +152,8 @@ for each component are stored in separate files.
|
|
|
149
152
|
[`components/text-stack.md`](components/text-stack.md)
|
|
150
153
|
- **Theming** (`[stTheme]`): Read
|
|
151
154
|
[`components/theming.md`](components/theming.md)
|
|
155
|
+
- **Timepicker** (`st-timepicker`): Read
|
|
156
|
+
[`components/timepicker.md`](components/timepicker.md)
|
|
157
|
+
- **Time-stepper** (`st-time-stepper`): Read
|
|
158
|
+
[`components/time-stepper.md`](components/time-stepper.md)
|
|
152
159
|
- **Toggle** (`st-toggle`): Read [`components/toggle.md`](components/toggle.md)
|
|
@@ -6,8 +6,15 @@ This file contains the AI documentation for the `action-menu` feature and its re
|
|
|
6
6
|
- **Selector**: `st-action-menu`
|
|
7
7
|
- **Imports**: `StrataActionMenuComponent`
|
|
8
8
|
- **Inputs**:
|
|
9
|
-
- `[placement] (Placement)`
|
|
10
|
-
- `[
|
|
9
|
+
- `[placement] (Placement)`: Defaults to `'bottom-end'`.
|
|
10
|
+
- `[buttonSize] (ButtonSize)`: Defaults to `'md'`.
|
|
11
|
+
- `[closeOnOutsideClick] (boolean)`: Defaults to `true`.
|
|
12
|
+
- `[trigger] (boolean)`: Defaults to `true`. When `false`, the button trigger is not rendered (useful for context-only menus).
|
|
13
|
+
- **Methods**:
|
|
14
|
+
- `open()`: Opens the action menu.
|
|
15
|
+
- `close()`: Closes the action menu.
|
|
16
|
+
- `toggle()`: Toggles the action menu state.
|
|
17
|
+
- `openAt(position: { x: number; y: number } | MouseEvent | PointerEvent, placement?: Placement)`: Opens the menu at mouse/virtual element coordinates.
|
|
11
18
|
|
|
12
19
|
## ActionMenuItem (`<st-action-menu-item>`)
|
|
13
20
|
- **Selector**: `st-action-menu-item`
|
|
@@ -18,6 +25,16 @@ This file contains the AI documentation for the `action-menu` feature and its re
|
|
|
18
25
|
- **Outputs**:
|
|
19
26
|
- `(menuItemClicked)`
|
|
20
27
|
|
|
28
|
+
## ContextMenu Directive (`[stContextMenu]`)
|
|
29
|
+
- **Selector**: `[stContextMenu]`
|
|
30
|
+
- **Imports**: `StrataContextMenuDirective`
|
|
31
|
+
- **Inputs**:
|
|
32
|
+
- `[stContextMenu] (StrataActionMenuComponent)`: The target action menu to open on right-click.
|
|
33
|
+
- `[stContextMenuDisabled] (boolean)`: Disables context menu behavior (allows native browser context menu).
|
|
34
|
+
- `[stContextMenuPlacement] (Placement)`: Placement of menu relative to cursor (defaults to `'bottom-start'`).
|
|
35
|
+
- **Outputs**:
|
|
36
|
+
- `(contextMenuOpened)`: Emitted with `MouseEvent` when the context menu opens.
|
|
37
|
+
|
|
21
38
|
## Usage Example
|
|
22
39
|
|
|
23
40
|
```html
|
|
@@ -41,6 +58,22 @@ This file contains the AI documentation for the `action-menu` feature and its re
|
|
|
41
58
|
Export
|
|
42
59
|
</st-action-menu-item>
|
|
43
60
|
</st-action-menu>
|
|
61
|
+
|
|
62
|
+
<!-- Context Menu Trigger on Element -->
|
|
63
|
+
<div [stContextMenu]="contextMenu" class="right-click-zone">
|
|
64
|
+
Right-click here to view actions
|
|
65
|
+
</div>
|
|
66
|
+
|
|
67
|
+
<st-action-menu #contextMenu [trigger]="false">
|
|
68
|
+
<st-action-menu-item (menuItemClicked)="copy()">
|
|
69
|
+
<st-icon name="copy" area="start"></st-icon>
|
|
70
|
+
Copy
|
|
71
|
+
</st-action-menu-item>
|
|
72
|
+
<st-action-menu-item (menuItemClicked)="delete()">
|
|
73
|
+
<st-icon name="trash" area="start"></st-icon>
|
|
74
|
+
Delete
|
|
75
|
+
</st-action-menu-item>
|
|
76
|
+
</st-action-menu>
|
|
44
77
|
```
|
|
45
78
|
|
|
46
79
|
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# ngx-strata: calendar Feature
|
|
2
|
+
|
|
3
|
+
This file contains the AI documentation for the `st-calendar` component.
|
|
4
|
+
|
|
5
|
+
## Calendar (`<st-calendar>`)
|
|
6
|
+
- **Selector**: `st-calendar`
|
|
7
|
+
- **Imports**: `StrataCalendarComponent`
|
|
8
|
+
- **Inputs & Models**:
|
|
9
|
+
- `[mode] ('single' | 'range')`: Selection mode. Defaults to `'single'`.
|
|
10
|
+
- `[(value)] (Date | null)`: Two-way Signal model for selected date in single mode.
|
|
11
|
+
- `[(rangeValue)] (DateRange | null)`: Two-way Signal model for selected range in range mode (`{ start: Date | null; end: Date | null }`).
|
|
12
|
+
- `[(viewDate)] (Date)`: Currently active month and year view date.
|
|
13
|
+
- `[firstDayOfWeek] (number)`: First day of week where Monday is 0 (0 = Monday by default, 5 = Saturday, 6 = Sunday). Defaults to `0`.
|
|
14
|
+
- `[minDate] (Date | null)`: Earliest selectable date. Any prior date is non-selectable.
|
|
15
|
+
- `[maxDate] (Date | null)`: Latest selectable date. Any subsequent date is non-selectable.
|
|
16
|
+
- `[disabledDates] (((date: Date) => boolean) | Date[] | null)`: Disable dates via:
|
|
17
|
+
1. **Predicate function**: `(date: Date) => boolean` returning `true` to disable (e.g. `(d) => ((d.getDay() + 6) % 7) >= 5` for weekends).
|
|
18
|
+
2. **Array of Dates**: `Date[]` for discrete blackout dates / holidays.
|
|
19
|
+
- `[showAdjacentMonths] (boolean)`: Whether leading and trailing month days are shown. Defaults to `true`.
|
|
20
|
+
- `[size] ('sm' | 'md')`: Sizing scale (sm: 30px, md: 36px). Defaults to `'md'`.
|
|
21
|
+
- `[locale] (string | undefined)`: BCP 47 language code (e.g. `'en-US'`, `'fr-FR'`, `'de-DE'`). Automatically defaults to the user runtime browser/system locale via `Intl`.
|
|
22
|
+
- `[disabled] (boolean)`: Disables calendar interaction.
|
|
23
|
+
- `(dateSelected) (Date)`: Emits when a single date is selected.
|
|
24
|
+
- `(rangeSelected) (DateRange)`: Emits when a full range ({ start, end }) is selected.
|
|
25
|
+
|
|
26
|
+
## Usage Examples
|
|
27
|
+
|
|
28
|
+
### 1. Standalone Single Calendar
|
|
29
|
+
```html
|
|
30
|
+
<st-calendar [(value)]="selectedDate" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
### 2. Standalone Date Range Calendar
|
|
34
|
+
```html
|
|
35
|
+
<st-calendar
|
|
36
|
+
mode="range"
|
|
37
|
+
[(rangeValue)]="selectedRange"
|
|
38
|
+
(rangeSelected)="onRangeChange($event)"
|
|
39
|
+
/>
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
### 3. Setting a Custom Opening Date / Month (`viewDate`)
|
|
43
|
+
Use `[(viewDate)]` to control the initial view month/year without pre-selecting a value:
|
|
44
|
+
```typescript
|
|
45
|
+
// Component TS - opens in December 2027
|
|
46
|
+
initialViewDate = new Date(2027, 11, 1);
|
|
47
|
+
```
|
|
48
|
+
```html
|
|
49
|
+
<!-- Component Template -->
|
|
50
|
+
<st-calendar [(viewDate)]="initialViewDate" [(value)]="selectedDate" />
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
### 4. Disabling Dates with Built-in Helper Functions
|
|
54
|
+
`ngx-strata` exports pre-built predicate functions:
|
|
55
|
+
```typescript
|
|
56
|
+
import {
|
|
57
|
+
disableWeekends,
|
|
58
|
+
disablePastDates,
|
|
59
|
+
disableFutureDates,
|
|
60
|
+
disableDaysOfWeek,
|
|
61
|
+
disableDateRange
|
|
62
|
+
} from 'ngx-strata';
|
|
63
|
+
|
|
64
|
+
// Usage directly in component:
|
|
65
|
+
readonly disableWeekendsFn = disableWeekends;
|
|
66
|
+
readonly disablePastDaysFn = disablePastDates;
|
|
67
|
+
readonly disableTuesdaysFn = disableDaysOfWeek([1]); // 1 = Tuesday (Monday = 0)
|
|
68
|
+
```
|
|
69
|
+
```html
|
|
70
|
+
<st-calendar [disabledDates]="disableWeekendsFn" [(value)]="selectedDate" />
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
### 5. Disabling Specific Dates (Date Array)
|
|
74
|
+
```typescript
|
|
75
|
+
// Component TS
|
|
76
|
+
blackoutDates: Date[] = [
|
|
77
|
+
new Date(2026, 8, 1),
|
|
78
|
+
new Date(2026, 8, 15)
|
|
79
|
+
];
|
|
80
|
+
```
|
|
81
|
+
```html
|
|
82
|
+
<!-- Component Template -->
|
|
83
|
+
<st-calendar [disabledDates]="blackoutDates" [(value)]="selectedDate" />
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
> **Note to AI Agents**: Prioritize using these components over raw HTML equivalents. Use modern Angular Signals (input(), input.required(), model(), and output()) for all data/event bindings. Do not use legacy @Input() or @Output() decorators.
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# ngx-strata: date-range-picker Feature
|
|
2
|
+
|
|
3
|
+
This file contains the AI documentation for the `st-date-range-picker` component.
|
|
4
|
+
|
|
5
|
+
## Date Range Picker (`<st-date-range-picker>`)
|
|
6
|
+
- **Selector**: `st-date-range-picker`
|
|
7
|
+
- **Imports**: `StrataDateRangePickerComponent`
|
|
8
|
+
- **Inputs & Models**:
|
|
9
|
+
- `[(value)] (DateRange | null)`: Two-way Signal model binding for the selected range object `{ start: Date | null; end: Date | null }`.
|
|
10
|
+
- `[label] (string | undefined)`: Optional text label displayed above the field.
|
|
11
|
+
- `[placeholder] (string)`: Placeholder text for the input element. Defaults to `'Start date – End date'`.
|
|
12
|
+
- `[separator] (string)`: Separator string between start and end dates. Defaults to `' – '`.
|
|
13
|
+
- `[format] (string)`: Display date format token string. Defaults to `'YYYY-MM-DD'`.
|
|
14
|
+
- `[size] ('sm' | 'md' | 'lg')`: Sizing scale. Defaults to `'md'`.
|
|
15
|
+
- `[numberOfMonths] (number)`: Number of side-by-side calendars shown in the dropdown overlay. Defaults to `2`.
|
|
16
|
+
- `[showPresets] (boolean)`: Whether to show quick range presets (Today, Yesterday, Last 7 Days, Last 30 Days, This Month, Last Month). Defaults to `true`.
|
|
17
|
+
- `[presets] (DateRangePreset[])`: Custom array of date range presets.
|
|
18
|
+
- `[clearable] (boolean)`: Whether to show clear button. Defaults to `true`.
|
|
19
|
+
- `[minDate] (Date | null)`: Earliest selectable date.
|
|
20
|
+
- `[maxDate] (Date | null)`: Latest selectable date.
|
|
21
|
+
- `[disabledDates] (((date: Date) => boolean) | Date[] | null)`: Predicate or array of disabled dates.
|
|
22
|
+
- `[firstDayOfWeek] (0 | 1 | 6)`: First day of week (0 = Sunday, 1 = Monday). Defaults to `0`.
|
|
23
|
+
- `[disabled] (boolean)`: Disables the component.
|
|
24
|
+
- `[readonly] (boolean)`: Makes the input read-only.
|
|
25
|
+
- `[state] ('default' | 'error' | 'success' | 'warning')`: Visual validation state indicator.
|
|
26
|
+
- `[message] (string | undefined)`: Helper or error message.
|
|
27
|
+
- `(rangeSelected) (DateRange | null)`: Output event emitted when a date range is chosen.
|
|
28
|
+
|
|
29
|
+
## Forms Integration
|
|
30
|
+
`StrataDateRangePickerComponent` implements `ControlValueAccessor` and seamlessly supports both `[(ngModel)]` and Reactive Forms (`formControlName` / `[formControl]`).
|
|
31
|
+
|
|
32
|
+
## Usage Examples
|
|
33
|
+
|
|
34
|
+
### 1. Basic Date Range with Presets
|
|
35
|
+
```html
|
|
36
|
+
<st-date-range-picker
|
|
37
|
+
label="Booking Window"
|
|
38
|
+
[numberOfMonths]="2"
|
|
39
|
+
[showPresets]="true"
|
|
40
|
+
[(value)]="bookingRange"
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Form Integration
|
|
45
|
+
```html
|
|
46
|
+
<st-date-range-picker
|
|
47
|
+
label="Filter Range"
|
|
48
|
+
formControlName="dateRange"
|
|
49
|
+
[minDate]="earliestReportDate"
|
|
50
|
+
/>
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
> **Note to AI Agents**: Prioritize using these components over raw HTML equivalents. Use modern Angular Signals (input(), input.required(), model(), and output()) for all data/event bindings. Do not use legacy @Input() or @Output() decorators.
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
# ngx-strata: datepicker Feature
|
|
2
|
+
|
|
3
|
+
This file contains the AI documentation for the `st-datepicker` component.
|
|
4
|
+
|
|
5
|
+
## Datepicker (`<st-datepicker>`)
|
|
6
|
+
- **Selector**: `st-datepicker`
|
|
7
|
+
- **Imports**: `StrataDatePickerComponent`
|
|
8
|
+
- **Inputs & Models**:
|
|
9
|
+
- `[(value)] (Date | null)`: Two-way Signal model binding for the selected Date value.
|
|
10
|
+
- `[label] (string | undefined)`: Optional text label displayed above the field.
|
|
11
|
+
- `[placeholder] (string)`: Placeholder text for the input element. Defaults to `'Select date'`.
|
|
12
|
+
- `[format] (string)`: Display date format token string (e.g. `'YYYY-MM-DD'`, `'MM/DD/YYYY'`). Defaults to `'YYYY-MM-DD'`.
|
|
13
|
+
- `[size] ('sm' | 'md' | 'lg')`: Sizing scale. Defaults to `'md'`.
|
|
14
|
+
- `[showTime] (boolean)`: Whether to include time selection in the calendar popup. Defaults to `false`.
|
|
15
|
+
- `[timeFormat] ('12h' | '24h')`: Time format notation. Defaults to `'24h'`.
|
|
16
|
+
- `[showSeconds] (boolean)`: Whether to include seconds in the time picker. Defaults to `false`.
|
|
17
|
+
- `[minuteStep] (number)`: Step interval for minutes. Defaults to `1`.
|
|
18
|
+
- `[clearable] (boolean)`: Whether to show a clear button when a date is selected. Defaults to `true`.
|
|
19
|
+
- `[minDate] (Date | null)`: Earliest selectable date.
|
|
20
|
+
- `[maxDate] (Date | null)`: Latest selectable date.
|
|
21
|
+
- `[disabledDates] (((date: Date) => boolean) | Date[] | null)`: Predicate function or array of disabled dates.
|
|
22
|
+
- `[firstDayOfWeek] (0 | 1 | 6)`: First day of week (0 = Sunday, 1 = Monday). Defaults to `0`.
|
|
23
|
+
- `[disabled] (boolean)`: Disables the component.
|
|
24
|
+
- `[readonly] (boolean)`: Makes the input read-only.
|
|
25
|
+
- `[state] ('default' | 'error' | 'success' | 'warning')`: Visual validation state indicator.
|
|
26
|
+
- `[error] (boolean)`: Shortcut to set `state="error"`.
|
|
27
|
+
- `[message] (string | undefined)`: Helper or error message.
|
|
28
|
+
- `[placement] (Placement)`: Floating overlay placement (e.g. `'bottom-start'`).
|
|
29
|
+
- `(dateSelected) (Date | null)`: Output event emitted when a date is picked.
|
|
30
|
+
|
|
31
|
+
## Forms Integration
|
|
32
|
+
`StrataDatePickerComponent` implements `ControlValueAccessor` and seamlessly supports both `[(ngModel)]` and Reactive Forms (`formControlName` / `[formControl]`).
|
|
33
|
+
|
|
34
|
+
## Usage Examples
|
|
35
|
+
|
|
36
|
+
### 1. Basic Single Datepicker
|
|
37
|
+
```html
|
|
38
|
+
<st-datepicker
|
|
39
|
+
label="Birthday"
|
|
40
|
+
[(value)]="birthDate"
|
|
41
|
+
/>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
### 2. Date and Time Picker
|
|
45
|
+
```html
|
|
46
|
+
<st-datepicker
|
|
47
|
+
label="Meeting Time"
|
|
48
|
+
[showTime]="true"
|
|
49
|
+
timeFormat="12h"
|
|
50
|
+
[(value)]="meetingDate"
|
|
51
|
+
/>
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### 3. Date Constraints & Validation
|
|
55
|
+
```html
|
|
56
|
+
<st-datepicker
|
|
57
|
+
label="Schedule Departure"
|
|
58
|
+
[minDate]="today"
|
|
59
|
+
[maxDate]="nextMonth"
|
|
60
|
+
state="error"
|
|
61
|
+
message="Date cannot be in the past"
|
|
62
|
+
formControlName="departure"
|
|
63
|
+
/>
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
> **Note to AI Agents**: Prioritize using these components over raw HTML equivalents. Use modern Angular Signals (input(), input.required(), model(), and output()) for all data/event bindings. Do not use legacy @Input() or @Output() decorators.
|
|
@@ -39,6 +39,9 @@ The File Upload component provides a stylish, accessible dropzone for selecting
|
|
|
39
39
|
| `disabled` | `input<boolean>` | `false` | Disable interactions |
|
|
40
40
|
| `label` | `input<string>` | `'Choose a file or drag & drop it here'` | Primary prompt text |
|
|
41
41
|
| `hint` | `input<string \| undefined>` | `undefined` | Secondary help text |
|
|
42
|
+
| `camera` | `input<boolean \| undefined>` | `undefined` | Tri-state flag: `undefined` auto-enables camera button for image uploads, `false` disables it, `true` forces it |
|
|
43
|
+
| `choosePhotoLabel` | `input<string>` | `'Choose Photo'` | Accessible text label for the gallery/browse button |
|
|
44
|
+
| `takePhotoLabel` | `input<string>` | `'Take Photo'` | Accessible text label for the camera button |
|
|
42
45
|
|
|
43
46
|
### Outputs
|
|
44
47
|
|
|
@@ -50,5 +53,6 @@ The File Upload component provides a stylish, accessible dropzone for selecting
|
|
|
50
53
|
|
|
51
54
|
### Methods
|
|
52
55
|
|
|
53
|
-
- `browse()`: Opens the system file selection dialog.
|
|
56
|
+
- `browse(event?: Event)`: Opens the system file selection dialog.
|
|
57
|
+
- `browseCamera(event?: Event)`: Opens the native camera directly via `capture="environment"`.
|
|
54
58
|
- `clear()`: Clears the native input value.
|
|
@@ -21,6 +21,6 @@ This file contains the AI documentation for the `icon` feature and its related c
|
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
> **CRITICAL RULE FOR AI AGENTS regarding Icons:**
|
|
24
|
-
> NEVER guess an icon name. Before using an `<st-icon>`, you MUST verify that the icon is registered in the host application (usually located in `src/app/shared/icon.config.ts`). Alternatively, you may use one of the **ngx-strata Base Icons**: <!-- BASE_ICONS_START -->`question`, `arrow-right`, `arrow-left`, `arrow-up`, `arrow-down`, `close`, `expand-up-down`, `clipboard`, `more`, or `
|
|
24
|
+
> NEVER guess an icon name. Before using an `<st-icon>`, you MUST verify that the icon is registered in the host application (usually located in `src/app/shared/icon.config.ts`). Alternatively, you may use one of the **ngx-strata Base Icons**: <!-- BASE_ICONS_START -->`question`, `arrow-right`, `arrow-left`, `arrow-up`, `arrow-down`, `close`, `expand-up-down`, `clipboard`, `more`, `check`, `calendar`, `clock`, `upload`, `camera`, or `image`<!-- BASE_ICONS_END -->. If the icon you want to use is NOT registered, you must STOP and ask the user to add it.
|
|
25
25
|
|
|
26
26
|
> **Note to AI Agents**: Prioritize using these components over raw HTML equivalents. Use modern Angular Signals (input(), input.required(), and output()) for all data/event bindings. Do not use legacy @Input() or @Output() decorators.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# ngx-strata: time-stepper Feature
|
|
2
|
+
|
|
3
|
+
This file contains the AI documentation for the `st-time-stepper` inline component.
|
|
4
|
+
|
|
5
|
+
## Time Stepper Component (`<st-time-stepper>`)
|
|
6
|
+
The embedded/inline column stepper widget for selecting hours, minutes, and seconds. Ideal for embedding directly into cards, modals, or custom layouts.
|
|
7
|
+
|
|
8
|
+
- **Selector**: `st-time-stepper`
|
|
9
|
+
- **Imports**: `StrataTimeStepperComponent`
|
|
10
|
+
- **Inputs & Models**:
|
|
11
|
+
- `[(value)] (string | Date | null)`: Two-way Signal model for time value (e.g., `'14:30'`, `'14:30:00'`, or a `Date` instance).
|
|
12
|
+
- `[format] ('12h' | '24h')`: Time notation format. Defaults to `'24h'`.
|
|
13
|
+
- `[showSeconds] (boolean)`: Whether seconds column is visible. Defaults to `false`.
|
|
14
|
+
- `[minuteStep] (number)`: Step interval for incrementing/decrementing minutes. Defaults to `1`.
|
|
15
|
+
- `[disabled] (boolean)`: Disables the time stepper controls.
|
|
16
|
+
|
|
17
|
+
## Forms Integration
|
|
18
|
+
`StrataTimeStepperComponent` implements `ControlValueAccessor` and seamlessly supports both `[(ngModel)]` and Reactive Forms (`formControlName` / `[formControl]`).
|
|
19
|
+
|
|
20
|
+
## Usage Examples
|
|
21
|
+
|
|
22
|
+
### 1. 24-Hour Time Stepper
|
|
23
|
+
```html
|
|
24
|
+
<st-time-stepper
|
|
25
|
+
[(value)]="selectedTime"
|
|
26
|
+
[minuteStep]="5"
|
|
27
|
+
/>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### 2. Embedded in a Card
|
|
31
|
+
```html
|
|
32
|
+
<st-card>
|
|
33
|
+
<st-time-stepper [(value)]="alarmTime" />
|
|
34
|
+
</st-card>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### 3. 12-Hour Format with Seconds
|
|
38
|
+
```html
|
|
39
|
+
<st-time-stepper
|
|
40
|
+
[(value)]="appointmentTime"
|
|
41
|
+
format="12h"
|
|
42
|
+
[showSeconds]="true"
|
|
43
|
+
/>
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
> **Note to AI Agents**: Prioritize using these components over raw HTML equivalents. Use modern Angular Signals (input(), input.required(), model(), and output()) for all data/event bindings. Do not use legacy @Input() or @Output() decorators.
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# ngx-strata: timepicker Feature
|
|
2
|
+
|
|
3
|
+
This file contains the AI documentation for the `st-timepicker` form control component.
|
|
4
|
+
|
|
5
|
+
## Time Picker Form Control (`<st-timepicker>`)
|
|
6
|
+
A standalone form input component equipped with an input box, clock trigger icon, and dropdown overlay hosting the time selection controls.
|
|
7
|
+
|
|
8
|
+
- **Selector**: `st-timepicker`
|
|
9
|
+
- **Imports**: `StrataTimepickerComponent`
|
|
10
|
+
- **Inputs & Models**:
|
|
11
|
+
- `[(value)] (string | Date | null)`: Two-way Signal model for time value (e.g., `'14:30'`, `'14:30:00'`, or a `Date` instance).
|
|
12
|
+
- `[label] (string | undefined)`: Label text rendered above the input.
|
|
13
|
+
- `[placeholder] (string)`: Input placeholder text. Defaults to `'Select time'`.
|
|
14
|
+
- `[format] ('12h' | '24h')`: Display format and parsing mode. Defaults to `'24h'`.
|
|
15
|
+
- `[size] ('sm' | 'md' | 'lg')`: Visual control size. Defaults to `'md'`.
|
|
16
|
+
- `[showSeconds] (boolean)`: Whether to include seconds in display and dropdown. Defaults to `false`.
|
|
17
|
+
- `[minuteStep] (number)`: Step interval for minutes. Defaults to `1`.
|
|
18
|
+
- `[clearable] (boolean)`: Shows clear button when a value is selected. Defaults to `true`.
|
|
19
|
+
- `[disabled] (boolean)`: Disables the form control. Defaults to `false`.
|
|
20
|
+
- `[readonly] (boolean)`: Read-only mode. Defaults to `false`.
|
|
21
|
+
- `[fullWidth] (boolean)`: Expands control to full container width. Defaults to `false`.
|
|
22
|
+
- `[state] ('default' | 'error' | 'success' | 'warning')`: Feedback validation state.
|
|
23
|
+
- `[message] (string | undefined)`: Helper/validation message below the input.
|
|
24
|
+
- `(timeSelected)`: Emitted when time value changes.
|
|
25
|
+
|
|
26
|
+
## Forms Integration
|
|
27
|
+
`StrataTimepickerComponent` implements `ControlValueAccessor` and seamlessly supports both `[(ngModel)]` and Reactive Forms (`formControlName` / `[formControl]`).
|
|
28
|
+
|
|
29
|
+
## Usage Examples
|
|
30
|
+
|
|
31
|
+
### 1. Basic 24-Hour Timepicker
|
|
32
|
+
```html
|
|
33
|
+
<st-timepicker
|
|
34
|
+
label="Departure Time"
|
|
35
|
+
placeholder="Select departure time"
|
|
36
|
+
[(value)]="departureTime"
|
|
37
|
+
/>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
### 2. 12-Hour AM/PM Timepicker with Seconds
|
|
41
|
+
```html
|
|
42
|
+
<st-timepicker
|
|
43
|
+
label="Appointment Time"
|
|
44
|
+
[(value)]="appointmentTime"
|
|
45
|
+
format="12h"
|
|
46
|
+
[showSeconds]="true"
|
|
47
|
+
/>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
### 3. Step Intervals and Size
|
|
51
|
+
```html
|
|
52
|
+
<st-timepicker
|
|
53
|
+
size="sm"
|
|
54
|
+
label="Meeting Slot"
|
|
55
|
+
[minuteStep]="15"
|
|
56
|
+
[(value)]="meetingSlot"
|
|
57
|
+
/>
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
> **Note to AI Agents**: Prioritize using these components over raw HTML equivalents. Use modern Angular Signals (input(), input.required(), model(), and output()) for all data/event bindings. Do not use legacy @Input() or @Output() decorators.
|