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