@mediusinc/mng-commons 5.4.0-rc.3 → 5.4.0-rc.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/core/data-list/data-list-params-helpers.d.ts +1 -1
  2. package/core/data-list/data-list.model.d.ts +1 -0
  3. package/core/helpers/type-helpers.d.ts +12 -0
  4. package/esm2022/core/data-list/data-list-params-helpers.mjs +29 -5
  5. package/esm2022/core/data-list/data-list.model.mjs +1 -1
  6. package/esm2022/core/helpers/type-helpers.mjs +1 -1
  7. package/esm2022/filter/descriptors/filter-generic.descriptor.mjs +21 -0
  8. package/esm2022/filter/descriptors/filter-lookup.descriptor.mjs +1 -1
  9. package/esm2022/filter/descriptors/filter.descriptor.mjs +40 -1
  10. package/esm2022/filter/index.mjs +3 -1
  11. package/esm2022/filter/models/filter-generic-property.model.mjs +2 -0
  12. package/esm2022/form/components/dropdown/dropdown.component.mjs +159 -10
  13. package/esm2022/table/api/descriptors/table.descriptor.mjs +51 -2
  14. package/esm2022/table/components/column-filter/column-filter.component.mjs +2 -2
  15. package/esm2022/table/components/filter/filter-active-tag/filter-active-tag.component.mjs +4 -1
  16. package/esm2022/table/components/filter/filter-form/filter-form.component.mjs +42 -9
  17. package/esm2022/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.mjs +95 -11
  18. package/esm2022/table/components/table/table.component.mjs +57 -13
  19. package/esm2022/table/helpers/filters.mjs +32 -2
  20. package/esm2022/table/services/table-feature-config.token.mjs +1 -1
  21. package/esm2022/tableview/action/components/localization/data-language-dropdown.component.mjs +2 -2
  22. package/esm2022/tableview/api/editor/descriptors/field-many.descriptor.mjs +11 -10
  23. package/esm2022/tableview/api/editor/descriptors/field.descriptor.mjs +16 -2
  24. package/esm2022/tableview/api/editor/models/formly-custom-field.model.mjs +2 -1
  25. package/esm2022/tableview/editor/components/formly/fields/formly-field-datepicker/formly-field-datepicker.component.mjs +23 -3
  26. package/esm2022/tableview/editor/components/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +2 -2
  27. package/esm2022/tableview/editor/components/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
  28. package/esm2022/tableview/editor/components/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +3 -4
  29. package/esm2022/tableview/editor/components/formly/fields/formly-field-type.abstract.component.mjs +2 -1
  30. package/fesm2022/mediusinc-mng-commons-core.mjs +28 -4
  31. package/fesm2022/mediusinc-mng-commons-core.mjs.map +1 -1
  32. package/fesm2022/mediusinc-mng-commons-filter.mjs +61 -1
  33. package/fesm2022/mediusinc-mng-commons-filter.mjs.map +1 -1
  34. package/fesm2022/mediusinc-mng-commons-form.mjs +156 -7
  35. package/fesm2022/mediusinc-mng-commons-form.mjs.map +1 -1
  36. package/fesm2022/mediusinc-mng-commons-table-api.mjs +50 -1
  37. package/fesm2022/mediusinc-mng-commons-table-api.mjs.map +1 -1
  38. package/fesm2022/mediusinc-mng-commons-table.mjs +230 -45
  39. package/fesm2022/mediusinc-mng-commons-table.mjs.map +1 -1
  40. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs +26 -10
  41. package/fesm2022/mediusinc-mng-commons-tableview-api.mjs.map +1 -1
  42. package/fesm2022/mediusinc-mng-commons-tableview.mjs +29 -8
  43. package/fesm2022/mediusinc-mng-commons-tableview.mjs.map +1 -1
  44. package/filter/descriptors/filter-generic.descriptor.d.ts +11 -0
  45. package/filter/descriptors/filter.descriptor.d.ts +21 -2
  46. package/filter/index.d.ts +2 -0
  47. package/filter/models/filter-generic-property.model.d.ts +7 -0
  48. package/form/components/dropdown/dropdown.component.d.ts +27 -1
  49. package/i18n/en.json +4 -0
  50. package/i18n/sl.json +4 -0
  51. package/package.json +1 -1
  52. package/table/api/descriptors/table.descriptor.d.ts +33 -1
  53. package/table/components/filter/filter-form/filter-form.component.d.ts +11 -2
  54. package/table/components/filter/filter-overlay-with-tag/filter-overlay-with-tag.component.d.ts +21 -1
  55. package/table/components/table/table.component.d.ts +20 -5
  56. package/table/helpers/filters.d.ts +9 -1
  57. package/table/services/table-feature-config.token.d.ts +1 -0
  58. package/tableview/api/editor/descriptors/field-many.descriptor.d.ts +6 -4
  59. package/tableview/api/editor/descriptors/field.descriptor.d.ts +10 -1
  60. package/version-info.json +5 -5
@@ -33,6 +33,8 @@ class FilterDescriptor {
33
33
  this._columnClassName = '';
34
34
  this._columnWidth = null;
35
35
  this._columnMinWidth = null;
36
+ this._isGenericFilter = false;
37
+ this._dropdownClassName = '';
36
38
  this._property = property;
37
39
  this._showOnColumn = property;
38
40
  }
@@ -117,6 +119,15 @@ class FilterDescriptor {
117
119
  get title() {
118
120
  return this._title;
119
121
  }
122
+ get isGenericFilter() {
123
+ return this._isGenericFilter;
124
+ }
125
+ get genericValueProvider() {
126
+ return this._valueSuggestionProvider;
127
+ }
128
+ get dropdownClassName() {
129
+ return this._dropdownClassName;
130
+ }
120
131
  /**
121
132
  * Converts filter to given type.
122
133
  *
@@ -126,6 +137,15 @@ class FilterDescriptor {
126
137
  this._filterType = filterType;
127
138
  return this;
128
139
  }
140
+ /**
141
+ * Sets the filter as a generic filter. For internal use only.
142
+ *
143
+ * @internal
144
+ */
145
+ asGenericFilter() {
146
+ this._isGenericFilter = true;
147
+ return this;
148
+ }
129
149
  /**
130
150
  * Set filter as date type.
131
151
  *
@@ -245,6 +265,18 @@ class FilterDescriptor {
245
265
  this._numberUseGrouping = useGrouping;
246
266
  return this;
247
267
  }
268
+ /**
269
+ * Sets a data provider for autocomplete text suggestions.
270
+ *
271
+ * @param valueDataProvider Data provider for autocomplete.
272
+ */
273
+ withGenericValueProvider(valueDataProvider) {
274
+ if (!(this.filterType === FilterTypeEnum.String || this.filterType === FilterTypeEnum.LookupEnum)) {
275
+ throw new CommonsInternalError('Generic value lookup can only be set for the string or lookup enum filter types.');
276
+ }
277
+ this._valueSuggestionProvider = valueDataProvider;
278
+ return this;
279
+ }
248
280
  /**
249
281
  * @deprecated Use ${withDatePickerDisplay} instead.
250
282
  */
@@ -342,6 +374,10 @@ class FilterDescriptor {
342
374
  this._title = title;
343
375
  return this;
344
376
  }
377
+ withDropdownClassName(dropdownClassName) {
378
+ this._dropdownClassName = dropdownClassName;
379
+ return this;
380
+ }
345
381
  /**
346
382
  * Copies current descriptor to a new instance.
347
383
  */
@@ -370,6 +406,9 @@ class FilterDescriptor {
370
406
  descriptor._columnWidth = this._columnWidth;
371
407
  descriptor._columnMinWidth = this._columnMinWidth;
372
408
  descriptor._columnClassName = this._columnClassName;
409
+ descriptor._isGenericFilter = this._isGenericFilter;
410
+ descriptor._valueSuggestionProvider = this._valueSuggestionProvider;
411
+ descriptor._dropdownClassName = this._dropdownClassName;
373
412
  }
374
413
  }
375
414
 
@@ -609,11 +648,32 @@ class FilterLookupEnumDescriptor extends FilterLookupDescriptor {
609
648
  }
610
649
  }
611
650
 
651
+ class FilterGenericDescriptor {
652
+ constructor(propertyLookupDataProvider) {
653
+ this._propertyLookup = propertyLookupDataProvider;
654
+ }
655
+ get propertyLookup() {
656
+ return this._propertyLookup;
657
+ }
658
+ get valueLookup() {
659
+ return this._valueLookup;
660
+ }
661
+ withValueLookup(valueLookup) {
662
+ this._valueLookup = valueLookup;
663
+ return this;
664
+ }
665
+ copy() {
666
+ const descriptor = new FilterGenericDescriptor(this._propertyLookup);
667
+ descriptor._valueLookup = this._valueLookup;
668
+ return descriptor;
669
+ }
670
+ }
671
+
612
672
  // descriptors
613
673
 
614
674
  /**
615
675
  * Generated bundle index. Do not edit.
616
676
  */
617
677
 
618
- export { FilterDescriptor, FilterDisplayTypeEnum, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterTypeEnum };
678
+ export { FilterDescriptor, FilterDisplayTypeEnum, FilterGenericDescriptor, FilterLookupDescriptor, FilterLookupEnumDescriptor, FilterLookupTypeEnum, FilterTypeEnum };
619
679
  //# sourceMappingURL=mediusinc-mng-commons-filter.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"mediusinc-mng-commons-filter.mjs","sources":["../../filter/src/models/filter.model.ts","../../filter/src/descriptors/filter.descriptor.ts","../../filter/src/descriptors/filter-lookup.descriptor.ts","../../filter/src/index.ts","../../filter/src/mediusinc-mng-commons-filter.ts"],"sourcesContent":["export enum FilterTypeEnum {\n String,\n Number,\n Boolean,\n Date,\n Lookup,\n LookupEnum\n}\n\nexport enum FilterLookupTypeEnum {\n Dropdown,\n Autocomplete\n}\n\nexport enum FilterDisplayTypeEnum {\n Column,\n OverlayWithTag\n}\n","import {CommonsInternalError, FilterMatchModeExtendedType, IFilterDescriptor, LoggerService} from '@mediusinc/mng-commons/core';\nimport {InputTrimType} from '@mediusinc/mng-commons/form/api';\n\nimport {FilterDisplayTypeEnum, FilterTypeEnum} from '../models/filter.model';\n\nexport type FilterDatePickerDisplayOptsType = {\n applyFromDisplayFormat?: boolean;\n format?: string;\n showTime?: boolean;\n showSeconds?: boolean;\n};\n\nexport type FilterDateValueOptsType = {\n utc?: boolean;\n noTime?: boolean;\n noTimeZone?: boolean;\n};\n\nexport type FilterDateOptsType = FilterDateValueOptsType &\n FilterDatePickerDisplayOptsType & {\n displayFormat?: string;\n };\n\nexport type FilterNumberFractionOptsType = {\n minFractionDigits?: number;\n maxFractionDigits?: number;\n};\n\nexport type FilterLocaleOptsType = {\n locale?: string;\n};\n\nexport type FilterNumberOptsType = FilterNumberFractionOptsType &\n FilterLocaleOptsType & {\n displayFormat?: string;\n };\n\nexport class FilterDescriptor<FilterModel, TableModel> implements IFilterDescriptor<FilterModel, TableModel> {\n protected readonly _property: string;\n protected _showOnColumn?: string;\n\n protected _filterType = FilterTypeEnum.String;\n protected _displayType?: FilterDisplayTypeEnum;\n\n // default value\n protected _hasDefaultValue = false;\n protected _defaultMatchMode?: FilterMatchModeExtendedType;\n protected _defaultValue?: FilterModel | FilterModel[];\n protected _matchModes?: string[];\n\n // value display\n private _displayFormat?: string;\n private _displayFormatApplyToField?: boolean;\n private _locale?: string;\n\n // number filter field specific properties\n protected _numberMinFractionDigits?: number;\n protected _numberMaxFractionDigits?: number;\n protected _numberUseGrouping = true;\n\n // date filter field specific properties\n protected _datePickerFormat?: string;\n protected _datePickerShowTime?: boolean;\n protected _datePickerShowSeconds?: boolean;\n protected _dateValueNoTime?: boolean;\n protected _dateValueNoTimezone?: boolean;\n protected _dateValueUtc?: boolean;\n\n protected _placeholder?: string;\n protected _className = '';\n protected _columnClassName = '';\n protected _columnWidth: number | null = null;\n protected _columnMinWidth: number | null = null;\n protected _inputTrim?: InputTrimType;\n protected _title?: string;\n\n constructor(property: string) {\n this._property = property;\n this._showOnColumn = property;\n }\n\n public get filterType() {\n return this._filterType;\n }\n\n public get showOnColumn() {\n return this._showOnColumn;\n }\n\n public get displayType() {\n return this._displayType;\n }\n\n public get hasDefaultValue() {\n return this._hasDefaultValue;\n }\n\n public get defaultValue() {\n return this._defaultValue;\n }\n\n public get defaultMatchMode() {\n return this._defaultMatchMode;\n }\n\n public get matchModes() {\n return this._matchModes;\n }\n\n public get displayFormat() {\n return this._displayFormat;\n }\n\n public get displayFormatApplyToField() {\n return this._displayFormatApplyToField;\n }\n\n public get locale() {\n return this._locale;\n }\n\n public get numberMinFractionDigits() {\n return this._numberMinFractionDigits;\n }\n\n public get numberMaxFractionDigits() {\n return this._numberMaxFractionDigits;\n }\n\n public get numberUseGrouping() {\n return this._numberUseGrouping;\n }\n\n public get datePickerFormat() {\n return this._datePickerFormat;\n }\n\n public get datePickerShowTime() {\n return this._datePickerShowTime;\n }\n\n public get datePickerShowSeconds() {\n return this._datePickerShowSeconds;\n }\n\n public get dateValueUtc() {\n return this._dateValueUtc;\n }\n\n public get dateValueNoTimezone() {\n return this._dateValueNoTimezone;\n }\n\n public get dateValueNoTime() {\n return this._dateValueNoTime;\n }\n\n public get placeholder() {\n return this._placeholder;\n }\n\n public get className() {\n return this._className;\n }\n\n public get columnClassName() {\n return this._columnClassName;\n }\n\n public get columnWidth() {\n return this._columnWidth;\n }\n\n public get columnMinWidth() {\n return this._columnMinWidth;\n }\n\n public get trimOption() {\n return this._inputTrim;\n }\n\n public get property() {\n return this._property;\n }\n\n public get title() {\n return this._title;\n }\n\n /**\n * Converts filter to given type.\n *\n * @param filterType Filter type.\n */\n public asFilterType(filterType: FilterTypeEnum) {\n this._filterType = filterType;\n return this;\n }\n\n /**\n * Set filter as date type.\n *\n * @param opts Additional options.\n */\n public asDate(opts?: FilterDateOptsType): this {\n this._filterType = FilterTypeEnum.Date;\n this.withDisplayFormat(opts?.displayFormat).withDatePickerDisplay(opts).withDateValue(opts);\n return this;\n }\n\n /**\n * Set filter as number type.\n *\n * @param opts Additional options.\n */\n public asNumber(opts?: FilterNumberOptsType): this {\n this._filterType = FilterTypeEnum.Number;\n this.withDisplayFormat(opts?.displayFormat).withNumberFractions(opts?.minFractionDigits, opts?.maxFractionDigits).withLocale(opts?.locale);\n return this;\n }\n\n /**\n * Shows filter on column for given property.\n *\n * @param property Column property to show filter on.\n * @param displayType Optional display type override. If not column, the filter will not be shown on column.\n */\n public withShowOnColumn(property: keyof TableModel, displayType: FilterDisplayTypeEnum | undefined = FilterDisplayTypeEnum.Column): this {\n return this.withShowOnColumnUnsafe(property as string, displayType);\n }\n\n /**\n * Shows filter on column for given property.\n *\n * This function is UNSAFE.\n *\n * @param property Column property to show filter on.\n * @param displayType Optional display type override. If not column, the filter will not be shown on column.\n */\n public withShowOnColumnUnsafe(property: string, displayType: FilterDisplayTypeEnum | undefined = FilterDisplayTypeEnum.Column): this {\n this._showOnColumn = property;\n this._displayType = displayType;\n return this;\n }\n\n /**\n * Changes display type of filter.\n *\n * @param type Display type.\n */\n public withDisplayType(type?: FilterDisplayTypeEnum): this {\n this._displayType = type;\n return this;\n }\n\n /**\n * Sets default filter value for filter.\n *\n * @param value Value for default filter.\n * @param matchMode Match mode for default filter.\n */\n public withDefaultFilter(value: FilterModel | FilterModel[] | undefined, matchMode: FilterMatchModeExtendedType): this {\n this._hasDefaultValue = true;\n this._defaultValue = value;\n this._defaultMatchMode = matchMode;\n this.validateDefaultFilter(value, matchMode);\n return this;\n }\n\n protected validateDefaultFilter(value: FilterModel | FilterModel[] | undefined, matchMode: FilterMatchModeExtendedType) {\n if (matchMode === 'between' && value != null && (!Array.isArray(value) || value.filter(v => v != null).length !== 2)) {\n throw new CommonsInternalError(`Default value for filter match mode ${matchMode} must provide exactly 2 values in array`);\n }\n if ((matchMode === 'in' || matchMode === 'notIn') && value != null && (!Array.isArray(value) || value.filter(v => v != null).length === 0)) {\n throw new CommonsInternalError(`Default value for filter match mode ${matchMode} must be array and provide at least 1 non-null value`);\n }\n if (matchMode === 'exists' || matchMode === 'doesNotExist') {\n this._defaultValue = undefined;\n }\n\n if (matchMode && this._matchModes && this._matchModes.indexOf(matchMode) < 0) {\n this._defaultMatchMode = undefined;\n LoggerService.get().debug(`WARNING: Default filter match mode '${matchMode}' could not be assigned for property ${this._property}.`);\n }\n }\n\n /**\n * Sets format for display of filter value (applies to date and number).\n *\n * @param format Format (Angular formatting rules apply).\n * @param applyToField If the format should also be applied to field on filter editing form.\n */\n public withDisplayFormat(format?: string, applyToField?: boolean): this {\n this._displayFormat = format;\n this._displayFormatApplyToField = applyToField;\n return this;\n }\n\n /**\n * Sets locale for filter.\n *\n * @param locale Locale.\n */\n public withLocale(locale?: string): this {\n this._locale = locale;\n return this;\n }\n\n /**\n * Sets fraction for number filter editing field.\n *\n * @param min Min fraction digits (i.e. digits after decimal).\n * @param max Max fraction digits (i.e. digits after decimal).\n */\n public withNumberFractions(min?: number, max?: number) {\n this._numberMinFractionDigits = min;\n this._numberMaxFractionDigits = max;\n return this;\n }\n\n /**\n * If number grouping should be used.\n *\n * @param useGrouping Enables/disbaled the feature.\n */\n public withNumberGrouping(useGrouping = true): this {\n this._numberUseGrouping = useGrouping;\n return this;\n }\n\n /**\n * @deprecated Use ${withDatePickerDisplay} instead.\n */\n public withDateFormat(format?: string, showTime = false, showSeconds = false): this {\n this._datePickerFormat = format;\n this._datePickerShowTime = showTime;\n this._datePickerShowSeconds = showSeconds;\n return this;\n }\n\n /**\n * Sets date picker display options.\n *\n * @param opts Options.\n */\n public withDatePickerDisplay(opts?: FilterDatePickerDisplayOptsType): this {\n this._displayFormatApplyToField = opts?.applyFromDisplayFormat;\n this._datePickerFormat = opts?.format;\n this._datePickerShowTime = opts?.showTime;\n this._datePickerShowSeconds = opts?.showSeconds;\n return this;\n }\n\n /**\n * Sets filter date value formatting options.\n *\n * @param opts Options.\n */\n public withDateValue(opts?: FilterDateValueOptsType): this {\n this._dateValueUtc = opts?.utc;\n this._dateValueNoTimezone = opts?.noTimeZone;\n this._dateValueNoTime = opts?.noTime;\n return this;\n }\n\n /**\n * Sets placeholder for filter field.\n *\n * @param placeholder Text for placeholder.\n */\n public withPlaceholder(placeholder: string): this {\n this._placeholder = placeholder;\n return this;\n }\n\n /**\n * Sets class name for filter.\n *\n * @param className Class name.\n */\n public withClassName(className: string): this {\n this._className = className;\n return this;\n }\n\n /**\n * Sets class name for column display type.\n *\n * @param className Class name for column.\n */\n public withColumnClassName(className: string): this {\n this._columnClassName = className;\n return this;\n }\n\n /**\n * Set column width for column display type.\n *\n * @param width Relative width (in percentage) of table width:\n * @param minWidth\n */\n public withColumnWidth(width?: number, minWidth?: number): this {\n this._columnWidth = width ?? null;\n this._columnMinWidth = minWidth ?? null;\n return this;\n }\n\n /**\n * Sets input trimming for filter value field.\n *\n * @param trimOption Trim setting.\n */\n public withInputTrimming(trimOption: InputTrimType = 'both'): this {\n this._inputTrim = trimOption;\n return this;\n }\n\n /**\n * Sets range of match modes for this filter. If non provided, the defaults are applied.\n *\n * @param matchModes Match mode options.\n */\n public withMatchModes(matchModes?: Array<FilterMatchModeExtendedType>): this {\n this._matchModes = matchModes;\n return this;\n }\n\n /**\n * Filter title. If non provided, the defaults are applied.\n *\n * @param title Title for the field.\n */\n public withTitle(title: string): this {\n this._title = title;\n return this;\n }\n\n /**\n * Copies current descriptor to a new instance.\n */\n public copy(): FilterDescriptor<FilterModel, TableModel> {\n const descriptor = new FilterDescriptor<FilterModel, TableModel>(this._property);\n this.copyFieldsTo(descriptor);\n return descriptor;\n }\n\n protected copyFieldsTo(descriptor: FilterDescriptor<FilterModel, TableModel>) {\n descriptor._filterType = this._filterType;\n descriptor._hasDefaultValue = this._hasDefaultValue;\n descriptor._defaultValue = this._defaultValue;\n descriptor._defaultMatchMode = this._defaultMatchMode;\n descriptor._displayFormat = this._displayFormat;\n descriptor._locale = this._locale;\n descriptor._numberMinFractionDigits = this._numberMinFractionDigits;\n descriptor._numberMaxFractionDigits = this._numberMaxFractionDigits;\n descriptor._numberUseGrouping = this._numberUseGrouping;\n descriptor._datePickerFormat = this._datePickerFormat;\n descriptor._datePickerShowTime = this._datePickerShowTime;\n descriptor._dateValueUtc = this._dateValueUtc;\n descriptor._dateValueNoTimezone = this._dateValueNoTimezone;\n descriptor._dateValueNoTime = this._dateValueNoTime;\n descriptor._placeholder = this._placeholder;\n descriptor._className = this._className;\n descriptor._columnWidth = this._columnWidth;\n descriptor._columnMinWidth = this._columnMinWidth;\n descriptor._columnClassName = this._columnClassName;\n }\n}\n","import {of} from 'rxjs';\n\nimport {\n ClassOptType,\n ClassType,\n CommonsInternalError,\n EnumConstantType,\n EnumValue,\n FilterMatchModeExtendedType,\n ILookupDataProvider,\n ILookupDescriptor,\n LookupDataProviderLookupFnType,\n ServiceClassOptType,\n ServiceClassType,\n fromEnumConstantsAsValueArray,\n fromEnumValuesAsValueArray,\n getEnumConstantName\n} from '@mediusinc/mng-commons/core';\nimport {LookupDataProviderInst} from '@mediusinc/mng-commons/form/api';\nimport {EnumDescriptor, findClassIdAttribute, trySetLookupItemsProperties} from '@mediusinc/mng-commons/model';\n\nimport {FilterLookupTypeEnum, FilterTypeEnum} from '../models/filter.model';\nimport {FilterDescriptor} from './filter.descriptor';\n\nexport type FilterLookupDescriptorConstructorOptsType<\n FilterModel,\n Service,\n Sorts = keyof FilterModel,\n Filters extends keyof any = keyof FilterModel\n> = FilterLookupDescriptorCreateOptsProviderType<FilterModel, Service, Sorts, Filters> & {\n type?: ClassType<FilterModel>;\n optionsValueProperty?: string | null;\n};\n\nexport type FilterLookupDescriptorCreateOptsProviderType<FilterModel, Service, Sorts = keyof FilterModel, Filters extends keyof any = keyof FilterModel> = {\n serviceType?: ServiceClassType<Service>;\n dataProvider?: ILookupDataProvider<FilterModel, Service, Sorts, Filters>;\n};\n\nexport type FilterLookupAutocompleteOptsType = {\n openOnFocus?: boolean;\n inlineSearch?: boolean;\n autoClear?: boolean;\n};\n\nexport class FilterLookupDescriptor<FilterModel, TableModel, Service = any, Sorts = keyof FilterModel, Filters extends keyof any = keyof FilterModel>\n extends FilterDescriptor<FilterModel, TableModel>\n implements ILookupDescriptor<FilterModel, Service, Sorts, Filters>\n{\n protected readonly _dataProvider: ILookupDataProvider<FilterModel, Service, Sorts, Filters>;\n protected readonly _optionsValueProperty?: string | null;\n protected _lookupType?: FilterLookupTypeEnum = FilterLookupTypeEnum.Dropdown;\n protected _optionsLabelProperty?: string;\n protected _optionsLabelTranslate = false;\n protected _multiselect = false;\n\n protected _dropdownClassName = 'mng-filter-lookup-dropdown';\n\n protected _autocompleteOpenOnFocus?: boolean;\n protected _autocompleteInlineSearch?: boolean;\n protected _autocompleteAutoClear?: boolean;\n\n constructor(property: string, cfg?: FilterLookupDescriptorConstructorOptsType<FilterModel, Service, Sorts, Filters>) {\n super(property);\n this._filterType = FilterTypeEnum.Lookup;\n\n if (cfg?.dataProvider) {\n this._dataProvider = cfg.dataProvider;\n } else {\n this._dataProvider = new LookupDataProviderInst<FilterModel, Service, Sorts, Filters, ClassOptType<FilterModel>, ServiceClassOptType<Service>>(\n cfg?.type,\n cfg?.serviceType\n );\n }\n\n this._optionsValueProperty = typeof cfg?.optionsValueProperty === 'undefined' ? findClassIdAttribute(this._dataProvider.classType) ?? undefined : cfg?.optionsValueProperty;\n\n trySetLookupItemsProperties(this, false);\n }\n\n public get lookupType() {\n return this._lookupType;\n }\n\n public get dataProvider() {\n return this._dataProvider;\n }\n\n public get optionsLabelProperty() {\n return this._optionsLabelProperty;\n }\n\n public get optionsLabelTranslate() {\n return this._optionsLabelTranslate;\n }\n\n public get optionsValueProperty() {\n return this._optionsValueProperty ?? undefined;\n }\n\n public get multiselect() {\n return this._multiselect;\n }\n\n public get autocompleteOpenOnFocus() {\n return this._autocompleteOpenOnFocus;\n }\n\n public get autocompleteAutoClear() {\n return this._autocompleteAutoClear;\n }\n\n public get autocompleteInlineSearch() {\n return this._autocompleteInlineSearch;\n }\n\n public get dropdownClassName() {\n return this._dropdownClassName;\n }\n\n /**\n * Sets label property for options display.\n *\n * @param property Property for label options.\n * @param translate If the options should be translated through the i18n.\n */\n public withOptionsLabelProperty(property: keyof FilterModel, translate = false): this {\n return this.withOptionsLabelPropertyUnsafe(property as string, translate);\n }\n\n /**\n * Sets label property for options display.\n *\n * This function is UNSAFE!\n *\n * @param property Property for label options.\n * @param translate If the options should be translated through the i18n.\n */\n public withOptionsLabelPropertyUnsafe(property: string, translate = false): this {\n this._optionsLabelProperty = property;\n this._optionsLabelTranslate = translate;\n return this;\n }\n\n /**\n * Method will set `optionsValueProperty`, because track properties are not supported here as filters need final value to work correctly.\n * Use `optionsValueProperty` in filter creation instead.\n */\n public withOptionsTrackProperty(): this {\n return this;\n }\n\n /**\n * Method will set `optionsValueProperty`, because track properties are not supported here as filters need final value to work correctly.\n * Use `optionsValueProperty` in filter creation instead.\n */\n public withOptionsTrackPropertyUnsafe(): this {\n return this;\n }\n\n public withLookup(lookup?: LookupDataProviderLookupFnType<FilterModel, Service, Sorts, Filters>): this {\n this._dataProvider.withLookup(lookup);\n return this;\n }\n\n /**\n * Sets multiselect for lookups.\n *\n * @param multiselect Enables/disables the feature.\n */\n public withMultiselect(multiselect = true) {\n this._multiselect = multiselect;\n return this;\n }\n\n /**\n * Sets the dropdown class name.\n * @param dropdownClassName Class name for dropdown.\n */\n public withDropdownClassName(dropdownClassName: string): this {\n this._dropdownClassName = dropdownClassName;\n return this;\n }\n\n /**\n * Sets default filter value for filter.\n *\n * @param value Value for default filter.\n * @param matchMode Match mode for default filter.\n */\n public override withDefaultFilter(value: FilterModel | FilterModel[] | undefined, matchMode: FilterMatchModeExtendedType): this {\n this._hasDefaultValue = true;\n this._defaultValue = value;\n this._defaultMatchMode = matchMode;\n\n this.validateDefaultFilter(value, matchMode);\n\n if ((Array.isArray(value) && !this.multiselect) || (this.multiselect && !Array.isArray(value))) {\n throw new CommonsInternalError(`Default value not in correct format for property ${this._property}.`, {name: 'FilterDescriptorError'});\n }\n\n return this;\n }\n\n /**\n * Sets lookup as autocomplete instead of dropdown.\n *\n * @param opts Additional options.\n */\n public asAutocomplete(opts?: FilterLookupAutocompleteOptsType): this {\n this._lookupType = FilterLookupTypeEnum.Autocomplete;\n this._autocompleteAutoClear = opts?.autoClear;\n this._autocompleteOpenOnFocus = opts?.openOnFocus;\n this._autocompleteInlineSearch = opts?.inlineSearch;\n return this;\n }\n\n /**\n * Copies current descriptor to a new instance.\n */\n public override copy(): FilterLookupDescriptor<FilterModel, TableModel, Service, Sorts, Filters> {\n const descriptor = new FilterLookupDescriptor<FilterModel, TableModel, Service, Sorts, Filters>(this._property, {\n dataProvider: this.dataProvider\n });\n this.copyFieldsTo(descriptor);\n return descriptor;\n }\n\n protected override copyFieldsTo(filter: FilterLookupDescriptor<FilterModel, TableModel, Service, Sorts, Filters>) {\n super.copyFieldsTo(filter);\n filter._lookupType = this._lookupType;\n filter._optionsLabelProperty = this._optionsLabelProperty;\n filter._optionsLabelTranslate = this._optionsLabelTranslate;\n filter._multiselect = this._multiselect;\n filter._dropdownClassName = this._dropdownClassName;\n filter._autocompleteOpenOnFocus = this._autocompleteOpenOnFocus;\n filter._autocompleteInlineSearch = this._autocompleteInlineSearch;\n }\n}\n\nexport class FilterLookupEnumDescriptor<Enum, TableModel> extends FilterLookupDescriptor<EnumValue, TableModel, undefined, never, never> {\n private readonly _enum: EnumDescriptor<Enum>;\n private readonly _optionEnumValues: EnumValue[];\n private readonly _nameAsValue: boolean = false;\n\n constructor(property: string, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>) {\n super(property, {\n dataProvider: new LookupDataProviderInst<EnumValue, undefined, never, never, undefined, undefined>(undefined, undefined),\n optionsValueProperty: 'value'\n });\n this._filterType = FilterTypeEnum.LookupEnum;\n\n this._enum = enumDesc;\n\n this._optionEnumValues = Array.isArray(options)\n ? fromEnumValuesAsValueArray(this._enum.type, options, this._enum.nameAsValue, this._enum.i18nBaseKey ?? undefined)\n : fromEnumConstantsAsValueArray(this._enum.type, this._enum.nameAsValue, this._enum.i18nBaseKey ?? undefined);\n\n this.withLookup(() => of(this._optionEnumValues));\n this.withOptionsLabelProperty('title', this._enum.i18nBaseKey !== null);\n }\n\n public get enum() {\n return this._enum;\n }\n\n /**\n * Sets lookup as autocomplete instead of dropdown.\n *\n * @param opts Additional options.\n */\n public override asAutocomplete(opts?: FilterLookupAutocompleteOptsType): this {\n super.asAutocomplete({\n ...opts,\n openOnFocus: opts?.openOnFocus ?? true,\n inlineSearch: opts?.inlineSearch ?? true\n });\n return this;\n }\n\n public withMultiselectEnum(multiselect = true): FilterLookupEnumDescriptor<Enum, TableModel> {\n return super.withMultiselect(multiselect) as FilterLookupEnumDescriptor<Enum, TableModel>;\n }\n\n /**\n * Do not use, use `withDefaultFilterEnum` instead.\n */\n public override withDefaultFilter(): this {\n throw new CommonsInternalError(`withDefaultFilter on FilterLookupEnumDescriptor should not be used. Use withDefaultFilterEnum instead.`, {name: 'FilterDescriptorError'});\n }\n\n /**\n * Sets default filter value for filter.\n *\n * @param value Value(s) for default filter.\n * @param matchMode Match mode for default filter.\n */\n public withDefaultFilterEnum(value: EnumConstantType | EnumConstantType[] | undefined, matchMode: FilterMatchModeExtendedType): this {\n let defaultOptionValue: any | any[];\n if (Array.isArray(value)) {\n defaultOptionValue = this._nameAsValue ? value.map(value => getEnumConstantName(this.enum.type, value)) : value;\n } else if (value != null) {\n defaultOptionValue = this._nameAsValue ? getEnumConstantName(this.enum.type, value) : value;\n }\n\n if (defaultOptionValue != null) {\n let option: any | any[];\n if (Array.isArray(defaultOptionValue)) {\n option = defaultOptionValue.map(value => this._optionEnumValues.find(o => o.value === value));\n } else {\n option = this._optionEnumValues.find(o => o.value === defaultOptionValue);\n }\n\n let defaultFilterValue: any | any[];\n if (Array.isArray(option)) {\n defaultFilterValue = this._optionsValueProperty ? option.map(value => value[this._optionsValueProperty as keyof object]) : option;\n } else {\n defaultFilterValue = this._optionsValueProperty ? option[this._optionsValueProperty as keyof object] : option;\n }\n\n super.withDefaultFilter(defaultFilterValue, matchMode);\n }\n return this;\n }\n\n /**\n * Copies current descriptor to a new instance.\n */\n public override copy(): FilterLookupEnumDescriptor<Enum, TableModel> {\n const field = new FilterLookupEnumDescriptor<Enum, TableModel>(this._property, this.enum, []);\n this.copyFieldsTo(field);\n return field;\n }\n}\n","// descriptors\nexport * from './descriptors/filter.descriptor';\nexport * from './descriptors/filter-lookup.descriptor';\n\n// models\nexport * from './models/filter.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;IAAY,eAOX;AAPD,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,cAAA,CAAA,cAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAO,CAAA;AACP,IAAA,cAAA,CAAA,cAAA,CAAA,MAAA,CAAA,GAAA,CAAA,CAAA,GAAA,MAAI,CAAA;AACJ,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,QAAM,CAAA;AACN,IAAA,cAAA,CAAA,cAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YA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AAI,CAAC;KACf;AAED;;AAEG;IACa,IAAI,GAAA;AAChB,QAAA,MAAM,KAAK,GAAG,IAAI,0BAA0B,CAAmB,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;AAC9F,QAAA,IAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;AACzB,QAAA,OAAO,KAAK,CAAC;KAChB;AACJ;;AC7UD;;ACAA;;AAEG;;;;"}
1
+ {"version":3,"file":"mediusinc-mng-commons-filter.mjs","sources":["../../filter/src/models/filter.model.ts","../../filter/src/descriptors/filter.descriptor.ts","../../filter/src/descriptors/filter-lookup.descriptor.ts","../../filter/src/descriptors/filter-generic.descriptor.ts","../../filter/src/index.ts","../../filter/src/mediusinc-mng-commons-filter.ts"],"sourcesContent":["export enum FilterTypeEnum {\n String,\n Number,\n Boolean,\n Date,\n Lookup,\n LookupEnum\n}\n\nexport enum FilterLookupTypeEnum {\n Dropdown,\n Autocomplete\n}\n\nexport enum FilterDisplayTypeEnum {\n Column,\n OverlayWithTag\n}\n","import {CommonsInternalError, FilterMatchModeExtendedType, IFilterDescriptor, ILookupDataProvider, LoggerService} from '@mediusinc/mng-commons/core';\nimport {InputTrimType, LookupDataProviderInst} from '@mediusinc/mng-commons/form/api';\n\nimport {FilterDisplayTypeEnum, FilterTypeEnum} from '../models/filter.model';\n\nexport type FilterDatePickerDisplayOptsType = {\n applyFromDisplayFormat?: boolean;\n format?: string;\n showTime?: boolean;\n showSeconds?: boolean;\n};\n\nexport type FilterDateValueOptsType = {\n utc?: boolean;\n noTime?: boolean;\n noTimeZone?: boolean;\n};\n\nexport type FilterDateOptsType = FilterDateValueOptsType &\n FilterDatePickerDisplayOptsType & {\n displayFormat?: string;\n };\n\nexport type FilterNumberFractionOptsType = {\n minFractionDigits?: number;\n maxFractionDigits?: number;\n};\n\nexport type FilterLocaleOptsType = {\n locale?: string;\n};\n\nexport type FilterNumberOptsType = FilterNumberFractionOptsType &\n FilterLocaleOptsType & {\n displayFormat?: string;\n };\n\nexport class FilterDescriptor<FilterModel, TableModel> implements IFilterDescriptor<FilterModel, TableModel> {\n protected readonly _property: string;\n protected _showOnColumn?: string;\n\n protected _filterType = FilterTypeEnum.String;\n protected _displayType?: FilterDisplayTypeEnum;\n\n // default value\n protected _hasDefaultValue = false;\n protected _defaultMatchMode?: FilterMatchModeExtendedType;\n protected _defaultValue?: FilterModel | FilterModel[];\n protected _matchModes?: string[];\n\n // value display\n private _displayFormat?: string;\n private _displayFormatApplyToField?: boolean;\n private _locale?: string;\n\n // number filter field specific properties\n protected _numberMinFractionDigits?: number;\n protected _numberMaxFractionDigits?: number;\n protected _numberUseGrouping = true;\n\n // date filter field specific properties\n protected _datePickerFormat?: string;\n protected _datePickerShowTime?: boolean;\n protected _datePickerShowSeconds?: boolean;\n protected _dateValueNoTime?: boolean;\n protected _dateValueNoTimezone?: boolean;\n protected _dateValueUtc?: boolean;\n\n protected _placeholder?: string;\n protected _className = '';\n protected _columnClassName = '';\n protected _columnWidth: number | null = null;\n protected _columnMinWidth: number | null = null;\n protected _inputTrim?: InputTrimType;\n protected _title?: string;\n\n protected _isGenericFilter = false;\n protected _valueSuggestionProvider?: ILookupDataProvider<string, any, any, 'field'>;\n protected _dropdownClassName = '';\n\n constructor(property: string) {\n this._property = property;\n this._showOnColumn = property;\n }\n\n public get filterType() {\n return this._filterType;\n }\n\n public get showOnColumn() {\n return this._showOnColumn;\n }\n\n public get displayType() {\n return this._displayType;\n }\n\n public get hasDefaultValue() {\n return this._hasDefaultValue;\n }\n\n public get defaultValue() {\n return this._defaultValue;\n }\n\n public get defaultMatchMode() {\n return this._defaultMatchMode;\n }\n\n public get matchModes() {\n return this._matchModes;\n }\n\n public get displayFormat() {\n return this._displayFormat;\n }\n\n public get displayFormatApplyToField() {\n return this._displayFormatApplyToField;\n }\n\n public get locale() {\n return this._locale;\n }\n\n public get numberMinFractionDigits() {\n return this._numberMinFractionDigits;\n }\n\n public get numberMaxFractionDigits() {\n return this._numberMaxFractionDigits;\n }\n\n public get numberUseGrouping() {\n return this._numberUseGrouping;\n }\n\n public get datePickerFormat() {\n return this._datePickerFormat;\n }\n\n public get datePickerShowTime() {\n return this._datePickerShowTime;\n }\n\n public get datePickerShowSeconds() {\n return this._datePickerShowSeconds;\n }\n\n public get dateValueUtc() {\n return this._dateValueUtc;\n }\n\n public get dateValueNoTimezone() {\n return this._dateValueNoTimezone;\n }\n\n public get dateValueNoTime() {\n return this._dateValueNoTime;\n }\n\n public get placeholder() {\n return this._placeholder;\n }\n\n public get className() {\n return this._className;\n }\n\n public get columnClassName() {\n return this._columnClassName;\n }\n\n public get columnWidth() {\n return this._columnWidth;\n }\n\n public get columnMinWidth() {\n return this._columnMinWidth;\n }\n\n public get trimOption() {\n return this._inputTrim;\n }\n\n public get property() {\n return this._property;\n }\n\n public get title() {\n return this._title;\n }\n\n public get isGenericFilter() {\n return this._isGenericFilter;\n }\n\n public get genericValueProvider() {\n return this._valueSuggestionProvider;\n }\n\n public get dropdownClassName(): string {\n return this._dropdownClassName;\n }\n\n /**\n * Converts filter to given type.\n *\n * @param filterType Filter type.\n */\n public asFilterType(filterType: FilterTypeEnum) {\n this._filterType = filterType;\n return this;\n }\n\n /**\n * Sets the filter as a generic filter. For internal use only.\n *\n * @internal\n */\n public asGenericFilter(): this {\n this._isGenericFilter = true;\n return this;\n }\n\n /**\n * Set filter as date type.\n *\n * @param opts Additional options.\n */\n public asDate(opts?: FilterDateOptsType): this {\n this._filterType = FilterTypeEnum.Date;\n this.withDisplayFormat(opts?.displayFormat).withDatePickerDisplay(opts).withDateValue(opts);\n return this;\n }\n\n /**\n * Set filter as number type.\n *\n * @param opts Additional options.\n */\n public asNumber(opts?: FilterNumberOptsType): this {\n this._filterType = FilterTypeEnum.Number;\n this.withDisplayFormat(opts?.displayFormat).withNumberFractions(opts?.minFractionDigits, opts?.maxFractionDigits).withLocale(opts?.locale);\n return this;\n }\n\n /**\n * Shows filter on column for given property.\n *\n * @param property Column property to show filter on.\n * @param displayType Optional display type override. If not column, the filter will not be shown on column.\n */\n public withShowOnColumn(property: keyof TableModel, displayType: FilterDisplayTypeEnum | undefined = FilterDisplayTypeEnum.Column): this {\n return this.withShowOnColumnUnsafe(property as string, displayType);\n }\n\n /**\n * Shows filter on column for given property.\n *\n * This function is UNSAFE.\n *\n * @param property Column property to show filter on.\n * @param displayType Optional display type override. If not column, the filter will not be shown on column.\n */\n public withShowOnColumnUnsafe(property: string, displayType: FilterDisplayTypeEnum | undefined = FilterDisplayTypeEnum.Column): this {\n this._showOnColumn = property;\n this._displayType = displayType;\n return this;\n }\n\n /**\n * Changes display type of filter.\n *\n * @param type Display type.\n */\n public withDisplayType(type?: FilterDisplayTypeEnum): this {\n this._displayType = type;\n return this;\n }\n\n /**\n * Sets default filter value for filter.\n *\n * @param value Value for default filter.\n * @param matchMode Match mode for default filter.\n */\n public withDefaultFilter(value: FilterModel | FilterModel[] | undefined, matchMode: FilterMatchModeExtendedType): this {\n this._hasDefaultValue = true;\n this._defaultValue = value;\n this._defaultMatchMode = matchMode;\n this.validateDefaultFilter(value, matchMode);\n return this;\n }\n\n protected validateDefaultFilter(value: FilterModel | FilterModel[] | undefined, matchMode: FilterMatchModeExtendedType) {\n if (matchMode === 'between' && value != null && (!Array.isArray(value) || value.filter(v => v != null).length !== 2)) {\n throw new CommonsInternalError(`Default value for filter match mode ${matchMode} must provide exactly 2 values in array`);\n }\n if ((matchMode === 'in' || matchMode === 'notIn') && value != null && (!Array.isArray(value) || value.filter(v => v != null).length === 0)) {\n throw new CommonsInternalError(`Default value for filter match mode ${matchMode} must be array and provide at least 1 non-null value`);\n }\n if (matchMode === 'exists' || matchMode === 'doesNotExist') {\n this._defaultValue = undefined;\n }\n\n if (matchMode && this._matchModes && this._matchModes.indexOf(matchMode) < 0) {\n this._defaultMatchMode = undefined;\n LoggerService.get().debug(`WARNING: Default filter match mode '${matchMode}' could not be assigned for property ${this._property}.`);\n }\n }\n\n /**\n * Sets format for display of filter value (applies to date and number).\n *\n * @param format Format (Angular formatting rules apply).\n * @param applyToField If the format should also be applied to field on filter editing form.\n */\n public withDisplayFormat(format?: string, applyToField?: boolean): this {\n this._displayFormat = format;\n this._displayFormatApplyToField = applyToField;\n return this;\n }\n\n /**\n * Sets locale for filter.\n *\n * @param locale Locale.\n */\n public withLocale(locale?: string): this {\n this._locale = locale;\n return this;\n }\n\n /**\n * Sets fraction for number filter editing field.\n *\n * @param min Min fraction digits (i.e. digits after decimal).\n * @param max Max fraction digits (i.e. digits after decimal).\n */\n public withNumberFractions(min?: number, max?: number) {\n this._numberMinFractionDigits = min;\n this._numberMaxFractionDigits = max;\n return this;\n }\n\n /**\n * If number grouping should be used.\n *\n * @param useGrouping Enables/disbaled the feature.\n */\n public withNumberGrouping(useGrouping = true): this {\n this._numberUseGrouping = useGrouping;\n return this;\n }\n\n /**\n * Sets a data provider for autocomplete text suggestions.\n *\n * @param valueDataProvider Data provider for autocomplete.\n */\n public withGenericValueProvider(valueDataProvider: LookupDataProviderInst<string, any, any, 'field'>): this {\n if (!(this.filterType === FilterTypeEnum.String || this.filterType === FilterTypeEnum.LookupEnum)) {\n throw new CommonsInternalError('Generic value lookup can only be set for the string or lookup enum filter types.');\n }\n\n this._valueSuggestionProvider = valueDataProvider;\n return this;\n }\n\n /**\n * @deprecated Use ${withDatePickerDisplay} instead.\n */\n public withDateFormat(format?: string, showTime = false, showSeconds = false): this {\n this._datePickerFormat = format;\n this._datePickerShowTime = showTime;\n this._datePickerShowSeconds = showSeconds;\n return this;\n }\n\n /**\n * Sets date picker display options.\n *\n * @param opts Options.\n */\n public withDatePickerDisplay(opts?: FilterDatePickerDisplayOptsType): this {\n this._displayFormatApplyToField = opts?.applyFromDisplayFormat;\n this._datePickerFormat = opts?.format;\n this._datePickerShowTime = opts?.showTime;\n this._datePickerShowSeconds = opts?.showSeconds;\n return this;\n }\n\n /**\n * Sets filter date value formatting options.\n *\n * @param opts Options.\n */\n public withDateValue(opts?: FilterDateValueOptsType): this {\n this._dateValueUtc = opts?.utc;\n this._dateValueNoTimezone = opts?.noTimeZone;\n this._dateValueNoTime = opts?.noTime;\n return this;\n }\n\n /**\n * Sets placeholder for filter field.\n *\n * @param placeholder Text for placeholder.\n */\n public withPlaceholder(placeholder: string): this {\n this._placeholder = placeholder;\n return this;\n }\n\n /**\n * Sets class name for filter.\n *\n * @param className Class name.\n */\n public withClassName(className: string): this {\n this._className = className;\n return this;\n }\n\n /**\n * Sets class name for column display type.\n *\n * @param className Class name for column.\n */\n public withColumnClassName(className: string): this {\n this._columnClassName = className;\n return this;\n }\n\n /**\n * Set column width for column display type.\n *\n * @param width Relative width (in percentage) of table width:\n * @param minWidth\n */\n public withColumnWidth(width?: number, minWidth?: number): this {\n this._columnWidth = width ?? null;\n this._columnMinWidth = minWidth ?? null;\n return this;\n }\n\n /**\n * Sets input trimming for filter value field.\n *\n * @param trimOption Trim setting.\n */\n public withInputTrimming(trimOption: InputTrimType = 'both'): this {\n this._inputTrim = trimOption;\n return this;\n }\n\n /**\n * Sets range of match modes for this filter. If non provided, the defaults are applied.\n *\n * @param matchModes Match mode options.\n */\n public withMatchModes(matchModes?: Array<FilterMatchModeExtendedType>): this {\n this._matchModes = matchModes;\n return this;\n }\n\n /**\n * Filter title. If non provided, the defaults are applied.\n *\n * @param title Title for the field.\n */\n public withTitle(title: string): this {\n this._title = title;\n return this;\n }\n\n public withDropdownClassName(dropdownClassName: string): this {\n this._dropdownClassName = dropdownClassName;\n return this;\n }\n\n /**\n * Copies current descriptor to a new instance.\n */\n public copy(): FilterDescriptor<FilterModel, TableModel> {\n const descriptor = new FilterDescriptor<FilterModel, TableModel>(this._property);\n this.copyFieldsTo(descriptor);\n return descriptor;\n }\n\n protected copyFieldsTo(descriptor: FilterDescriptor<FilterModel, TableModel>) {\n descriptor._filterType = this._filterType;\n descriptor._hasDefaultValue = this._hasDefaultValue;\n descriptor._defaultValue = this._defaultValue;\n descriptor._defaultMatchMode = this._defaultMatchMode;\n descriptor._displayFormat = this._displayFormat;\n descriptor._locale = this._locale;\n descriptor._numberMinFractionDigits = this._numberMinFractionDigits;\n descriptor._numberMaxFractionDigits = this._numberMaxFractionDigits;\n descriptor._numberUseGrouping = this._numberUseGrouping;\n descriptor._datePickerFormat = this._datePickerFormat;\n descriptor._datePickerShowTime = this._datePickerShowTime;\n descriptor._dateValueUtc = this._dateValueUtc;\n descriptor._dateValueNoTimezone = this._dateValueNoTimezone;\n descriptor._dateValueNoTime = this._dateValueNoTime;\n descriptor._placeholder = this._placeholder;\n descriptor._className = this._className;\n descriptor._columnWidth = this._columnWidth;\n descriptor._columnMinWidth = this._columnMinWidth;\n descriptor._columnClassName = this._columnClassName;\n descriptor._isGenericFilter = this._isGenericFilter;\n descriptor._valueSuggestionProvider = this._valueSuggestionProvider;\n descriptor._dropdownClassName = this._dropdownClassName;\n }\n}\n","import {of} from 'rxjs';\n\nimport {\n ClassOptType,\n ClassType,\n CommonsInternalError,\n EnumConstantType,\n EnumValue,\n FilterMatchModeExtendedType,\n ILookupDataProvider,\n ILookupDescriptor,\n LookupDataProviderLookupFnType,\n ServiceClassOptType,\n ServiceClassType,\n fromEnumConstantsAsValueArray,\n fromEnumValuesAsValueArray,\n getEnumConstantName\n} from '@mediusinc/mng-commons/core';\nimport {LookupDataProviderInst} from '@mediusinc/mng-commons/form/api';\nimport {EnumDescriptor, findClassIdAttribute, trySetLookupItemsProperties} from '@mediusinc/mng-commons/model';\n\nimport {FilterLookupTypeEnum, FilterTypeEnum} from '../models/filter.model';\nimport {FilterDescriptor} from './filter.descriptor';\n\nexport type FilterLookupDescriptorConstructorOptsType<\n FilterModel,\n Service,\n Sorts = keyof FilterModel,\n Filters extends keyof any = keyof FilterModel\n> = FilterLookupDescriptorCreateOptsProviderType<FilterModel, Service, Sorts, Filters> & {\n type?: ClassType<FilterModel>;\n optionsValueProperty?: string | null;\n};\n\nexport type FilterLookupDescriptorCreateOptsProviderType<FilterModel, Service, Sorts = keyof FilterModel, Filters extends keyof any = keyof FilterModel> = {\n serviceType?: ServiceClassType<Service>;\n dataProvider?: ILookupDataProvider<FilterModel, Service, Sorts, Filters>;\n};\n\nexport type FilterLookupAutocompleteOptsType = {\n openOnFocus?: boolean;\n inlineSearch?: boolean;\n autoClear?: boolean;\n};\n\nexport class FilterLookupDescriptor<FilterModel, TableModel, Service = any, Sorts = keyof FilterModel, Filters extends keyof any = keyof FilterModel>\n extends FilterDescriptor<FilterModel, TableModel>\n implements ILookupDescriptor<FilterModel, Service, Sorts, Filters>\n{\n protected readonly _dataProvider: ILookupDataProvider<FilterModel, Service, Sorts, Filters>;\n protected readonly _optionsValueProperty?: string | null;\n protected _lookupType?: FilterLookupTypeEnum = FilterLookupTypeEnum.Dropdown;\n protected _optionsLabelProperty?: string;\n protected _optionsLabelTranslate = false;\n protected _multiselect = false;\n\n protected override _dropdownClassName = 'mng-filter-lookup-dropdown';\n\n protected _autocompleteOpenOnFocus?: boolean;\n protected _autocompleteInlineSearch?: boolean;\n protected _autocompleteAutoClear?: boolean;\n\n constructor(property: string, cfg?: FilterLookupDescriptorConstructorOptsType<FilterModel, Service, Sorts, Filters>) {\n super(property);\n this._filterType = FilterTypeEnum.Lookup;\n\n if (cfg?.dataProvider) {\n this._dataProvider = cfg.dataProvider;\n } else {\n this._dataProvider = new LookupDataProviderInst<FilterModel, Service, Sorts, Filters, ClassOptType<FilterModel>, ServiceClassOptType<Service>>(\n cfg?.type,\n cfg?.serviceType\n );\n }\n\n this._optionsValueProperty = typeof cfg?.optionsValueProperty === 'undefined' ? findClassIdAttribute(this._dataProvider.classType) ?? undefined : cfg?.optionsValueProperty;\n\n trySetLookupItemsProperties(this, false);\n }\n\n public get lookupType() {\n return this._lookupType;\n }\n\n public get dataProvider() {\n return this._dataProvider;\n }\n\n public get optionsLabelProperty() {\n return this._optionsLabelProperty;\n }\n\n public get optionsLabelTranslate() {\n return this._optionsLabelTranslate;\n }\n\n public get optionsValueProperty() {\n return this._optionsValueProperty ?? undefined;\n }\n\n public get multiselect() {\n return this._multiselect;\n }\n\n public get autocompleteOpenOnFocus() {\n return this._autocompleteOpenOnFocus;\n }\n\n public get autocompleteAutoClear() {\n return this._autocompleteAutoClear;\n }\n\n public get autocompleteInlineSearch() {\n return this._autocompleteInlineSearch;\n }\n\n public override get dropdownClassName() {\n return this._dropdownClassName;\n }\n\n /**\n * Sets label property for options display.\n *\n * @param property Property for label options.\n * @param translate If the options should be translated through the i18n.\n */\n public withOptionsLabelProperty(property: keyof FilterModel, translate = false): this {\n return this.withOptionsLabelPropertyUnsafe(property as string, translate);\n }\n\n /**\n * Sets label property for options display.\n *\n * This function is UNSAFE!\n *\n * @param property Property for label options.\n * @param translate If the options should be translated through the i18n.\n */\n public withOptionsLabelPropertyUnsafe(property: string, translate = false): this {\n this._optionsLabelProperty = property;\n this._optionsLabelTranslate = translate;\n return this;\n }\n\n /**\n * Method will set `optionsValueProperty`, because track properties are not supported here as filters need final value to work correctly.\n * Use `optionsValueProperty` in filter creation instead.\n */\n public withOptionsTrackProperty(): this {\n return this;\n }\n\n /**\n * Method will set `optionsValueProperty`, because track properties are not supported here as filters need final value to work correctly.\n * Use `optionsValueProperty` in filter creation instead.\n */\n public withOptionsTrackPropertyUnsafe(): this {\n return this;\n }\n\n public withLookup(lookup?: LookupDataProviderLookupFnType<FilterModel, Service, Sorts, Filters>): this {\n this._dataProvider.withLookup(lookup);\n return this;\n }\n\n /**\n * Sets multiselect for lookups.\n *\n * @param multiselect Enables/disables the feature.\n */\n public withMultiselect(multiselect = true) {\n this._multiselect = multiselect;\n return this;\n }\n\n /**\n * Sets the dropdown class name.\n * @param dropdownClassName Class name for dropdown.\n */\n public override withDropdownClassName(dropdownClassName: string): this {\n this._dropdownClassName = dropdownClassName;\n return this;\n }\n\n /**\n * Sets default filter value for filter.\n *\n * @param value Value for default filter.\n * @param matchMode Match mode for default filter.\n */\n public override withDefaultFilter(value: FilterModel | FilterModel[] | undefined, matchMode: FilterMatchModeExtendedType): this {\n this._hasDefaultValue = true;\n this._defaultValue = value;\n this._defaultMatchMode = matchMode;\n\n this.validateDefaultFilter(value, matchMode);\n\n if ((Array.isArray(value) && !this.multiselect) || (this.multiselect && !Array.isArray(value))) {\n throw new CommonsInternalError(`Default value not in correct format for property ${this._property}.`, {name: 'FilterDescriptorError'});\n }\n\n return this;\n }\n\n /**\n * Sets lookup as autocomplete instead of dropdown.\n *\n * @param opts Additional options.\n */\n public asAutocomplete(opts?: FilterLookupAutocompleteOptsType): this {\n this._lookupType = FilterLookupTypeEnum.Autocomplete;\n this._autocompleteAutoClear = opts?.autoClear;\n this._autocompleteOpenOnFocus = opts?.openOnFocus;\n this._autocompleteInlineSearch = opts?.inlineSearch;\n return this;\n }\n\n /**\n * Copies current descriptor to a new instance.\n */\n public override copy(): FilterLookupDescriptor<FilterModel, TableModel, Service, Sorts, Filters> {\n const descriptor = new FilterLookupDescriptor<FilterModel, TableModel, Service, Sorts, Filters>(this._property, {\n dataProvider: this.dataProvider\n });\n this.copyFieldsTo(descriptor);\n return descriptor;\n }\n\n protected override copyFieldsTo(filter: FilterLookupDescriptor<FilterModel, TableModel, Service, Sorts, Filters>) {\n super.copyFieldsTo(filter);\n filter._lookupType = this._lookupType;\n filter._optionsLabelProperty = this._optionsLabelProperty;\n filter._optionsLabelTranslate = this._optionsLabelTranslate;\n filter._multiselect = this._multiselect;\n filter._dropdownClassName = this._dropdownClassName;\n filter._autocompleteOpenOnFocus = this._autocompleteOpenOnFocus;\n filter._autocompleteInlineSearch = this._autocompleteInlineSearch;\n }\n}\n\nexport class FilterLookupEnumDescriptor<Enum, TableModel> extends FilterLookupDescriptor<EnumValue, TableModel, undefined, never, never> {\n private readonly _enum: EnumDescriptor<Enum>;\n private readonly _optionEnumValues: EnumValue[];\n private readonly _nameAsValue: boolean = false;\n\n constructor(property: string, enumDesc: EnumDescriptor<Enum>, options?: Array<Enum>) {\n super(property, {\n dataProvider: new LookupDataProviderInst<EnumValue, undefined, never, never, undefined, undefined>(undefined, undefined),\n optionsValueProperty: 'value'\n });\n this._filterType = FilterTypeEnum.LookupEnum;\n\n this._enum = enumDesc;\n\n this._optionEnumValues = Array.isArray(options)\n ? fromEnumValuesAsValueArray(this._enum.type, options, this._enum.nameAsValue, this._enum.i18nBaseKey ?? undefined)\n : fromEnumConstantsAsValueArray(this._enum.type, this._enum.nameAsValue, this._enum.i18nBaseKey ?? undefined);\n\n this.withLookup(() => of(this._optionEnumValues));\n this.withOptionsLabelProperty('title', this._enum.i18nBaseKey !== null);\n }\n\n public get enum() {\n return this._enum;\n }\n\n /**\n * Sets lookup as autocomplete instead of dropdown.\n *\n * @param opts Additional options.\n */\n public override asAutocomplete(opts?: FilterLookupAutocompleteOptsType): this {\n super.asAutocomplete({\n ...opts,\n openOnFocus: opts?.openOnFocus ?? true,\n inlineSearch: opts?.inlineSearch ?? true\n });\n return this;\n }\n\n public withMultiselectEnum(multiselect = true): FilterLookupEnumDescriptor<Enum, TableModel> {\n return super.withMultiselect(multiselect) as FilterLookupEnumDescriptor<Enum, TableModel>;\n }\n\n /**\n * Do not use, use `withDefaultFilterEnum` instead.\n */\n public override withDefaultFilter(): this {\n throw new CommonsInternalError(`withDefaultFilter on FilterLookupEnumDescriptor should not be used. Use withDefaultFilterEnum instead.`, {name: 'FilterDescriptorError'});\n }\n\n /**\n * Sets default filter value for filter.\n *\n * @param value Value(s) for default filter.\n * @param matchMode Match mode for default filter.\n */\n public withDefaultFilterEnum(value: EnumConstantType | EnumConstantType[] | undefined, matchMode: FilterMatchModeExtendedType): this {\n let defaultOptionValue: any | any[];\n if (Array.isArray(value)) {\n defaultOptionValue = this._nameAsValue ? value.map(value => getEnumConstantName(this.enum.type, value)) : value;\n } else if (value != null) {\n defaultOptionValue = this._nameAsValue ? getEnumConstantName(this.enum.type, value) : value;\n }\n\n if (defaultOptionValue != null) {\n let option: any | any[];\n if (Array.isArray(defaultOptionValue)) {\n option = defaultOptionValue.map(value => this._optionEnumValues.find(o => o.value === value));\n } else {\n option = this._optionEnumValues.find(o => o.value === defaultOptionValue);\n }\n\n let defaultFilterValue: any | any[];\n if (Array.isArray(option)) {\n defaultFilterValue = this._optionsValueProperty ? option.map(value => value[this._optionsValueProperty as keyof object]) : option;\n } else {\n defaultFilterValue = this._optionsValueProperty ? option[this._optionsValueProperty as keyof object] : option;\n }\n\n super.withDefaultFilter(defaultFilterValue, matchMode);\n }\n return this;\n }\n\n /**\n * Copies current descriptor to a new instance.\n */\n public override copy(): FilterLookupEnumDescriptor<Enum, TableModel> {\n const field = new FilterLookupEnumDescriptor<Enum, TableModel>(this._property, this.enum, []);\n this.copyFieldsTo(field);\n return field;\n }\n}\n","import {LookupDataProviderInst} from '@mediusinc/mng-commons/form/api';\n\nimport {FilterGenericProperty} from '../models/filter-generic-property.model';\n\nexport class FilterGenericDescriptor {\n protected _propertyLookup: LookupDataProviderInst<FilterGenericProperty>;\n protected _valueLookup?: LookupDataProviderInst<string, any, any, 'field'>;\n\n constructor(propertyLookupDataProvider: LookupDataProviderInst<FilterGenericProperty>) {\n this._propertyLookup = propertyLookupDataProvider;\n }\n\n public get propertyLookup() {\n return this._propertyLookup;\n }\n\n public get valueLookup() {\n return this._valueLookup;\n }\n\n public withValueLookup(valueLookup: LookupDataProviderInst<string, any, any, 'field'>): this {\n this._valueLookup = valueLookup;\n return this;\n }\n\n public copy(): FilterGenericDescriptor {\n const descriptor = new FilterGenericDescriptor(this._propertyLookup);\n descriptor._valueLookup = this._valueLookup;\n return descriptor;\n }\n}\n","// descriptors\nexport * from './descriptors/filter.descriptor';\nexport * from './descriptors/filter-lookup.descriptor';\nexport * from './descriptors/filter-generic.descriptor';\n\n// models\nexport * from './models/filter.model';\nexport * from './models/filter-generic-property.model';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;IAAY,eAOX;AAPD,CAAA,UAAY,cAAc,EAAA;AACtB,IAAA,cAAA,CAAA,cAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA,GAAA,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.loadingInput = input(false, { alias: 'loading', transform: booleanAttribute });
609
609
  this.disabledInput = input(false, { alias: 'disabled', transform: booleanAttribute });
610
+ this.allowInput = input(false, { transform: booleanAttribute });
610
611
  this.appendTo = input('body');
612
+ this.inlineSearch = input(false, { transform: booleanAttribute });
613
+ this.searchTrim = input(undefined);
611
614
  this.valueChange = output();
612
615
  this.blur = output();
613
616
  this.primeDropdown = viewChild(Dropdown);
@@ -625,6 +628,8 @@ class DropdownComponent {
625
628
  this.items = signal([]);
626
629
  this.firstTimeSettingItems = true;
627
630
  this.isDropdownPanelShown = false;
631
+ // used with custom input functionality
632
+ this.valueSuggestionProviderSubscription = null;
628
633
  this.optionsLabelProperty = computed(() => {
629
634
  if (this.optionsLabelTranslate()) {
630
635
  // setup translation properties
@@ -671,18 +676,31 @@ class DropdownComponent {
671
676
  }), switchMap(items => this.transformItems(items)), takeUntilDestroyed())
672
677
  .subscribe({
673
678
  next: res => {
674
- this.items.set(res);
679
+ this.setItems(res);
680
+ if (this.inlineSearch()) {
681
+ if (!this.valueSuggestionResultCacheSubject) {
682
+ this.valueSuggestionResultCacheSubject = new ReplaySubject(1);
683
+ }
684
+ this.valueSuggestionResultCacheSubject?.next(res);
685
+ }
675
686
  this._loading.set(false);
676
- this.selectFirstItem();
687
+ this.selectFirstItem(); // only selects first item if selectFirstItemInput is set accordingly
677
688
  this.adjustValueOnItemsValuePropertyTypeMismatch();
678
689
  },
679
690
  error: err => {
680
- this.items.set([]);
691
+ this.setItems([]);
681
692
  this._loading.set(false);
682
693
  const error = fromSubscribeError(err, 'DropdownComponentError');
683
694
  this.logger.log(error, getErrorLogLevel(error));
684
695
  }
685
696
  });
697
+ effect(() => {
698
+ if (this.allowInput()) {
699
+ if (this.optionsLabelProperty() && !this.optionsValueProperty()) {
700
+ throw new CommonsInternalError(`allowInput is not supported when optionsLabelProperty is defined but optionsValueProperty is missing. Set optionsValueProperty to enable allowInput.`);
701
+ }
702
+ }
703
+ });
686
704
  }
687
705
  registerOnChange(fn) {
688
706
  this.onChangeFn = fn;
@@ -705,7 +723,9 @@ class DropdownComponent {
705
723
  this.adjustValueOnItemsValuePropertyTypeMismatch(true);
706
724
  }
707
725
  onDropdownBlur(event) {
708
- if (this.isDropdownPanelShown) {
726
+ // if allowCustomInput is enabled, the input element might still be in focus with the
727
+ // dropdown panel hidden - that's why the !this.allowCustomInput() check is needed
728
+ if (this.isDropdownPanelShown && !this.allowInput()) {
709
729
  // ignore this blur event
710
730
  return;
711
731
  }
@@ -720,6 +740,103 @@ class DropdownComponent {
720
740
  if (!this.changeValueOnBlur()) {
721
741
  this.propagateValueChange(event.value);
722
742
  }
743
+ if (this.allowInput()) {
744
+ const optionsLabelProperty = this.optionsLabelProperty();
745
+ let query = undefined;
746
+ if (typeof event?.value === 'string' && event?.value.trim() === '') {
747
+ return;
748
+ }
749
+ else if (typeof event.value === 'string') {
750
+ query = this.trimValue(event.value);
751
+ }
752
+ this.valueSuggestionProviderSubscription?.unsubscribe();
753
+ if (this.dataProvider()) {
754
+ if (!this.inlineSearch()) {
755
+ const params = {
756
+ limit: 10
757
+ };
758
+ if (optionsLabelProperty) {
759
+ params.sort = [{ property: optionsLabelProperty }];
760
+ }
761
+ if (query && query.length > 0 && optionsLabelProperty) {
762
+ params.filters = {
763
+ [optionsLabelProperty]: {
764
+ value: query,
765
+ matchMode: FilterMatchMode.StartsWith
766
+ }
767
+ };
768
+ }
769
+ this.valueSuggestionProviderSubscription = this.getLookup(params, query)
770
+ .pipe(takeUntilDestroyed(this.destroyRef))
771
+ .subscribe({
772
+ next: items => {
773
+ this.setItems(items);
774
+ },
775
+ error: err => {
776
+ this.setItems([]);
777
+ const error = fromSubscribeError(err, 'DropdownComponentError', {
778
+ search: query,
779
+ params: params
780
+ });
781
+ this.logger.log(error, getErrorLogLevel(error));
782
+ }
783
+ });
784
+ }
785
+ else if (this.valueSuggestionResultCacheSubject) {
786
+ this.valueSuggestionProviderSubscription = this.valueSuggestionResultCacheSubject.pipe(take(1)).subscribe(result => {
787
+ this.setItems(result, query);
788
+ });
789
+ }
790
+ }
791
+ else if (this.options().length > 0) {
792
+ this.setItems(this.options(), query);
793
+ }
794
+ }
795
+ }
796
+ /**
797
+ * Sets the items in the dropdown. If a query is provided, the items will be filtered by the query (using a 'starts with' filter).
798
+ *
799
+ * @param items The items to set.
800
+ * @param [query] The query to filter the items by.
801
+ */
802
+ setItems(items, query) {
803
+ if (this.allowInput()) {
804
+ if (items.length > 0) {
805
+ // items can either be objects (with optionsValueProperty specifying a string property) or strings
806
+ if (typeof items[0] === 'object') {
807
+ if (!this.optionsValueProperty()) {
808
+ throw new CommonsInternalError(`allowInput is not supported when optionValueProperty is not set and the dropdown items are of type object. Set optionsValueProperty to enable allowInput.`);
809
+ }
810
+ if (typeof items[0]?.[this.optionsValueProperty()] !== 'string') {
811
+ throw new CommonsInternalError(`allowInput is only supported when the value property (specified with optionsValueProperty) is of type string.`);
812
+ }
813
+ }
814
+ else if (!(typeof items[0] === 'string' && !this.optionsLabelProperty() && !this.optionsValueProperty())) {
815
+ throw new CommonsInternalError(`'allowInput' is only supported for items of type string or object. For object types, ensure that the 'optionsValueProperty' is specified and represents a property of type string.`);
816
+ }
817
+ }
818
+ }
819
+ if (query) {
820
+ const queryLowerCase = query?.toLowerCase() ?? '';
821
+ const filteredItems = items.filter(i => {
822
+ let itemLabel = i;
823
+ const optionsLabelProperty = this.optionsLabelProperty();
824
+ if (optionsLabelProperty && typeof i === 'object') {
825
+ itemLabel = i[optionsLabelProperty];
826
+ }
827
+ if (itemLabel == null) {
828
+ return queryLowerCase == null || !queryLowerCase.length;
829
+ }
830
+ if (typeof itemLabel !== 'string') {
831
+ itemLabel = itemLabel.toString();
832
+ }
833
+ return itemLabel.toLowerCase().startsWith(queryLowerCase);
834
+ });
835
+ this.items.set([...filteredItems]);
836
+ }
837
+ else {
838
+ this.items.set([...items]);
839
+ }
723
840
  }
724
841
  onDropdownPanelShow() {
725
842
  this.isDropdownPanelShown = true;
@@ -793,7 +910,7 @@ class DropdownComponent {
793
910
  }
794
911
  }
795
912
  else if (typeof this.items()[0][optionsValueProp] !== typeof this._value) {
796
- // types dont match, search and compare by string
913
+ // types don't match, search and compare by string
797
914
  const selectedOption = this.items().find(i => i[optionsValueProp] != null && i[optionsValueProp].toString() === this._value.toString());
798
915
  if (selectedOption) {
799
916
  this.ngModelValue.set(selectedOption[optionsValueProp]);
@@ -811,12 +928,44 @@ class DropdownComponent {
811
928
  this.onChangeFn(value);
812
929
  this.valueChange.emit(value);
813
930
  }
931
+ /**
932
+ * Gets the lookup from the data provider.
933
+ *
934
+ * @param params The parameters to pass to the lookup.
935
+ * @param [query] The search query to filter the items by.
936
+ */
937
+ getLookup(params, query) {
938
+ const dataProvider = this.dataProvider();
939
+ if (dataProvider) {
940
+ return toObservable(dataProvider.lookup(params, this.dataProviderService, query)).pipe(switchMap(res => {
941
+ return of(res ?? []);
942
+ }));
943
+ }
944
+ return of([]);
945
+ }
946
+ /**
947
+ * Trims the leading and/or trailing whitespace from the given value based on the search trimming mode.
948
+ *
949
+ * @param value - The value to be trimmed.
950
+ */
951
+ trimValue(value) {
952
+ switch (this.searchTrim()) {
953
+ case 'start':
954
+ return value?.trimStart();
955
+ case 'end':
956
+ return value?.trimEnd();
957
+ case 'both':
958
+ return value?.trim();
959
+ default:
960
+ return value;
961
+ }
962
+ }
814
963
  static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: DropdownComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
815
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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 }, appendTo: { classPropertyName: "appendTo", publicName: "appendTo", 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]=\"appendTo()\">\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", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "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$2.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "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", "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: 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
964
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.0.5", 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 }, 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: "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 [editable]=\"allowInput()\"\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]=\"appendTo()\">\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", "loadingIcon", "filterPlaceholder", "filterLocale", "variant", "inputId", "dataKey", "filterBy", "filterFields", "autofocus", "resetFilterOnHide", "checkmark", "dropdownIcon", "loading", "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$2.MultiSelect, selector: "p-multiSelect", inputs: ["id", "ariaLabel", "style", "styleClass", "panelStyle", "panelStyleClass", "inputId", "disabled", "readonly", "group", "filter", "filterPlaceHolder", "filterLocale", "overlayVisible", "tabindex", "variant", "appendTo", "dataKey", "name", "ariaLabelledBy", "displaySelectedLabel", "maxSelectedLabels", "selectionLimit", "selectedItemsLabel", "showToggleAll", "emptyFilterMessage", "emptyMessage", "resetFilterOnHide", "dropdownIcon", "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", "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: 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"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
816
965
  }
817
966
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.5", ngImport: i0, type: DropdownComponent, decorators: [{
818
967
  type: Component,
819
- 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]=\"appendTo()\">\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" }]
968
+ 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 [editable]=\"allowInput()\"\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]=\"appendTo()\">\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" }]
820
969
  }], ctorParameters: () => [] });
821
970
 
822
971
  const NUMBER_RANGE_VALUE_ACCESSOR = {