quang 20.2.4 → 20.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.
@@ -20,10 +20,12 @@ The `QuangAutocompleteComponent` is a comprehensive autocomplete input with real
20
20
  - `componentPlaceholder`: `string` — Placeholder text for the input. Inherited from `QuangBaseComponent`
21
21
  - `componentTabIndex`: `number` — Tab index for accessibility. Inherited from `QuangBaseComponent`
22
22
  - `componentClass`: `string | string[]` — Additional CSS classes. Inherited from `QuangBaseComponent`
23
- - `errorMap`: `{[key: string]: string}` — Custom error messages. Inherited from `QuangBaseComponent`
23
+ - `errorMap`: `ErrorData[]` — Custom error messages. Inherited from `QuangBaseComponent`
24
24
  - `successMessage`: `string` — Success message to display. Inherited from `QuangBaseComponent`
25
- - `helpMessage`: `string` — Help text for the component. Inherited from `QuangBaseComponent`
25
+ - `helpMessage`: `string` — Help text displayed as a tooltip or below the input. Inherited from `QuangBaseComponent`
26
+ - `helpMessageTooltip`: `boolean` — If true, help message is shown as a tooltip (with icon); if false, help message is shown inline below the input. Default: `false`. Inherited from `QuangBaseComponent`
26
27
  - `formControl`: `FormControl` — Form control for reactive forms. Inherited from `QuangBaseComponent`
28
+ - Tooltip icon projection: to display the tooltip icon, use `<ng-content select="[help-icon]" />` in the component template.
27
29
 
28
30
  ## Outputs
29
31
 
@@ -39,10 +41,33 @@ The `QuangAutocompleteComponent` is a comprehensive autocomplete input with real
39
41
  <quang-autocomplete
40
42
  [selectOptions]="countryOptions"
41
43
  formControlName="country"
44
+ />
45
+ ```
46
+
47
+ ### Help Message as Tooltip
48
+
49
+ ```html
50
+ <quang-autocomplete
51
+ [selectOptions]="countryOptions"
52
+ [helpMessage]="'form.help.country'"
53
+ [helpMessageTooltip]="true"
54
+ formControlName="country"
42
55
  >
56
+ <svg-icon src="assets/icons/svg/help.svg" help-icon />
43
57
  </quang-autocomplete>
44
58
  ```
45
59
 
60
+ ### Help Message Inline
61
+
62
+ ```html
63
+ <quang-autocomplete
64
+ [selectOptions]="countryOptions"
65
+ [helpMessage]="'form.help.country'"
66
+ [helpMessageTooltip]="false"
67
+ formControlName="country"
68
+ />
69
+ ```
70
+
46
71
  ### Multiple Selection with Chips
47
72
 
48
73
  ```html
@@ -61,7 +61,7 @@ declare class QuangAutocompleteComponent extends QuangBaseComponent<string | num
61
61
  deleteChip(chipValue: any): void;
62
62
  createChipList(chip: any): void;
63
63
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuangAutocompleteComponent, never>;
64
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangAutocompleteComponent, "quang-autocomplete", never, { "syncFormWithText": { "alias": "syncFormWithText"; "required": false; "isSignal": true; }; "optionListMaxHeight": { "alias": "optionListMaxHeight"; "required": false; "isSignal": true; }; "selectOptions": { "alias": "selectOptions"; "required": true; "isSignal": true; }; "translateValue": { "alias": "translateValue"; "required": false; "isSignal": true; }; "scrollBehaviorOnOpen": { "alias": "scrollBehaviorOnOpen"; "required": false; "isSignal": true; }; "emitOnly": { "alias": "emitOnly"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "chipMaxLength": { "alias": "chipMaxLength"; "required": false; "isSignal": true; }; "multiSelectDisplayMode": { "alias": "multiSelectDisplayMode"; "required": false; "isSignal": true; }; "searchTextDebounce": { "alias": "searchTextDebounce"; "required": false; "isSignal": true; }; "internalFilterOptions": { "alias": "internalFilterOptions"; "required": false; "isSignal": true; }; }, { "selectedOption": "selectedOption"; "searchTextChange": "searchTextChange"; }, never, never, true, never>;
64
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangAutocompleteComponent, "quang-autocomplete", never, { "syncFormWithText": { "alias": "syncFormWithText"; "required": false; "isSignal": true; }; "optionListMaxHeight": { "alias": "optionListMaxHeight"; "required": false; "isSignal": true; }; "selectOptions": { "alias": "selectOptions"; "required": true; "isSignal": true; }; "translateValue": { "alias": "translateValue"; "required": false; "isSignal": true; }; "scrollBehaviorOnOpen": { "alias": "scrollBehaviorOnOpen"; "required": false; "isSignal": true; }; "emitOnly": { "alias": "emitOnly"; "required": false; "isSignal": true; }; "multiple": { "alias": "multiple"; "required": false; "isSignal": true; }; "chipMaxLength": { "alias": "chipMaxLength"; "required": false; "isSignal": true; }; "multiSelectDisplayMode": { "alias": "multiSelectDisplayMode"; "required": false; "isSignal": true; }; "searchTextDebounce": { "alias": "searchTextDebounce"; "required": false; "isSignal": true; }; "internalFilterOptions": { "alias": "internalFilterOptions"; "required": false; "isSignal": true; }; }, { "selectedOption": "selectedOption"; "searchTextChange": "searchTextChange"; }, never, ["[help-icon]"], true, never>;
65
65
  }
66
66
 
67
67
  export { QuangAutocompleteComponent };
@@ -12,10 +12,12 @@ The `QuangCheckboxComponent` is a versatile checkbox and toggle switch component
12
12
  - `componentPlaceholder`: `string` — Placeholder text for the input. Inherited from `QuangBaseComponent`
13
13
  - `componentTabIndex`: `number` — Tab index for accessibility. Inherited from `QuangBaseComponent`
14
14
  - `componentClass`: `string | string[]` — Additional CSS classes. Inherited from `QuangBaseComponent`
15
- - `errorMap`: `{[key: string]: string}` — Custom error messages. Inherited from `QuangBaseComponent`
15
+ - `errorMap`: `ErrorData[]` — Custom error messages. Inherited from `QuangBaseComponent`
16
16
  - `successMessage`: `string` — Success message to display. Inherited from `QuangBaseComponent`
17
- - `helpMessage`: `string` — Help text for the component. Inherited from `QuangBaseComponent`
17
+ - `helpMessage`: `string` — Help text displayed as a tooltip or below the input. Inherited from `QuangBaseComponent`
18
+ - `helpMessageTooltip`: `boolean` — If true, help message is shown as a tooltip (with icon); if false, help message is shown inline below the input. Default: `false`. Inherited from `QuangBaseComponent`
18
19
  - `formControl`: `FormControl` — Form control for reactive forms. Inherited from `QuangBaseComponent`
20
+ - Tooltip icon projection: to display the tooltip icon, use `<ng-content select="[help-icon]" />` in the component template.
19
21
 
20
22
  ## Outputs
21
23
 
@@ -24,17 +26,40 @@ The `QuangCheckboxComponent` is a versatile checkbox and toggle switch component
24
26
 
25
27
  ## Usage
26
28
 
29
+
27
30
  ### Basic Checkbox
31
+ ```html
32
+ <quang-checkbox
33
+ checkType="checkbox"
34
+ componentLabel="form.label.agreeToTerms"
35
+ formControlName="agreeToTerms"
36
+ />
37
+ ```
28
38
 
39
+ ### Help Message as Tooltip
29
40
  ```html
30
41
  <quang-checkbox
31
42
  checkType="checkbox"
32
43
  componentLabel="form.label.agreeToTerms"
44
+ [helpMessage]="'form.help.agreeToTerms'"
45
+ [helpMessageTooltip]="true"
33
46
  formControlName="agreeToTerms"
34
47
  >
48
+ <svg-icon src="assets/icons/svg/help.svg" help-icon />
35
49
  </quang-checkbox>
36
50
  ```
37
51
 
52
+ ### Help Message Inline
53
+ ```html
54
+ <quang-checkbox
55
+ checkType="checkbox"
56
+ componentLabel="form.label.agreeToTerms"
57
+ [helpMessage]="'form.help.agreeToTerms'"
58
+ [helpMessageTooltip]="false"
59
+ formControlName="agreeToTerms"
60
+ />
61
+ ```
62
+
38
63
  ### Toggle Switch
39
64
 
40
65
  ```html
@@ -8,7 +8,7 @@ declare class QuangCheckboxComponent extends QuangBaseComponent<boolean> {
8
8
  removeMargin: _angular_core.InputSignal<boolean>;
9
9
  onChangedEventHandler($event: Event): void;
10
10
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuangCheckboxComponent, never>;
11
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangCheckboxComponent, "quang-checkbox", never, { "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "checkType": { "alias": "checkType"; "required": true; "isSignal": true; }; "removeMargin": { "alias": "removeMargin"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
11
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangCheckboxComponent, "quang-checkbox", never, { "labelPosition": { "alias": "labelPosition"; "required": false; "isSignal": true; }; "checkType": { "alias": "checkType"; "required": true; "isSignal": true; }; "removeMargin": { "alias": "removeMargin"; "required": false; "isSignal": true; }; }, {}, never, ["[help-icon]"], true, never>;
12
12
  }
13
13
 
14
14
  export { QuangCheckboxComponent };
@@ -5,23 +5,27 @@ The `QuangDateComponent` is a comprehensive date and time picker based on [Air D
5
5
  ## Supported Features
6
6
 
7
7
  ### Date Selection Modes
8
+
8
9
  - **Single Date**: Select a single date
9
10
  - **Date Range**: Select start and end dates with range highlighting
10
11
  - **Inline Calendar**: Display calendar directly in the page without popup
11
12
  - **Time Only**: Show only time picker without date selection
12
13
 
13
14
  ### Input Formats
15
+
14
16
  - **Custom Date Formats**: Configurable display formats using Unicode date patterns
15
17
  - **Time Formats**: Separate time format configuration
16
18
  - **Invalid Date Handling**: Custom messages for invalid date inputs
17
19
  - **Search Input**: Live search with debouncing for date input
18
20
 
19
21
  ### Internationalization
22
+
20
23
  - **Multi-language Support**: Integrated with QuangTranslationService
21
24
  - **Locale Override**: Manual locale setting capability
22
25
  - **Browser Language Fallback**: Automatic language detection
23
26
 
24
27
  ### Customization
28
+
25
29
  - **Icon Support**: Custom calendar icons through content projection
26
30
  - **CSS Styling**: Custom classes for calendar and button elements
27
31
  - **Position Control**: Configurable popup positioning
@@ -57,15 +61,18 @@ The `QuangDateComponent` is a comprehensive date and time picker based on [Air D
57
61
  - `searchTextDebounce`: `number` — Debounce time in milliseconds for search input. Default: `500`
58
62
 
59
63
  All standard inputs inherited from `QuangBaseComponent`:
64
+
60
65
  - `isReadonly`: `boolean` — Makes the input read-only
61
66
  - `componentLabel`: `string` — Label text (supports i18n keys)
62
67
  - `componentPlaceholder`: `string` — Placeholder text (supports i18n keys)
63
68
  - `componentTabIndex`: `number` — Tab index for accessibility
64
69
  - `componentClass`: `string` — Additional CSS classes for the input element
65
- - `errorMap`: `Record<string, any>` — Validation error messages
70
+ - `errorMap`: `ErrorData[]` — Validation error messages
66
71
  - `successMessage`: `string` — Success message text
67
72
  - `helpMessage`: `string` — Help text displayed below the input
73
+ - `helpMessageTooltip`: `boolean` — If true, displays help message as a tooltip (with projected icon); if false, displays help message inline below the input. Default: `false`
68
74
  - `formControl`: `FormControl` — Angular reactive form control
75
+ - Tooltip icon projection: to display the tooltip icon, use `<ng-content select="[help-icon]" />` in the component template.
69
76
 
70
77
  ## Outputs
71
78
 
@@ -78,6 +85,7 @@ All standard inputs inherited from `QuangBaseComponent`:
78
85
  ## Usage
79
86
 
80
87
  ### Basic Date Picker
88
+
81
89
  ```html
82
90
  <quang-date
83
91
  [errorMap]="errors()"
@@ -89,386 +97,65 @@ All standard inputs inherited from `QuangBaseComponent`:
89
97
  ```
90
98
 
91
99
  ### Date Picker with Time Selection
100
+
92
101
  ```html
93
102
  <quang-date
94
103
  [errorMap]="errors()"
95
- [timepicker]="true"
96
- [minDate]="minDate"
97
104
  [maxDate]="maxDate"
105
+ [minDate]="minDate"
106
+ [timepicker]="true"
98
107
  componentLabel="form.label.appointment"
99
108
  dateFormat="dd/MM/yyyy"
100
- timeFormat="HH:mm"
101
109
  formControlName="appointmentDateTime"
110
+ timeFormat="HH:mm"
102
111
  >
103
- <img src="assets/icons/svg/calendar.svg" alt="Calendar" />
112
+ <img
113
+ alt="Calendar"
114
+ src="assets/icons/svg/calendar.svg"
115
+ />
104
116
  </quang-date>
105
117
  ```
106
118
 
107
119
  ### Date Range Selection
120
+
108
121
  ```html
109
122
  <quang-date
110
123
  [errorMap]="errors()"
111
- [rangeSelection]="true"
112
- [minDate]="startDate"
113
124
  [maxDate]="endDate"
125
+ [minDate]="startDate"
126
+ [rangeSelection]="true"
114
127
  componentLabel="form.label.dateRange"
115
- multipleDatesSeparator=" to "
116
128
  formControlName="dateRange"
129
+ multipleDatesSeparator=" to "
117
130
  >
118
131
  <i class="fas fa-calendar-alt"></i>
119
132
  </quang-date>
120
133
  ```
121
134
 
122
- ### Time-Only Picker
123
- ```html
124
- <quang-date
125
- [errorMap]="errors()"
126
- [showOnlyTimepicker]="true"
127
- [minHour]="9"
128
- [maxHour]="17"
129
- [minMinute]="0"
130
- [maxMinute]="59"
131
- componentLabel="form.label.meetingTime"
132
- timeFormat="HH:mm"
133
- formControlName="meetingTime"
134
- >
135
- <svg-icon src="assets/icons/svg/clock.svg" />
136
- </quang-date>
137
- ```
138
-
139
- ### Inline Calendar
140
- ```html
141
- <quang-date
142
- [errorMap]="errors()"
143
- [showInline]="true"
144
- [timepicker]="true"
145
- componentLabel="form.label.eventDate"
146
- formControlName="eventDate"
147
- calendarClasses="custom-calendar-style"
148
- />
149
- ```
150
-
151
- ### Custom Date Format and Validation
152
- ```html
153
- <quang-date
154
- [errorMap]="errors()"
155
- [minDate]="minAllowedDate"
156
- [maxDate]="maxAllowedDate"
157
- dateFormat="yyyy-MM-dd"
158
- invalidDateMessage="Please enter a valid date in YYYY-MM-DD format"
159
- componentLabel="form.label.deadline"
160
- componentPlaceholder="YYYY-MM-DD"
161
- formControlName="deadline"
162
- >
163
- <svg-icon src="assets/icons/svg/calendar.svg" />
164
- </quang-date>
165
- ```
166
-
167
- ### Advanced Configuration with Air Datepicker Options
168
- ```html
169
- <quang-date
170
- [errorMap]="errors()"
171
- [datepickerOptions]="customDatepickerOptions"
172
- componentLabel="form.label.advancedDate"
173
- formControlName="advancedDate"
174
- >
175
- <svg-icon src="assets/icons/svg/calendar.svg" />
176
- </quang-date>
177
- ```
178
-
179
- #### TypeScript Configuration Example
180
- ```typescript
181
- customDatepickerOptions: QuangDatepickerOptions = {
182
- view: 'months',
183
- minView: 'months',
184
- dateFormat: 'MM/yyyy',
185
- autoClose: true,
186
- position: 'top center',
187
- offset: 10,
188
- showOtherMonths: false,
189
- selectOtherMonths: false,
190
- moveToOtherMonthsOnSelect: false
191
- };
192
- ```
193
-
194
- ### Localization Example
195
- ```html
196
- <!-- Use specific locale -->
197
- <quang-date
198
- [errorMap]="errors()"
199
- activeLanguageOverride="it"
200
- componentLabel="form.label.dataCompleanno"
201
- formControlName="dataCompleanno"
202
- >
203
- <svg-icon src="assets/icons/svg/calendar.svg" />
204
- </quang-date>
205
-
206
- <!-- Use QuangTranslationService automatic detection -->
207
- <quang-date
208
- [errorMap]="errors()"
209
- componentLabel="form.label.date"
210
- formControlName="date"
211
- >
212
- <svg-icon src="assets/icons/svg/calendar.svg" />
213
- </quang-date>
214
- ```
215
-
216
- ## Installation & Setup
217
-
218
- ### Required Styles
219
- Add the global date component styles to your application:
220
-
221
- **Option 1: In angular.json**
222
- ```json
223
- "styles": [
224
- "node_modules/quang/components/date/global-date.component.scss"
225
- ]
226
- ```
227
-
228
- **Option 2: In your global styles file**
229
- ```scss
230
- @import 'quang/components/date/global-date.component.scss';
231
- ```
232
-
233
- **Option 3: In vendors folder (recommended)**
234
- ```scss
235
- // src/sass/vendors/_date-component.scss
236
- @import 'node_modules/quang/components/date/global-date.component.scss';
237
- ```
238
-
239
- ### Air Datepicker Integration
240
- The component automatically handles Air Datepicker setup and configuration. Supported locales include:
241
- - English (en) - Default
242
- - Italian (it)
243
- - French (fr)
244
- - Auto-detection based on browser/QuangTranslationService
245
-
246
135
  ## Component Behavior
247
136
 
248
137
  ### Date Format Patterns
138
+
249
139
  Uses [Unicode Date Field Symbol Table](https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table):
250
140
 
251
- | Pattern | Description | Example |
252
- |---------|-------------|---------|
253
- | `dd/MM/yyyy` | Day/Month/Year | 25/12/2023 |
254
- | `MM/dd/yyyy` | Month/Day/Year | 12/25/2023 |
255
- | `yyyy-MM-dd` | ISO Date | 2023-12-25 |
256
- | `dd MMM yyyy` | Day Month Year | 25 Dec 2023 |
257
- | `EEEE, dd MMMM yyyy` | Full Date | Monday, 25 December 2023 |
141
+ | Pattern | Description | Example |
142
+ | -------------------- | -------------- | ------------------------ |
143
+ | `dd/MM/yyyy` | Day/Month/Year | 25/12/2023 |
144
+ | `MM/dd/yyyy` | Month/Day/Year | 12/25/2023 |
145
+ | `yyyy-MM-dd` | ISO Date | 2023-12-25 |
146
+ | `dd MMM yyyy` | Day Month Year | 25 Dec 2023 |
147
+ | `EEEE, dd MMMM yyyy` | Full Date | Monday, 25 December 2023 |
258
148
 
259
149
  ### Time Format Patterns
260
- | Pattern | Description | Example |
261
- |---------|-------------|---------|
262
- | `HH:mm` | 24-hour format | 14:30 |
263
- | `hh:mm a` | 12-hour format | 02:30 PM |
264
- | `HH:mm:ss` | With seconds | 14:30:45 |
265
-
266
- ### Display Modes
267
-
268
- #### Single Date Mode (Default)
269
- - Returns: `Date | null`
270
- - User selects one date
271
- - Input shows formatted date string
272
-
273
- #### Range Selection Mode
274
- - Returns: `DateRange | null` = `{ dateFrom: string | null, dateTo: string | null }`
275
- - User selects start and end dates
276
- - Input shows both dates with separator
277
- - Visual range highlighting in calendar
278
-
279
- #### Time-Only Mode
280
- - Returns: `string` in specified time format
281
- - No date selection available
282
- - Only time picker controls visible
283
-
284
- #### Inline Mode
285
- - Calendar always visible
286
- - No popup behavior
287
- - Useful for dashboard widgets or dedicated date selection areas
288
-
289
- ### Validation Integration
290
-
291
- #### Built-in Validation
292
- - **Date Range**: Automatic validation against `minDate`/`maxDate`
293
- - **Time Range**: Validation against `minHour`/`maxHour`, `minMinute`/`maxMinute`
294
- - **Format Validation**: Invalid date format detection with custom messages
295
-
296
- #### Custom Validation
297
- ```typescript
298
- // Custom validator example
299
- dateValidator(control: AbstractControl): ValidationErrors | null {
300
- const value = control.value;
301
- if (!value) return null;
302
-
303
- const selectedDate = new Date(value);
304
- const today = new Date();
305
-
306
- if (selectedDate < today) {
307
- return { pastDate: { message: 'Date cannot be in the past' } };
308
- }
309
-
310
- return null;
311
- }
312
- ```
313
-
314
- ### Accessibility Features
315
-
316
- #### Keyboard Navigation
317
- - **Tab**: Navigate to/from date input
318
- - **Enter/Space**: Open calendar when focused on button
319
- - **Arrow Keys**: Navigate calendar dates
320
- - **Escape**: Close calendar popup
321
-
322
- #### Screen Reader Support
323
- - **ARIA Labels**: Calendar button properly labeled
324
- - **Date Announcements**: Selected dates announced
325
- - **Error Messages**: Validation errors announced
326
- - **Help Text**: Additional guidance provided
327
-
328
- #### Focus Management
329
- - **Focus Trapping**: Keyboard focus contained within open calendar
330
- - **Focus Return**: Focus returns to trigger element when calendar closes
331
- - **Visual Indicators**: Clear focus styling
332
-
333
- ### Performance Considerations
334
-
335
- #### Debouncing
336
- - **Search Input**: Configurable debounce for typed date input
337
- - **Validation**: Debounced validation to prevent excessive API calls
338
- - **Change Detection**: OnPush strategy for optimal performance
339
-
340
- #### Memory Management
341
- - **Air Datepicker Cleanup**: Automatic instance destruction
342
- - **Event Listeners**: Proper cleanup on component destruction
343
- - **Subscription Management**: RxJS subscriptions properly handled
344
150
 
345
- ## Best Practices
346
-
347
- ### Date Format Selection
348
- - **Use consistent formats**: Stick to one format throughout your application
349
- - **Consider locale**: Match user's expected date format for their region
350
- - **ISO format**: Use `yyyy-MM-dd` for data storage and API communication
351
- - **User-friendly display**: Use localized formats like `dd/MM/yyyy` for UI
352
-
353
- ### Range Selection Guidelines
354
- - **Clear separators**: Use intuitive separators like " to " or " - "
355
- - **Validation**: Always validate that end date is after start date
356
- - **User feedback**: Provide clear visual indication of selected range
357
- - **Default behavior**: Consider setting reasonable default ranges
358
-
359
- ### Time Picker Configuration
360
- - **Business hours**: Use `minHour`/`maxHour` to limit to relevant times
361
- - **Step intervals**: Configure minute steps for appointment scheduling
362
- - **Format consistency**: Match time format with user expectations
363
-
364
- ### Internationalization
365
- - **Automatic detection**: Let QuangTranslationService handle locale automatically
366
- - **Override sparingly**: Only use `activeLanguageOverride` for specific cases
367
- - **Test multiple locales**: Verify date formats work across all supported languages
368
-
369
- ### Performance Optimization
370
- - **Debouncing**: Increase `searchTextDebounce` for slower networks
371
- - **Inline calendars**: Use sparingly as they're always rendered
372
- - **Air Datepicker options**: Avoid complex configurations that impact performance
373
-
374
- ## Troubleshooting
375
-
376
- ### Common Issues
377
-
378
- #### Calendar not showing
379
- - **Check styles**: Ensure global styles are imported
380
- - **Z-index conflicts**: Calendar popup may be behind other elements
381
- - **Container overflow**: Parent containers may clip calendar popup
382
- - **Content projection**: Verify icon/content is projected correctly
383
-
384
- #### Date format issues
385
- - **Invalid patterns**: Check Unicode date pattern syntax
386
- - **Locale mismatch**: Format patterns may not match selected locale
387
- - **Parsing errors**: Ensure `invalidDateMessage` provides clear guidance
388
-
389
- #### Validation problems
390
- - **Min/max dates**: Verify date constraints are properly set
391
- - **Time constraints**: Check hour/minute ranges are logical
392
- - **Custom validators**: Ensure proper integration with Angular forms
393
-
394
- #### Localization not working
395
- - **QuangTranslationService**: Check service is properly configured
396
- - **Language fallback**: Browser language detection may fail
397
- - **Manual override**: Use `activeLanguageOverride` as fallback
398
-
399
- ### Performance Issues
400
-
401
- #### Slow calendar opening
402
- - **Reduce options complexity**: Simplify `datepickerOptions`
403
- - **Debounce optimization**: Adjust `searchTextDebounce` value
404
- - **Check for memory leaks**: Ensure proper component cleanup
405
-
406
- #### Memory usage
407
- - **Air Datepicker instances**: Component handles cleanup automatically
408
- - **Event listeners**: Should be cleaned up on destroy
409
- - **Large date ranges**: Consider pagination for extensive date selections
410
-
411
- ### Styling Problems
412
-
413
- #### Button styling
414
- - **Use `buttonClass`**: Add custom classes via input
415
- - **Bootstrap conflicts**: Check for conflicting CSS rules
416
- - **Responsive design**: Test on different screen sizes
417
-
418
- #### Calendar appearance
419
- - **Global styles**: Ensure proper SCSS import
420
- - **Custom themes**: Use `calendarClasses` for theming
421
- - **Mobile responsiveness**: Test calendar popup on mobile devices
422
-
423
- ### Integration Issues
424
-
425
- #### Form validation
426
- - **Error messages**: Use `errorMap` for custom validation messages
427
- - **Success states**: Configure `successMessage` for positive feedback
428
- - **Help text**: Use `helpMessage` for user guidance
429
-
430
- #### API integration
431
- - **Date serialization**: Use consistent format for API calls
432
- - **Time zones**: Handle time zone conversion properly
433
- - **Range queries**: Format date ranges correctly for backend
434
-
435
- #### Third-party conflicts
436
- - **CSS frameworks**: Check for styling conflicts
437
- - **Date libraries**: Avoid conflicts with other date manipulation libraries
438
- - **Event handling**: Ensure proper event propagation
439
-
440
- ## Advanced Configuration
441
-
442
- ### Custom Air Datepicker Options
443
- ```typescript
444
- // Advanced configuration example
445
- advancedOptions: QuangDatepickerOptions = {
446
- view: 'years',
447
- minView: 'months',
448
- maxView: 'years',
449
- startDate: new Date(),
450
- firstDay: 1, // Monday as first day
451
- weekends: [6, 0], // Saturday, Sunday
452
- dateFormat: 'dd/MM/yyyy',
453
- altField: true,
454
- altFieldDateFormat: 'yyyy-MM-dd',
455
- showOtherMonths: true,
456
- selectOtherMonths: true,
457
- moveToOtherMonthsOnSelect: true,
458
- showOtherYears: true,
459
- selectOtherYears: true,
460
- moveToOtherYearsOnSelect: true,
461
- minDate: new Date(),
462
- maxDate: new Date(Date.now() + 365 * 24 * 60 * 60 * 1000), // +1 year
463
- disabledDates: [new Date('2023-12-25')], // Christmas
464
- position: 'bottom center',
465
- offset: 12,
466
- autoClose: true,
467
- toggleSelected: false
468
- };
469
- ```
151
+ | Pattern | Description | Example |
152
+ | ---------- | -------------- | -------- |
153
+ | `HH:mm` | 24-hour format | 14:30 |
154
+ | `hh:mm a` | 12-hour format | 02:30 PM |
155
+ | `HH:mm:ss` | With seconds | 14:30:45 |
470
156
 
471
157
  ### Custom Styling
158
+
472
159
  ```scss
473
160
  // Custom calendar styling
474
161
  .custom-calendar-style {
@@ -476,12 +163,12 @@ advancedOptions: QuangDatepickerOptions = {
476
163
  border: 2px solid #007bff;
477
164
  border-radius: 8px;
478
165
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
479
-
166
+
480
167
  .air-datepicker-cell.-selected- {
481
168
  background: linear-gradient(45deg, #007bff, #0056b3);
482
169
  color: white;
483
170
  }
484
-
171
+
485
172
  .air-datepicker-cell.-in-range- {
486
173
  background-color: rgba(0, 123, 255, 0.1);
487
174
  }
@@ -494,18 +181,21 @@ advancedOptions: QuangDatepickerOptions = {
494
181
  This component extends the `QuangBaseComponent` and inherits its features, such as label, error messages, and success messages.
495
182
 
496
183
  ### Air Datepicker Integration
184
+
497
185
  - **Full API Access**: Use `datepickerOptions` for complete Air Datepicker configuration
498
186
  - **Event Handling**: Component manages `onSelect` and `onHide` events automatically
499
187
  - **Localization**: Automatic locale configuration with fallback options
500
188
  - **Instance Management**: Air Datepicker instances are properly created and destroyed
501
189
 
502
190
  ### Form Integration
191
+
503
192
  - **Reactive Forms**: Full support for Angular reactive forms
504
193
  - **Template-driven Forms**: Compatible with template-driven forms
505
194
  - **Validation**: Integrates with Angular validation system
506
195
  - **Change Detection**: Optimized with OnPush strategy
507
196
 
508
197
  ### QuangTranslationService Integration
198
+
509
199
  - **Automatic Language**: Uses active language from translation service
510
200
  - **Label Translation**: All labels support i18n keys
511
201
  - **Message Translation**: Error and help messages support translation
@@ -83,7 +83,7 @@ declare class QuangDateComponent extends QuangBaseComponent<string | DateRange |
83
83
  private setupTimepicker;
84
84
  checkDateMatch(date: string): boolean;
85
85
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<QuangDateComponent, never>;
86
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangDateComponent, "quang-date", never, { "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "timeFormat": { "alias": "timeFormat"; "required": false; "isSignal": true; }; "activeLanguageOverride": { "alias": "activeLanguageOverride"; "required": false; "isSignal": true; }; "timepicker": { "alias": "timepicker"; "required": false; "isSignal": true; }; "invalidDateMessage": { "alias": "invalidDateMessage"; "required": false; "isSignal": true; }; "showOnlyTimepicker": { "alias": "showOnlyTimepicker"; "required": false; "isSignal": true; }; "minHour": { "alias": "minHour"; "required": false; "isSignal": true; }; "maxHour": { "alias": "maxHour"; "required": false; "isSignal": true; }; "minMinute": { "alias": "minMinute"; "required": false; "isSignal": true; }; "maxMinute": { "alias": "maxMinute"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "showInline": { "alias": "showInline"; "required": false; "isSignal": true; }; "calendarClasses": { "alias": "calendarClasses"; "required": false; "isSignal": true; }; "buttonClass": { "alias": "buttonClass"; "required": false; "isSignal": true; }; "datepickerOptions": { "alias": "datepickerOptions"; "required": false; "isSignal": true; }; "multipleDatesSeparator": { "alias": "multipleDatesSeparator"; "required": false; "isSignal": true; }; "rangeSelection": { "alias": "rangeSelection"; "required": false; "isSignal": true; }; "searchTextDebounce": { "alias": "searchTextDebounce"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
86
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<QuangDateComponent, "quang-date", never, { "dateFormat": { "alias": "dateFormat"; "required": false; "isSignal": true; }; "timeFormat": { "alias": "timeFormat"; "required": false; "isSignal": true; }; "activeLanguageOverride": { "alias": "activeLanguageOverride"; "required": false; "isSignal": true; }; "timepicker": { "alias": "timepicker"; "required": false; "isSignal": true; }; "invalidDateMessage": { "alias": "invalidDateMessage"; "required": false; "isSignal": true; }; "showOnlyTimepicker": { "alias": "showOnlyTimepicker"; "required": false; "isSignal": true; }; "minHour": { "alias": "minHour"; "required": false; "isSignal": true; }; "maxHour": { "alias": "maxHour"; "required": false; "isSignal": true; }; "minMinute": { "alias": "minMinute"; "required": false; "isSignal": true; }; "maxMinute": { "alias": "maxMinute"; "required": false; "isSignal": true; }; "minDate": { "alias": "minDate"; "required": false; "isSignal": true; }; "maxDate": { "alias": "maxDate"; "required": false; "isSignal": true; }; "showInline": { "alias": "showInline"; "required": false; "isSignal": true; }; "calendarClasses": { "alias": "calendarClasses"; "required": false; "isSignal": true; }; "buttonClass": { "alias": "buttonClass"; "required": false; "isSignal": true; }; "datepickerOptions": { "alias": "datepickerOptions"; "required": false; "isSignal": true; }; "multipleDatesSeparator": { "alias": "multipleDatesSeparator"; "required": false; "isSignal": true; }; "rangeSelection": { "alias": "rangeSelection"; "required": false; "isSignal": true; }; "searchTextDebounce": { "alias": "searchTextDebounce"; "required": false; "isSignal": true; }; }, {}, never, ["[help-icon]", "*"], true, never>;
87
87
  }
88
88
 
89
89
  export { QuangDateComponent };