@acorex/components 22.0.0-next.2 → 22.0.0-next.21

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.
Files changed (76) hide show
  1. package/combo-box/README.md +3 -0
  2. package/fesm2022/acorex-components-calendar.mjs +12 -14
  3. package/fesm2022/acorex-components-calendar.mjs.map +1 -1
  4. package/fesm2022/acorex-components-color-palette.mjs +2 -2
  5. package/fesm2022/acorex-components-color-palette.mjs.map +1 -1
  6. package/fesm2022/acorex-components-combo-box.mjs +669 -0
  7. package/fesm2022/acorex-components-combo-box.mjs.map +1 -0
  8. package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs +50 -0
  9. package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-DCcRJYfF.mjs.map +1 -0
  10. package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs → acorex-components-conversation-open-composer-picker-for-files-BuNEjswI.mjs} +2 -2
  11. package/fesm2022/{acorex-components-conversation-open-composer-picker-for-files-Hh5Oyp3p.mjs.map → acorex-components-conversation-open-composer-picker-for-files-BuNEjswI.mjs.map} +1 -1
  12. package/fesm2022/acorex-components-conversation.mjs +194 -5768
  13. package/fesm2022/acorex-components-conversation.mjs.map +1 -1
  14. package/fesm2022/acorex-components-cron-job.mjs +12 -12
  15. package/fesm2022/acorex-components-cron-job.mjs.map +1 -1
  16. package/fesm2022/acorex-components-datetime-box.mjs +44 -12
  17. package/fesm2022/acorex-components-datetime-box.mjs.map +1 -1
  18. package/fesm2022/acorex-components-datetime-input.mjs +332 -312
  19. package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
  20. package/fesm2022/acorex-components-datetime-picker.mjs +11 -1
  21. package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
  22. package/fesm2022/acorex-components-decorators.mjs +2 -2
  23. package/fesm2022/acorex-components-decorators.mjs.map +1 -1
  24. package/fesm2022/acorex-components-file-viewer.mjs +346 -125
  25. package/fesm2022/acorex-components-file-viewer.mjs.map +1 -1
  26. package/fesm2022/acorex-components-form.mjs +4 -3
  27. package/fesm2022/acorex-components-form.mjs.map +1 -1
  28. package/fesm2022/acorex-components-list.mjs +265 -19
  29. package/fesm2022/acorex-components-list.mjs.map +1 -1
  30. package/fesm2022/acorex-components-map.mjs +1170 -13712
  31. package/fesm2022/acorex-components-map.mjs.map +1 -1
  32. package/fesm2022/acorex-components-menu.mjs +211 -74
  33. package/fesm2022/acorex-components-menu.mjs.map +1 -1
  34. package/fesm2022/acorex-components-phone-box.mjs +6 -6
  35. package/fesm2022/acorex-components-phone-box.mjs.map +1 -1
  36. package/fesm2022/acorex-components-popup.mjs +388 -78
  37. package/fesm2022/acorex-components-popup.mjs.map +1 -1
  38. package/fesm2022/acorex-components-query-builder.mjs +6 -2
  39. package/fesm2022/acorex-components-query-builder.mjs.map +1 -1
  40. package/fesm2022/acorex-components-rest-api-generator.mjs +2 -2
  41. package/fesm2022/acorex-components-rest-api-generator.mjs.map +1 -1
  42. package/fesm2022/acorex-components-rrule.mjs +2 -2
  43. package/fesm2022/acorex-components-rrule.mjs.map +1 -1
  44. package/fesm2022/acorex-components-scheduler-picker.mjs +16 -16
  45. package/fesm2022/acorex-components-scheduler-picker.mjs.map +1 -1
  46. package/fesm2022/acorex-components-scheduler.mjs +2 -2
  47. package/fesm2022/acorex-components-scheduler.mjs.map +1 -1
  48. package/fesm2022/acorex-components-select-box.mjs +176 -451
  49. package/fesm2022/acorex-components-select-box.mjs.map +1 -1
  50. package/fesm2022/acorex-components-selection-list.mjs +0 -4
  51. package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
  52. package/package.json +7 -7
  53. package/select-box/README.md +2 -0
  54. package/types/acorex-components-combo-box.d.ts +202 -0
  55. package/types/acorex-components-conversation.d.ts +11 -25
  56. package/types/acorex-components-datetime-box.d.ts +16 -4
  57. package/types/acorex-components-datetime-input.d.ts +62 -68
  58. package/types/acorex-components-file-viewer.d.ts +109 -17
  59. package/types/acorex-components-list.d.ts +65 -3
  60. package/types/acorex-components-map.d.ts +299 -45
  61. package/types/acorex-components-menu.d.ts +26 -4
  62. package/types/acorex-components-phone-box.d.ts +2 -2
  63. package/types/acorex-components-popup.d.ts +143 -35
  64. package/types/acorex-components-query-builder.d.ts +10 -9
  65. package/types/acorex-components-select-box.d.ts +36 -147
  66. package/types/acorex-components-selection-list.d.ts +1 -2
  67. package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-CNHiM1Sp.mjs +0 -106
  68. package/fesm2022/acorex-components-conversation-composer-action-choice-dialog.component-CNHiM1Sp.mjs.map +0 -1
  69. package/fesm2022/acorex-components-modal-acorex-components-modal-Djl-uo9b.mjs +0 -388
  70. package/fesm2022/acorex-components-modal-acorex-components-modal-Djl-uo9b.mjs.map +0 -1
  71. package/fesm2022/acorex-components-modal-modal-content.component-BpUsCI8D.mjs +0 -247
  72. package/fesm2022/acorex-components-modal-modal-content.component-BpUsCI8D.mjs.map +0 -1
  73. package/fesm2022/acorex-components-modal.mjs +0 -2
  74. package/fesm2022/acorex-components-modal.mjs.map +0 -1
  75. package/modal/README.md +0 -3
  76. package/types/acorex-components-modal.d.ts +0 -132
@@ -1,17 +1,25 @@
1
1
  import { MXInputBaseValueComponent, AXComponent, AXFocusableComponent, AXValuableComponent, AXClearableComponent } from '@acorex/cdk/common';
2
2
  import { AXCalendarService } from '@acorex/core/date-time';
3
- import { AXFormatService } from '@acorex/core/format';
4
- import { AXLocaleService } from '@acorex/core/locale';
3
+ import { AXLocaleService, AXIRLocaleProfile } from '@acorex/core/locale';
5
4
  import { AXPlatform } from '@acorex/core/platform';
6
5
  import { getWordBoundsAtPosition } from '@acorex/core/utils';
7
6
  import * as i0 from '@angular/core';
8
- import { inject, signal, input, computed, linkedSignal, viewChild, output, effect, untracked, forwardRef, HostBinding, HostListener, ViewEncapsulation, Component, NgModule } from '@angular/core';
7
+ import { InjectionToken, inject, signal, input, output, computed, linkedSignal, viewChild, effect, untracked, forwardRef, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
9
8
  import * as i1 from '@angular/forms';
10
9
  import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
11
10
  import { map } from 'rxjs';
12
11
 
12
+ const AXDateTimeInputDefaultConfig = {
13
+ allowTyping: false,
14
+ };
15
+ const AX_DATETIME_INPUT_CONFIG = new InjectionToken('AX_DATETIME_INPUT_CONFIG', {
16
+ providedIn: 'root',
17
+ factory: () => AXDateTimeInputDefaultConfig,
18
+ });
19
+
13
20
  /**
14
- * A component for date and time input with various custom features.
21
+ * A component for date and time input with segment-based typing, keyboard navigation,
22
+ * and calendar-aware formatting (gregorian and solar-hijri).
15
23
  *
16
24
  * @category Components
17
25
  */
@@ -19,12 +27,10 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
19
27
  constructor() {
20
28
  super(...arguments);
21
29
  this.platformService = inject(AXPlatform);
22
- this.formatService = inject(AXFormatService);
23
30
  this.localeService = inject(AXLocaleService);
24
31
  this.calendarService = inject(AXCalendarService);
25
- /**
26
- * @ignore
27
- */
32
+ this.defaultConfig = inject(AX_DATETIME_INPUT_CONFIG);
33
+ /** @ignore */
28
34
  this._editingParts = {
29
35
  year: {
30
36
  key: 'year',
@@ -33,7 +39,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
33
39
  enabled: false,
34
40
  default: 2023,
35
41
  typedValue: null,
36
- realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.year.placeholder),
42
+ realValue: () => this._formatPart(this._editingDate(), this._editingParts.year.placeholder),
37
43
  },
38
44
  month: {
39
45
  key: 'month',
@@ -42,7 +48,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
42
48
  enabled: false,
43
49
  default: 1,
44
50
  typedValue: null,
45
- realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.month.placeholder),
51
+ realValue: () => this._formatPart(this._editingDate(), this._editingParts.month.placeholder),
46
52
  },
47
53
  day: {
48
54
  key: 'day',
@@ -51,7 +57,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
51
57
  enabled: false,
52
58
  default: 1,
53
59
  typedValue: null,
54
- realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.day.placeholder),
60
+ realValue: () => this._formatPart(this._editingDate(), this._editingParts.day.placeholder),
55
61
  },
56
62
  hour: {
57
63
  key: 'hour',
@@ -60,7 +66,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
60
66
  enabled: false,
61
67
  default: 0,
62
68
  typedValue: null,
63
- realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.hour.placeholder),
69
+ realValue: () => this._formatPart(this._editingDate(), this._editingParts.hour.placeholder),
64
70
  },
65
71
  minute: {
66
72
  key: 'minute',
@@ -69,7 +75,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
69
75
  enabled: false,
70
76
  default: 0,
71
77
  typedValue: null,
72
- realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.minute.placeholder),
78
+ realValue: () => this._formatPart(this._editingDate(), this._editingParts.minute.placeholder),
73
79
  },
74
80
  second: {
75
81
  key: 'second',
@@ -78,7 +84,7 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
78
84
  enabled: false,
79
85
  default: 0,
80
86
  typedValue: null,
81
- realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.second.placeholder),
87
+ realValue: () => this._formatPart(this._editingDate(), this._editingParts.second.placeholder),
82
88
  },
83
89
  AMPM: {
84
90
  key: 'AMPM',
@@ -87,79 +93,98 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
87
93
  enabled: false,
88
94
  default: 0,
89
95
  typedValue: null,
90
- realValue: () => this.formatService.format(this._editingDate(), 'datetime', this._editingParts.AMPM.placeholder),
96
+ realValue: () => this._formatPart(this._editingDate(), this._editingParts.AMPM.placeholder),
91
97
  },
92
98
  };
93
- /**
94
- * @ignore
95
- */
99
+ /** @ignore */
96
100
  this._editingText = signal('', /* @ts-ignore */
97
101
  ...(ngDevMode ? [{ debugName: "_editingText" }] : /* istanbul ignore next */ []));
98
- /**
99
- * @ignore
100
- */
102
+ /** @ignore */
101
103
  this._inputChars = [];
104
+ /** @ignore */
105
+ this._activePart = signal(null, /* @ts-ignore */
106
+ ...(ngDevMode ? [{ debugName: "_activePart" }] : /* istanbul ignore next */ []));
102
107
  /**
103
- * Indicates whether typing is allowed in the input field.
108
+ * When true, the user can type digits and navigate segments with the keyboard.
109
+ * When false, keyboard input is blocked (used by datetime-box picker mode).
110
+ * Defaults to `AX_DATETIME_INPUT_CONFIG.allowTyping` when not set on the instance.
104
111
  * @defaultValue false
105
112
  */
106
- this.allowTyping = input(false, /* @ts-ignore */
113
+ this.allowTyping = input(this.defaultConfig.allowTyping, /* @ts-ignore */
107
114
  ...(ngDevMode ? [{ debugName: "allowTyping" }] : /* istanbul ignore next */ []));
108
115
  /**
109
116
  * @description The calendar type to use for the datetime input.
110
117
  */
111
118
  this.calendar = input(null, /* @ts-ignore */
112
119
  ...(ngDevMode ? [{ debugName: "calendar" }] : /* istanbul ignore next */ []));
113
- this._calendarSystem = computed(() => this.calendar() ?? this.localeService.activeProfile().calendar.system, /* @ts-ignore */
114
- ...(ngDevMode ? [{ debugName: "_calendarSystem" }] : /* istanbul ignore next */ []));
115
- this._activePart = signal(null, /* @ts-ignore */
116
- ...(ngDevMode ? [{ debugName: "_activePart" }] : /* istanbul ignore next */ []));
117
- // TODO: fix this
118
- // #effect = effect(() => {
119
- // this._activePart()
120
- // this._clearInputBuffer();
121
- // });
122
- this._editingDate = linkedSignal(() => this.calendarService.now(this._calendarSystem()), /* @ts-ignore */
123
- ...(ngDevMode ? [{ debugName: "_editingDate" }] : /* istanbul ignore next */ []));
124
- /**
125
- * @ignore
126
- */
127
- this.input = viewChild('input', /* @ts-ignore */
128
- ...(ngDevMode ? [{ debugName: "input" }] : /* istanbul ignore next */ []));
129
120
  this.minValue = input(null, /* @ts-ignore */
130
121
  ...(ngDevMode ? [{ debugName: "minValue" }] : /* istanbul ignore next */ []));
131
122
  this.maxValue = input(null, /* @ts-ignore */
132
123
  ...(ngDevMode ? [{ debugName: "maxValue" }] : /* istanbul ignore next */ []));
133
124
  /**
134
- * Emitted when a click event occurs on the datetime box.
125
+ * Emitted when a click event occurs on the datetime input.
135
126
  * @event
136
127
  */
137
128
  this.onClick = output();
138
129
  this.picker = input('datetime', /* @ts-ignore */
139
130
  ...(ngDevMode ? [{ debugName: "picker" }] : /* istanbul ignore next */ []));
140
- this._resolvedFormat = computed(() => this.format() ?? this.localeService.activeProfile().formats[this.picker()]?.short ?? '', /* @ts-ignore */
141
- ...(ngDevMode ? [{ debugName: "_resolvedFormat" }] : /* istanbul ignore next */ []));
142
131
  /**
143
132
  * @deprecated use locale & mode instead
144
133
  */
145
134
  this.format = input(/* @ts-ignore */
146
135
  ...(ngDevMode ? [undefined, { debugName: "format" }] : /* istanbul ignore next */ []));
147
- this.#effect = effect(() => {
148
- this._resolvedFormat();
149
- this._calendarSystem();
150
- this._detectParts();
151
- untracked(() => {
152
- this._updateText();
153
- });
136
+ this._calendarSystem = computed(() => this.calendar() ?? this.localeService.activeProfile().calendar.system, /* @ts-ignore */
137
+ ...(ngDevMode ? [{ debugName: "_calendarSystem" }] : /* istanbul ignore next */ []));
138
+ this._resolvedFormat = computed(() => {
139
+ if (this.format()) {
140
+ return this.format();
141
+ }
142
+ // Calendar override can differ from the active locale; solar-hijri uses day/month/year.
143
+ const formats = this._calendarSystem() === 'solar-hijri' ? AXIRLocaleProfile.formats : this.localeService.activeProfile().formats;
144
+ return formats[this.picker()]?.short ?? '';
154
145
  }, /* @ts-ignore */
155
- ...(ngDevMode ? [{ debugName: "#effect" }] : /* istanbul ignore next */ []));
146
+ ...(ngDevMode ? [{ debugName: "_resolvedFormat" }] : /* istanbul ignore next */ []));
147
+ /** @ignore */
148
+ this._editingDate = linkedSignal(() => this.calendarService.now(this._calendarSystem()), /* @ts-ignore */
149
+ ...(ngDevMode ? [{ debugName: "_editingDate" }] : /* istanbul ignore next */ []));
150
+ /** @ignore */
151
+ this.inputRef = viewChild('input', /* @ts-ignore */
152
+ ...(ngDevMode ? [{ debugName: "inputRef" }] : /* istanbul ignore next */ []));
156
153
  /**
157
154
  * @description check if page is in rtl or ltr
158
155
  */
159
156
  this.isRtl = signal(this.platformService.isRtl(), /* @ts-ignore */
160
157
  ...(ngDevMode ? [{ debugName: "isRtl" }] : /* istanbul ignore next */ []));
158
+ /** @ignore */
159
+ this.#formatEffect = effect(() => {
160
+ this._resolvedFormat();
161
+ this._calendarSystem();
162
+ this._detectParts();
163
+ untracked(() => {
164
+ this.internalValueChanged(this.value);
165
+ });
166
+ }, /* @ts-ignore */
167
+ ...(ngDevMode ? [{ debugName: "#formatEffect" }] : /* istanbul ignore next */ []));
168
+ }
169
+ /** @ignore */
170
+ get inputElement() {
171
+ return this.inputRef()?.nativeElement;
172
+ }
173
+ /** @ignore */
174
+ #formatEffect;
175
+ /** @ignore */
176
+ ngOnInit() {
177
+ super.ngOnInit();
178
+ this.platformService.directionChange.pipe(map((i) => i.data === 'rtl')).subscribe((isRtl) => this.isRtl.set(isRtl));
179
+ }
180
+ /**
181
+ * Formats a part using the calendar already attached to the AXDateTime.
182
+ * @ignore
183
+ */
184
+ _formatPart(date, placeholder) {
185
+ return date.format(placeholder);
161
186
  }
162
- #effect;
187
+ /** @ignore */
163
188
  _detectParts() {
164
189
  Object.values(this._editingParts).forEach((e) => {
165
190
  e.enabled = false;
@@ -173,17 +198,8 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
173
198
  }
174
199
  });
175
200
  }
176
- /**
177
- * @description listen to direction change to react to it.
178
- */
179
- ngOnInit() {
180
- this.platformService.directionChange.pipe(map((i) => i.data === 'rtl')).subscribe((isRtl) => this.isRtl.set(isRtl));
181
- }
182
- /**
183
- * @ignore
184
- */
201
+ /** @ignore */
185
202
  _getOrderedParts() {
186
- // TODO: better spliter format
187
203
  const formatParts = this._resolvedFormat().split(/[^a-zA-Z]+/);
188
204
  const result = [];
189
205
  formatParts.forEach((f) => {
@@ -193,18 +209,13 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
193
209
  });
194
210
  return result;
195
211
  }
196
- /**
197
- * @ignore
198
- */
212
+ /** @ignore */
199
213
  _clearInputBuffer() {
200
214
  this._inputChars = [];
201
215
  }
202
- /**
203
- * @ignore
204
- */
216
+ /** @ignore */
205
217
  _updateText() {
206
218
  let text = this._resolvedFormat();
207
- //
208
219
  Object.values(this._editingParts).forEach((part) => {
209
220
  if (this._activePart() == part.key) {
210
221
  if (part.typedValue)
@@ -221,52 +232,50 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
221
232
  this._highlightActivePart();
222
233
  }
223
234
  }
224
- //TODO: fix this
225
- /**
226
- * Sets the internal date value, adjusting it based on editing parts.
227
- * @param value - The date to set. Returns `undefined` if no value is provided.
228
- * @ignore
229
- */
230
- // override internalSetValue(value?: Date) {
231
- // console.log('internalSetValue', value);
232
- // if (value) {
233
- // let editingDate = this.calendarService.create(value, this._calendarSystem());
234
- // let applyChanges = false;
235
- // Object.values(this._editingParts).forEach((part) => {
236
- // if (!part.enabled) {
237
- // editingDate = editingDate.set(part.key as TimeUnit, part.default);
238
- // applyChanges = true;
239
- // }
240
- // });
241
- // if (applyChanges) {
242
- // return editingDate.date;
243
- // }
244
- // }
245
- // return value;
246
- // }
247
235
  /**
248
236
  * Handles changes to the internal date value, updating editing parts and text representation.
249
- *
250
- * @param value - The new date value. If not provided, resets editing parts.
251
237
  * @ignore
252
238
  */
253
239
  internalValueChanged(value) {
254
240
  if (value && this.calendarService.isValidDate(value)) {
255
- this._editingDate.set(this.calendarService.create(value, this._calendarSystem()));
256
- }
257
- Object.values(this._editingParts).forEach((part) => {
258
- if (value) {
259
- if (part.typedValue != part.placeholder)
260
- part.typedValue = part.realValue();
241
+ const next = this.calendarService.create(value, this._calendarSystem());
242
+ const sameAsEditing = this._editingDate().date.getTime() === next.date.getTime();
243
+ this._editingDate.set(next);
244
+ // Parent ngModel echo after typing — keep the in-progress segment buffer.
245
+ if (sameAsEditing && this._activePart()) {
246
+ this._updateText();
247
+ return;
261
248
  }
262
- else
249
+ Object.values(this._editingParts).forEach((part) => {
250
+ part.typedValue = part.enabled ? part.realValue() : null;
251
+ });
252
+ this._clearInputBuffer();
253
+ }
254
+ else {
255
+ Object.values(this._editingParts).forEach((part) => {
263
256
  part.typedValue = null;
264
- });
257
+ });
258
+ this._clearInputBuffer();
259
+ }
265
260
  this._updateText();
266
261
  }
267
262
  /**
268
- * @ignore
263
+ * Normalizes Persian (U+06F0-U+06F9) and Arabic-Indic (U+0660-U+0669) digits to ASCII.
264
+ * @ignore
269
265
  */
266
+ _normalizeDigit(key) {
267
+ if (!key || key.length !== 1)
268
+ return null;
269
+ const code = key.charCodeAt(0);
270
+ if (code >= 0x30 && code <= 0x39)
271
+ return key;
272
+ if (code >= 0x06f0 && code <= 0x06f9)
273
+ return String.fromCharCode(code - 0x06f0 + 0x30);
274
+ if (code >= 0x0660 && code <= 0x0669)
275
+ return String.fromCharCode(code - 0x0660 + 0x30);
276
+ return null;
277
+ }
278
+ /** @ignore */
270
279
  _handleOnKeydownEvent(e) {
271
280
  const ignore = () => {
272
281
  if (e.key === 'Tab' || e.code === 'Space' || e.code === 'Enter') {
@@ -280,12 +289,10 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
280
289
  return;
281
290
  }
282
291
  const input = e.target;
283
- //
284
292
  const orderedParts = this._getOrderedParts();
285
293
  const part = this._activePart() ? this._editingParts[this._activePart()] : orderedParts[0];
286
294
  const nextPart = part ? orderedParts[orderedParts.indexOf(part) + 1] : null;
287
295
  const prevPart = part ? orderedParts[orderedParts.indexOf(part) - 1] : null;
288
- //
289
296
  const goNext = () => {
290
297
  this._clearInputBuffer();
291
298
  if (nextPart) {
@@ -300,41 +307,48 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
300
307
  this._highlightActivePart();
301
308
  }
302
309
  };
303
- /*************** Handle Left and Right **************/
310
+ const digit = this._normalizeDigit(e.key);
304
311
  if (e.code === 'ArrowRight' || e.code === 'ArrowLeft') {
305
312
  ignore();
306
- e.code === 'ArrowRight' ? goNext() : goPrev();
313
+ if (!this._activePart()) {
314
+ this._activePart.set(part?.key ?? null);
315
+ this._highlightActivePart();
316
+ }
317
+ else {
318
+ e.code === 'ArrowRight' ? goNext() : goPrev();
319
+ }
307
320
  }
308
321
  else if ((e.code === 'ArrowUp' || e.code === 'ArrowDown') && !e.ctrlKey) {
309
- /*************** Handle Up and Down **************/
310
- if (this.disabled || this.readonly) {
311
- ignore();
322
+ ignore();
323
+ if (this.disabled || this.readonly || !part) {
312
324
  return;
313
325
  }
314
- else {
315
- ignore();
316
- const sign = e.code === 'ArrowUp' ? +1 : -1;
317
- this._activePart.set(part.key);
318
- const newVal = this._editingDate().add(part.key, sign);
319
- this._editingParts[part.key].typedValue = this.formatService.format(newVal, 'datetime', this._editingParts[part.key].placeholder);
320
- this._editingDate.set(newVal);
321
- this._detectValueChanges();
322
- }
326
+ const sign = e.code === 'ArrowUp' ? +1 : -1;
327
+ this._activePart.set(part.key);
328
+ this._clearInputBuffer();
329
+ const unit = part.key === 'AMPM' ? 'hour' : part.key;
330
+ const amount = part.key === 'AMPM' ? sign * 12 : sign;
331
+ const newVal = this._editingDate().add(unit, amount);
332
+ this._editingDate.set(newVal);
333
+ this._getOrderedParts().forEach((p) => {
334
+ p.typedValue = p.realValue();
335
+ });
336
+ this._detectValueChanges();
323
337
  }
324
338
  else if (e.code == 'Backspace' || e.code == 'Delete') {
325
- /*************** Handle Backspace **************/
326
- if (this.disabled || this.readonly) {
339
+ if (this.disabled || this.readonly || !part) {
327
340
  return;
328
341
  }
329
342
  if (input.value) {
330
343
  ignore();
344
+ this._clearInputBuffer();
345
+ this._activePart.set(part.key);
331
346
  this._editingParts[part.key].typedValue = this._editingParts[part.key].placeholder;
332
- this._detectValueChanges();
347
+ this._updateText();
333
348
  goPrev();
334
349
  }
335
350
  }
336
351
  else if (e.code == 'Tab' || e.code == 'Space') {
337
- /*************** Handle Backspace **************/
338
352
  if (input.value) {
339
353
  if (!e.shiftKey && nextPart) {
340
354
  ignore();
@@ -345,192 +359,184 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
345
359
  goPrev();
346
360
  }
347
361
  }
348
- // TODO: FiX type in input
349
362
  }
350
- else if (e.key?.trim() && !isNaN(Number(e.key))) {
363
+ else if (digit != null) {
364
+ ignore();
365
+ if (this.disabled || this.readonly || !part) {
366
+ return;
367
+ }
368
+ this._activePart.set(part.key);
369
+ this._handleDigitInput(part, digit, goNext);
370
+ }
371
+ else if (part?.key === 'AMPM' && (e.key?.toLowerCase() === 'a' || e.key?.toLowerCase() === 'p')) {
351
372
  ignore();
352
- return;
353
373
  if (this.disabled || this.readonly) {
354
374
  return;
355
375
  }
356
- let next = false;
357
- const editing = this._editingParts[part.key];
358
- //
359
- switch (part.key) {
360
- case 'year': {
361
- if (editing.placeholder.length == 2 && this._inputChars.length == 0) {
362
- this._inputChars.push(...this.formatService
363
- .format(this.calendarService.now(this._calendarSystem()), 'datetime', 'yyyy')
364
- .substring(0, 2)
365
- .split(''));
366
- }
367
- if (this._inputChars.length < 4) {
368
- editing.typedValue = `${this._inputChars.join('')}${e.key}`;
369
- this._inputChars.push(e.key);
370
- if (this._inputChars.length > 3) {
371
- next = true;
372
- }
373
- }
374
- else {
375
- next = true;
376
- }
377
- editing.typedValue = ('0000' + editing.typedValue).slice(-4);
378
- const nv = parseInt(editing.typedValue);
379
- //if (nv > 0) {
380
- const newVal = this._editingDate().set('year', nv);
381
- this._editingDate.set(newVal);
382
- this._detectValueChanges();
383
- //}
384
- break;
376
+ const hour = this._editingDate().hour;
377
+ const wantsPM = e.key.toLowerCase() === 'p';
378
+ if (wantsPM && hour < 12) {
379
+ this._applyEditingDate(this._editingDate().add('hour', 12));
380
+ }
381
+ else if (!wantsPM && hour >= 12) {
382
+ this._applyEditingDate(this._editingDate().add('hour', -12));
383
+ }
384
+ }
385
+ else {
386
+ ignore();
387
+ }
388
+ super.emitOnKeydownEvent(e);
389
+ }
390
+ /** @ignore */
391
+ _handleDigitInput(part, digit, goNext) {
392
+ let next = false;
393
+ const editing = this._editingParts[part.key];
394
+ switch (part.key) {
395
+ case 'year': {
396
+ if (editing.placeholder.length == 2 && this._inputChars.length == 0) {
397
+ this._inputChars.push(...this._formatPart(this.calendarService.now(this._calendarSystem()), 'yyyy').substring(0, 2).split(''));
385
398
  }
386
- case 'month': {
387
- if (this._inputChars.length == 0) {
388
- this._inputChars.push(e.key);
389
- editing.typedValue = `0${e.key}`;
390
- if (parseInt(e.key) > 1) {
391
- this._clearInputBuffer();
392
- next = true;
393
- }
394
- }
395
- else if (this._inputChars.length == 1) {
396
- const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
397
- if (newStr > 12) {
398
- editing.typedValue = `0${e.key}`;
399
- }
400
- else {
401
- editing.typedValue = newStr.toString();
402
- }
403
- this._clearInputBuffer();
399
+ this._inputChars.push(digit);
400
+ editing.typedValue = ('0000' + this._inputChars.join('')).slice(-4);
401
+ if (this._inputChars.length >= 4) {
402
+ next = true;
403
+ }
404
+ const nv = parseInt(editing.typedValue);
405
+ if (nv > 0) {
406
+ this._applyEditingDate(this._editingDate().set('year', nv));
407
+ }
408
+ break;
409
+ }
410
+ case 'month': {
411
+ if (this._inputChars.length == 0) {
412
+ this._inputChars.push(digit);
413
+ editing.typedValue = `0${digit}`;
414
+ if (parseInt(digit) > 1) {
404
415
  next = true;
405
416
  }
406
- editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
407
- const nv = parseInt(editing.typedValue);
408
- if (nv > 0) {
409
- const newVal = this._editingDate().set(part.key, nv);
410
- this._editingDate.set(newVal);
411
- this._detectValueChanges();
412
- }
413
- break;
414
417
  }
415
- case 'day': {
416
- if (this._inputChars.length == 0) {
417
- this._inputChars.push(e.key);
418
- editing.typedValue = `0${e.key}`;
419
- if (parseInt(e.key) > 3) {
420
- this._clearInputBuffer();
421
- next = true;
422
- }
423
- }
424
- else if (this._inputChars.length == 1) {
425
- const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
426
- if (newStr > this._editingDate().month.totalDays) {
427
- editing.typedValue = `0${e.key}`;
428
- }
429
- else {
430
- editing.typedValue = newStr.toString();
431
- }
432
- this._clearInputBuffer();
418
+ else {
419
+ const combined = parseInt(`${this._inputChars[0]}${digit}`);
420
+ editing.typedValue = combined > 12 || combined < 1 ? `0${digit}` : `${combined}`.padStart(2, '0');
421
+ next = true;
422
+ }
423
+ const nv = parseInt(editing.typedValue);
424
+ if (nv > 0) {
425
+ this._applyEditingDate(this._editingDate().set('month', nv));
426
+ }
427
+ break;
428
+ }
429
+ case 'day': {
430
+ const totalDays = this._editingDate().month.totalDays;
431
+ if (this._inputChars.length == 0) {
432
+ this._inputChars.push(digit);
433
+ editing.typedValue = `0${digit}`;
434
+ if (parseInt(digit) > Math.floor(totalDays / 10)) {
433
435
  next = true;
434
436
  }
435
- editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
436
- const nv = parseInt(editing.typedValue);
437
- if (nv > 0) {
438
- const newVal = this._editingDate().set(part.key, nv);
439
- this._editingDate.set(newVal);
440
- this._detectValueChanges();
441
- }
442
- break;
443
437
  }
444
- case 'hour': {
445
- if (this._inputChars.length == 0) {
446
- this._inputChars.push(e.key);
447
- editing.typedValue = `0${e.key}`;
448
- if (parseInt(e.key) > 2) {
449
- next = true;
450
- }
451
- }
452
- else if (this._inputChars.length == 1) {
453
- const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
454
- if (newStr > 23) {
455
- editing.typedValue = `0${e.key}`;
456
- }
457
- else {
458
- editing.typedValue = newStr.toString();
459
- }
438
+ else {
439
+ const combined = parseInt(`${this._inputChars[0]}${digit}`);
440
+ editing.typedValue = combined > totalDays || combined < 1 ? `0${digit}` : `${combined}`.padStart(2, '0');
441
+ next = true;
442
+ }
443
+ const nv = parseInt(editing.typedValue);
444
+ if (nv > 0) {
445
+ this._applyEditingDate(this._editingDate().set('day', nv));
446
+ }
447
+ break;
448
+ }
449
+ case 'hour': {
450
+ if (this._inputChars.length == 0) {
451
+ this._inputChars.push(digit);
452
+ editing.typedValue = `0${digit}`;
453
+ if (parseInt(digit) > 2) {
460
454
  next = true;
461
455
  }
462
- editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
463
- const newVal = this._editingDate().set('hour', parseInt(editing.typedValue));
464
- this._editingDate.set(newVal);
465
- this._detectValueChanges();
466
- break;
467
456
  }
468
- case 'minute':
469
- case 'second':
470
- if (this._inputChars.length == 0) {
471
- this._inputChars.push(e.key);
472
- editing.typedValue = `0${e.key}`;
473
- if (parseInt(e.key) > 5) {
474
- this._clearInputBuffer();
475
- next = true;
476
- }
477
- }
478
- else if (this._inputChars.length == 1) {
479
- const newStr = parseInt(`${this._inputChars[0]}${e.key}`);
480
- if (newStr > 59) {
481
- editing.typedValue = `0${e.key}`;
482
- }
483
- else {
484
- editing.typedValue = newStr.toString();
485
- }
486
- this._clearInputBuffer();
457
+ else {
458
+ const combined = parseInt(`${this._inputChars[0]}${digit}`);
459
+ editing.typedValue = combined > 23 ? `0${digit}` : `${combined}`.padStart(2, '0');
460
+ next = true;
461
+ }
462
+ this._applyEditingDate(this._editingDate().set('hour', parseInt(editing.typedValue)));
463
+ break;
464
+ }
465
+ case 'minute':
466
+ case 'second': {
467
+ if (this._inputChars.length == 0) {
468
+ this._inputChars.push(digit);
469
+ editing.typedValue = `0${digit}`;
470
+ if (parseInt(digit) > 5) {
487
471
  next = true;
488
472
  }
489
- editing.typedValue = editing.typedValue?.length === 1 ? '0' + editing.typedValue : editing.typedValue;
490
- // eslint-disable-next-line no-case-declarations
491
- const newVal = this._editingDate().set(part.key, parseInt(editing.typedValue));
492
- this._editingDate.set(newVal);
493
- this._detectValueChanges();
494
- break;
495
- default:
473
+ }
474
+ else {
475
+ const combined = parseInt(`${this._inputChars[0]}${digit}`);
476
+ editing.typedValue = combined > 59 ? `0${digit}` : `${combined}`.padStart(2, '0');
477
+ next = true;
478
+ }
479
+ this._applyEditingDate(this._editingDate().set(part.key, parseInt(editing.typedValue)));
480
+ break;
496
481
  }
497
- if (next) {
498
- goNext();
482
+ default:
499
483
  return;
500
- }
501
484
  }
502
- /*************** Emit Event **************/
503
- super.emitOnKeydownEvent(e);
485
+ if (next) {
486
+ goNext();
487
+ }
504
488
  }
505
- /**
506
- * @ignore
507
- */
489
+ /** @ignore */
490
+ _applyEditingDate(value) {
491
+ this._editingDate.set(value);
492
+ this._detectValueChanges();
493
+ }
494
+ /** @ignore */
508
495
  _handleKeyUpEvent() {
509
496
  if (this._activePart()) {
510
497
  this._highlightActivePart();
511
498
  }
512
499
  }
513
- /**
514
- * @ignore
515
- */
500
+ /** @ignore */
516
501
  _handleFocusEvent(e) {
517
- //this._highlightActivePart();
502
+ if (this.allowTyping()) {
503
+ setTimeout(() => this._selectFirstPart(), 0);
504
+ }
518
505
  super.emitOnFocusEvent(e);
519
506
  }
520
- /**
521
- * @ignore
522
- */
507
+ /** @ignore */
523
508
  _handleBlurEvent(e) {
509
+ this._activePart.set(null);
510
+ this._clearInputBuffer();
511
+ if (this.allowTyping()) {
512
+ this._clampToRange();
513
+ if (!this.value) {
514
+ Object.values(this._editingParts).forEach((part) => {
515
+ part.typedValue = null;
516
+ });
517
+ this._editingText.set('');
518
+ }
519
+ }
524
520
  super.emitOnBlurEvent(e);
525
521
  }
526
- /**
527
- * @ignore
528
- */
522
+ /** @ignore */
523
+ _clampToRange() {
524
+ const value = this.value;
525
+ if (!value)
526
+ return;
527
+ const min = this.minValue();
528
+ const max = this.maxValue();
529
+ if (min && value.getTime() < min.getTime()) {
530
+ this.commitValue(new Date(min), true);
531
+ }
532
+ else if (max && value.getTime() > max.getTime()) {
533
+ this.commitValue(new Date(max), true);
534
+ }
535
+ }
536
+ /** @ignore */
529
537
  _handleOnInputClickEvent(e) {
530
538
  if (this.allowTyping()) {
531
- setTimeout(() => {
532
- this._detectPartAtPosition();
533
- }, 0);
539
+ setTimeout(() => this._selectFirstPart(), 0);
534
540
  }
535
541
  this.onClick.emit({
536
542
  component: this,
@@ -538,26 +544,39 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
538
544
  nativeEvent: e,
539
545
  });
540
546
  }
541
- /**
542
- * @ignore
543
- */
544
- _detectPartAtPosition() {
545
- const input = this.input();
546
- if (!input || !input.value)
547
- return;
548
- const sStart = input.selectionEnd || 0;
549
- const re = /[a-zA-Z0-9]+/gi;
550
- const valueParts = Array.from(input.value.matchAll(re));
547
+ /** @ignore */
548
+ _selectFirstPart() {
551
549
  const orderedParts = this._getOrderedParts();
552
- const index = valueParts.findIndex((c) => c.index <= sStart && c.index + c[0].length >= sStart);
553
- this._activePart.set(orderedParts[index].key);
554
- this._highlightActivePart();
550
+ if (!orderedParts.length)
551
+ return;
552
+ this._clearInputBuffer();
553
+ this._activePart.set(orderedParts[0].key);
554
+ const wasEmpty = !this._editingText();
555
+ this._ensureEditableText();
556
+ if (wasEmpty) {
557
+ setTimeout(() => this._highlightActivePart(), 0);
558
+ }
559
+ else {
560
+ this._highlightActivePart();
561
+ }
555
562
  }
556
- /**
557
- * @ignore
558
- */
563
+ /** @ignore */
564
+ _ensureEditableText() {
565
+ if (this._editingText())
566
+ return;
567
+ const format = this._resolvedFormat();
568
+ if (!format)
569
+ return;
570
+ Object.values(this._editingParts).forEach((part) => {
571
+ if (part.enabled && part.typedValue == null) {
572
+ part.typedValue = part.placeholder;
573
+ }
574
+ });
575
+ this._editingText.set(format);
576
+ }
577
+ /** @ignore */
559
578
  _highlightActivePart() {
560
- const input = this.input();
579
+ const input = this.inputElement;
561
580
  if (!input || !input.value || !this._activePart())
562
581
  return;
563
582
  const orderedParts = this._getOrderedParts();
@@ -569,17 +588,12 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
569
588
  input.setSelectionRange(start, end);
570
589
  }
571
590
  }
572
- /**
573
- * @ignore
574
- */
591
+ /** @ignore */
575
592
  _detectValueChanges() {
576
593
  this.commitValue(this._editingDate().date, true);
577
594
  }
578
- get __hostName() {
579
- return this.name;
580
- }
581
595
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeInputComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
582
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: AXDateTimeInputComponent, isStandalone: true, selector: "ax-datetime-input", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, allowTyping: { classPropertyName: "allowTyping", publicName: "allowTyping", isSignal: true, isRequired: false, transformFunction: null }, calendar: { classPropertyName: "calendar", publicName: "calendar", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, picker: { classPropertyName: "picker", publicName: "picker", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange", onClick: "onClick" }, host: { listeners: { "keydown": "_handleOnKeydownEvent($event)", "keyup": "_handleKeyUpEvent()" }, properties: { "attr.name": "this.__hostName" } }, providers: [
596
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "22.0.8", type: AXDateTimeInputComponent, isStandalone: true, selector: "ax-datetime-input", inputs: { disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, allowTyping: { classPropertyName: "allowTyping", publicName: "allowTyping", isSignal: true, isRequired: false, transformFunction: null }, calendar: { classPropertyName: "calendar", publicName: "calendar", isSignal: true, isRequired: false, transformFunction: null }, minValue: { classPropertyName: "minValue", publicName: "minValue", isSignal: true, isRequired: false, transformFunction: null }, maxValue: { classPropertyName: "maxValue", publicName: "maxValue", isSignal: true, isRequired: false, transformFunction: null }, picker: { classPropertyName: "picker", publicName: "picker", isSignal: true, isRequired: false, transformFunction: null }, format: { classPropertyName: "format", publicName: "format", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", stateChange: "stateChange", onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus", readonlyChange: "readonlyChange", disabledChange: "disabledChange", onKeyDown: "onKeyDown", onKeyUp: "onKeyUp", onKeyPress: "onKeyPress", onClick: "onClick" }, host: { listeners: { "keydown": "_handleOnKeydownEvent($event)", "keyup": "_handleKeyUpEvent()" }, properties: { "attr.name": "name" } }, providers: [
583
597
  { provide: AXComponent, useExisting: AXDateTimeInputComponent },
584
598
  { provide: AXFocusableComponent, useExisting: AXDateTimeInputComponent },
585
599
  { provide: AXValuableComponent, useExisting: AXDateTimeInputComponent },
@@ -589,11 +603,22 @@ class AXDateTimeInputComponent extends MXInputBaseValueComponent {
589
603
  useExisting: forwardRef(() => AXDateTimeInputComponent),
590
604
  multi: true,
591
605
  },
592
- ], viewQueries: [{ propertyName: "input", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<input\n #input\n id=\"input\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n class=\"ax-input\"\n type=\"text\"\n [attr.placeholder]=\"placeholder\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-select-none]=\"!allowTyping()\"\n [class.ax-state-readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [readonly]=\"true\"\n [ngModel]=\"_editingText()\"\n (mouseup)=\"_handleOnInputClickEvent($event)\"\n (blur)=\"_handleBlurEvent($event)\"\n (focus)=\"_handleFocusEvent($event)\"\n [style.text-align]=\"isRtl() ? 'end' : 'start'\"\n [tabindex]=\"tabIndex\"\n/>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: ["@layer components{.ax-select-none,.ax-select-none *{-webkit-user-select:none!important;user-select:none!important}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], encapsulation: i0.ViewEncapsulation.None }); }
606
+ ], viewQueries: [{ propertyName: "inputRef", first: true, predicate: ["input"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<input\n #input\n id=\"input\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n class=\"ax-input\"\n type=\"text\"\n [dir]=\"isRtl() ? 'rtl' : 'ltr'\"\n [attr.placeholder]=\"placeholder || _resolvedFormat()\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-select-none]=\"!allowTyping()\"\n [class.ax-state-readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [readonly]=\"true\"\n [ngModel]=\"_editingText()\"\n (mouseup)=\"_handleOnInputClickEvent($event)\"\n (blur)=\"_handleBlurEvent($event)\"\n (focus)=\"_handleFocusEvent($event)\"\n [style.text-align]=\"isRtl() ? 'end' : 'start'\"\n [tabindex]=\"tabIndex\"\n/>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: ["@layer components{.ax-select-none,.ax-select-none *{-webkit-user-select:none!important;user-select:none!important}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox]):not([ngNoCva])[formControlName],textarea:not([ngNoCva])[formControlName],input:not([type=checkbox]):not([ngNoCva])[formControl],textarea:not([ngNoCva])[formControl],input:not([type=checkbox]):not([ngNoCva])[ngModel],textarea:not([ngNoCva])[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
593
607
  }
594
608
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeInputComponent, decorators: [{
595
609
  type: Component,
596
- args: [{ selector: 'ax-datetime-input', encapsulation: ViewEncapsulation.None, inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id'], outputs: ['valueChange', 'stateChange', 'onValueChanged', 'onBlur', 'onFocus', 'readonlyChange', 'disabledChange'], providers: [
610
+ args: [{ selector: 'ax-datetime-input', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, inputs: ['disabled', 'readonly', 'tabIndex', 'placeholder', 'value', 'state', 'name', 'id'], outputs: [
611
+ 'valueChange',
612
+ 'stateChange',
613
+ 'onValueChanged',
614
+ 'onBlur',
615
+ 'onFocus',
616
+ 'readonlyChange',
617
+ 'disabledChange',
618
+ 'onKeyDown',
619
+ 'onKeyUp',
620
+ 'onKeyPress',
621
+ ], providers: [
597
622
  { provide: AXComponent, useExisting: AXDateTimeInputComponent },
598
623
  { provide: AXFocusableComponent, useExisting: AXDateTimeInputComponent },
599
624
  { provide: AXValuableComponent, useExisting: AXDateTimeInputComponent },
@@ -603,17 +628,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
603
628
  useExisting: forwardRef(() => AXDateTimeInputComponent),
604
629
  multi: true,
605
630
  },
606
- ], imports: [FormsModule], template: "<input\n #input\n id=\"input\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n class=\"ax-input\"\n type=\"text\"\n [attr.placeholder]=\"placeholder\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-select-none]=\"!allowTyping()\"\n [class.ax-state-readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [readonly]=\"true\"\n [ngModel]=\"_editingText()\"\n (mouseup)=\"_handleOnInputClickEvent($event)\"\n (blur)=\"_handleBlurEvent($event)\"\n (focus)=\"_handleFocusEvent($event)\"\n [style.text-align]=\"isRtl() ? 'end' : 'start'\"\n [tabindex]=\"tabIndex\"\n/>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: ["@layer components{.ax-select-none,.ax-select-none *{-webkit-user-select:none!important;user-select:none!important}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
607
- }], propDecorators: { allowTyping: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowTyping", required: false }] }], calendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendar", required: false }] }], input: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], picker: [{ type: i0.Input, args: [{ isSignal: true, alias: "picker", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], _handleOnKeydownEvent: [{
608
- type: HostListener,
609
- args: ['keydown', ['$event']]
610
- }], _handleKeyUpEvent: [{
611
- type: HostListener,
612
- args: ['keyup']
613
- }], __hostName: [{
614
- type: HostBinding,
615
- args: ['attr.name']
616
- }] } });
631
+ ], imports: [FormsModule], host: {
632
+ '(keydown)': '_handleOnKeydownEvent($event)',
633
+ '(keyup)': '_handleKeyUpEvent()',
634
+ '[attr.name]': 'name',
635
+ }, template: "<input\n #input\n id=\"input\"\n autocomplete=\"off\"\n autocorrect=\"off\"\n autocapitalize=\"off\"\n spellcheck=\"false\"\n class=\"ax-input\"\n type=\"text\"\n [dir]=\"isRtl() ? 'rtl' : 'ltr'\"\n [attr.placeholder]=\"placeholder || _resolvedFormat()\"\n [class.ax-state-disabled]=\"disabled\"\n [class.ax-select-none]=\"!allowTyping()\"\n [class.ax-state-readonly]=\"readonly\"\n [disabled]=\"disabled\"\n [readonly]=\"true\"\n [ngModel]=\"_editingText()\"\n (mouseup)=\"_handleOnInputClickEvent($event)\"\n (blur)=\"_handleBlurEvent($event)\"\n (focus)=\"_handleFocusEvent($event)\"\n [style.text-align]=\"isRtl() ? 'end' : 'start'\"\n [tabindex]=\"tabIndex\"\n/>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: ["@layer components{.ax-select-none,.ax-select-none *{-webkit-user-select:none!important;user-select:none!important}}\n/*! tailwindcss v4.1.16 | MIT License | https://tailwindcss.com */\n"] }]
636
+ }], propDecorators: { allowTyping: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowTyping", required: false }] }], calendar: [{ type: i0.Input, args: [{ isSignal: true, alias: "calendar", required: false }] }], minValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "minValue", required: false }] }], maxValue: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxValue", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }], picker: [{ type: i0.Input, args: [{ isSignal: true, alias: "picker", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }], inputRef: [{ type: i0.ViewChild, args: ['input', { isSignal: true }] }] } });
617
637
 
618
638
  class AXDateTimeInputModule {
619
639
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXDateTimeInputModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
@@ -632,5 +652,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
632
652
  * Generated bundle index. Do not edit.
633
653
  */
634
654
 
635
- export { AXDateTimeInputComponent, AXDateTimeInputModule };
655
+ export { AXDateTimeInputComponent, AXDateTimeInputDefaultConfig, AXDateTimeInputModule, AX_DATETIME_INPUT_CONFIG };
636
656
  //# sourceMappingURL=acorex-components-datetime-input.mjs.map