ngx-strata 0.5.2 → 0.6.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/assets/icons/calendar.svg +1 -0
- package/assets/styles/components/modal.scss +13 -3
- package/dist/strata/strata.css +1 -1
- package/fesm2022/ngx-strata.mjs +1304 -4
- package/fesm2022/ngx-strata.mjs.map +1 -1
- package/package.json +1 -1
- package/skills/ngx-strata/SKILL.md +5 -0
- package/skills/ngx-strata/components/action-menu.md +1 -0
- 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/icon.md +1 -1
- package/skills/ngx-strata/components/time-picker.md +37 -0
- package/types/ngx-strata.d.ts +297 -23
package/package.json
CHANGED
|
@@ -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,6 @@ 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
|
+
- **Time-picker** (`st-time-picker`): Read
|
|
156
|
+
[`components/time-picker.md`](components/time-picker.md)
|
|
152
157
|
- **Toggle** (`st-toggle`): Read [`components/toggle.md`](components/toggle.md)
|
|
@@ -7,6 +7,7 @@ This file contains the AI documentation for the `action-menu` feature and its re
|
|
|
7
7
|
- **Imports**: `StrataActionMenuComponent`
|
|
8
8
|
- **Inputs**:
|
|
9
9
|
- `[placement] (Placement)`
|
|
10
|
+
- `[buttonSize] (ButtonSize)`
|
|
10
11
|
- `[closeOnOutsideClick] (boolean)`
|
|
11
12
|
|
|
12
13
|
## ActionMenuItem (`<st-action-menu-item>`)
|
|
@@ -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.
|
|
@@ -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`, or `calendar`<!-- 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,37 @@
|
|
|
1
|
+
# ngx-strata: time-picker Feature
|
|
2
|
+
|
|
3
|
+
This file contains the AI documentation for the `st-time-picker` component.
|
|
4
|
+
|
|
5
|
+
## Time Picker (`<st-time-picker>`)
|
|
6
|
+
- **Selector**: `st-time-picker`
|
|
7
|
+
- **Imports**: `StrataTimePickerComponent`
|
|
8
|
+
- **Inputs & Models**:
|
|
9
|
+
- `[(value)] (string | Date | null)`: Two-way Signal model for time value (e.g. `'14:30'` / `'14:30:00'` or a `Date` instance).
|
|
10
|
+
- `[format] ('12h' | '24h')`: Time display format. Defaults to `'24h'`.
|
|
11
|
+
- `[showSeconds] (boolean)`: Whether to include seconds column. Defaults to `false`.
|
|
12
|
+
- `[minuteStep] (number)`: Step interval for incrementing/decrementing minutes. Defaults to `1`.
|
|
13
|
+
- `[disabled] (boolean)`: Disables the time picker controls.
|
|
14
|
+
|
|
15
|
+
## Forms Integration
|
|
16
|
+
`StrataTimePickerComponent` implements `ControlValueAccessor` and seamlessly supports both `[(ngModel)]` and Reactive Forms (`formControlName` / `[formControl]`).
|
|
17
|
+
|
|
18
|
+
## Usage Examples
|
|
19
|
+
|
|
20
|
+
### 1. 24-Hour Time Picker
|
|
21
|
+
```html
|
|
22
|
+
<st-time-picker
|
|
23
|
+
[(value)]="selectedTime"
|
|
24
|
+
[minuteStep]="5"
|
|
25
|
+
/>
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
### 2. 12-Hour AM/PM Time Picker with Seconds
|
|
29
|
+
```html
|
|
30
|
+
<st-time-picker
|
|
31
|
+
[(value)]="appointmentTime"
|
|
32
|
+
format="12h"
|
|
33
|
+
[showSeconds]="true"
|
|
34
|
+
/>
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
> **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.
|