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