@mediusinc/mng-commons 5.0.0-rc.1 → 5.0.0-rc.3
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/core/data-providers/base-data-provider.factory.d.ts +13 -0
- package/core/data-providers/base.data-provider.d.ts +2 -14
- package/core/descriptors/editor.descriptor.d.ts +1 -1
- package/core/descriptors/tableview.descriptor.d.ts +5 -5
- package/core/directives/component.directive.d.ts +2 -2
- package/core/index.d.ts +1 -0
- package/core/router/route-builder.d.ts +149 -26
- package/core/router/routes-builder.d.ts +28 -13
- package/core/security/permission.service.d.ts +1 -0
- package/core/services/commons-router.service.d.ts +3 -3
- package/core/services/commons.service.d.ts +31 -42
- package/core/services/tokens/module-config.token.d.ts +2 -2
- package/esm2022/core/components/notification/notification-wrapper.component.mjs +5 -5
- package/esm2022/core/components/pages/error/error.page.component.mjs +5 -5
- package/esm2022/core/components/pages/not-found/not-found.page.component.mjs +5 -5
- package/esm2022/core/data-providers/base-data-provider.factory.mjs +28 -0
- package/esm2022/core/data-providers/base.data-provider.mjs +1 -31
- package/esm2022/core/descriptors/editor.descriptor.mjs +1 -1
- package/esm2022/core/descriptors/tableview.descriptor.mjs +1 -1
- package/esm2022/core/directives/component.directive.mjs +12 -9
- package/esm2022/core/directives/dialog-keydown-handler.directive.mjs +3 -3
- package/esm2022/core/directives/template.directive.mjs +3 -3
- package/esm2022/core/index.mjs +2 -1
- package/esm2022/core/pipes/boolean.pipe.mjs +3 -3
- package/esm2022/core/pipes/class-map.pipe.mjs +3 -3
- package/esm2022/core/pipes/enum.pipe.mjs +3 -3
- package/esm2022/core/pipes/enumerate-async.pipe.mjs +3 -3
- package/esm2022/core/pipes/enumerate.pipe.mjs +3 -3
- package/esm2022/core/pipes/getter.pipe.mjs +3 -3
- package/esm2022/core/pipes/i18n-property.pipe.mjs +3 -3
- package/esm2022/core/pipes/json-path.pipe.mjs +3 -3
- package/esm2022/core/pipes/parametrize.pipe.mjs +3 -3
- package/esm2022/core/pipes/template.pipe.mjs +3 -3
- package/esm2022/core/router/route-builder.mjs +211 -84
- package/esm2022/core/router/routes-builder.mjs +41 -43
- package/esm2022/core/security/permission.service.mjs +7 -5
- package/esm2022/core/services/commons-init.service.mjs +5 -5
- package/esm2022/core/services/commons-router.service.mjs +18 -17
- package/esm2022/core/services/commons.service.mjs +112 -169
- package/esm2022/core/services/local-storage-config.service.mjs +3 -3
- package/esm2022/core/services/tokens/module-config.token.mjs +1 -1
- package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +4 -4
- package/esm2022/form/api/data-providers/lookup-data-provider.factory.mjs +31 -0
- package/esm2022/form/api/data-providers/lookup.data-provider.mjs +1 -31
- package/esm2022/form/api/index.mjs +2 -1
- package/esm2022/form/components/autocomplete/autocomplete.component.mjs +105 -102
- package/esm2022/form/components/date-range/date-range.component.mjs +3 -3
- package/esm2022/form/components/dropdown/dropdown.component.mjs +148 -90
- package/esm2022/form/directives/input-trim.directive.mjs +3 -3
- package/esm2022/model/data-providers/base-from-type-data-provider.factory.mjs +8 -0
- package/esm2022/model/descriptors/enum.descriptor.mjs +3 -6
- package/esm2022/model/descriptors/model.descriptor.mjs +22 -9
- package/esm2022/model/descriptors/type.descriptor.mjs +3 -9
- package/esm2022/model/index.mjs +3 -1
- package/esm2022/table/api/data-providers/table-data-provider.factory.mjs +33 -0
- package/esm2022/table/api/data-providers/table.data-provider.mjs +1 -31
- package/esm2022/table/api/descriptors/sort.descriptor.mjs +2 -2
- package/esm2022/table/api/descriptors/table-descriptor.factory.mjs +89 -0
- package/esm2022/table/api/descriptors/table.descriptor.mjs +4 -139
- package/esm2022/table/api/helpers/table-descriptor-helpers.mjs +97 -0
- package/esm2022/table/api/index.mjs +4 -1
- package/esm2022/table/components/column-filter-full/column-filter-full.component.mjs +8 -9
- package/esm2022/table/components/column-value/column-value.component.mjs +4 -4
- package/esm2022/table/components/table/table.component.mjs +7 -7
- package/esm2022/table/pipes/locale-default-row-class.pipe.mjs +5 -5
- package/esm2022/table/pipes/table-column-filter-class.pipe.mjs +3 -3
- package/esm2022/table/services/data-list.service.mjs +4 -4
- package/esm2022/tableview/action/components/action/action.component.mjs +142 -190
- package/esm2022/tableview/action/components/editor/action-editor.component.mjs +58 -68
- package/esm2022/tableview/action/components/editor/injector-context/action-editor-injector-context.component.mjs +133 -154
- package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +22 -40
- package/esm2022/tableview/action/components/route/action-route.component.mjs +21 -26
- package/esm2022/tableview/action/components/table/action-table.component.mjs +4 -4
- package/esm2022/tableview/action/models/execution/action-instance.model.mjs +1 -1
- package/esm2022/tableview/action/services/action-executor.service.mjs +10 -10
- package/esm2022/tableview/action/services/component-action-executor.service.mjs +3 -3
- package/esm2022/tableview/action/services/data-provider-executor.service.mjs +3 -3
- package/esm2022/tableview/action/services/navigation.service.mjs +6 -5
- package/esm2022/tableview/action/services/root-action-executor.service.mjs +3 -3
- package/esm2022/tableview/action/services/view-container.service.mjs +8 -24
- package/esm2022/tableview/api/action/descriptors/action-descriptor.factory.mjs +119 -0
- package/esm2022/tableview/api/action/descriptors/action-editor-descriptor.factory.mjs +77 -0
- package/esm2022/tableview/api/action/descriptors/action-editor.descriptor.mjs +28 -80
- package/esm2022/tableview/api/action/descriptors/action-link-descriptor.factory.mjs +45 -0
- package/esm2022/tableview/api/action/descriptors/action-link.descriptor.mjs +1 -32
- package/esm2022/tableview/api/action/descriptors/action.descriptor.mjs +3 -69
- package/esm2022/tableview/api/action/models/action-component.model.mjs +1 -1
- package/esm2022/tableview/api/action/models/execution/action-instance.model.mjs +1 -1
- package/esm2022/tableview/api/action/models/execution/view-container.model.mjs +1 -1
- package/esm2022/tableview/api/editor/data-providers/editor-data-provider.factory.mjs +33 -0
- package/esm2022/tableview/api/editor/data-providers/editor.data-provider.mjs +1 -31
- package/esm2022/tableview/api/editor/descriptors/editor-descriptor.factory.mjs +81 -0
- package/esm2022/tableview/api/editor/descriptors/editor.descriptor.mjs +24 -161
- package/esm2022/tableview/api/editor/descriptors/field-action.descriptor.mjs +1 -1
- package/esm2022/tableview/api/editor/descriptors/field-base.descriptor.mjs +13 -5
- package/esm2022/tableview/api/editor/descriptors/field-group.descriptor.mjs +3 -3
- package/esm2022/tableview/api/editor/descriptors/field-lookup.descriptor.mjs +4 -4
- package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +3 -3
- package/esm2022/tableview/api/editor/descriptors/field-validation.descriptor.mjs +1 -1
- package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +36 -7
- package/esm2022/tableview/api/editor/helpers/editor-descriptor-helpers.mjs +95 -0
- package/esm2022/tableview/api/editor/helpers/field-validators.mjs +17 -27
- package/esm2022/tableview/api/editor/models/editor-fields.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/field-action-context.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/field-validation.model.mjs +2 -0
- package/esm2022/tableview/api/editor/models/field.model.mjs +1 -1
- package/esm2022/tableview/api/editor/models/form-editor.event.mjs +1 -1
- package/esm2022/tableview/api/editor/models/form-editor.interface.mjs +1 -1
- package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +3 -3
- package/esm2022/tableview/api/editor/models/formly-field.model.mjs +1 -1
- package/esm2022/tableview/api/index.mjs +11 -1
- package/esm2022/tableview/api/tableview/data-providers/tableview-data-provider.factory.mjs +47 -0
- package/esm2022/tableview/api/tableview/data-providers/tableview.data-provider.mjs +5 -46
- package/esm2022/tableview/api/tableview/descriptors/tableview-descriptor.factory.mjs +111 -0
- package/esm2022/tableview/api/tableview/descriptors/tableview.descriptor.mjs +26 -186
- package/esm2022/tableview/api/tableview/helpers/files-export.mjs +2 -2
- package/esm2022/tableview/api/tableview/helpers/tableview-create.mjs +5 -5
- package/esm2022/tableview/api/tableview/helpers/tableview-default-actions.mjs +53 -18
- package/esm2022/tableview/api/tableview/helpers/tableview-descriptor-helpers.mjs +110 -0
- package/esm2022/tableview/api/tableview/helpers/tableview-input-builder.mjs +2 -2
- package/esm2022/tableview/editor/components/editor/form-editor.component.mjs +163 -138
- package/esm2022/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.mjs +9 -5
- package/esm2022/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.mjs +13 -16
- package/esm2022/tableview/editor/components/formly/fields/formly-field-custom/formly-field-custom.component.mjs +3 -3
- package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +103 -0
- package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +12 -16
- package/esm2022/tableview/editor/components/formly/fields/formly-field-fieldset/formly-field-fieldset.component.mjs +3 -3
- package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +36 -53
- package/esm2022/tableview/editor/components/formly/fields/formly-field-label/formly-field-label.component.mjs +3 -3
- package/esm2022/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.mjs +20 -24
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.mjs +24 -28
- package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +30 -31
- package/esm2022/tableview/editor/components/formly/fields/formly-field-tabs/formly-field-tabs.component.mjs +3 -3
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-no-label-wrapper/formly-field-no-label-wrapper.component.mjs +3 -3
- package/esm2022/tableview/editor/components/formly/wrappers/formly-field-wrapper/formly-field-wrapper.component.mjs +3 -3
- package/esm2022/tableview/editor/helpers/editor-formly.mjs +85 -56
- package/esm2022/tableview/editor/helpers/formly-config.mjs +5 -3
- package/esm2022/tableview/editor/models/formly-config.model.mjs +1 -1
- package/esm2022/tableview/editor/services/form-editor.service.mjs +96 -0
- package/esm2022/tableview/index.mjs +2 -1
- package/esm2022/tableview/tableview/components/route/tableview-route.component.mjs +10 -10
- package/esm2022/tableview/tableview/components/tableview/tableview.component.mjs +26 -43
- package/esm2022/tableview/tableview/router/tableview-route-builder.mjs +17 -43
- package/fesm2022/mediusinc-mng-commons-core.mjs +460 -390
- package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-filter.mjs +3 -3
- package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form-api.mjs +18 -18
- package/fesm2022/mediusinc-mng-commons-form-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-form.mjs +257 -195
- package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-model.mjs +43 -33
- package/fesm2022/mediusinc-mng-commons-model.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table-api.mjs +192 -146
- package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-table.mjs +26 -27
- package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +906 -665
- package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
- package/fesm2022/mediusinc-mng-commons-tableview.mjs +1015 -960
- package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
- package/form/api/data-providers/lookup-data-provider.factory.d.ts +18 -0
- package/form/api/data-providers/lookup.data-provider.d.ts +2 -14
- package/form/api/index.d.ts +1 -0
- package/form/components/autocomplete/autocomplete.component.d.ts +33 -24
- package/form/components/dropdown/dropdown.component.d.ts +38 -25
- package/model/data-providers/base-from-type-data-provider.factory.d.ts +8 -0
- package/model/descriptors/enum.descriptor.d.ts +1 -2
- package/model/descriptors/model.descriptor.d.ts +11 -4
- package/model/descriptors/type.descriptor.d.ts +2 -4
- package/model/index.d.ts +1 -0
- package/package.json +1 -1
- package/table/api/data-providers/table-data-provider.factory.d.ts +18 -0
- package/table/api/data-providers/table.data-provider.d.ts +2 -14
- package/table/api/descriptors/table-descriptor.factory.d.ts +44 -0
- package/table/api/descriptors/table.descriptor.d.ts +4 -65
- package/table/api/helpers/table-descriptor-helpers.d.ts +44 -0
- package/table/api/index.d.ts +3 -0
- package/table/components/column-filter-full/column-filter-full.component.d.ts +5 -4
- package/table/components/table/table.component.d.ts +11 -11
- package/table/services/data-list.service.d.ts +9 -10
- package/tableview/action/components/action/action.component.d.ts +37 -44
- package/tableview/action/components/editor/action-editor.component.d.ts +20 -18
- package/tableview/action/components/editor/injector-context/action-editor-injector-context.component.d.ts +24 -26
- package/tableview/action/components/localization/data-language-dropdown.component.d.ts +11 -14
- package/tableview/action/components/route/action-route.component.d.ts +7 -12
- package/tableview/action/components/table/action-table.component.d.ts +3 -3
- package/tableview/action/models/execution/action-instance.model.d.ts +2 -1
- package/tableview/action/services/view-container.service.d.ts +3 -9
- package/tableview/api/action/descriptors/action-descriptor.factory.d.ts +36 -0
- package/tableview/api/action/descriptors/action-editor-descriptor.factory.d.ts +31 -0
- package/tableview/api/action/descriptors/action-editor.descriptor.d.ts +25 -37
- package/tableview/api/action/descriptors/action-link-descriptor.factory.d.ts +15 -0
- package/tableview/api/action/descriptors/action-link.descriptor.d.ts +1 -9
- package/tableview/api/action/descriptors/action.descriptor.d.ts +4 -27
- package/tableview/api/action/models/action-component.model.d.ts +8 -8
- package/tableview/api/action/models/execution/action-instance.model.d.ts +2 -1
- package/tableview/api/action/models/execution/view-container.model.d.ts +4 -3
- package/tableview/api/editor/data-providers/editor-data-provider.factory.d.ts +18 -0
- package/tableview/api/editor/data-providers/editor.data-provider.d.ts +2 -14
- package/tableview/api/editor/descriptors/editor-descriptor.factory.d.ts +44 -0
- package/tableview/api/editor/descriptors/editor.descriptor.d.ts +44 -105
- package/tableview/api/editor/descriptors/field-action.descriptor.d.ts +3 -3
- package/tableview/api/editor/descriptors/field-base.descriptor.d.ts +35 -33
- package/tableview/api/editor/descriptors/field-group.descriptor.d.ts +8 -7
- package/tableview/api/editor/descriptors/field-lookup.descriptor.d.ts +2 -2
- package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +8 -8
- package/tableview/api/editor/descriptors/field-validation.descriptor.d.ts +10 -13
- package/tableview/api/editor/descriptors/field.descriptor.d.ts +16 -1
- package/tableview/api/editor/helpers/editor-descriptor-helpers.d.ts +43 -0
- package/tableview/api/editor/helpers/field-validators.d.ts +7 -3
- package/tableview/api/editor/models/editor-fields.model.d.ts +25 -21
- package/tableview/api/editor/models/field-action-context.model.d.ts +10 -8
- package/tableview/api/editor/models/field-validation.model.d.ts +26 -0
- package/tableview/api/editor/models/field.model.d.ts +0 -10
- package/tableview/api/editor/models/form-editor.event.d.ts +26 -16
- package/tableview/api/editor/models/form-editor.interface.d.ts +38 -8
- package/tableview/api/editor/models/formly-custom-field.model.d.ts +1 -1
- package/tableview/api/editor/models/formly-field.model.d.ts +9 -7
- package/tableview/api/index.d.ts +10 -0
- package/tableview/api/tableview/data-providers/tableview-data-provider.factory.d.ts +25 -0
- package/tableview/api/tableview/data-providers/tableview.data-provider.d.ts +3 -20
- package/tableview/api/tableview/descriptors/tableview-descriptor.factory.d.ts +49 -0
- package/tableview/api/tableview/descriptors/tableview.descriptor.d.ts +41 -102
- package/tableview/api/tableview/helpers/tableview-create.d.ts +2 -2
- package/tableview/api/tableview/helpers/tableview-default-actions.d.ts +4 -2
- package/tableview/api/tableview/helpers/tableview-descriptor-helpers.d.ts +42 -0
- package/tableview/api/tableview/helpers/tableview-input-builder.d.ts +1 -1
- package/tableview/editor/components/editor/form-editor.component.d.ts +54 -36
- package/tableview/editor/components/formly/fields/formly-field-action/formly-field-action.component.d.ts +5 -3
- package/tableview/editor/components/formly/fields/formly-field-autocomplete/formly-field-autocomplete.component.d.ts +1 -0
- package/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.d.ts +22 -0
- package/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.d.ts +1 -1
- package/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.d.ts +5 -7
- package/tableview/editor/components/formly/fields/formly-field-lookup-dialog/formly-field-lookup-dialog.component.d.ts +1 -1
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-form/formly-field-table-dialog-form.component.d.ts +3 -4
- package/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +3 -5
- package/tableview/editor/helpers/editor-formly.d.ts +11 -10
- package/tableview/editor/models/formly-config.model.d.ts +1 -1
- package/tableview/editor/services/form-editor.service.d.ts +39 -0
- package/tableview/index.d.ts +1 -0
- package/tableview/tableview/components/route/tableview-route.component.d.ts +2 -2
- package/tableview/tableview/components/tableview/tableview.component.d.ts +11 -10
- package/tableview/tableview/router/tableview-route-builder.d.ts +7 -13
- package/version-info.json +11 -0
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { AsyncPipe } from '@angular/common';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { forwardRef, inject, Injector, DestroyRef, input,
|
|
3
|
+
import { forwardRef, inject, Injector, DestroyRef, input, booleanAttribute, output, viewChild, signal, computed, effect, Component, ChangeDetectionStrategy, Directive, Optional, Input, HostListener } from '@angular/core';
|
|
4
4
|
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
5
|
-
import * as
|
|
6
|
-
import { NG_VALUE_ACCESSOR,
|
|
7
|
-
import * as
|
|
5
|
+
import * as i3 from '@angular/forms';
|
|
6
|
+
import { NG_VALUE_ACCESSOR, FormsModule, FormBuilder, ReactiveFormsModule } from '@angular/forms';
|
|
7
|
+
import * as i2 from '@ngx-translate/core';
|
|
8
8
|
import { TranslateService, TranslateModule } from '@ngx-translate/core';
|
|
9
9
|
import * as i1 from 'primeng/autocomplete';
|
|
10
10
|
import { AutoComplete, AutoCompleteModule } from 'primeng/autocomplete';
|
|
11
11
|
import { ReplaySubject, take, switchMap, of, merge } from 'rxjs';
|
|
12
|
-
import {
|
|
12
|
+
import { map } from 'rxjs/operators';
|
|
13
13
|
import { LoggerService, CommonsInternalError, FilterMatchMode, fromSubscribeError, getErrorLogLevel, toObservable } from '@mediusinc/mng-commons/core';
|
|
14
14
|
import * as i1$1 from 'primeng/calendar';
|
|
15
15
|
import { CalendarModule } from 'primeng/calendar';
|
|
16
16
|
import * as i1$2 from 'primeng/dropdown';
|
|
17
17
|
import { Dropdown, DropdownModule } from 'primeng/dropdown';
|
|
18
18
|
import * as i2$1 from 'primeng/multiselect';
|
|
19
|
-
import { MultiSelectModule } from 'primeng/multiselect';
|
|
19
|
+
import { MultiSelect, MultiSelectModule } from 'primeng/multiselect';
|
|
20
20
|
|
|
21
21
|
const AUTOCOMPLETE_VALUE_ACCESSOR = {
|
|
22
22
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -24,28 +24,32 @@ const AUTOCOMPLETE_VALUE_ACCESSOR = {
|
|
|
24
24
|
multi: true
|
|
25
25
|
};
|
|
26
26
|
class AutocompleteComponent {
|
|
27
|
+
get value() {
|
|
28
|
+
return this._value;
|
|
29
|
+
}
|
|
27
30
|
constructor() {
|
|
28
31
|
this.injector = inject(Injector);
|
|
32
|
+
this.destroyRef = inject(DestroyRef);
|
|
29
33
|
this.translate = inject(TranslateService);
|
|
30
34
|
this.logger = inject(LoggerService).create('AutocompleteComponent');
|
|
31
|
-
// private readonly formlyWrapper = inject(FormlyFieldWrapperComponent, {optional: true}); // TODO: find workarround
|
|
32
|
-
this.destroyRef = inject(DestroyRef);
|
|
33
35
|
this.dataProvider = input.required();
|
|
34
36
|
this.optionsTrackProperty = input();
|
|
35
37
|
this.optionsValuePropertyInit = input(undefined, { alias: 'optionsValueProperty' });
|
|
36
38
|
this.optionsLabelPropertyInit = input(undefined, { alias: 'optionsLabelProperty' });
|
|
37
|
-
this.optionsLabelTranslate = input(false);
|
|
38
|
-
this.inlineSearch = input(false);
|
|
39
|
-
this.openOnFocus = input(false);
|
|
40
|
-
this.multiselect = input(false);
|
|
39
|
+
this.optionsLabelTranslate = input(false, { transform: booleanAttribute });
|
|
40
|
+
this.inlineSearch = input(false, { transform: booleanAttribute });
|
|
41
|
+
this.openOnFocus = input(false, { transform: booleanAttribute });
|
|
42
|
+
this.multiselect = input(false, { transform: booleanAttribute });
|
|
41
43
|
this.placeholder = input();
|
|
42
44
|
this.className = input();
|
|
43
45
|
this.dropdownClassName = input();
|
|
44
|
-
this.showClear = input(false);
|
|
45
|
-
this.autoClear = input(false);
|
|
46
|
-
this.selectFirst = input(false); //on every input field change return first given value (or null)
|
|
46
|
+
this.showClear = input(false, { transform: booleanAttribute });
|
|
47
|
+
this.autoClear = input(false, { transform: booleanAttribute });
|
|
48
|
+
this.selectFirst = input(false, { transform: booleanAttribute }); //on every input field change return first given value (or null)
|
|
47
49
|
this.searchTrim = input(undefined);
|
|
48
|
-
this.
|
|
50
|
+
this.disabledInput = input(false, { transform: booleanAttribute, alias: 'disabled' });
|
|
51
|
+
this.valueChange = output();
|
|
52
|
+
this.blur = output();
|
|
49
53
|
this.primeAutocomplete = viewChild(AutoComplete);
|
|
50
54
|
this.isInited = false;
|
|
51
55
|
this.searchSubscription = null;
|
|
@@ -54,7 +58,9 @@ class AutocompleteComponent {
|
|
|
54
58
|
this.onChangeFn = () => { };
|
|
55
59
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
56
60
|
this.onTouchedFn = () => { };
|
|
57
|
-
this.
|
|
61
|
+
this.ngModelValue = signal(undefined);
|
|
62
|
+
this._disabled = signal(false);
|
|
63
|
+
this.disabled = computed(() => this._disabled() || this.disabledInput());
|
|
58
64
|
this.suggestions = signal([]);
|
|
59
65
|
this.isPanelShown = false;
|
|
60
66
|
this.isFocused = false;
|
|
@@ -89,19 +95,16 @@ class AutocompleteComponent {
|
|
|
89
95
|
}
|
|
90
96
|
return this.optionsValuePropertyInit();
|
|
91
97
|
});
|
|
98
|
+
effect(() => {
|
|
99
|
+
this._value = this.convertValueWithOptionsValuePropSetting(this.ngModelValue());
|
|
100
|
+
});
|
|
92
101
|
}
|
|
93
102
|
ngOnInit() {
|
|
94
|
-
this.autocompleteFormControl.valueChanges.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(v => {
|
|
95
|
-
this.propagateValueChange(v);
|
|
96
|
-
});
|
|
97
103
|
this.setItemsAndDataProvider();
|
|
98
|
-
if (this.selectFirst() && !this.
|
|
104
|
+
if (this.selectFirst() && !this._value) {
|
|
99
105
|
this.onSearch(undefined, true);
|
|
100
106
|
}
|
|
101
107
|
}
|
|
102
|
-
ngOnDestroy() {
|
|
103
|
-
this.searchSubscription?.unsubscribe();
|
|
104
|
-
}
|
|
105
108
|
onSearch(event, isInit = false) {
|
|
106
109
|
this.searchSubscription?.unsubscribe();
|
|
107
110
|
const optionsLabelProperty = this.optionsLabelProperty();
|
|
@@ -124,11 +127,13 @@ class AutocompleteComponent {
|
|
|
124
127
|
if (!this.queryResultCacheSubject) {
|
|
125
128
|
this.queryResultCacheSubject = new ReplaySubject(1);
|
|
126
129
|
}
|
|
127
|
-
this.searchSubscription = this.getLookup(params, query)
|
|
130
|
+
this.searchSubscription = this.getLookup(params, query)
|
|
131
|
+
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
132
|
+
.subscribe({
|
|
128
133
|
next: items => {
|
|
129
134
|
this.queryResultCacheSubject?.next(items);
|
|
130
135
|
this.setSuggestionsFromItems(items, query);
|
|
131
|
-
if (isInit && !this.
|
|
136
|
+
if (isInit && !this._value) {
|
|
132
137
|
this.selectFirstItem();
|
|
133
138
|
}
|
|
134
139
|
},
|
|
@@ -153,9 +158,7 @@ class AutocompleteComponent {
|
|
|
153
158
|
return;
|
|
154
159
|
const suggestions = this.suggestions();
|
|
155
160
|
if (suggestions.length > 0 && !this.userSelectedItem) {
|
|
156
|
-
|
|
157
|
-
const value = optionsValueProperty ? suggestions[0][optionsValueProperty] : suggestions[0];
|
|
158
|
-
this.setValue(value);
|
|
161
|
+
this.setValue(suggestions[0]);
|
|
159
162
|
}
|
|
160
163
|
else if (!this.userSelectedItem) {
|
|
161
164
|
// 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
|
|
@@ -172,34 +175,6 @@ class AutocompleteComponent {
|
|
|
172
175
|
this.primeAutocomplete()?.hide();
|
|
173
176
|
}
|
|
174
177
|
}
|
|
175
|
-
/**
|
|
176
|
-
* Selects and sets new value
|
|
177
|
-
*/
|
|
178
|
-
setValue(value, fromUser = false) {
|
|
179
|
-
let outputValue = value;
|
|
180
|
-
const optionsValueProperty = this.optionsValueProperty();
|
|
181
|
-
if (optionsValueProperty && value && typeof value === 'object') {
|
|
182
|
-
outputValue = value[optionsValueProperty];
|
|
183
|
-
}
|
|
184
|
-
if (fromUser) {
|
|
185
|
-
this.userSelectedItem = outputValue;
|
|
186
|
-
}
|
|
187
|
-
else {
|
|
188
|
-
this.autocompleteFormControl.setValue(outputValue);
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
trimValue(value) {
|
|
192
|
-
switch (this.searchTrim()) {
|
|
193
|
-
case 'start':
|
|
194
|
-
return value?.trimStart();
|
|
195
|
-
case 'end':
|
|
196
|
-
return value?.trimEnd();
|
|
197
|
-
case 'both':
|
|
198
|
-
return value?.trim();
|
|
199
|
-
default:
|
|
200
|
-
return value;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
178
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
204
179
|
onFocus(event) {
|
|
205
180
|
this.isFocused = true;
|
|
@@ -210,13 +185,13 @@ class AutocompleteComponent {
|
|
|
210
185
|
/**
|
|
211
186
|
* calls the selectFirst item anytime the input field goes out of focus and if the suggestions panel is not displayed.
|
|
212
187
|
*/
|
|
213
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
214
188
|
onBlur(event) {
|
|
215
189
|
this.isFocused = false;
|
|
216
190
|
if (!this.isPanelShown) {
|
|
217
191
|
this.selectFirstItem();
|
|
218
192
|
}
|
|
219
|
-
|
|
193
|
+
this.onTouchedFn();
|
|
194
|
+
this.blur.emit(event);
|
|
220
195
|
}
|
|
221
196
|
onShow() {
|
|
222
197
|
this.isPanelShown = true;
|
|
@@ -232,26 +207,7 @@ class AutocompleteComponent {
|
|
|
232
207
|
}
|
|
233
208
|
onClear() {
|
|
234
209
|
this.onChangeFn();
|
|
235
|
-
this.
|
|
236
|
-
}
|
|
237
|
-
propagateValueChange(value) {
|
|
238
|
-
let output = value;
|
|
239
|
-
const optionsValueProperty = this.optionsValueProperty();
|
|
240
|
-
if (this.multiselect() && Array.isArray(value)) {
|
|
241
|
-
output = output.map((item) => {
|
|
242
|
-
if (optionsValueProperty && item && typeof item === 'object') {
|
|
243
|
-
return item[optionsValueProperty];
|
|
244
|
-
}
|
|
245
|
-
return null;
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
|
-
else {
|
|
249
|
-
if (optionsValueProperty && value && typeof value === 'object') {
|
|
250
|
-
output = value[optionsValueProperty];
|
|
251
|
-
}
|
|
252
|
-
}
|
|
253
|
-
this.onChangeFn(output);
|
|
254
|
-
this.valueChangeEventEmitter.next(output);
|
|
210
|
+
this.propagateValueChange(null);
|
|
255
211
|
}
|
|
256
212
|
registerOnChange(fn) {
|
|
257
213
|
this.onChangeFn = fn;
|
|
@@ -260,15 +216,12 @@ class AutocompleteComponent {
|
|
|
260
216
|
this.onTouchedFn = fn;
|
|
261
217
|
}
|
|
262
218
|
setDisabledState(isDisabled) {
|
|
263
|
-
|
|
264
|
-
this.autocompleteFormControl.disable();
|
|
265
|
-
}
|
|
266
|
-
else {
|
|
267
|
-
this.autocompleteFormControl.enable();
|
|
268
|
-
}
|
|
219
|
+
setTimeout(() => this._disabled.set(isDisabled));
|
|
269
220
|
}
|
|
270
221
|
writeValue(value) {
|
|
271
222
|
this.setItemsAndDataProvider();
|
|
223
|
+
// write value immediately - it is important so that first select is not triggered!
|
|
224
|
+
this._value = value;
|
|
272
225
|
const optionsValuePropertyInit = this.optionsValuePropertyInit();
|
|
273
226
|
if (optionsValuePropertyInit && value != null && typeof value !== 'object') {
|
|
274
227
|
const defaultItem = { [optionsValuePropertyInit]: value };
|
|
@@ -278,7 +231,7 @@ class AutocompleteComponent {
|
|
|
278
231
|
}
|
|
279
232
|
const matchedItem = this.suggestions().find(i => i[optionsValuePropertyInit] === value);
|
|
280
233
|
if (matchedItem) {
|
|
281
|
-
this.
|
|
234
|
+
this.setValueFromWrite(matchedItem);
|
|
282
235
|
}
|
|
283
236
|
else {
|
|
284
237
|
this.getLookup({
|
|
@@ -290,34 +243,34 @@ class AutocompleteComponent {
|
|
|
290
243
|
}
|
|
291
244
|
}
|
|
292
245
|
})
|
|
293
|
-
.pipe(
|
|
246
|
+
.pipe(take(1))
|
|
294
247
|
.subscribe({
|
|
295
248
|
next: items => {
|
|
296
249
|
let isMatch = false;
|
|
297
250
|
if (items.length === 1) {
|
|
298
|
-
this.
|
|
251
|
+
this.setValueFromWrite(items[0]);
|
|
299
252
|
isMatch = true;
|
|
300
253
|
}
|
|
301
254
|
else if (items.length > 1) {
|
|
302
255
|
// for lookup data providers not using query params
|
|
303
256
|
const matchedItem = items.find(i => i[optionsValuePropertyInit] === value);
|
|
304
257
|
if (matchedItem) {
|
|
305
|
-
this.
|
|
258
|
+
this.setValueFromWrite(matchedItem);
|
|
306
259
|
isMatch = true;
|
|
307
260
|
}
|
|
308
261
|
}
|
|
309
262
|
if (!isMatch) {
|
|
310
|
-
this.
|
|
263
|
+
this.setValueFromWrite(defaultItem);
|
|
311
264
|
}
|
|
312
265
|
},
|
|
313
266
|
error: () => {
|
|
314
|
-
this.
|
|
267
|
+
this.setValueFromWrite(defaultItem);
|
|
315
268
|
}
|
|
316
269
|
});
|
|
317
270
|
}
|
|
318
271
|
}
|
|
319
272
|
else {
|
|
320
|
-
this.
|
|
273
|
+
this.setValueFromWrite(value);
|
|
321
274
|
}
|
|
322
275
|
}
|
|
323
276
|
setItemsAndDataProvider() {
|
|
@@ -331,11 +284,11 @@ class AutocompleteComponent {
|
|
|
331
284
|
}
|
|
332
285
|
this.isInited = true;
|
|
333
286
|
}
|
|
334
|
-
|
|
287
|
+
setValueFromWrite(value) {
|
|
335
288
|
if (value && this.optionsLabelTranslate()) {
|
|
336
289
|
value = this.i18nPopulateItems([value], this.translate.instant(this.i18nGetItemsKeys([value])))[0];
|
|
337
290
|
}
|
|
338
|
-
this.
|
|
291
|
+
this.ngModelValue.set(value);
|
|
339
292
|
}
|
|
340
293
|
getLookup(params, query) {
|
|
341
294
|
return toObservable(this.dataProvider().lookup(params, this.dataProviderService, query)).pipe(switchMap(items => {
|
|
@@ -398,16 +351,66 @@ class AutocompleteComponent {
|
|
|
398
351
|
this.userSelectedItem = undefined;
|
|
399
352
|
}
|
|
400
353
|
}
|
|
401
|
-
|
|
402
|
-
|
|
354
|
+
/**
|
|
355
|
+
* Selects and sets new value.
|
|
356
|
+
*
|
|
357
|
+
* @param value Represents the object value.
|
|
358
|
+
* @param fromUser If set value is triggered from user.
|
|
359
|
+
*/
|
|
360
|
+
setValue(value, fromUser = false) {
|
|
361
|
+
if (fromUser) {
|
|
362
|
+
this.userSelectedItem = value;
|
|
363
|
+
}
|
|
364
|
+
else {
|
|
365
|
+
this.ngModelValue.set(value);
|
|
366
|
+
}
|
|
367
|
+
this.propagateValueChange(value);
|
|
368
|
+
}
|
|
369
|
+
trimValue(value) {
|
|
370
|
+
switch (this.searchTrim()) {
|
|
371
|
+
case 'start':
|
|
372
|
+
return value?.trimStart();
|
|
373
|
+
case 'end':
|
|
374
|
+
return value?.trimEnd();
|
|
375
|
+
case 'both':
|
|
376
|
+
return value?.trim();
|
|
377
|
+
default:
|
|
378
|
+
return value;
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
propagateValueChange(value) {
|
|
382
|
+
const output = this.convertValueWithOptionsValuePropSetting(value);
|
|
383
|
+
this._value = output;
|
|
384
|
+
this.onChangeFn(output);
|
|
385
|
+
this.valueChange.emit(output);
|
|
386
|
+
}
|
|
387
|
+
convertValueWithOptionsValuePropSetting(value) {
|
|
388
|
+
const optionsValueProperty = this.optionsValueProperty();
|
|
389
|
+
if (!optionsValueProperty) {
|
|
390
|
+
return value;
|
|
391
|
+
}
|
|
392
|
+
if (this.multiselect() && Array.isArray(value)) {
|
|
393
|
+
return value.map((item) => {
|
|
394
|
+
if (item && typeof item === 'object') {
|
|
395
|
+
return item[optionsValueProperty];
|
|
396
|
+
}
|
|
397
|
+
return null;
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
else if (value && typeof value === 'object') {
|
|
401
|
+
return value[optionsValueProperty];
|
|
402
|
+
}
|
|
403
|
+
else {
|
|
404
|
+
return value;
|
|
405
|
+
}
|
|
406
|
+
}
|
|
407
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AutocompleteComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
408
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "17.3.4", 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 }, optionsValuePropertyInit: { classPropertyName: "optionsValuePropertyInit", publicName: "optionsValueProperty", 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 }, 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 }, searchTrim: { classPropertyName: "searchTrim", publicName: "searchTrim", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", 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-autoComplete\n (onFocus)=\"onFocus($event)\"\n [ngModel]=\"ngModelValue()\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear()\"\n [disabled]=\"disabled()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n", dependencies: [{ kind: "ngmodule", type: AutoCompleteModule }, { kind: "component", type: i1.AutoComplete, selector: "p-autoComplete", inputs: ["minLength", "delay", "style", "panelStyle", "styleClass", "panelStyleClass", "inputStyle", "inputId", "inputStyleClass", "placeholder", "readonly", "disabled", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "maxlength", "name", "required", "size", "appendTo", "autoHighlight", "forceSelection", "type", "autoZIndex", "baseZIndex", "ariaLabel", "dropdownAriaLabel", "ariaLabelledBy", "dropdownIcon", "unique", "group", "completeOnFocus", "showClear", "field", "dropdown", "showEmptyMessage", "dropdownMode", "multiple", "tabindex", "dataKey", "emptyMessage", "showTransitionOptions", "hideTransitionOptions", "autofocus", "autocomplete", "optionGroupChildren", "optionGroupLabel", "overlayOptions", "suggestions", "itemSize", "optionLabel", "id", "searchMessage", "emptySelectionMessage", "selectionMessage", "autoOptionFocus", "selectOnFocus", "searchLocale", "optionDisabled", "focusOnHover"], outputs: ["completeMethod", "onSelect", "onUnselect", "onFocus", "onBlur", "onDropdownClick", "onClear", "onKeyUp", "onShow", "onHide", "onLazyLoad"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
403
409
|
}
|
|
404
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
410
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: AutocompleteComponent, decorators: [{
|
|
405
411
|
type: Component,
|
|
406
|
-
args: [{ standalone: true, selector: 'mng-autocomplete', providers: [AUTOCOMPLETE_VALUE_ACCESSOR], imports: [AutoCompleteModule,
|
|
407
|
-
}],
|
|
408
|
-
type: Output,
|
|
409
|
-
args: ['valueChange']
|
|
410
|
-
}] } });
|
|
412
|
+
args: [{ standalone: true, selector: 'mng-autocomplete', providers: [AUTOCOMPLETE_VALUE_ACCESSOR], imports: [AutoCompleteModule, AsyncPipe, TranslateModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<p-autoComplete\n (onFocus)=\"onFocus($event)\"\n [ngModel]=\"ngModelValue()\"\n [placeholder]=\"placeholder()\"\n [dropdown]=\"true\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [suggestions]=\"suggestions()\"\n [multiple]=\"multiselect()\"\n [showEmptyMessage]=\"true\"\n [emptyMessage]=\"'mngAutocomplete.noMatches' | translate\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [minLength]=\"openOnFocus() ? 0 : 1\"\n [showClear]=\"showClear()\"\n [forceSelection]=\"autoClear()\"\n [disabled]=\"disabled()\"\n (completeMethod)=\"onSearch($event)\"\n (onSelect)=\"onSelect($event)\"\n (onBlur)=\"onBlur($event)\"\n (onClear)=\"onClear()\"\n (onShow)=\"onShow()\"\n (onHide)=\"onHide()\"\n appendTo=\"body\"\n dropdownMode=\"current\">\n</p-autoComplete>\n" }]
|
|
413
|
+
}], ctorParameters: () => [] });
|
|
411
414
|
|
|
412
415
|
const DATE_RANGE_VALUE_ACCESSOR = {
|
|
413
416
|
provide: NG_VALUE_ACCESSOR,
|
|
@@ -503,10 +506,10 @@ class DateRangeComponent {
|
|
|
503
506
|
this.onChangeFn(date);
|
|
504
507
|
}
|
|
505
508
|
}
|
|
506
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
507
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.
|
|
509
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DateRangeComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
510
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", 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 }, dateFormat: { classPropertyName: "dateFormat", publicName: "dateFormat", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, providers: [DATE_RANGE_VALUE_ACCESSOR], ngImport: i0, template: "@if (showTime()) {\n <div class=\"flex gap-2\">\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n </div>\n} @else {\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n selectionMode=\"range\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n}\n", dependencies: [{ kind: "ngmodule", type: CalendarModule }, { kind: "component", type: i1$1.Calendar, selector: "p-calendar", inputs: ["iconDisplay", "style", "styleClass", "inputStyle", "inputId", "name", "inputStyleClass", "placeholder", "ariaLabelledBy", "ariaLabel", "iconAriaLabel", "disabled", "dateFormat", "multipleSeparator", "rangeSeparator", "inline", "showOtherMonths", "selectOtherMonths", "showIcon", "icon", "appendTo", "readonlyInput", "shortYearCutoff", "monthNavigator", "yearNavigator", "hourFormat", "timeOnly", "stepHour", "stepMinute", "stepSecond", "showSeconds", "required", "showOnFocus", "showWeek", "showClear", "dataType", "selectionMode", "maxDateCount", "showButtonBar", "todayButtonStyleClass", "clearButtonStyleClass", "autoZIndex", "baseZIndex", "panelStyleClass", "panelStyle", "keepInvalid", "hideOnDateTimeSelect", "touchUI", "timeSeparator", "focusTrap", "showTransitionOptions", "hideTransitionOptions", "tabindex", "minDate", "maxDate", "disabledDates", "disabledDays", "yearRange", "showTime", "responsiveOptions", "numberOfMonths", "firstDayOfWeek", "locale", "view", "defaultDate"], outputs: ["onFocus", "onBlur", "onClose", "onSelect", "onClear", "onInput", "onTodayClick", "onClearClick", "onMonthChange", "onYearChange", "onClickOutside", "onShow"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
508
511
|
}
|
|
509
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
512
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DateRangeComponent, decorators: [{
|
|
510
513
|
type: Component,
|
|
511
514
|
args: [{ standalone: true, selector: 'mng-date-range', providers: [DATE_RANGE_VALUE_ACCESSOR], imports: [CalendarModule, ReactiveFormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (showTime()) {\n <div class=\"flex gap-2\">\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"fromCtrl\"\n [maxDate]=\"toCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"toCtrl\"\n [minDate]=\"fromCtrl.value\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n [showTime]=\"true\"\n [showSeconds]=\"showSeconds()\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n </div>\n} @else {\n <p-calendar\n appendTo=\"body\"\n [formControl]=\"dateRangeCtrl\"\n [placeholder]=\"placeholder()\"\n [dateFormat]=\"dateFormat()\"\n selectionMode=\"range\"\n [showIcon]=\"true\"\n [firstDayOfWeek]=\"1\"\n (onFocus)=\"onTouchedFn()\"></p-calendar>\n}\n" }]
|
|
512
515
|
}] });
|
|
@@ -517,46 +520,58 @@ const DROPDOWN_VALUE_ACCESSOR = {
|
|
|
517
520
|
multi: true
|
|
518
521
|
};
|
|
519
522
|
class DropdownComponent {
|
|
523
|
+
get value() {
|
|
524
|
+
return this._value;
|
|
525
|
+
}
|
|
520
526
|
constructor() {
|
|
521
527
|
this.logger = inject(LoggerService).create('DropdownComponent');
|
|
522
528
|
this.injector = inject(Injector);
|
|
523
529
|
this.destroyRef = inject(DestroyRef);
|
|
524
530
|
this.translate = inject(TranslateService);
|
|
525
|
-
// private readonly formlyWrapper = inject(FormlyFieldWrapperComponent, {optional: true}); TODO: find workarround
|
|
526
|
-
this.dropdownFormControl = new FormControl();
|
|
527
531
|
this.dataProvider = input();
|
|
528
532
|
this.options = input([]);
|
|
529
533
|
this.optionsTrackProperty = input();
|
|
530
534
|
this.optionsLabelPropertyInit = input(undefined, { alias: 'optionsLabelProperty' });
|
|
531
|
-
this.optionsLabelTranslate = input(false);
|
|
532
|
-
this.
|
|
535
|
+
this.optionsLabelTranslate = input(false, { transform: booleanAttribute });
|
|
536
|
+
this.optionsValuePropertyInput = input(undefined, { alias: 'optionsValueProperty' });
|
|
533
537
|
this.optionsDisabledProperty = input();
|
|
534
|
-
this.multiselect = input(false);
|
|
538
|
+
this.multiselect = input(false, { transform: booleanAttribute });
|
|
535
539
|
this.placeholder = input();
|
|
536
|
-
this.showClear = input(false);
|
|
537
|
-
this.
|
|
540
|
+
this.showClear = input(false, { transform: booleanAttribute });
|
|
541
|
+
this.selectFirstItemInput = input(false, { transform: booleanAttribute, alias: 'selectFirstItem' });
|
|
538
542
|
this.className = input();
|
|
539
543
|
this.dropdownClassName = input();
|
|
540
|
-
this.changeValueOnBlur = input(false);
|
|
541
|
-
this.
|
|
542
|
-
this.
|
|
544
|
+
this.changeValueOnBlur = input(false, { transform: booleanAttribute });
|
|
545
|
+
this.loadingInput = input(false, { alias: 'loading', transform: booleanAttribute });
|
|
546
|
+
this.disabledInput = input(false, { alias: 'disabled', transform: booleanAttribute });
|
|
547
|
+
this.valueChange = output();
|
|
548
|
+
this.blur = output();
|
|
543
549
|
this.primeDropdown = viewChild(Dropdown);
|
|
544
|
-
this.
|
|
550
|
+
this.primeMultiselect = viewChild(MultiSelect);
|
|
551
|
+
this.ngModelValue = signal(undefined);
|
|
552
|
+
this._loading = signal(false);
|
|
553
|
+
this._disabled = signal(false);
|
|
554
|
+
this.loading = computed(() => this.loadingInput() || this._loading());
|
|
555
|
+
this.disabled = computed(() => this.disabledInput() || this._disabled());
|
|
556
|
+
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
557
|
+
this.onChangeFn = () => { };
|
|
545
558
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
546
559
|
this.onTouchedFn = () => { };
|
|
560
|
+
this.dataProviderService = null;
|
|
547
561
|
this.items = signal([]);
|
|
548
562
|
this.firstTimeSettingItems = true;
|
|
563
|
+
this.isDropdownPanelShown = false;
|
|
549
564
|
this.optionsLabelProperty = computed(() => {
|
|
550
565
|
if (this.optionsLabelTranslate()) {
|
|
551
566
|
// setup translation properties
|
|
552
567
|
if (this.optionsLabelPropertyInit()) {
|
|
553
568
|
return `${this.optionsLabelPropertyInit()}_i18n`;
|
|
554
569
|
}
|
|
555
|
-
else if (!this.optionsLabelPropertyInit() && !this.
|
|
570
|
+
else if (!this.optionsLabelPropertyInit() && !this.optionsValuePropertyInput()) {
|
|
556
571
|
return 'title_i18n';
|
|
557
572
|
}
|
|
558
573
|
else {
|
|
559
|
-
throw new CommonsInternalError(`Invalid use with value (${this.
|
|
574
|
+
throw new CommonsInternalError(`Invalid use with value (${this.optionsValuePropertyInput()}) and label (${this.optionsLabelPropertyInit()}) property setup.`, {
|
|
560
575
|
name: 'DropdownComponentError'
|
|
561
576
|
});
|
|
562
577
|
}
|
|
@@ -566,28 +581,87 @@ class DropdownComponent {
|
|
|
566
581
|
this.optionsValueProperty = computed(() => {
|
|
567
582
|
if (this.optionsLabelTranslate()) {
|
|
568
583
|
// setup translation properties
|
|
569
|
-
if (!this.optionsLabelPropertyInit() && !this.
|
|
584
|
+
if (!this.optionsLabelPropertyInit() && !this.optionsValuePropertyInput()) {
|
|
570
585
|
return 'value';
|
|
571
586
|
}
|
|
572
587
|
else if (!this.optionsLabelPropertyInit()) {
|
|
573
|
-
throw new CommonsInternalError(`Invalid use with value (${this.
|
|
588
|
+
throw new CommonsInternalError(`Invalid use with value (${this.optionsValuePropertyInput()}) and label (${this.optionsLabelPropertyInit()}) property setup.`, {
|
|
574
589
|
name: 'DropdownComponentError'
|
|
575
590
|
});
|
|
576
591
|
}
|
|
577
592
|
}
|
|
578
|
-
return this.
|
|
593
|
+
return this.optionsValuePropertyInput();
|
|
594
|
+
});
|
|
595
|
+
effect(() => {
|
|
596
|
+
this._value = this.ngModelValue();
|
|
579
597
|
});
|
|
580
598
|
}
|
|
581
599
|
ngOnInit() {
|
|
582
|
-
this.
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
600
|
+
this.setDataProviderAndOptions();
|
|
601
|
+
}
|
|
602
|
+
registerOnChange(fn) {
|
|
603
|
+
this.onChangeFn = fn;
|
|
604
|
+
}
|
|
605
|
+
registerOnTouched(fn) {
|
|
606
|
+
this.onTouchedFn = fn;
|
|
607
|
+
}
|
|
608
|
+
setDisabledState(isDisabled) {
|
|
609
|
+
setTimeout(() => this._disabled.set(isDisabled));
|
|
610
|
+
}
|
|
611
|
+
writeValue(value) {
|
|
612
|
+
// this check is required because angular in some cases writes null value
|
|
613
|
+
// before value accessor is initialized
|
|
614
|
+
// if form control value is of primitive type (ex: enums) then write value is not called (we think)
|
|
615
|
+
if (value == null && this._value == null) {
|
|
616
|
+
return;
|
|
617
|
+
}
|
|
618
|
+
// write value immediately - it is important so that first select is not triggered!
|
|
619
|
+
this._value = value;
|
|
620
|
+
this.adjustValueOnItemsValuePropertyTypeMismatch(true);
|
|
621
|
+
}
|
|
622
|
+
onDropdownBlur(event) {
|
|
623
|
+
if (this.isDropdownPanelShown) {
|
|
624
|
+
// ignore this blur event
|
|
625
|
+
return;
|
|
626
|
+
}
|
|
627
|
+
const primeDropdown = this.primeDropdown();
|
|
628
|
+
if (this.changeValueOnBlur() && primeDropdown) {
|
|
629
|
+
this.propagateValueChange(primeDropdown.value);
|
|
630
|
+
}
|
|
631
|
+
this.onTouchedFn();
|
|
632
|
+
this.blur.emit(event);
|
|
633
|
+
}
|
|
634
|
+
onDropdownChange(event) {
|
|
635
|
+
if (!this.changeValueOnBlur()) {
|
|
636
|
+
this.propagateValueChange(event.value);
|
|
637
|
+
}
|
|
638
|
+
}
|
|
639
|
+
onDropdownPanelShow() {
|
|
640
|
+
this.isDropdownPanelShown = true;
|
|
641
|
+
}
|
|
642
|
+
onDropdownPanelHide() {
|
|
643
|
+
this.isDropdownPanelShown = false;
|
|
644
|
+
}
|
|
645
|
+
onMultiselectChange(event) {
|
|
646
|
+
if (!this.changeValueOnBlur()) {
|
|
647
|
+
this.propagateValueChange(event.value);
|
|
648
|
+
}
|
|
649
|
+
}
|
|
650
|
+
onMultiselectBlur(event) {
|
|
651
|
+
this.onTouchedFn();
|
|
652
|
+
this.blur.emit(event.originalEvent);
|
|
653
|
+
}
|
|
654
|
+
onMultiselectPanelHide() {
|
|
655
|
+
const primeMultiselect = this.primeMultiselect();
|
|
656
|
+
if (this.changeValueOnBlur() && primeMultiselect) {
|
|
657
|
+
this.propagateValueChange(primeMultiselect.value);
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
setDataProviderAndOptions() {
|
|
587
661
|
const dataProvider = this.dataProvider();
|
|
588
662
|
const options = this.options();
|
|
589
663
|
if (dataProvider) {
|
|
590
|
-
this.
|
|
664
|
+
this._loading.set(true);
|
|
591
665
|
this.dataProviderService = dataProvider.serviceType ? this.injector.get(dataProvider.serviceType) : null;
|
|
592
666
|
toObservable(dataProvider.lookup({ limit: 50 }, this.dataProviderService))
|
|
593
667
|
.pipe(switchMap(items => {
|
|
@@ -623,15 +697,12 @@ class DropdownComponent {
|
|
|
623
697
|
.subscribe({
|
|
624
698
|
next: res => {
|
|
625
699
|
this.items.set(res);
|
|
626
|
-
this.
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
const value = optionsValueProperty ? res[0][optionsValueProperty] : res[0];
|
|
630
|
-
this.dropdownFormControl?.setValue(value);
|
|
631
|
-
this.firstTimeSettingItems = false;
|
|
632
|
-
}
|
|
700
|
+
this._loading.set(false);
|
|
701
|
+
this.selectFirstItem();
|
|
702
|
+
this.adjustValueOnItemsValuePropertyTypeMismatch();
|
|
633
703
|
},
|
|
634
704
|
error: err => {
|
|
705
|
+
this._loading.set(false);
|
|
635
706
|
const error = fromSubscribeError(err, 'DropdownComponentError');
|
|
636
707
|
this.logger.log(error, getErrorLogLevel(error));
|
|
637
708
|
}
|
|
@@ -640,74 +711,65 @@ class DropdownComponent {
|
|
|
640
711
|
else {
|
|
641
712
|
toObservable(options ?? [])
|
|
642
713
|
.pipe(takeUntilDestroyed(this.destroyRef))
|
|
643
|
-
.subscribe(
|
|
644
|
-
|
|
645
|
-
|
|
714
|
+
.subscribe({
|
|
715
|
+
next: qr => {
|
|
716
|
+
this.items.set(qr);
|
|
717
|
+
this._loading.set(false);
|
|
718
|
+
this.selectFirstItem();
|
|
719
|
+
this.adjustValueOnItemsValuePropertyTypeMismatch();
|
|
720
|
+
},
|
|
721
|
+
error: err => {
|
|
722
|
+
this.items.set([]);
|
|
723
|
+
this._loading.set(false);
|
|
724
|
+
const error = fromSubscribeError(err, 'DropdownComponentError');
|
|
725
|
+
this.logger.log(error, getErrorLogLevel(error));
|
|
726
|
+
}
|
|
646
727
|
});
|
|
647
728
|
}
|
|
648
729
|
}
|
|
649
|
-
|
|
650
|
-
this.
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
if (this.changeValueOnBlur()) {
|
|
675
|
-
this.propagateValueChange(this.dropdownFormControl.value);
|
|
730
|
+
selectFirstItem() {
|
|
731
|
+
if (this.firstTimeSettingItems && this.items().length > 0 && this.selectFirstItemInput() && !this._value) {
|
|
732
|
+
const optionsValueProperty = this.optionsValueProperty();
|
|
733
|
+
const value = optionsValueProperty ? this.items()[0][optionsValueProperty] : this.items()[0];
|
|
734
|
+
this.ngModelValue.set(value); // set to write for input
|
|
735
|
+
this.firstTimeSettingItems = false;
|
|
736
|
+
this.propagateValueChange(value);
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
adjustValueOnItemsValuePropertyTypeMismatch(setNgModelValue = false) {
|
|
740
|
+
const optionsValueProp = this.optionsValueProperty();
|
|
741
|
+
if (optionsValueProp &&
|
|
742
|
+
this._value &&
|
|
743
|
+
this.items().length > 0 &&
|
|
744
|
+
this.items()[0][optionsValueProp] != null &&
|
|
745
|
+
typeof this.items()[0][optionsValueProp] !== typeof this._value) {
|
|
746
|
+
// types dont match, search and compare by string
|
|
747
|
+
const selectedOption = this.items().find(i => i[optionsValueProp] != null && i[optionsValueProp].toString() === this._value.toString());
|
|
748
|
+
if (selectedOption) {
|
|
749
|
+
this.ngModelValue.set(selectedOption[optionsValueProp]);
|
|
750
|
+
}
|
|
751
|
+
else if (setNgModelValue) {
|
|
752
|
+
// force write to ngModelValue anyway
|
|
753
|
+
this.ngModelValue.set(this._value);
|
|
754
|
+
}
|
|
676
755
|
}
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
if (this.changeValueOnBlur()) {
|
|
681
|
-
this.propagateValueChange(this.dropdownFormControl.value);
|
|
756
|
+
else if (setNgModelValue) {
|
|
757
|
+
// force write to ngModelValue anyway
|
|
758
|
+
this.ngModelValue.set(this._value);
|
|
682
759
|
}
|
|
683
760
|
}
|
|
684
761
|
propagateValueChange(value) {
|
|
685
|
-
|
|
686
|
-
return;
|
|
687
|
-
}
|
|
688
|
-
// this.formlyWrapper?.formControl?.markAsTouched(); TODO
|
|
762
|
+
this._value = value;
|
|
689
763
|
this.onChangeFn(value);
|
|
690
|
-
this.
|
|
764
|
+
this.valueChange.emit(value);
|
|
691
765
|
}
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
* In dropdown (from ang. 15 and switch to standalone cmp) null value was always committed to dropdown even if default value was set (using ngModel or formControl) which is incorrect.
|
|
695
|
-
* Github issue: https://github.com/angular/angular/issues/14988
|
|
696
|
-
* @private
|
|
697
|
-
*/
|
|
698
|
-
isValueAccessorInitialized() {
|
|
699
|
-
return typeof this.onChangeFn !== 'undefined';
|
|
700
|
-
}
|
|
701
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.2", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
702
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.2", 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 }, optionsValuePropertyInit: { classPropertyName: "optionsValuePropertyInit", 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 }, selectFirstItem: { classPropertyName: "selectFirstItem", 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 } }, outputs: { valueChangeEventEmitter: "valueChange" }, providers: [DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true, isSignal: true }], ngImport: i0, template: "@if (!multiselect()) {\n <p-dropdown\n [formControl]=\"dropdownFormControl\"\n [placeholder]=\"placeholder()\"\n [dataKey]=\"optionsTrackProperty()\"\n [optionLabel]=\"optionsLabelProperty()\"\n [optionValue]=\"optionsValueProperty()\"\n [optionDisabled]=\"optionsDisabledProperty()\"\n [options]=\"items()\"\n [showClear]=\"showClear()\"\n [autoDisplayFirst]=\"false\"\n [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n (onBlur)=\"onDropdownBlur($event)\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n appendTo=\"body\">\n </p-dropdown>\n} @else {\n <p-multiSelect\n [maxSelectedLabels]=\"1\"\n [selectedItemsLabel]=\"'mngDropdown.multiselectOverMaxDisplayLimit' | translate\"\n [formControl]=\"dropdownFormControl\"\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 (onPanelHide)=\"onPanelHide($event)\"\n appendTo=\"body\">\n </p-multiSelect>\n}\n", dependencies: [{ kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i2$1.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i3.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
766
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
767
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "17.3.4", 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 } }, outputs: { valueChange: "valueChange", blur: "blur" }, providers: [DROPDOWN_VALUE_ACCESSOR], viewQueries: [{ propertyName: "primeDropdown", first: true, predicate: Dropdown, descendants: true, isSignal: true }, { propertyName: "primeMultiselect", first: true, predicate: MultiSelect, descendants: true, isSignal: true }], ngImport: i0, template: "@if (!multiselect()) {\n <p-dropdown\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 [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [disabled]=\"disabled()\"\n (onBlur)=\"onDropdownBlur($event)\"\n (onChange)=\"onDropdownChange($event)\"\n (onShow)=\"onDropdownPanelShow()\"\n (onHide)=\"onDropdownPanelHide()\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n appendTo=\"body\">\n </p-dropdown>\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 appendTo=\"body\">\n </p-multiSelect>\n}\n", dependencies: [{ kind: "ngmodule", type: DropdownModule }, { kind: "component", type: i1$2.Dropdown, selector: "p-dropdown", inputs: ["id", "scrollHeight", "filter", "name", "style", "panelStyle", "styleClass", "panelStyleClass", "readonly", "required", "editable", "appendTo", "tabindex", "placeholder", "filterPlaceholder", "filterLocale", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "autoDisplayFirst", "group", "showClear", "emptyFilterMessage", "emptyMessage", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "ariaLabel", "ariaLabelledBy", "filterMatchMode", "maxlength", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "focusOnHover", "selectOnFocus", "autoOptionFocus", "autofocusFilter", "disabled", "itemSize", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "filterValue", "options"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onShow", "onHide", "onClear", "onLazyLoad"] }, { kind: "ngmodule", type: MultiSelectModule }, { kind: "component", type: i2$1.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "optionLabel", "optionValue", "optionDisabled", "optionGroupLabel", "optionGroupChildren", "showHeader", "filterBy", "scrollHeight", "lazy", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "overlayOptions", "ariaFilterLabel", "filterMatchMode", "tooltip", "tooltipPosition", "tooltipPositionStyle", "tooltipStyleClass", "autofocusFilter", "display", "autocomplete", "showClear", "autoZIndex", "baseZIndex", "showTransitionOptions", "hideTransitionOptions", "defaultLabel", "placeholder", "options", "filterValue", "itemSize", "selectAll", "focusOnHover", "filterFields", "selectOnFocus", "autoOptionFocus"], outputs: ["onChange", "onFilter", "onFocus", "onBlur", "onClick", "onClear", "onPanelShow", "onPanelHide", "onLazyLoad", "onRemove", "onSelectAllChange"] }, { kind: "ngmodule", type: TranslateModule }, { kind: "pipe", type: i2.TranslatePipe, name: "translate" }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
703
768
|
}
|
|
704
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
769
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
705
770
|
type: Component,
|
|
706
|
-
args: [{ standalone: true, selector: 'mng-dropdown', providers: [DROPDOWN_VALUE_ACCESSOR], imports: [DropdownModule, MultiSelectModule, TranslateModule,
|
|
707
|
-
}],
|
|
708
|
-
type: Output,
|
|
709
|
-
args: ['valueChange']
|
|
710
|
-
}] } });
|
|
771
|
+
args: [{ standalone: true, selector: 'mng-dropdown', providers: [DROPDOWN_VALUE_ACCESSOR], imports: [DropdownModule, MultiSelectModule, TranslateModule, FormsModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "@if (!multiselect()) {\n <p-dropdown\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 [styleClass]=\"className()\"\n [panelStyleClass]=\"dropdownClassName()\"\n [disabled]=\"disabled()\"\n (onBlur)=\"onDropdownBlur($event)\"\n (onChange)=\"onDropdownChange($event)\"\n (onShow)=\"onDropdownPanelShow()\"\n (onHide)=\"onDropdownPanelHide()\"\n [dropdownIcon]=\"loading() ? 'pi pi-spinner pi-spin' : 'pi pi-chevron-down'\"\n appendTo=\"body\">\n </p-dropdown>\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 appendTo=\"body\">\n </p-multiSelect>\n}\n" }]
|
|
772
|
+
}], ctorParameters: () => [] });
|
|
711
773
|
|
|
712
774
|
class InputTrimDirective {
|
|
713
775
|
constructor(el, ngControl) {
|
|
@@ -742,16 +804,16 @@ class InputTrimDirective {
|
|
|
742
804
|
return value;
|
|
743
805
|
}
|
|
744
806
|
}
|
|
745
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.
|
|
746
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.
|
|
807
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: InputTrimDirective, deps: [{ token: i0.ElementRef }, { token: i3.NgControl, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
808
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "17.3.4", type: InputTrimDirective, isStandalone: true, selector: "[mngInputTrim]", inputs: { mngInputTrim: "mngInputTrim" }, host: { listeners: { "blur": "onBlur()" } }, ngImport: i0 }); }
|
|
747
809
|
}
|
|
748
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.
|
|
810
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.4", ngImport: i0, type: InputTrimDirective, decorators: [{
|
|
749
811
|
type: Directive,
|
|
750
812
|
args: [{
|
|
751
813
|
standalone: true,
|
|
752
814
|
selector: '[mngInputTrim]'
|
|
753
815
|
}]
|
|
754
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }, { type:
|
|
816
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i3.NgControl, decorators: [{
|
|
755
817
|
type: Optional
|
|
756
818
|
}] }], propDecorators: { mngInputTrim: [{
|
|
757
819
|
type: Input
|