@mediusinc/mng-commons 7.3.0 → 7.4.0-rc.1
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/mediusinc-mng-commons-core.mjs +4 -3
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +19 -3
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +21 -0
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +437 -235
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-4BDcYyDd.mjs → mediusinc-mng-commons-table-column-toggle.component-bggQruAI.mjs} +2 -2
- package/fesm2022/{mediusinc-mng-commons-table-column-toggle.component-4BDcYyDd.mjs.map → mediusinc-mng-commons-table-column-toggle.component-bggQruAI.mjs.map} +1 -1
- package/fesm2022/{mediusinc-mng-commons-table-mediusinc-mng-commons-table-DoXp48ZT.mjs → mediusinc-mng-commons-table-mediusinc-mng-commons-table-SYFYosV_.mjs} +66 -14
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-SYFYosV_.mjs.map +1 -0
- package/fesm2022/mediusinc-mng-commons-table.mjs +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +19 -3
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +5 -4
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/i18n/en.json +4 -1
- package/i18n/sl.json +5 -1
- package/package.json +1 -1
- package/types/mediusinc-mng-commons-core.d.ts +14 -4
- package/types/mediusinc-mng-commons-filter.d.ts +14 -4
- package/types/mediusinc-mng-commons-form-api.d.ts +14 -1
- package/types/mediusinc-mng-commons-form.d.ts +83 -78
- package/types/mediusinc-mng-commons-table.d.ts +6 -1
- package/types/mediusinc-mng-commons-tableview-api.d.ts +14 -4
- package/version-info.json +6 -6
- package/fesm2022/mediusinc-mng-commons-table-mediusinc-mng-commons-table-DoXp48ZT.mjs.map +0 -1
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import { NgTemplateOutlet } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import {
|
|
3
|
+
import { InjectionToken, inject, Injectable, forwardRef, Injector, DestroyRef, input, booleanAttribute, output, viewChild, signal, computed, afterNextRender, ChangeDetectionStrategy, ViewEncapsulation, Component, numberAttribute, ChangeDetectorRef, effect, ElementRef, Renderer2, Directive } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed, toObservable as toObservable$1 } from '@angular/core/rxjs-interop';
|
|
5
|
-
import * as i1 from '@angular/forms';
|
|
5
|
+
import * as i1$1 from '@angular/forms';
|
|
6
6
|
import { NG_VALUE_ACCESSOR, FormsModule, NG_VALIDATORS, FormBuilder, Validators, ReactiveFormsModule, NgControl } from '@angular/forms';
|
|
7
7
|
import { TranslateService, TranslatePipe } from '@ngx-translate/core';
|
|
8
8
|
import { AutoComplete } from 'primeng/autocomplete';
|
|
9
9
|
import { InputGroup } from 'primeng/inputgroup';
|
|
10
10
|
import { InputGroupAddon } from 'primeng/inputgroupaddon';
|
|
11
|
-
import {
|
|
11
|
+
import { Tag } from 'primeng/tag';
|
|
12
|
+
import { of, tap, merge, ReplaySubject, take, Subject, distinctUntilChanged, debounceTime, combineLatest, switchMap, map as map$1 } from 'rxjs';
|
|
12
13
|
import { map } from 'rxjs/operators';
|
|
13
|
-
import { LoggerService,
|
|
14
|
+
import { FilterMatchMode, toObservable, LoggerService, effectWithDeps, CommonsInternalError, fromSubscribeError, getErrorLogLevel, RerenderDirective, booleanWithDefaultAttribute, narrowI18nToTranslation, TemplateDirective, CommonsFeatureTypeEnum } from '@mediusinc/mng-commons/core';
|
|
14
15
|
import { Divider } from 'primeng/divider';
|
|
15
16
|
import { DatePicker } from 'primeng/datepicker';
|
|
16
|
-
import * as i1
|
|
17
|
+
import * as i1 from 'primeng/inputmask';
|
|
17
18
|
import { InputMask, InputMaskModule } from 'primeng/inputmask';
|
|
18
19
|
import { Listbox } from 'primeng/listbox';
|
|
19
20
|
import { Overlay } from 'primeng/overlay';
|
|
@@ -21,24 +22,184 @@ import { MultiSelect } from 'primeng/multiselect';
|
|
|
21
22
|
import { Select } from 'primeng/select';
|
|
22
23
|
import { InputNumber } from 'primeng/inputnumber';
|
|
23
24
|
|
|
25
|
+
const COMMONS_FORM_FEATURE_CONFIG_IT = new InjectionToken('COMMONS_FORM_FEATURE_CONFIG');
|
|
26
|
+
|
|
27
|
+
var _a;
|
|
28
|
+
class LookupLabelResolutionService {
|
|
29
|
+
static { this.IDLE_CLEANUP_TIMEOUT_MS = 2000; }
|
|
30
|
+
#config = inject(COMMONS_FORM_FEATURE_CONFIG_IT, { optional: true });
|
|
31
|
+
#cleanupInterval = this.#config?.lookupNameResolutionCleanupInterval ?? 5 * 60 * 1000;
|
|
32
|
+
#cache = new Map();
|
|
33
|
+
#providerInstanceKeys = new WeakMap();
|
|
34
|
+
#providerInstanceKeyCounter = 0;
|
|
35
|
+
#lastCleanupTimestamp = 0;
|
|
36
|
+
#cleanupScheduled = false;
|
|
37
|
+
storeEntry(dataProvider, valueProperty, propertyValue, item) {
|
|
38
|
+
if ((dataProvider.cacheEnabled ?? true) && (this.#config?.lookupNameResolutionConfigEnabled ?? true)) {
|
|
39
|
+
const expiresAt = new Date();
|
|
40
|
+
const expiresInSeconds = dataProvider.cacheTtl ?? 120;
|
|
41
|
+
expiresAt.setSeconds(expiresAt.getSeconds() + expiresInSeconds);
|
|
42
|
+
const key = this.#getKey(dataProvider, valueProperty, propertyValue);
|
|
43
|
+
this.#cache.set(key, { item, expiresAt });
|
|
44
|
+
this.#scheduleCacheCleanup();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
getEntries(dataProvider, dataProviderService, valueProperty, propertyValues) {
|
|
48
|
+
this.#scheduleCacheCleanup();
|
|
49
|
+
if ((dataProvider.cacheEnabled ?? true) && (this.#config?.lookupNameResolutionConfigEnabled ?? true)) {
|
|
50
|
+
const keys = propertyValues.map(value => this.#getKey(dataProvider, valueProperty, value));
|
|
51
|
+
if (keys.every(key => {
|
|
52
|
+
const entry = this.#cache.get(key);
|
|
53
|
+
return !!(entry && entry.expiresAt > new Date());
|
|
54
|
+
})) {
|
|
55
|
+
return of(keys.map(key => this.#cache.get(key)?.item));
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return this.#lookup(dataProvider, dataProviderService, valueProperty, propertyValues);
|
|
59
|
+
}
|
|
60
|
+
clear(opts) {
|
|
61
|
+
if (opts?.providerKey) {
|
|
62
|
+
for (const [key] of this.#cache) {
|
|
63
|
+
if (key.startsWith(`${opts.providerKey}_`)) {
|
|
64
|
+
this.#cache.delete(key);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
this.#cache.clear();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
#lookup(dataProvider, dataProviderService, valueProperty, propertyValues) {
|
|
73
|
+
const isMultiValue = propertyValues.length > 1;
|
|
74
|
+
const params = {
|
|
75
|
+
filters: {
|
|
76
|
+
[valueProperty]: {
|
|
77
|
+
value: isMultiValue ? propertyValues : propertyValues[0],
|
|
78
|
+
matchMode: isMultiValue ? FilterMatchMode.In : FilterMatchMode.Equals
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return toObservable(dataProvider.lookup(params, dataProviderService)).pipe(tap(items => items.forEach(item => this.storeEntry(dataProvider, valueProperty, item[valueProperty], item))));
|
|
83
|
+
}
|
|
84
|
+
#getKey(dataProvider, valueProperty, propertyValue) {
|
|
85
|
+
const providerKey = dataProvider.cacheKey ?? this.#getProviderInstanceKey(dataProvider);
|
|
86
|
+
return `${providerKey}_${valueProperty}_${propertyValue}`;
|
|
87
|
+
}
|
|
88
|
+
#getProviderInstanceKey(dataProvider) {
|
|
89
|
+
const key = this.#providerInstanceKeys.get(dataProvider);
|
|
90
|
+
if (key) {
|
|
91
|
+
return key;
|
|
92
|
+
}
|
|
93
|
+
const newKey = `lookup-provider-${++this.#providerInstanceKeyCounter}`;
|
|
94
|
+
this.#providerInstanceKeys.set(dataProvider, newKey);
|
|
95
|
+
return newKey;
|
|
96
|
+
}
|
|
97
|
+
#scheduleCacheCleanup() {
|
|
98
|
+
if (this.#cleanupScheduled) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
const now = Date.now();
|
|
102
|
+
if (now - this.#lastCleanupTimestamp < this.#cleanupInterval) {
|
|
103
|
+
return;
|
|
104
|
+
}
|
|
105
|
+
this.#cleanupScheduled = true;
|
|
106
|
+
this.#runWhenIdle(() => {
|
|
107
|
+
this.#cleanupScheduled = false;
|
|
108
|
+
const runTimestamp = Date.now();
|
|
109
|
+
if (runTimestamp - this.#lastCleanupTimestamp < this.#cleanupInterval) {
|
|
110
|
+
return;
|
|
111
|
+
}
|
|
112
|
+
this.#lastCleanupTimestamp = runTimestamp;
|
|
113
|
+
this.#clearExpiredEntries(runTimestamp);
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
#clearExpiredEntries(now) {
|
|
117
|
+
for (const [key, entry] of this.#cache) {
|
|
118
|
+
if (entry.expiresAt.getTime() <= now) {
|
|
119
|
+
this.#cache.delete(key);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
#runWhenIdle(task) {
|
|
124
|
+
const requestIdleCallback = window.requestIdleCallback;
|
|
125
|
+
if (requestIdleCallback) {
|
|
126
|
+
requestIdleCallback(() => task(), { timeout: _a.IDLE_CLEANUP_TIMEOUT_MS });
|
|
127
|
+
return;
|
|
128
|
+
}
|
|
129
|
+
requestAnimationFrame(task);
|
|
130
|
+
}
|
|
131
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LookupLabelResolutionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
132
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LookupLabelResolutionService, providedIn: 'root' }); }
|
|
133
|
+
}
|
|
134
|
+
_a = LookupLabelResolutionService;
|
|
135
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: LookupLabelResolutionService, decorators: [{
|
|
136
|
+
type: Injectable,
|
|
137
|
+
args: [{ providedIn: 'root' }]
|
|
138
|
+
}] });
|
|
139
|
+
|
|
140
|
+
function createAutocompleteItem(item, opts) {
|
|
141
|
+
// If item is already an AutocompleteItem, return it as-is to prevent double wrapping
|
|
142
|
+
if (item != null && typeof item === 'object' && '__original' in item && '__value' in item) {
|
|
143
|
+
return item;
|
|
144
|
+
}
|
|
145
|
+
const valueProp = opts?.optionsValueProperty;
|
|
146
|
+
const labelProp = opts?.optionsLabelProperty;
|
|
147
|
+
const trackProp = opts?.optionsTrackProperty;
|
|
148
|
+
const isTranslate = opts?.optionsLabelTranslate;
|
|
149
|
+
const acValue = valueProp != null && item[valueProp] != null ? item[valueProp] : item;
|
|
150
|
+
const labelFromItem = ((labelProp != null && item[labelProp] != null ? item[labelProp] : item) ?? '').toString();
|
|
151
|
+
const trackValue = trackProp ? (item[trackProp] ?? acValue) : acValue;
|
|
152
|
+
return {
|
|
153
|
+
__original: item,
|
|
154
|
+
__track: typeof trackValue === 'object' ? trackValue : trackValue?.toString(),
|
|
155
|
+
__value: acValue,
|
|
156
|
+
__label: isTranslate && opts?.translate ? opts.translate.instant(labelFromItem) : labelFromItem,
|
|
157
|
+
__labelI18nKey: isTranslate ? labelFromItem : undefined
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
|
|
24
161
|
const AUTOCOMPLETE_VALUE_ACCESSOR = {
|
|
25
162
|
provide: NG_VALUE_ACCESSOR,
|
|
26
163
|
useExisting: forwardRef(() => AutocompleteComponent),
|
|
27
164
|
multi: true
|
|
28
165
|
};
|
|
29
166
|
class AutocompleteComponent {
|
|
167
|
+
#injector;
|
|
168
|
+
#destroyRef;
|
|
169
|
+
#translate;
|
|
170
|
+
#labelLookupService;
|
|
171
|
+
#logger;
|
|
172
|
+
#isInited;
|
|
173
|
+
#searchSubscription;
|
|
174
|
+
#dataProviderService;
|
|
175
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
176
|
+
#onChangeFn;
|
|
177
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
178
|
+
#onTouchedFn;
|
|
179
|
+
#value;
|
|
180
|
+
#valueItem;
|
|
181
|
+
#disabledWritable;
|
|
182
|
+
#isPanelShown;
|
|
183
|
+
#isFocused;
|
|
184
|
+
#userSelectedItem;
|
|
185
|
+
#queryResultCacheSubject;
|
|
186
|
+
#currentQuery;
|
|
30
187
|
get value() {
|
|
31
|
-
return this
|
|
188
|
+
return this.#value;
|
|
189
|
+
}
|
|
190
|
+
get valueAsItem() {
|
|
191
|
+
return this.#valueItem;
|
|
32
192
|
}
|
|
33
193
|
constructor() {
|
|
34
|
-
this
|
|
35
|
-
this
|
|
36
|
-
this
|
|
37
|
-
this
|
|
194
|
+
this.#injector = inject(Injector);
|
|
195
|
+
this.#destroyRef = inject(DestroyRef);
|
|
196
|
+
this.#translate = inject(TranslateService);
|
|
197
|
+
this.#labelLookupService = inject(LookupLabelResolutionService);
|
|
198
|
+
this.#logger = inject(LoggerService).create('AutocompleteComponent');
|
|
38
199
|
this.dataProvider = input.required(...(ngDevMode ? [{ debugName: "dataProvider" }] : []));
|
|
39
200
|
this.optionsTrackProperty = input(...(ngDevMode ? [undefined, { debugName: "optionsTrackProperty" }] : []));
|
|
40
|
-
this.
|
|
41
|
-
this.
|
|
201
|
+
this.optionsValueProperty = input(undefined, ...(ngDevMode ? [{ debugName: "optionsValueProperty" }] : []));
|
|
202
|
+
this.optionsLabelProperty = input(undefined, ...(ngDevMode ? [{ debugName: "optionsLabelProperty" }] : []));
|
|
42
203
|
this.optionsLabelTranslate = input(false, { ...(ngDevMode ? { debugName: "optionsLabelTranslate" } : {}), transform: booleanAttribute });
|
|
43
204
|
this.inlineSearch = input(false, { ...(ngDevMode ? { debugName: "inlineSearch" } : {}), transform: booleanAttribute });
|
|
44
205
|
this.openOnFocus = input(false, { ...(ngDevMode ? { debugName: "openOnFocus" } : {}), transform: booleanAttribute });
|
|
@@ -49,6 +210,7 @@ class AutocompleteComponent {
|
|
|
49
210
|
this.showClear = input(false, { ...(ngDevMode ? { debugName: "showClear" } : {}), transform: booleanAttribute });
|
|
50
211
|
this.autoClear = input(false, { ...(ngDevMode ? { debugName: "autoClear" } : {}), transform: booleanAttribute });
|
|
51
212
|
this.selectFirst = input(false, { ...(ngDevMode ? { debugName: "selectFirst" } : {}), transform: booleanAttribute }); //on every input field change return first given value (or null)
|
|
213
|
+
this.allowInput = input(false, { ...(ngDevMode ? { debugName: "allowInput" } : {}), transform: booleanAttribute });
|
|
52
214
|
this.searchTrim = input(undefined, ...(ngDevMode ? [{ debugName: "searchTrim" }] : []));
|
|
53
215
|
this.disabledInput = input(false, { ...(ngDevMode ? { debugName: "disabledInput" } : {}), transform: booleanAttribute, alias: 'disabled' });
|
|
54
216
|
this.templates = input([], ...(ngDevMode ? [{ debugName: "templates" }] : []));
|
|
@@ -56,62 +218,49 @@ class AutocompleteComponent {
|
|
|
56
218
|
// eslint-disable-next-line @angular-eslint/no-output-native
|
|
57
219
|
this.blur = output();
|
|
58
220
|
this.primeAutocomplete = viewChild(AutoComplete, ...(ngDevMode ? [{ debugName: "primeAutocomplete" }] : []));
|
|
59
|
-
this
|
|
60
|
-
this
|
|
61
|
-
this
|
|
221
|
+
this.#isInited = false;
|
|
222
|
+
this.#searchSubscription = null;
|
|
223
|
+
this.#dataProviderService = null;
|
|
62
224
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
63
|
-
this
|
|
225
|
+
this.#onChangeFn = () => { };
|
|
64
226
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
65
|
-
this
|
|
227
|
+
this.#onTouchedFn = () => { };
|
|
66
228
|
this.ngModelValue = signal(undefined, ...(ngDevMode ? [{ debugName: "ngModelValue" }] : []));
|
|
67
|
-
this
|
|
68
|
-
this.disabled = computed(() => this
|
|
229
|
+
this.#disabledWritable = signal(false, ...(ngDevMode ? [{ debugName: "#disabledWritable" }] : []));
|
|
230
|
+
this.disabled = computed(() => this.#disabledWritable() || this.disabledInput(), ...(ngDevMode ? [{ debugName: "disabled" }] : []));
|
|
69
231
|
this.suggestions = signal([], ...(ngDevMode ? [{ debugName: "suggestions" }] : []));
|
|
70
|
-
this
|
|
71
|
-
this
|
|
232
|
+
this.#isPanelShown = false;
|
|
233
|
+
this.#isFocused = false;
|
|
72
234
|
this.prependTemplates = computed(() => this.templates().filter(t => t.name() === 'prepend'), ...(ngDevMode ? [{ debugName: "prependTemplates" }] : []));
|
|
73
235
|
this.appendTemplates = computed(() => this.templates().filter(t => t.name() === 'append'), ...(ngDevMode ? [{ debugName: "appendTemplates" }] : []));
|
|
74
|
-
this.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
throw new CommonsInternalError(`Invalid use with value (${this.optionsValuePropertyInit()}) and label (${this.optionsLabelPropertyInit()}) property setup.`, {
|
|
85
|
-
name: 'AutocompleteComponentError'
|
|
86
|
-
});
|
|
87
|
-
}
|
|
236
|
+
effectWithDeps([this.ngModelValue, this.primeAutocomplete, this.multiselect], ([ngModelValue, primeAutocomplete, multiselect]) => {
|
|
237
|
+
this.#value = this.#getValueFromItem(ngModelValue);
|
|
238
|
+
this.#valueItem = ngModelValue;
|
|
239
|
+
// sync to autcomplete only if all is ready
|
|
240
|
+
if (primeAutocomplete != null &&
|
|
241
|
+
multiselect === primeAutocomplete?.multiple &&
|
|
242
|
+
(this.#valueItem == null || (multiselect && Array.isArray(this.#valueItem)) || (!multiselect && !Array.isArray(this.#valueItem)))) {
|
|
243
|
+
primeAutocomplete?.updateModel(this.#valueItem);
|
|
88
244
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
245
|
+
});
|
|
246
|
+
effectWithDeps([this.optionsLabelTranslate, this.optionsLabelProperty, this.optionsValueProperty], ([isLabelTranslate, labelProp, valueProp]) => {
|
|
247
|
+
if (isLabelTranslate && labelProp == null && valueProp) {
|
|
248
|
+
throw new CommonsInternalError(`Invalid use with value (${valueProp}) and label (${labelProp}) property setup.`, {
|
|
249
|
+
name: 'AutocompleteComponentError'
|
|
250
|
+
});
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
merge([this.#translate.onTranslationChange, this.#translate.onLangChange])
|
|
254
|
+
.pipe(takeUntilDestroyed())
|
|
255
|
+
.subscribe(() => {
|
|
256
|
+
this.suggestions.update(items => items.map(item => this.#createAutocompleteItem(item.__original)));
|
|
257
|
+
});
|
|
258
|
+
afterNextRender(() => {
|
|
259
|
+
this.#setItemsAndDataProvider();
|
|
260
|
+
if (this.selectFirst() && !this.#value) {
|
|
261
|
+
this.onSearch(undefined, true);
|
|
102
262
|
}
|
|
103
|
-
return this.optionsValuePropertyInit();
|
|
104
|
-
}, ...(ngDevMode ? [{ debugName: "optionsValueProperty" }] : []));
|
|
105
|
-
effect(() => {
|
|
106
|
-
this._value = this.convertValueWithOptionsValuePropSetting(this.ngModelValue());
|
|
107
|
-
this._rawValue = this.ngModelValue();
|
|
108
263
|
});
|
|
109
|
-
}
|
|
110
|
-
ngOnInit() {
|
|
111
|
-
this.setItemsAndDataProvider();
|
|
112
|
-
if (this.selectFirst() && !this._value) {
|
|
113
|
-
this.onSearch(undefined, true);
|
|
114
|
-
}
|
|
115
264
|
}
|
|
116
265
|
onSearch(event, isInit = false) {
|
|
117
266
|
// openOnFocus enables this method to be called when input is focused. The dropdown button calls this method and puts the focus on the input field, which causes 2 calls.
|
|
@@ -120,11 +269,11 @@ class AutocompleteComponent {
|
|
|
120
269
|
return;
|
|
121
270
|
// cancel any existing requests
|
|
122
271
|
if (!this.inlineSearch()) {
|
|
123
|
-
this
|
|
272
|
+
this.#searchSubscription?.unsubscribe();
|
|
124
273
|
}
|
|
125
274
|
const optionsLabelProperty = this.optionsLabelProperty();
|
|
126
|
-
const query = this
|
|
127
|
-
this
|
|
275
|
+
const query = this.#trimSearchQuery(event?.query);
|
|
276
|
+
this.#currentQuery = query;
|
|
128
277
|
const params = {
|
|
129
278
|
limit: 50
|
|
130
279
|
};
|
|
@@ -139,160 +288,154 @@ class AutocompleteComponent {
|
|
|
139
288
|
}
|
|
140
289
|
};
|
|
141
290
|
}
|
|
142
|
-
if (!this
|
|
143
|
-
if (!this
|
|
144
|
-
this
|
|
291
|
+
if (!this.#queryResultCacheSubject || !this.inlineSearch()) {
|
|
292
|
+
if (!this.#queryResultCacheSubject) {
|
|
293
|
+
this.#queryResultCacheSubject = new ReplaySubject(1);
|
|
145
294
|
}
|
|
146
|
-
this
|
|
147
|
-
.pipe(takeUntilDestroyed(this
|
|
295
|
+
this.#searchSubscription = this.#getLookup(params, query)
|
|
296
|
+
.pipe(takeUntilDestroyed(this.#destroyRef))
|
|
148
297
|
.subscribe({
|
|
149
298
|
next: items => {
|
|
150
|
-
this
|
|
151
|
-
this.
|
|
152
|
-
|
|
153
|
-
|
|
299
|
+
this.#queryResultCacheSubject?.next(items);
|
|
300
|
+
const optionsValueProperty = this.optionsValueProperty();
|
|
301
|
+
const dataProvider = this.dataProvider();
|
|
302
|
+
if (dataProvider && optionsValueProperty) {
|
|
303
|
+
items.forEach(item => this.#labelLookupService.storeEntry(dataProvider, optionsValueProperty, item[optionsValueProperty], item));
|
|
304
|
+
}
|
|
305
|
+
this.#setSuggestionsFromLookupItems(items, query);
|
|
306
|
+
if (isInit && !this.#value) {
|
|
307
|
+
this.#selectFirstItem();
|
|
154
308
|
}
|
|
155
309
|
},
|
|
156
310
|
error: err => {
|
|
157
|
-
this
|
|
311
|
+
this.#setSuggestionsFromLookupItems([], query);
|
|
158
312
|
const error = fromSubscribeError(err, 'AutocompleteComponentError', {
|
|
159
313
|
search: query,
|
|
160
314
|
params: params
|
|
161
315
|
});
|
|
162
|
-
this
|
|
316
|
+
this.#logger.log(error, getErrorLogLevel(error));
|
|
163
317
|
}
|
|
164
318
|
});
|
|
165
319
|
}
|
|
166
|
-
else if (this
|
|
167
|
-
this
|
|
168
|
-
this
|
|
320
|
+
else if (this.#queryResultCacheSubject) {
|
|
321
|
+
this.#searchSubscription = this.#queryResultCacheSubject.pipe(take(1)).subscribe(result => {
|
|
322
|
+
this.#setSuggestionsFromLookupItems(result, query);
|
|
169
323
|
});
|
|
170
324
|
}
|
|
171
325
|
}
|
|
172
|
-
selectFirstItem() {
|
|
173
|
-
if (!this.selectFirst() || this.multiselect())
|
|
174
|
-
return;
|
|
175
|
-
const suggestions = this.suggestions();
|
|
176
|
-
if (suggestions.length > 0 && !this.userSelectedItem) {
|
|
177
|
-
this.setValue(suggestions[0]);
|
|
178
|
-
}
|
|
179
|
-
else if (!this.userSelectedItem) {
|
|
180
|
-
// handles the case if the user provides an input and de-focuses the input field before suggestions are loaded or if there are no suggestions at all
|
|
181
|
-
this.setValue(null);
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
326
|
/**
|
|
185
327
|
* Triggered by user when selecting an item from an autocomplete suggestion list.
|
|
186
328
|
*/
|
|
187
329
|
onSelect(event) {
|
|
188
330
|
let newValue = event.value;
|
|
189
|
-
if (this.multiselect() && Array.isArray(this
|
|
190
|
-
newValue = [...this
|
|
331
|
+
if (this.multiselect() && Array.isArray(this.#valueItem) && this.#valueItem.length > 0) {
|
|
332
|
+
newValue = [...this.#valueItem, newValue];
|
|
191
333
|
}
|
|
192
334
|
else if (this.multiselect()) {
|
|
193
335
|
newValue = [newValue];
|
|
194
336
|
}
|
|
195
|
-
this
|
|
196
|
-
this
|
|
337
|
+
this.#setValueItem(newValue, true);
|
|
338
|
+
this.#isFocused = false;
|
|
197
339
|
}
|
|
198
340
|
/**
|
|
199
341
|
* Triggered by user when selecting an item from an autocomplete suggestion list.
|
|
200
342
|
*/
|
|
201
343
|
onUnselect(event) {
|
|
202
344
|
let newValue = null;
|
|
203
|
-
if (this.multiselect() && Array.isArray(this
|
|
204
|
-
|
|
205
|
-
newValue = this._rawValue.filter(i => (cmpProp ? i[cmpProp] !== event.value[cmpProp] : i !== event.value));
|
|
345
|
+
if (this.multiselect() && Array.isArray(this.#valueItem) && this.#valueItem.length > 0) {
|
|
346
|
+
newValue = this.#valueItem.filter(i => i.__track !== event.value.__track);
|
|
206
347
|
}
|
|
207
348
|
else if (this.multiselect()) {
|
|
208
349
|
newValue = [];
|
|
209
350
|
}
|
|
210
|
-
this
|
|
211
|
-
this
|
|
351
|
+
this.#setValueItem(newValue, true);
|
|
352
|
+
this.#isFocused = false;
|
|
212
353
|
}
|
|
213
354
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
214
355
|
onFocus(event) {
|
|
215
|
-
this
|
|
356
|
+
this.#isFocused = true;
|
|
216
357
|
}
|
|
217
358
|
/**
|
|
218
359
|
* calls the selectFirst item anytime the input field goes out of focus and if the suggestions panel is not displayed.
|
|
219
360
|
*/
|
|
220
361
|
onBlur(event) {
|
|
221
|
-
this
|
|
362
|
+
this.#isFocused = false;
|
|
222
363
|
const inputSearchVal = this.primeAutocomplete()?.inputEL?.nativeElement?.value;
|
|
223
|
-
if (this.autoClear() && this
|
|
224
|
-
this
|
|
364
|
+
if (this.autoClear() && this.#value != null && (inputSearchVal == null || inputSearchVal === '')) {
|
|
365
|
+
this.#propagateValueItemChange(null);
|
|
225
366
|
}
|
|
226
|
-
else if (!this
|
|
227
|
-
this
|
|
367
|
+
else if (!this.#isPanelShown) {
|
|
368
|
+
this.#selectFirstItem();
|
|
228
369
|
}
|
|
229
|
-
this
|
|
370
|
+
this.#onTouchedFn();
|
|
230
371
|
this.blur.emit(event);
|
|
231
372
|
}
|
|
232
|
-
|
|
233
|
-
this
|
|
373
|
+
onPanelShow() {
|
|
374
|
+
this.#isPanelShown = true;
|
|
234
375
|
}
|
|
235
376
|
/**
|
|
236
377
|
* calls the selectFirst item anytime the suggestions panel is closed and input field isn't focused.
|
|
237
378
|
*/
|
|
238
|
-
|
|
239
|
-
this
|
|
240
|
-
if (!this
|
|
241
|
-
this
|
|
379
|
+
onPanelHide() {
|
|
380
|
+
this.#isPanelShown = false;
|
|
381
|
+
if (!this.#isFocused) {
|
|
382
|
+
this.#selectFirstItem();
|
|
242
383
|
}
|
|
243
384
|
}
|
|
244
385
|
onClear() {
|
|
245
|
-
if (this
|
|
246
|
-
this
|
|
386
|
+
if (this.#value != null) {
|
|
387
|
+
this.#propagateValueItemChange(this.multiselect() ? [] : null);
|
|
247
388
|
}
|
|
248
389
|
}
|
|
249
390
|
registerOnChange(fn) {
|
|
250
|
-
this
|
|
391
|
+
this.#onChangeFn = fn;
|
|
251
392
|
}
|
|
252
393
|
registerOnTouched(fn) {
|
|
253
|
-
this
|
|
394
|
+
this.#onTouchedFn = fn;
|
|
254
395
|
}
|
|
255
396
|
setDisabledState(isDisabled) {
|
|
256
|
-
setTimeout(() => this.
|
|
397
|
+
setTimeout(() => this.#disabledWritable.set(isDisabled));
|
|
257
398
|
}
|
|
258
399
|
writeValue(value) {
|
|
259
|
-
this
|
|
400
|
+
this.#setItemsAndDataProvider();
|
|
260
401
|
// write value immediately - it is important so that first select is not triggered!
|
|
261
|
-
this
|
|
262
|
-
const optionsValuePropertyInit = this.
|
|
263
|
-
if (optionsValuePropertyInit && value != null && (typeof value !== 'object' || (Array.isArray(value) && value?.length > 0))) {
|
|
402
|
+
this.#value = value;
|
|
403
|
+
const optionsValuePropertyInit = this.optionsValueProperty();
|
|
404
|
+
if (optionsValuePropertyInit && value != null && (typeof value !== 'object' || (Array.isArray(value) && value?.filter(v => v != null).length > 0))) {
|
|
264
405
|
const isMultiValue = Array.isArray(value);
|
|
265
|
-
const
|
|
266
|
-
const matchedItems =
|
|
267
|
-
if (matchedItems
|
|
268
|
-
this
|
|
406
|
+
const valueAsItemsArray = (isMultiValue ? [...value.filter(v => v != null)] : [value]).map(i => this.#createAutocompleteItem(i));
|
|
407
|
+
const matchedItems = valueAsItemsArray?.map(v => this.suggestions().find(i => v.__track === i.__track)).filter(Boolean);
|
|
408
|
+
if (matchedItems.length === valueAsItemsArray?.length) {
|
|
409
|
+
this.#setValueFromWrite(isMultiValue ? matchedItems : matchedItems[0]);
|
|
269
410
|
}
|
|
270
411
|
else {
|
|
271
|
-
this
|
|
272
|
-
|
|
273
|
-
[optionsValuePropertyInit]: {
|
|
274
|
-
value: isMultiValue ? lookupValue : lookupValue[0],
|
|
275
|
-
matchMode: isMultiValue ? FilterMatchMode.In : FilterMatchMode.Equals
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
})
|
|
412
|
+
this.#labelLookupService
|
|
413
|
+
.getEntries(this.dataProvider(), this.#dataProviderService, optionsValuePropertyInit, valueAsItemsArray.map(i => i.__track))
|
|
279
414
|
.pipe(take(1))
|
|
280
415
|
.subscribe({
|
|
281
416
|
next: items => {
|
|
282
|
-
|
|
283
|
-
|
|
417
|
+
// transform items to autocomplete items for comparation needs
|
|
418
|
+
const lookupAutocompleteItems = items.map(i => this.#createAutocompleteItem(i));
|
|
419
|
+
const matchedItems = valueAsItemsArray?.map((v, idx) => lookupAutocompleteItems.find(i => v.__track === i.__track)?.__original ??
|
|
420
|
+
this.#createValueLabelObjectFromOnlyValue(valueAsItemsArray[idx].__original));
|
|
421
|
+
this.#setValueFromWrite(isMultiValue ? matchedItems : matchedItems[0]);
|
|
284
422
|
},
|
|
285
423
|
error: () => {
|
|
286
|
-
this
|
|
424
|
+
this.#setValueFromWrite(isMultiValue
|
|
425
|
+
? this.#createValueLabelObjectFromOnlyValue(valueAsItemsArray[0].__original)
|
|
426
|
+
: valueAsItemsArray?.map(v => this.#createValueLabelObjectFromOnlyValue(v.__original)));
|
|
287
427
|
}
|
|
288
428
|
});
|
|
289
429
|
}
|
|
290
430
|
}
|
|
291
431
|
else {
|
|
292
|
-
this
|
|
432
|
+
this.#setValueFromWrite(value);
|
|
293
433
|
}
|
|
294
434
|
}
|
|
295
|
-
|
|
435
|
+
/**
|
|
436
|
+
* Transforms value and create fake object with value as value prop and label prop.
|
|
437
|
+
*/
|
|
438
|
+
#createValueLabelObjectFromOnlyValue(val) {
|
|
296
439
|
if (val == null) {
|
|
297
440
|
return val;
|
|
298
441
|
}
|
|
@@ -307,93 +450,116 @@ class AutocompleteComponent {
|
|
|
307
450
|
}
|
|
308
451
|
return obj;
|
|
309
452
|
}
|
|
310
|
-
setItemsAndDataProvider() {
|
|
311
|
-
if (this
|
|
453
|
+
#setItemsAndDataProvider() {
|
|
454
|
+
if (this.#isInited) {
|
|
312
455
|
return;
|
|
313
456
|
}
|
|
314
457
|
const dataProvider = this.dataProvider();
|
|
315
|
-
this
|
|
316
|
-
this
|
|
458
|
+
this.#dataProviderService = dataProvider.serviceType ? this.#injector.get(dataProvider.serviceType) : null;
|
|
459
|
+
this.#isInited = true;
|
|
317
460
|
}
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
461
|
+
/**
|
|
462
|
+
* Sets value from write. This must not be of type AutocompleteItem.
|
|
463
|
+
* @param value
|
|
464
|
+
* @private
|
|
465
|
+
*/
|
|
466
|
+
#setValueFromWrite(value) {
|
|
467
|
+
// Normalize value to always be internal item
|
|
468
|
+
let normalizedValue = value;
|
|
469
|
+
if (Array.isArray(value)) {
|
|
470
|
+
normalizedValue = value.map(v => this.#createAutocompleteItem(v));
|
|
471
|
+
}
|
|
472
|
+
else if (value != null) {
|
|
473
|
+
normalizedValue = this.#createAutocompleteItem(value);
|
|
321
474
|
}
|
|
322
|
-
if (this.ngModelValue() == null && this
|
|
475
|
+
if (this.ngModelValue() == null && this.#valueItem != null) {
|
|
323
476
|
// value must first be set to synchronise states, then in next async cycle set to wanted null value
|
|
324
|
-
this.ngModelValue.set(this
|
|
477
|
+
this.ngModelValue.set(this.#valueItem);
|
|
325
478
|
setTimeout(() => {
|
|
326
|
-
this.ngModelValue.set(
|
|
479
|
+
this.ngModelValue.set(normalizedValue);
|
|
327
480
|
});
|
|
328
481
|
}
|
|
329
482
|
else {
|
|
330
|
-
this.ngModelValue.set(
|
|
483
|
+
this.ngModelValue.set(normalizedValue);
|
|
331
484
|
}
|
|
332
485
|
}
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
i18nGetItemsKeys(items) {
|
|
348
|
-
return items.map(item => (typeof item === 'object' && this.optionsLabelPropertyInit() ? item[this.optionsLabelPropertyInit()] : item));
|
|
349
|
-
}
|
|
350
|
-
i18nPopulateItems(items, i18nMap) {
|
|
351
|
-
return items.map(item => {
|
|
352
|
-
if (typeof item === 'object' && this.optionsLabelPropertyInit()) {
|
|
353
|
-
const label = item[this.optionsLabelPropertyInit()];
|
|
354
|
-
const translation = narrowI18nToTranslation(i18nMap, label);
|
|
355
|
-
if (translation) {
|
|
356
|
-
return { ...item, [this.optionsLabelProperty()]: translation };
|
|
357
|
-
}
|
|
358
|
-
return { ...item };
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
const translation = narrowI18nToTranslation(i18nMap, item);
|
|
362
|
-
return {
|
|
363
|
-
[this.optionsLabelProperty()]: translation ?? item,
|
|
364
|
-
[this.optionsValueProperty()]: item
|
|
365
|
-
};
|
|
366
|
-
}
|
|
367
|
-
});
|
|
486
|
+
#selectFirstItem() {
|
|
487
|
+
if (!this.selectFirst() || this.multiselect())
|
|
488
|
+
return;
|
|
489
|
+
const suggestions = this.suggestions();
|
|
490
|
+
if (suggestions.length > 0 && !this.#userSelectedItem) {
|
|
491
|
+
this.#setValueItem(suggestions[0]);
|
|
492
|
+
}
|
|
493
|
+
else if (!this.#userSelectedItem) {
|
|
494
|
+
// handles the case if the user provides an input and de-focuses the input field before suggestions are loaded or if there are no suggestions at all
|
|
495
|
+
this.#setValueItem(null);
|
|
496
|
+
}
|
|
497
|
+
}
|
|
498
|
+
#getLookup(params, query) {
|
|
499
|
+
return toObservable(this.dataProvider().lookup(params, this.#dataProviderService, query)).pipe(map(res => res.map(item => this.#createAutocompleteItem(item))));
|
|
368
500
|
}
|
|
369
|
-
|
|
370
|
-
if (query && query !== this
|
|
501
|
+
#setSuggestionsFromLookupItems(items, query) {
|
|
502
|
+
if (query && query !== this.#currentQuery) {
|
|
371
503
|
// Skip processing to avoid outdated queries during inline search updates.
|
|
372
504
|
return;
|
|
373
505
|
}
|
|
506
|
+
// Normalize items to always be objects
|
|
507
|
+
const autocompleteItems = items.map(i => this.#createAutocompleteItem(i));
|
|
374
508
|
if (this.inlineSearch()) {
|
|
375
509
|
const queryLowerCase = query?.toLowerCase() ?? '';
|
|
376
|
-
const filteredItems =
|
|
377
|
-
|
|
378
|
-
const optionsLabelProperty = this.optionsLabelProperty();
|
|
379
|
-
if (optionsLabelProperty && typeof i === 'object') {
|
|
380
|
-
itemLabel = i[optionsLabelProperty];
|
|
381
|
-
}
|
|
382
|
-
if (itemLabel == null) {
|
|
383
|
-
return queryLowerCase == null || !queryLowerCase.length;
|
|
384
|
-
}
|
|
385
|
-
if (typeof itemLabel !== 'string') {
|
|
386
|
-
itemLabel = itemLabel.toString();
|
|
387
|
-
}
|
|
388
|
-
return itemLabel.toLowerCase().startsWith(queryLowerCase);
|
|
510
|
+
const filteredItems = autocompleteItems.filter(i => {
|
|
511
|
+
return i.__label.toLowerCase().startsWith(queryLowerCase);
|
|
389
512
|
});
|
|
390
|
-
this
|
|
391
|
-
this
|
|
513
|
+
this.#setSuggestionsWithCustomInput(filteredItems, query);
|
|
514
|
+
this.#userSelectedItem = undefined;
|
|
392
515
|
}
|
|
393
516
|
else {
|
|
394
|
-
this
|
|
395
|
-
this
|
|
517
|
+
this.#setSuggestionsWithCustomInput(autocompleteItems, query);
|
|
518
|
+
this.#userSelectedItem = undefined;
|
|
519
|
+
}
|
|
520
|
+
}
|
|
521
|
+
#setSuggestionsWithCustomInput(items, query) {
|
|
522
|
+
// Mark items as selected or suggested
|
|
523
|
+
const currentValue = this.#valueItem;
|
|
524
|
+
// Directly modify items array instead of creating copies
|
|
525
|
+
items = items
|
|
526
|
+
.filter(item => item != null)
|
|
527
|
+
.map(item => {
|
|
528
|
+
let isSelected = false;
|
|
529
|
+
// Check if item is selected
|
|
530
|
+
if (currentValue != null) {
|
|
531
|
+
if (Array.isArray(currentValue)) {
|
|
532
|
+
isSelected = this.multiselect() ? currentValue.some(v => v.__track === item.__track) : false;
|
|
533
|
+
}
|
|
534
|
+
else {
|
|
535
|
+
isSelected = currentValue.__track === item.__track;
|
|
536
|
+
}
|
|
537
|
+
}
|
|
538
|
+
return {
|
|
539
|
+
...item,
|
|
540
|
+
__isCustomInput: false,
|
|
541
|
+
__isSuggested: !isSelected,
|
|
542
|
+
__isSelected: isSelected
|
|
543
|
+
};
|
|
544
|
+
});
|
|
545
|
+
let finalItems = items;
|
|
546
|
+
// Add custom input as first item if allowCustomInput is enabled and query exists
|
|
547
|
+
if (this.allowInput() && query && query.length > 0) {
|
|
548
|
+
// Check if custom input already exists in items
|
|
549
|
+
const customInputExists = items.some(item => item.__label.toLowerCase() === query.toLowerCase());
|
|
550
|
+
if (!customInputExists) {
|
|
551
|
+
finalItems = [
|
|
552
|
+
{
|
|
553
|
+
...this.#createAutocompleteItem(query),
|
|
554
|
+
__isCustom: true,
|
|
555
|
+
__isSuggested: false,
|
|
556
|
+
__isSelected: false
|
|
557
|
+
},
|
|
558
|
+
...finalItems
|
|
559
|
+
];
|
|
560
|
+
}
|
|
396
561
|
}
|
|
562
|
+
this.suggestions.set(finalItems);
|
|
397
563
|
}
|
|
398
564
|
/**
|
|
399
565
|
* Selects and sets new value.
|
|
@@ -401,16 +567,16 @@ class AutocompleteComponent {
|
|
|
401
567
|
* @param value Represents the object value.
|
|
402
568
|
* @param fromUser If set value is triggered from user.
|
|
403
569
|
*/
|
|
404
|
-
|
|
570
|
+
#setValueItem(value, fromUser = false) {
|
|
405
571
|
if (fromUser) {
|
|
406
|
-
this
|
|
572
|
+
this.#userSelectedItem = value ?? undefined;
|
|
407
573
|
}
|
|
408
574
|
else {
|
|
409
575
|
this.ngModelValue.set(value);
|
|
410
576
|
}
|
|
411
|
-
this
|
|
577
|
+
this.#propagateValueItemChange(value);
|
|
412
578
|
}
|
|
413
|
-
|
|
579
|
+
#trimSearchQuery(value) {
|
|
414
580
|
switch (this.searchTrim()) {
|
|
415
581
|
case 'start':
|
|
416
582
|
return value?.trimStart();
|
|
@@ -422,42 +588,42 @@ class AutocompleteComponent {
|
|
|
422
588
|
return value;
|
|
423
589
|
}
|
|
424
590
|
}
|
|
591
|
+
#createAutocompleteItem(item) {
|
|
592
|
+
return createAutocompleteItem(item, {
|
|
593
|
+
translate: this.#translate,
|
|
594
|
+
optionsTrackProperty: this.optionsTrackProperty(),
|
|
595
|
+
optionsValueProperty: this.optionsValueProperty(),
|
|
596
|
+
optionsLabelProperty: this.optionsLabelProperty(),
|
|
597
|
+
optionsLabelTranslate: this.optionsLabelTranslate()
|
|
598
|
+
});
|
|
599
|
+
}
|
|
425
600
|
/**
|
|
426
|
-
* Propagates final value to
|
|
601
|
+
* Propagates final value to #value, on change fn and outputs.
|
|
427
602
|
*/
|
|
428
|
-
|
|
429
|
-
this
|
|
430
|
-
this
|
|
431
|
-
this
|
|
432
|
-
this.valueChange.emit(this
|
|
433
|
-
}
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
return value;
|
|
438
|
-
}
|
|
439
|
-
if (this.multiselect() && Array.isArray(value)) {
|
|
440
|
-
return value.map((item) => {
|
|
441
|
-
if (item && typeof item === 'object') {
|
|
442
|
-
return item[optionsValueProperty];
|
|
443
|
-
}
|
|
444
|
-
return null;
|
|
445
|
-
});
|
|
603
|
+
#propagateValueItemChange(value) {
|
|
604
|
+
this.#value = this.#getValueFromItem(value);
|
|
605
|
+
this.#valueItem = value;
|
|
606
|
+
this.#onChangeFn(this.#value);
|
|
607
|
+
this.valueChange.emit(this.#value);
|
|
608
|
+
}
|
|
609
|
+
#getValueFromItem(item) {
|
|
610
|
+
if (item == null) {
|
|
611
|
+
return item;
|
|
446
612
|
}
|
|
447
|
-
else if (
|
|
448
|
-
return
|
|
613
|
+
else if (Array.isArray(item)) {
|
|
614
|
+
return this.multiselect() ? item.map(item => item.__value) : [];
|
|
449
615
|
}
|
|
450
616
|
else {
|
|
451
|
-
return
|
|
617
|
+
return item?.__value;
|
|
452
618
|
}
|
|
453
619
|
}
|
|
454
620
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
455
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: AutocompleteComponent, isStandalone: true, selector: "mng-autocomplete", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: true, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null },
|
|
621
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: AutocompleteComponent, isStandalone: true, selector: "mng-autocomplete", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: true, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsValueProperty: { classPropertyName: "optionsValueProperty", publicName: "optionsValueProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelProperty: { classPropertyName: "optionsLabelProperty", publicName: "optionsLabelProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelTranslate: { classPropertyName: "optionsLabelTranslate", publicName: "optionsLabelTranslate", isSignal: true, isRequired: false, transformFunction: null }, inlineSearch: { classPropertyName: "inlineSearch", publicName: "inlineSearch", isSignal: true, isRequired: false, transformFunction: null }, openOnFocus: { classPropertyName: "openOnFocus", publicName: "openOnFocus", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, dropdownClassName: { classPropertyName: "dropdownClassName", publicName: "dropdownClassName", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, autoClear: { classPropertyName: "autoClear", publicName: "autoClear", isSignal: true, isRequired: false, transformFunction: null }, selectFirst: { classPropertyName: "selectFirst", publicName: "selectFirst", isSignal: true, isRequired: false, transformFunction: null }, allowInput: { classPropertyName: "allowInput", publicName: "allowInput", isSignal: true, isRequired: false, transformFunction: null }, searchTrim: { classPropertyName: "searchTrim", publicName: "searchTrim", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", blur: "blur" }, providers: [AUTOCOMPLETE_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeAutocomplete", first: true, predicate: AutoComplete, descendants: true, isSignal: true }], ngImport: i0, template: "<p-inputgroup [class]=\"{'has-prepends': prependTemplates().length > 0}\">\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n <p-autoComplete\n *mngRerender=\"multiselect()\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n dataKey=\"__track\"\n optionLabel=\"__label\"\n optionValue=\"__value\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [class]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minQueryLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear() || allowInput()\"\n autoOptionFocus=\"true\"\n [selectOnFocus]=\"allowInput()\"\n [disabled]=\"disabled()\"\n [completeOnFocus]=\"openOnFocus()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onUnselect)=\"onUnselect($event)\"\n (onFocus)=\"onFocus($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onPanelShow()\"\n (onHide)=\"onPanelHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n <ng-template let-item #item>\n <div style=\"display: flex; align-items: center; justify-content: space-between; width: 100%\">\n <span>{{ item.__label }}</span>\n @if (allowInput()) {\n <div style=\"display: flex; gap: 0.25rem\">\n @if (item.__isSelected) {\n <p-tag [value]=\"'general.selected' | translate\" severity=\"success\" />\n } @else if (item.__isSuggested) {\n <p-tag [value]=\"'general.suggested' | translate\" />\n } @else if (item.__isCustom) {\n <p-tag [value]=\"'general.custom' | translate\" severity=\"warn\" />\n }\n </div>\n }\n </div>\n </ng-template>\n </p-autoComplete>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</p-inputgroup>\n", styles: [".has-prepends .p-autocomplete-input-multiple{border-top-left-radius:0!important;border-bottom-left-radius:0!important}p-inputgroup{font-size:1rem}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "component", type: AutoComplete, selector: "p-autoComplete, p-autocomplete, p-auto-complete", inputs: ["minLength", "minQueryLength", "delay", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "addOnTab", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "optionLabel", "optionValue", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover", "typeahead", "addOnBlur", "separator", "appendTo", "motionOptions"], outputs: ["completeMethod", "onSelect", "onUnselect", "onAdd", "onFocus", "onBlur", "onDropdownClick", "onClear", "onInputKeydown", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: RerenderDirective, selector: "[mngRerender]", inputs: ["mngRerender"] }, { kind: "component", type: Tag, selector: "p-tag", inputs: ["styleClass", "severity", "value", "icon", "rounded"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
456
622
|
}
|
|
457
623
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
458
624
|
type: Component,
|
|
459
|
-
args: [{ selector: 'mng-autocomplete', encapsulation: ViewEncapsulation.None, providers: [AUTOCOMPLETE_VALUE_ACCESSOR], imports: [TranslatePipe, FormsModule, AutoComplete, InputGroup, InputGroupAddon, NgTemplateOutlet], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-inputgroup [class]=\"{'has-prepends': prependTemplates().length > 0}\">\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n <p-autoComplete\n
|
|
460
|
-
}], ctorParameters: () => [], propDecorators: { dataProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataProvider", required: true }] }], optionsTrackProperty: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsTrackProperty", required: false }] }],
|
|
625
|
+
args: [{ selector: 'mng-autocomplete', encapsulation: ViewEncapsulation.None, providers: [AUTOCOMPLETE_VALUE_ACCESSOR], imports: [TranslatePipe, FormsModule, AutoComplete, InputGroup, InputGroupAddon, NgTemplateOutlet, RerenderDirective, Tag], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-inputgroup [class]=\"{'has-prepends': prependTemplates().length > 0}\">\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n <p-autoComplete\n *mngRerender=\"multiselect()\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n dataKey=\"__track\"\n optionLabel=\"__label\"\n optionValue=\"__value\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [class]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minQueryLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear() || allowInput()\"\n autoOptionFocus=\"true\"\n [selectOnFocus]=\"allowInput()\"\n [disabled]=\"disabled()\"\n [completeOnFocus]=\"openOnFocus()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onUnselect)=\"onUnselect($event)\"\n (onFocus)=\"onFocus($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onPanelShow()\"\n (onHide)=\"onPanelHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n <ng-template let-item #item>\n <div style=\"display: flex; align-items: center; justify-content: space-between; width: 100%\">\n <span>{{ item.__label }}</span>\n @if (allowInput()) {\n <div style=\"display: flex; gap: 0.25rem\">\n @if (item.__isSelected) {\n <p-tag [value]=\"'general.selected' | translate\" severity=\"success\" />\n } @else if (item.__isSuggested) {\n <p-tag [value]=\"'general.suggested' | translate\" />\n } @else if (item.__isCustom) {\n <p-tag [value]=\"'general.custom' | translate\" severity=\"warn\" />\n }\n </div>\n }\n </div>\n </ng-template>\n </p-autoComplete>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</p-inputgroup>\n", styles: [".has-prepends .p-autocomplete-input-multiple{border-top-left-radius:0!important;border-bottom-left-radius:0!important}p-inputgroup{font-size:1rem}\n"] }]
|
|
626
|
+
}], ctorParameters: () => [], propDecorators: { dataProvider: [{ type: i0.Input, args: [{ isSignal: true, alias: "dataProvider", required: true }] }], optionsTrackProperty: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsTrackProperty", required: false }] }], optionsValueProperty: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsValueProperty", required: false }] }], optionsLabelProperty: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsLabelProperty", required: false }] }], optionsLabelTranslate: [{ type: i0.Input, args: [{ isSignal: true, alias: "optionsLabelTranslate", required: false }] }], inlineSearch: [{ type: i0.Input, args: [{ isSignal: true, alias: "inlineSearch", required: false }] }], openOnFocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "openOnFocus", required: false }] }], multiselect: [{ type: i0.Input, args: [{ isSignal: true, alias: "multiselect", required: false }] }], placeholder: [{ type: i0.Input, args: [{ isSignal: true, alias: "placeholder", required: false }] }], className: [{ type: i0.Input, args: [{ isSignal: true, alias: "className", required: false }] }], dropdownClassName: [{ type: i0.Input, args: [{ isSignal: true, alias: "dropdownClassName", required: false }] }], showClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "showClear", required: false }] }], autoClear: [{ type: i0.Input, args: [{ isSignal: true, alias: "autoClear", required: false }] }], selectFirst: [{ type: i0.Input, args: [{ isSignal: true, alias: "selectFirst", required: false }] }], allowInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "allowInput", required: false }] }], searchTrim: [{ type: i0.Input, args: [{ isSignal: true, alias: "searchTrim", required: false }] }], disabledInput: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], templates: [{ type: i0.Input, args: [{ isSignal: true, alias: "templates", required: false }] }], valueChange: [{ type: i0.Output, args: ["valueChange"] }], blur: [{ type: i0.Output, args: ["blur"] }], primeAutocomplete: [{ type: i0.ViewChild, args: [i0.forwardRef(() => AutoComplete), { isSignal: true }] }] } });
|
|
461
627
|
|
|
462
628
|
const DATETIME_PICKER_VALUE_ACCESSOR = {
|
|
463
629
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -755,7 +921,7 @@ class DatetimePickerComponent {
|
|
|
755
921
|
this.overlayVisible.set(false);
|
|
756
922
|
}
|
|
757
923
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: DatetimePickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
758
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: DatetimePickerComponent, isStandalone: true, selector: "mng-datetime-picker", inputs: { templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, timeInput: { classPropertyName: "timeInput", publicName: "time", isSignal: true, isRequired: false, transformFunction: null }, timeSelect: { classPropertyName: "timeSelect", publicName: "timeSelect", isSignal: true, isRequired: false, transformFunction: null }, timeSelectInterval: { classPropertyName: "timeSelectInterval", publicName: "timeSelectInterval", isSignal: true, isRequired: false, transformFunction: null }, secondsInput: { classPropertyName: "secondsInput", publicName: "seconds", isSignal: true, isRequired: false, transformFunction: null }, milliseconds: { classPropertyName: "milliseconds", publicName: "milliseconds", isSignal: true, isRequired: false, transformFunction: null }, primeTimePicker: { classPropertyName: "primeTimePicker", publicName: "primeTimePicker", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, showButtonBar: { classPropertyName: "showButtonBar", publicName: "showButtonBar", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, panelStyleClass: { classPropertyName: "panelStyleClass", publicName: "panelStyleClass", isSignal: true, isRequired: false, transformFunction: null }, inputStyleClass: { classPropertyName: "inputStyleClass", publicName: "inputStyleClass", isSignal: true, isRequired: false, transformFunction: null }, dateRange: { classPropertyName: "dateRange", publicName: "dateRange", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { blur: "blur" }, host: { classAttribute: "block" }, providers: [DATETIME_PICKER_VALUE_ACCESSOR, DATETIME_PICKER_VALIDATOR], viewQueries: [{ propertyName: "maskInput", first: true, predicate: InputMask, descendants: true, isSignal: true }], ngImport: i0, template: "<p-inputgroup class=\"flex-col gap-2\">\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <!-- Append to body, to prevent overflow in popups (like editable) -->\n <div class=\"flex gap-1\">\n <p-date-picker\n appendTo=\"body\"\n [class]=\"className() + ' basis-1/2 shrink-0'\"\n [panelStyleClass]=\"panelStyleClass()\"\n [inputStyleClass]=\"inputStyleClass()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [showClear]=\"showClear()\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [disabled]=\"disabled()\"\n [showTime]=\"time() && primeTimePicker()\"\n [showIcon]=\"showIcon()\"\n [showSeconds]=\"primeTimePicker() && seconds()\"\n [selectionMode]=\"!time() && dateRange() ? 'range' : 'single'\"\n [showButtonBar]=\"showButtonBar()\"\n [firstDayOfWeek]=\"1\"\n [ngModel]=\"displayDate()\"\n (onBlur)=\"handleDateBlur($event)\"\n (onClear)=\"onClear()\"\n (onTodayClick)=\"onSelectToday()\"\n (onClearClick)=\"onClear()\"\n (ngModelChange)=\"onDateModelChange($event)\"/>\n @if (time() && !primeTimePicker()) {\n <p-inputgroup class=\"basis-1/2 shrink-0\">\n <p-inputmask\n #InputMask\n class=\"w-full flex\"\n [invalid]=\"!timeValid()\"\n [(ngModel)]=\"selectedTime\"\n (ngModelChange)=\"onTimeSelect()\"\n [disabled]=\"disabled()\"\n [mask]=\"inputMaskConfig().mask\"\n [placeholder]=\"inputMaskConfig().placeholder\"\n [slotChar]=\"inputMaskConfig().format\"\n [showClear]=\"showClear()\"\n (onClear)=\"onClear()\"\n (click)=\"openOverlay()\"\n (onFocus)=\"openOverlay()\"\n (onBlur)=\"closeOverlay()\" />\n <button\n class=\"p-datepicker-dropdown cursor-pointer shrink-0\"\n [disabled]=\"disabled()\"\n (click)=\"focusTimeInputMask($event, InputMask)\"\n aria-label=\"Focus time mask input\">\n <i class=\"pi pi-clock\"></i>\n </button>\n </p-inputgroup>\n @if (timeSelect() && !disabled()) {\n <!-- Using display:contents rendering, so that the parents flex gap doesn\u2019t apply to this container -->\n <p-overlay class=\"contents\" [(visible)]=\"overlayVisible\" appendTo=\"body\">\n <!-- Refresh event is unnecessary, because it shares the value with the MaskInput, which then triggers ngModelChange.\n It still exists because defaultPropagation closes the popup in filters/editor on select, and disabling it, doesn't trigger the change event -->\n <p-listbox\n class=\"mr-10\"\n [options]=\"selectOptions()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [(ngModel)]=\"selectedTime\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseup)=\"closeOverlay()\"\n (onChange)=\"onTimeSelect()\" />\n </p-overlay>\n }\n }\n </div>\n\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n</p-inputgroup>\n\n<ng-template #prependAddons>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n<ng-template #appendAddons>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n", styles: ["mng-datetime-picker .p-inputtext.p-invalid:enabled:focus{border-color:var(--p-inputtext-invalid-border-color)}mng-datetime-picker .p-inputgroup .p-datepicker-dropdown{border-start-end-radius:var(--p-datepicker-dropdown-border-radius);border-end-end-radius:var(--p-datepicker-dropdown-border-radius)}\n"], dependencies: [{ kind: "component", type: DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "ngmodule", type: InputMaskModule }, { kind: "component", type: i1$1.InputMask, selector: "p-inputmask, p-inputMask, p-input-mask", inputs: ["type", "slotChar", "autoClear", "showClear", "style", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabel", "ariaLabelledBy", "ariaRequired", "readonly", "unmask", "characterPattern", "autofocus", "autocomplete", "keepBuffer", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown", "onClear"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { 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"] }, { kind: "component", type: Listbox, selector: "p-listbox, p-listBox, p-list-box", inputs: ["hostName", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "ariaLabel", "selectOnFocus", "searchLocale", "focusOnHover", "filterMessage", "filterFields", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "scrollHeight", "tabindex", "multiple", "styleClass", "listStyle", "listStyleClass", "readonly", "checkbox", "filter", "filterBy", "filterMatchMode", "filterLocale", "metaKeySelection", "dataKey", "showToggleAll", "optionLabel", "optionValue", "optionGroupChildren", "optionGroupLabel", "optionDisabled", "ariaFilterLabel", "filterPlaceHolder", "emptyFilterMessage", "emptyMessage", "group", "options", "filterValue", "selectAll", "striped", "highlightOnSelect", "checkmark", "dragdrop", "dropListData", "fluid"], outputs: ["onChange", "onClick", "onDblClick", "onFilter", "onFocus", "onBlur", "onSelectAllChange", "onLazyLoad", "onDrop"] }, { kind: "component", type: Overlay, selector: "p-overlay", inputs: ["hostName", "visible", "mode", "style", "styleClass", "contentStyle", "contentStyleClass", "target", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "listener", "responsive", "options", "appendTo", "inline", "motionOptions", "hostAttrSelector"], outputs: ["visibleChange", "onBeforeShow", "onShow", "onBeforeHide", "onHide", "onAnimationStart", "onAnimationDone", "onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
924
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: DatetimePickerComponent, isStandalone: true, selector: "mng-datetime-picker", inputs: { templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, timeInput: { classPropertyName: "timeInput", publicName: "time", isSignal: true, isRequired: false, transformFunction: null }, timeSelect: { classPropertyName: "timeSelect", publicName: "timeSelect", isSignal: true, isRequired: false, transformFunction: null }, timeSelectInterval: { classPropertyName: "timeSelectInterval", publicName: "timeSelectInterval", isSignal: true, isRequired: false, transformFunction: null }, secondsInput: { classPropertyName: "secondsInput", publicName: "seconds", isSignal: true, isRequired: false, transformFunction: null }, milliseconds: { classPropertyName: "milliseconds", publicName: "milliseconds", isSignal: true, isRequired: false, transformFunction: null }, primeTimePicker: { classPropertyName: "primeTimePicker", publicName: "primeTimePicker", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, minDate: { classPropertyName: "minDate", publicName: "minDate", isSignal: true, isRequired: false, transformFunction: null }, maxDate: { classPropertyName: "maxDate", publicName: "maxDate", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, showIcon: { classPropertyName: "showIcon", publicName: "showIcon", isSignal: true, isRequired: false, transformFunction: null }, showButtonBar: { classPropertyName: "showButtonBar", publicName: "showButtonBar", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, panelStyleClass: { classPropertyName: "panelStyleClass", publicName: "panelStyleClass", isSignal: true, isRequired: false, transformFunction: null }, inputStyleClass: { classPropertyName: "inputStyleClass", publicName: "inputStyleClass", isSignal: true, isRequired: false, transformFunction: null }, dateRange: { classPropertyName: "dateRange", publicName: "dateRange", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { blur: "blur" }, host: { classAttribute: "block" }, providers: [DATETIME_PICKER_VALUE_ACCESSOR, DATETIME_PICKER_VALIDATOR], viewQueries: [{ propertyName: "maskInput", first: true, predicate: InputMask, descendants: true, isSignal: true }], ngImport: i0, template: "<p-inputgroup class=\"flex-col gap-2\">\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <!-- Append to body, to prevent overflow in popups (like editable) -->\n <div class=\"flex gap-1\">\n <p-date-picker\n appendTo=\"body\"\n [class]=\"className() + ' basis-1/2 shrink-0'\"\n [panelStyleClass]=\"panelStyleClass()\"\n [inputStyleClass]=\"inputStyleClass()\"\n [minDate]=\"minDate()\"\n [maxDate]=\"maxDate()\"\n [showClear]=\"showClear()\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [disabled]=\"disabled()\"\n [showTime]=\"time() && primeTimePicker()\"\n [showIcon]=\"showIcon()\"\n [showSeconds]=\"primeTimePicker() && seconds()\"\n [selectionMode]=\"!time() && dateRange() ? 'range' : 'single'\"\n [showButtonBar]=\"showButtonBar()\"\n [firstDayOfWeek]=\"1\"\n [ngModel]=\"displayDate()\"\n (onBlur)=\"handleDateBlur($event)\"\n (onClear)=\"onClear()\"\n (onTodayClick)=\"onSelectToday()\"\n (onClearClick)=\"onClear()\"\n (ngModelChange)=\"onDateModelChange($event)\"/>\n @if (time() && !primeTimePicker()) {\n <p-inputgroup class=\"basis-1/2 shrink-0\">\n <p-inputmask\n #InputMask\n class=\"w-full flex\"\n [invalid]=\"!timeValid()\"\n [(ngModel)]=\"selectedTime\"\n (ngModelChange)=\"onTimeSelect()\"\n [disabled]=\"disabled()\"\n [mask]=\"inputMaskConfig().mask\"\n [placeholder]=\"inputMaskConfig().placeholder\"\n [slotChar]=\"inputMaskConfig().format\"\n [showClear]=\"showClear()\"\n (onClear)=\"onClear()\"\n (click)=\"openOverlay()\"\n (onFocus)=\"openOverlay()\"\n (onBlur)=\"closeOverlay()\" />\n <button\n class=\"p-datepicker-dropdown cursor-pointer shrink-0\"\n [disabled]=\"disabled()\"\n (click)=\"focusTimeInputMask($event, InputMask)\"\n aria-label=\"Focus time mask input\">\n <i class=\"pi pi-clock\"></i>\n </button>\n </p-inputgroup>\n @if (timeSelect() && !disabled()) {\n <!-- Using display:contents rendering, so that the parents flex gap doesn\u2019t apply to this container -->\n <p-overlay class=\"contents\" [(visible)]=\"overlayVisible\" appendTo=\"body\">\n <!-- Refresh event is unnecessary, because it shares the value with the MaskInput, which then triggers ngModelChange.\n It still exists because defaultPropagation closes the popup in filters/editor on select, and disabling it, doesn't trigger the change event -->\n <p-listbox\n class=\"mr-10\"\n [options]=\"selectOptions()\"\n optionLabel=\"label\"\n optionValue=\"value\"\n [(ngModel)]=\"selectedTime\"\n (click)=\"$event.stopPropagation()\"\n (mousedown)=\"$event.preventDefault()\"\n (mouseup)=\"closeOverlay()\"\n (onChange)=\"onTimeSelect()\" />\n </p-overlay>\n }\n }\n </div>\n\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n</p-inputgroup>\n\n<ng-template #prependAddons>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n<ng-template #appendAddons>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n", styles: ["mng-datetime-picker .p-inputtext.p-invalid:enabled:focus{border-color:var(--p-inputtext-invalid-border-color)}mng-datetime-picker .p-inputgroup .p-datepicker-dropdown{border-start-end-radius:var(--p-datepicker-dropdown-border-radius);border-end-end-radius:var(--p-datepicker-dropdown-border-radius)}\n"], dependencies: [{ kind: "component", type: DatePicker, selector: "p-datePicker, p-datepicker, p-date-picker", inputs: ["iconDisplay", "styleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "readonlyInput", "shortYearCutoff", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "showOnFocus", "showWeek", "startWeekFromFirstDayOfYear", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autofocus", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "view", "defaultDate", "appendTo", "motionOptions"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "ngmodule", type: InputMaskModule }, { kind: "component", type: i1.InputMask, selector: "p-inputmask, p-inputMask, p-input-mask", inputs: ["type", "slotChar", "autoClear", "showClear", "style", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabel", "ariaLabelledBy", "ariaRequired", "readonly", "unmask", "characterPattern", "autofocus", "autocomplete", "keepBuffer", "mask"], outputs: ["onComplete", "onFocus", "onBlur", "onInput", "onKeydown", "onClear"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Listbox, selector: "p-listbox, p-listBox, p-list-box", inputs: ["hostName", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "ariaLabel", "selectOnFocus", "searchLocale", "focusOnHover", "filterMessage", "filterFields", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "scrollHeight", "tabindex", "multiple", "styleClass", "listStyle", "listStyleClass", "readonly", "checkbox", "filter", "filterBy", "filterMatchMode", "filterLocale", "metaKeySelection", "dataKey", "showToggleAll", "optionLabel", "optionValue", "optionGroupChildren", "optionGroupLabel", "optionDisabled", "ariaFilterLabel", "filterPlaceHolder", "emptyFilterMessage", "emptyMessage", "group", "options", "filterValue", "selectAll", "striped", "highlightOnSelect", "checkmark", "dragdrop", "dropListData", "fluid"], outputs: ["onChange", "onClick", "onDblClick", "onFilter", "onFocus", "onBlur", "onSelectAllChange", "onLazyLoad", "onDrop"] }, { kind: "component", type: Overlay, selector: "p-overlay", inputs: ["hostName", "visible", "mode", "style", "styleClass", "contentStyle", "contentStyleClass", "target", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "listener", "responsive", "options", "appendTo", "inline", "motionOptions", "hostAttrSelector"], outputs: ["visibleChange", "onBeforeShow", "onShow", "onBeforeHide", "onHide", "onAnimationStart", "onAnimationDone", "onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
759
925
|
}
|
|
760
926
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: DatetimePickerComponent, decorators: [{
|
|
761
927
|
type: Component,
|
|
@@ -901,7 +1067,7 @@ class DateRangeComponent {
|
|
|
901
1067
|
}
|
|
902
1068
|
}
|
|
903
1069
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: DateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
904
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: DateRangeComponent, isStandalone: true, selector: "mng-date-range", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, milliseconds: { classPropertyName: "milliseconds", publicName: "milliseconds", isSignal: true, isRequired: false, transformFunction: null }, primeTimePicker: { classPropertyName: "primeTimePicker", publicName: "primeTimePicker", isSignal: true, isRequired: false, transformFunction: null }, timeSelect: { classPropertyName: "timeSelect", publicName: "timeSelect", isSignal: true, isRequired: false, transformFunction: null }, timeSelectInterval: { classPropertyName: "timeSelectInterval", publicName: "timeSelectInterval", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, inputStyleClass: { classPropertyName: "inputStyleClass", publicName: "inputStyleClass", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "className()" } }, providers: [DATE_RANGE_VALUE_ACCESSOR, DATE_RANGE_VALIDATOR], ngImport: i0, template: "@if (showTime()) {\n <div class=\"flex gap-1\" [class.flex-col]=\"vertical()\">\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <mng-datetime-picker\n class=\"w-full\"\n [inputStyleClass]=\"inputStyleClass()\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"(placeholder() + ' ' + ('mngTable.filterRangeFrom' | translate)).trim()\"\n [dateFormat]=\"dateFormat()\"\n showIcon=\"true\"\n time=\"true\"\n [seconds]=\"showSeconds()\"\n [milliseconds]=\"milliseconds()\"\n [primeTimePicker]=\"primeTimePicker()\"\n [timeSelect]=\"timeSelect()\"\n [timeSelectInterval]=\"timeSelectInterval()\"\n (blur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n @if (!vertical()) {\n <p-divider layout=\"horizontal\" class=\"!w-3 !p-0\" />\n }\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <mng-datetime-picker\n class=\"w-full\"\n [inputStyleClass]=\"inputStyleClass()\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"(placeholder() + ' ' + ('mngTable.filterRangeTo' | translate)).trim()\"\n [dateFormat]=\"dateFormat()\"\n showIcon=\"true\"\n time=\"true\"\n [seconds]=\"showSeconds()\"\n [milliseconds]=\"milliseconds()\"\n [primeTimePicker]=\"primeTimePicker()\"\n [timeSelect]=\"timeSelect()\"\n [timeSelectInterval]=\"timeSelectInterval()\"\n (blur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n </div>\n} @else {\n <p-input-group>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <mng-datetime-picker\n class=\"w-full\"\n [inputStyleClass]=\"inputStyleClass()\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n dateRange=\"true\"\n showIcon=\"true\"\n (blur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container\n ></p-input-group>\n}\n\n<ng-template #prependAddons>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n<ng-template #appendAddons>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n", styles: ["mng-date-range.ng-dirty.ng-invalid p-date-picker>.p-datepicker>.p-inputtext{border-color:var(--p-inputtext-invalid-border-color, #f87171)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: DatetimePickerComponent, selector: "mng-datetime-picker", inputs: ["templates", "time", "timeSelect", "timeSelectInterval", "seconds", "milliseconds", "primeTimePicker", "dateFormat", "placeholder", "minDate", "maxDate", "disabled", "showIcon", "showButtonBar", "showClear", "className", "panelStyleClass", "inputStyleClass", "dateRange"], outputs: ["blur"] }, { kind: "component", type: Divider, selector: "p-divider", inputs: ["styleClass", "layout", "type", "align"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1070
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: DateRangeComponent, isStandalone: true, selector: "mng-date-range", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showTime: { classPropertyName: "showTime", publicName: "showTime", isSignal: true, isRequired: false, transformFunction: null }, showSeconds: { classPropertyName: "showSeconds", publicName: "showSeconds", isSignal: true, isRequired: false, transformFunction: null }, milliseconds: { classPropertyName: "milliseconds", publicName: "milliseconds", isSignal: true, isRequired: false, transformFunction: null }, primeTimePicker: { classPropertyName: "primeTimePicker", publicName: "primeTimePicker", isSignal: true, isRequired: false, transformFunction: null }, timeSelect: { classPropertyName: "timeSelect", publicName: "timeSelect", isSignal: true, isRequired: false, transformFunction: null }, timeSelectInterval: { classPropertyName: "timeSelectInterval", publicName: "timeSelectInterval", isSignal: true, isRequired: false, transformFunction: null }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, inputStyleClass: { classPropertyName: "inputStyleClass", publicName: "inputStyleClass", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "className()" } }, providers: [DATE_RANGE_VALUE_ACCESSOR, DATE_RANGE_VALIDATOR], ngImport: i0, template: "@if (showTime()) {\n <div class=\"flex gap-1\" [class.flex-col]=\"vertical()\">\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <mng-datetime-picker\n class=\"w-full\"\n [inputStyleClass]=\"inputStyleClass()\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"(placeholder() + ' ' + ('mngTable.filterRangeFrom' | translate)).trim()\"\n [dateFormat]=\"dateFormat()\"\n showIcon=\"true\"\n time=\"true\"\n [seconds]=\"showSeconds()\"\n [milliseconds]=\"milliseconds()\"\n [primeTimePicker]=\"primeTimePicker()\"\n [timeSelect]=\"timeSelect()\"\n [timeSelectInterval]=\"timeSelectInterval()\"\n (blur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n @if (!vertical()) {\n <p-divider layout=\"horizontal\" class=\"!w-3 !p-0\" />\n }\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <mng-datetime-picker\n class=\"w-full\"\n [inputStyleClass]=\"inputStyleClass()\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"(placeholder() + ' ' + ('mngTable.filterRangeTo' | translate)).trim()\"\n [dateFormat]=\"dateFormat()\"\n showIcon=\"true\"\n time=\"true\"\n [seconds]=\"showSeconds()\"\n [milliseconds]=\"milliseconds()\"\n [primeTimePicker]=\"primeTimePicker()\"\n [timeSelect]=\"timeSelect()\"\n [timeSelectInterval]=\"timeSelectInterval()\"\n (blur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n </div>\n} @else {\n <p-input-group>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <mng-datetime-picker\n class=\"w-full\"\n [inputStyleClass]=\"inputStyleClass()\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n dateRange=\"true\"\n showIcon=\"true\"\n (blur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container\n ></p-input-group>\n}\n\n<ng-template #prependAddons>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n<ng-template #appendAddons>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n", styles: ["mng-date-range.ng-dirty.ng-invalid p-date-picker>.p-datepicker>.p-inputtext{border-color:var(--p-inputtext-invalid-border-color, #f87171)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: DatetimePickerComponent, selector: "mng-datetime-picker", inputs: ["templates", "time", "timeSelect", "timeSelectInterval", "seconds", "milliseconds", "primeTimePicker", "dateFormat", "placeholder", "minDate", "maxDate", "disabled", "showIcon", "showButtonBar", "showClear", "className", "panelStyleClass", "inputStyleClass", "dateRange"], outputs: ["blur"] }, { kind: "component", type: Divider, selector: "p-divider", inputs: ["styleClass", "layout", "type", "align"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
905
1071
|
}
|
|
906
1072
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: DateRangeComponent, decorators: [{
|
|
907
1073
|
type: Component,
|
|
@@ -924,6 +1090,7 @@ class DropdownComponent {
|
|
|
924
1090
|
this.injector = inject(Injector);
|
|
925
1091
|
this.destroyRef = inject(DestroyRef);
|
|
926
1092
|
this.translate = inject(TranslateService);
|
|
1093
|
+
this.labelLookupService = inject(LookupLabelResolutionService);
|
|
927
1094
|
this.dataProvider = input(...(ngDevMode ? [undefined, { debugName: "dataProvider" }] : []));
|
|
928
1095
|
this.options = input([], ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
929
1096
|
this.optionsTrackProperty = input(...(ngDevMode ? [undefined, { debugName: "optionsTrackProperty" }] : []));
|
|
@@ -1097,6 +1264,11 @@ class DropdownComponent {
|
|
|
1097
1264
|
.subscribe({
|
|
1098
1265
|
next: res => {
|
|
1099
1266
|
this.fetchedItems = res;
|
|
1267
|
+
const dataProvider = this.dataProvider();
|
|
1268
|
+
const optionsValueProperty = this.optionsValueProperty();
|
|
1269
|
+
if (dataProvider && optionsValueProperty) {
|
|
1270
|
+
res.forEach(item => this.labelLookupService.storeEntry(dataProvider, optionsValueProperty, item[optionsValueProperty], item));
|
|
1271
|
+
}
|
|
1100
1272
|
this.setItems(res, query);
|
|
1101
1273
|
this._loading.set(false);
|
|
1102
1274
|
this.selectFirstItem(); // only selects first item if selectFirstItemInput is set accordingly
|
|
@@ -1266,7 +1438,7 @@ class DropdownComponent {
|
|
|
1266
1438
|
}
|
|
1267
1439
|
}
|
|
1268
1440
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1269
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: DropdownComponent, isStandalone: true, selector: "mng-dropdown", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelPropertyInit: { classPropertyName: "optionsLabelPropertyInit", publicName: "optionsLabelProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelTranslate: { classPropertyName: "optionsLabelTranslate", publicName: "optionsLabelTranslate", isSignal: true, isRequired: false, transformFunction: null }, optionsValuePropertyInput: { classPropertyName: "optionsValuePropertyInput", publicName: "optionsValueProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsDisabledProperty: { classPropertyName: "optionsDisabledProperty", publicName: "optionsDisabledProperty", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, selectFirstItemInput: { classPropertyName: "selectFirstItemInput", publicName: "selectFirstItem", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, dropdownClassName: { classPropertyName: "dropdownClassName", publicName: "dropdownClassName", isSignal: true, isRequired: false, transformFunction: null }, changeValueOnBlur: { classPropertyName: "changeValueOnBlur", publicName: "changeValueOnBlur", isSignal: true, isRequired: false, transformFunction: null }, loadingInput: { classPropertyName: "loadingInput", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, allowInput: { classPropertyName: "allowInput", publicName: "allowInput", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, inlineSearch: { classPropertyName: "inlineSearch", publicName: "inlineSearch", isSignal: true, isRequired: false, transformFunction: null }, searchTrim: { classPropertyName: "searchTrim", publicName: "searchTrim", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", blur: "blur" }, providers: [DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeSelect", first: true, predicate: Select, descendants: true, isSignal: true }, { propertyName: "primeMultiselect", first: true, predicate: MultiSelect, descendants: true, isSignal: true }], ngImport: i0, template: "<p-inputgroup>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (!multiselect()) {\n <p-select\n [(ngModel)]=\"ngModelValue\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [showClear]=\"showClear()\"\n [editable]=\"allowInput()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [disabled]=\"disabled()\"\n [filter]=\"inlineSearch() && !allowInput()\"\n [filterBy]=\"optionsLabelProperty()\"\n (onBlur)=\"onDropdownBlur($event)\"\n (onChange)=\"onDropdownChange($event)\"\n (onShow)=\"onDropdownPanelShow()\"\n (onHide)=\"onDropdownPanelHide()\"\n (onFocus)=\"onFocus()\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n [appendTo]=\"appendTo()\">\n </p-select>\n } @else {\n <p-multiSelect\n [ngModel]=\"ngModelValue()\"\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [filter]=\"true\"\n [showToggleAll]=\"false\"\n [disabled]=\"disabled()\"\n (onChange)=\"onMultiselectChange($event)\"\n (onPanelHide)=\"onMultiselectPanelHide()\"\n (onBlur)=\"onMultiselectBlur($event)\"\n (onFocus)=\"onFocus()\"\n appendTo=\"body\">\n </p-multiSelect>\n }\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</p-inputgroup>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { 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"] }, { kind: "component", type: Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1441
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: DropdownComponent, isStandalone: true, selector: "mng-dropdown", inputs: { dataProvider: { classPropertyName: "dataProvider", publicName: "dataProvider", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null }, optionsTrackProperty: { classPropertyName: "optionsTrackProperty", publicName: "optionsTrackProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelPropertyInit: { classPropertyName: "optionsLabelPropertyInit", publicName: "optionsLabelProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsLabelTranslate: { classPropertyName: "optionsLabelTranslate", publicName: "optionsLabelTranslate", isSignal: true, isRequired: false, transformFunction: null }, optionsValuePropertyInput: { classPropertyName: "optionsValuePropertyInput", publicName: "optionsValueProperty", isSignal: true, isRequired: false, transformFunction: null }, optionsDisabledProperty: { classPropertyName: "optionsDisabledProperty", publicName: "optionsDisabledProperty", isSignal: true, isRequired: false, transformFunction: null }, multiselect: { classPropertyName: "multiselect", publicName: "multiselect", isSignal: true, isRequired: false, transformFunction: null }, placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, showClear: { classPropertyName: "showClear", publicName: "showClear", isSignal: true, isRequired: false, transformFunction: null }, selectFirstItemInput: { classPropertyName: "selectFirstItemInput", publicName: "selectFirstItem", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null }, dropdownClassName: { classPropertyName: "dropdownClassName", publicName: "dropdownClassName", isSignal: true, isRequired: false, transformFunction: null }, changeValueOnBlur: { classPropertyName: "changeValueOnBlur", publicName: "changeValueOnBlur", isSignal: true, isRequired: false, transformFunction: null }, loadingInput: { classPropertyName: "loadingInput", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, allowInput: { classPropertyName: "allowInput", publicName: "allowInput", isSignal: true, isRequired: false, transformFunction: null }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, inlineSearch: { classPropertyName: "inlineSearch", publicName: "inlineSearch", isSignal: true, isRequired: false, transformFunction: null }, searchTrim: { classPropertyName: "searchTrim", publicName: "searchTrim", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { valueChange: "valueChange", blur: "blur" }, providers: [DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeSelect", first: true, predicate: Select, descendants: true, isSignal: true }, { propertyName: "primeMultiselect", first: true, predicate: MultiSelect, descendants: true, isSignal: true }], ngImport: i0, template: "<p-inputgroup>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n @if (!multiselect()) {\n <p-select\n [(ngModel)]=\"ngModelValue\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [showClear]=\"showClear()\"\n [editable]=\"allowInput()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [disabled]=\"disabled()\"\n [filter]=\"inlineSearch() && !allowInput()\"\n [filterBy]=\"optionsLabelProperty()\"\n (onBlur)=\"onDropdownBlur($event)\"\n (onChange)=\"onDropdownChange($event)\"\n (onShow)=\"onDropdownPanelShow()\"\n (onHide)=\"onDropdownPanelHide()\"\n (onFocus)=\"onFocus()\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n [appendTo]=\"appendTo()\">\n </p-select>\n } @else {\n <p-multiSelect\n [ngModel]=\"ngModelValue()\"\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [filter]=\"true\"\n [showToggleAll]=\"false\"\n [disabled]=\"disabled()\"\n (onChange)=\"onMultiselectChange($event)\"\n (onPanelHide)=\"onMultiselectPanelHide()\"\n (onBlur)=\"onMultiselectBlur($event)\"\n (onFocus)=\"onFocus()\"\n appendTo=\"body\">\n </p-multiSelect>\n }\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</p-inputgroup>\n", dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: Select, selector: "p-select", inputs: ["id", "scrollHeight", "filter", "panelStyle", "styleClass", "panelStyleClass", "readonly", "editable", "tabindex", "placeholder", "loadingIcon", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "filterValue", "options", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "component", type: MultiSelect, selector: "p-multiSelect, p-multiselect, p-multi-select", inputs: ["id", "ariaLabel", "styleClass", "panelStyle", "panelStyleClass", "inputId", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "dataKey", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "chipIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "loading", "virtualScrollItemSize", "loadingIcon", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autofocus", "placeholder", "options", "filterValue", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus", "highlightOnSelect", "size", "variant", "fluid", "appendTo", "motionOptions"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1270
1442
|
}
|
|
1271
1443
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
1272
1444
|
type: Component,
|
|
@@ -1383,7 +1555,7 @@ class NumberRangeComponent {
|
|
|
1383
1555
|
this.onChangeFn([fromDate, toDate]);
|
|
1384
1556
|
}
|
|
1385
1557
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: NumberRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1386
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: NumberRangeComponent, isStandalone: true, selector: "mng-number-range", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, useGrouping: { classPropertyName: "useGrouping", publicName: "useGrouping", isSignal: true, isRequired: false, transformFunction: null }, minFractionDigits: { classPropertyName: "minFractionDigits", publicName: "minFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, maxFractionDigits: { classPropertyName: "maxFractionDigits", publicName: "maxFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { keyDown: "keyDown" }, providers: [NUMBER_RANGE_VALUE_ACCESSOR, NUMBER_RANGE_VALIDATOR], ngImport: i0, template: "<div class=\"flex gap-1\" [class.flex-col]=\"vertical()\">\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <p-inputNumber\n [formControl]=\"fromCtrl\"\n [placeholder]=\"placeholder() + ' ' + ('mngTable.filterRangeFrom' | translate)\"\n [useGrouping]=\"useGrouping()\"\n [minFractionDigits]=\"minFractionDigits()\"\n [maxFractionDigits]=\"maxFractionDigits()\"\n [max]=\"toCtrl.value\"\n [inputStyleClass]=\"className()\"\n (onKeyDown)=\"onKeyDown($event)\"\n (onBlur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <p-inputNumber\n [formControl]=\"toCtrl\"\n [placeholder]=\"placeholder() + ' ' + ('mngTable.filterRangeTo' | translate)\"\n [useGrouping]=\"useGrouping()\"\n [minFractionDigits]=\"minFractionDigits()\"\n [maxFractionDigits]=\"maxFractionDigits()\"\n [min]=\"fromCtrl.value\"\n [inputStyleClass]=\"className()\"\n (onKeyDown)=\"onKeyDown($event)\"\n (onBlur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n</div>\n\n<ng-template #prependAddons>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n<ng-template #appendAddons>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n", styles: ["mng-number-range.ng-dirty.ng-invalid>div>p-inputnumber .p-inputtext{border-color:var(--p-inputtext-invalid-border-color, #f87171)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1558
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.8", type: NumberRangeComponent, isStandalone: true, selector: "mng-number-range", inputs: { placeholder: { classPropertyName: "placeholder", publicName: "placeholder", isSignal: true, isRequired: false, transformFunction: null }, useGrouping: { classPropertyName: "useGrouping", publicName: "useGrouping", isSignal: true, isRequired: false, transformFunction: null }, minFractionDigits: { classPropertyName: "minFractionDigits", publicName: "minFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, maxFractionDigits: { classPropertyName: "maxFractionDigits", publicName: "maxFractionDigits", isSignal: true, isRequired: false, transformFunction: null }, required: { classPropertyName: "required", publicName: "required", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null }, templates: { classPropertyName: "templates", publicName: "templates", isSignal: true, isRequired: false, transformFunction: null }, className: { classPropertyName: "className", publicName: "className", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { keyDown: "keyDown" }, providers: [NUMBER_RANGE_VALUE_ACCESSOR, NUMBER_RANGE_VALIDATOR], ngImport: i0, template: "<div class=\"flex gap-1\" [class.flex-col]=\"vertical()\">\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <p-inputNumber\n [formControl]=\"fromCtrl\"\n [placeholder]=\"placeholder() + ' ' + ('mngTable.filterRangeFrom' | translate)\"\n [useGrouping]=\"useGrouping()\"\n [minFractionDigits]=\"minFractionDigits()\"\n [maxFractionDigits]=\"maxFractionDigits()\"\n [max]=\"toCtrl.value\"\n [inputStyleClass]=\"className()\"\n (onKeyDown)=\"onKeyDown($event)\"\n (onBlur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n <p-inputgroup>\n <ng-container *ngTemplateOutlet=\"prependAddons\"></ng-container>\n <p-inputNumber\n [formControl]=\"toCtrl\"\n [placeholder]=\"placeholder() + ' ' + ('mngTable.filterRangeTo' | translate)\"\n [useGrouping]=\"useGrouping()\"\n [minFractionDigits]=\"minFractionDigits()\"\n [maxFractionDigits]=\"maxFractionDigits()\"\n [min]=\"fromCtrl.value\"\n [inputStyleClass]=\"className()\"\n (onKeyDown)=\"onKeyDown($event)\"\n (onBlur)=\"onBlur()\" />\n <ng-container *ngTemplateOutlet=\"appendAddons\"></ng-container>\n </p-inputgroup>\n</div>\n\n<ng-template #prependAddons>\n @for (pt of prependTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"pt.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n<ng-template #appendAddons>\n @for (at of appendTemplates(); track $index) {\n <p-inputgroup-addon>\n <ng-container *ngTemplateOutlet=\"at.template\"></ng-container>\n </p-inputgroup-addon>\n }\n</ng-template>\n", styles: ["mng-number-range.ng-dirty.ng-invalid>div>p-inputnumber .p-inputtext{border-color:var(--p-inputtext-invalid-border-color, #f87171)}\n"], dependencies: [{ kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i1$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i1$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "component", type: InputNumber, selector: "p-inputNumber, p-inputnumber, p-input-number", inputs: ["showButtons", "format", "buttonLayout", "inputId", "styleClass", "placeholder", "tabindex", "title", "ariaLabelledBy", "ariaDescribedBy", "ariaLabel", "ariaRequired", "autocomplete", "incrementButtonClass", "decrementButtonClass", "incrementButtonIcon", "decrementButtonIcon", "readonly", "allowEmpty", "locale", "localeMatcher", "mode", "currency", "currencyDisplay", "useGrouping", "minFractionDigits", "maxFractionDigits", "prefix", "suffix", "inputStyle", "inputStyleClass", "showClear", "autofocus"], outputs: ["onInput", "onFocus", "onBlur", "onKeyDown", "onClear"] }, { kind: "component", type: InputGroup, selector: "p-inputgroup, p-inputGroup, p-input-group", inputs: ["styleClass"] }, { kind: "component", type: InputGroupAddon, selector: "p-inputgroup-addon, p-inputGroupAddon", inputs: ["style", "styleClass"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
1387
1559
|
}
|
|
1388
1560
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImport: i0, type: NumberRangeComponent, decorators: [{
|
|
1389
1561
|
type: Component,
|
|
@@ -1625,11 +1797,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.8", ngImpor
|
|
|
1625
1797
|
}]
|
|
1626
1798
|
}], propDecorators: { name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: true }] }] } });
|
|
1627
1799
|
|
|
1800
|
+
/**
|
|
1801
|
+
* Prepares providers for usage of the tableview functionalities.
|
|
1802
|
+
*
|
|
1803
|
+
* @returns {CommonsFeature} The `CommonsFeature` object with the layout configuration.
|
|
1804
|
+
*/
|
|
1805
|
+
function withForm(config) {
|
|
1806
|
+
return {
|
|
1807
|
+
type: CommonsFeatureTypeEnum.Form,
|
|
1808
|
+
providers: [
|
|
1809
|
+
{
|
|
1810
|
+
provide: COMMONS_FORM_FEATURE_CONFIG_IT,
|
|
1811
|
+
useValue: config
|
|
1812
|
+
}
|
|
1813
|
+
]
|
|
1814
|
+
};
|
|
1815
|
+
}
|
|
1816
|
+
/**
|
|
1817
|
+
* Provides a list of providers for configuring a form feature. Useful for lazy-loading form chunk in child (lazy loaded routes).
|
|
1818
|
+
*
|
|
1819
|
+
* @param {FormFeatureConfig} [config] - An optional configuration object for the form feature.
|
|
1820
|
+
*/
|
|
1821
|
+
function provideFormChild(config) {
|
|
1822
|
+
return [
|
|
1823
|
+
{
|
|
1824
|
+
provide: COMMONS_FORM_FEATURE_CONFIG_IT,
|
|
1825
|
+
useValue: config
|
|
1826
|
+
}
|
|
1827
|
+
];
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1628
1830
|
// components
|
|
1629
1831
|
|
|
1630
1832
|
/**
|
|
1631
1833
|
* Generated bundle index. Do not edit.
|
|
1632
1834
|
*/
|
|
1633
1835
|
|
|
1634
|
-
export { AUTOCOMPLETE_VALUE_ACCESSOR, AutocompleteComponent, AutocompleteTemplateDirective, DATETIME_PICKER_VALIDATOR, DATETIME_PICKER_VALUE_ACCESSOR, DATE_RANGE_VALIDATOR, DATE_RANGE_VALUE_ACCESSOR, DROPDOWN_VALUE_ACCESSOR, DateRangeComponent, DateRangeTemplateDirective, DatetimePickerComponent, DatetimePickerTemplateDirective, DropdownComponent, DropdownTemplateDirective, InputEmptyValueDirective, InputTrimDirective, NUMBER_RANGE_VALIDATOR, NUMBER_RANGE_VALUE_ACCESSOR, NumberRangeComponent, NumberRangeTemplateDirective };
|
|
1836
|
+
export { AUTOCOMPLETE_VALUE_ACCESSOR, AutocompleteComponent, AutocompleteTemplateDirective, DATETIME_PICKER_VALIDATOR, DATETIME_PICKER_VALUE_ACCESSOR, DATE_RANGE_VALIDATOR, DATE_RANGE_VALUE_ACCESSOR, DROPDOWN_VALUE_ACCESSOR, DateRangeComponent, DateRangeTemplateDirective, DatetimePickerComponent, DatetimePickerTemplateDirective, DropdownComponent, DropdownTemplateDirective, InputEmptyValueDirective, InputTrimDirective, LookupLabelResolutionService, NUMBER_RANGE_VALIDATOR, NUMBER_RANGE_VALUE_ACCESSOR, NumberRangeComponent, NumberRangeTemplateDirective, provideFormChild, withForm };
|
|
1635
1837
|
//# sourceMappingURL=mediusinc-mng-commons-form.mjs.map
|