@porscheinformatik/clr-addons 12.8.4 → 12.9.0

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.
@@ -4804,6 +4804,185 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
4804
4804
  }]
4805
4805
  }] });
4806
4806
 
4807
+ /*
4808
+ * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
4809
+ * This software is released under MIT license.
4810
+ * The full license information can be found in LICENSE in the root directory of this project.
4811
+ */
4812
+ /**
4813
+ * Generic accessor for deep object properties
4814
+ * that can be specified as simple dot-separated strings.
4815
+ */
4816
+ class NestedProperty {
4817
+ constructor(prop) {
4818
+ this.prop = prop;
4819
+ if (prop.indexOf('.') >= 0) {
4820
+ this.splitProp = prop.split('.');
4821
+ }
4822
+ }
4823
+ // Safe getter for a deep object property, will not throw an error but return
4824
+ // undefined if one of the intermediate properties is null or undefined.
4825
+ getPropValue(item) {
4826
+ if (this.splitProp) {
4827
+ let value = item;
4828
+ for (const nestedProp of this.splitProp) {
4829
+ if (value === null ||
4830
+ typeof value === 'undefined' ||
4831
+ typeof value[nestedProp] === 'undefined') {
4832
+ return undefined;
4833
+ }
4834
+ value = value[nestedProp];
4835
+ }
4836
+ return value;
4837
+ }
4838
+ else {
4839
+ return item[this.prop];
4840
+ }
4841
+ }
4842
+ }
4843
+
4844
+ class ClrDateFilterComponent {
4845
+ constructor(filterContainer, commonStrings) {
4846
+ this.commonStrings = commonStrings;
4847
+ this.filterValueChange = new EventEmitter();
4848
+ /**
4849
+ * Internal values and accessor
4850
+ */
4851
+ this._from = null;
4852
+ this._to = null;
4853
+ /**
4854
+ * The Observable required as part of the Filter interface
4855
+ */
4856
+ this._changes = new Subject();
4857
+ filterContainer.setFilter(this);
4858
+ }
4859
+ set property(value) {
4860
+ this.nestedProp = new NestedProperty(value);
4861
+ }
4862
+ get maxPlaceholderValue() {
4863
+ return this.maxPlaceholder || this.commonStrings.keys.maxValue;
4864
+ }
4865
+ get minPlaceholderValue() {
4866
+ return this.minPlaceholder || this.commonStrings.keys.minValue;
4867
+ }
4868
+ set value(values) {
4869
+ if (Array.isArray(values)) {
4870
+ if (values && (values[0] !== this._from || values[1] !== this._to)) {
4871
+ if (typeof values[0] === 'object') {
4872
+ this._from = values[0];
4873
+ }
4874
+ else {
4875
+ this._from = null;
4876
+ }
4877
+ if (typeof values[1] === 'object') {
4878
+ this._to = values[1];
4879
+ }
4880
+ else {
4881
+ this._to = null;
4882
+ }
4883
+ this._changes.next(values);
4884
+ }
4885
+ }
4886
+ }
4887
+ get from() {
4888
+ return this._from;
4889
+ }
4890
+ set from(from) {
4891
+ if (typeof from === 'object' && from !== this._from) {
4892
+ if (from && typeof from.setHours === 'function') {
4893
+ from.setHours(0, 0, 0, 0); // set from-date to start of day
4894
+ }
4895
+ this._from = from;
4896
+ this._changes.next([this._from, this._to]);
4897
+ this.filterValueChange.emit([this._from, this._to]);
4898
+ }
4899
+ }
4900
+ get to() {
4901
+ return this._to;
4902
+ }
4903
+ set to(to) {
4904
+ if (typeof to === 'object' && to !== this._to) {
4905
+ if (to && typeof to.setHours === 'function') {
4906
+ to.setHours(23, 59, 59, 999); // set to-date to end of day
4907
+ }
4908
+ this._to = to;
4909
+ this._changes.next([this._from, this._to]);
4910
+ this.filterValueChange.emit([this._from, this._to]);
4911
+ }
4912
+ }
4913
+ /**
4914
+ * Indicates if the filter is currently active, (at least one input is set)
4915
+ */
4916
+ isActive() {
4917
+ return this._from !== null || this._to !== null;
4918
+ }
4919
+ accepts(item) {
4920
+ const propValue = this.nestedProp.getPropValue(item);
4921
+ if (propValue === undefined) {
4922
+ return false;
4923
+ }
4924
+ if (this._from !== null && (!(propValue instanceof Date) || propValue.getTime() < this._from.getTime())) {
4925
+ return false;
4926
+ }
4927
+ if (this._to !== null && (!(propValue instanceof Date) || propValue.getTime() > this._to.getTime())) {
4928
+ return false;
4929
+ }
4930
+ return true;
4931
+ }
4932
+ // We do not want to expose the Subject itself, but the Observable which is read-only
4933
+ get changes() {
4934
+ return this._changes.asObservable();
4935
+ }
4936
+ get state() {
4937
+ return {
4938
+ property: this.nestedProp,
4939
+ from: this._from,
4940
+ to: this._to,
4941
+ };
4942
+ }
4943
+ equals(other) {
4944
+ return other === this;
4945
+ }
4946
+ ngOnDestroy() {
4947
+ throw new Error('Method not implemented.');
4948
+ }
4949
+ }
4950
+ ClrDateFilterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterComponent, deps: [{ token: i1.ClrDatagridFilter }, { token: i1.ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component });
4951
+ ClrDateFilterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.3.11", type: ClrDateFilterComponent, selector: "clr-date-filter", inputs: { property: ["clrProperty", "property"], maxPlaceholder: ["clrFilterMaxPlaceholder", "maxPlaceholder"], minPlaceholder: ["clrFilterMinPlaceholder", "minPlaceholder"], value: ["clrFilterValue", "value"] }, outputs: { filterValueChange: "clrFilterValueChange" }, ngImport: i0, template: "<clr-date-container>\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n</clr-date-container>\n<clr-date-container>\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n</clr-date-container>\n", styles: [""], components: [{ type: i1.ClrDateContainer, selector: "clr-date-container", inputs: ["clrPosition"] }], directives: [{ type: i1.ClrDateInput, selector: "[clrDate]", inputs: ["placeholder", "clrDate", "min", "max", "disabled"], outputs: ["clrDateChange"] }] });
4952
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterComponent, decorators: [{
4953
+ type: Component,
4954
+ args: [{ selector: 'clr-date-filter', template: "<clr-date-container>\n <input\n #input_from\n type=\"date\"\n name=\"from\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"from\"\n [placeholder]=\"minPlaceholderValue\"\n [attr.aria-label]=\"minPlaceholderValue\"\n />\n</clr-date-container>\n<clr-date-container>\n <input\n type=\"date\"\n name=\"to\"\n class=\"datagrid-date-filter-input\"\n [(clrDate)]=\"to\"\n [placeholder]=\"maxPlaceholderValue\"\n [attr.aria-label]=\"maxPlaceholderValue\"\n />\n</clr-date-container>\n", styles: [""] }]
4955
+ }], ctorParameters: function () { return [{ type: i1.ClrDatagridFilter }, { type: i1.ClrCommonStringsService }]; }, propDecorators: { property: [{
4956
+ type: Input,
4957
+ args: ['clrProperty']
4958
+ }], maxPlaceholder: [{
4959
+ type: Input,
4960
+ args: ['clrFilterMaxPlaceholder']
4961
+ }], minPlaceholder: [{
4962
+ type: Input,
4963
+ args: ['clrFilterMinPlaceholder']
4964
+ }], value: [{
4965
+ type: Input,
4966
+ args: ['clrFilterValue']
4967
+ }], filterValueChange: [{
4968
+ type: Output,
4969
+ args: ['clrFilterValueChange']
4970
+ }] } });
4971
+
4972
+ class ClrDateFilterModule {
4973
+ }
4974
+ ClrDateFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4975
+ ClrDateFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, declarations: [ClrDateFilterComponent], imports: [ClarityModule, CommonModule, FormsModule], exports: [ClrDateFilterComponent] });
4976
+ ClrDateFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, imports: [[ClarityModule, CommonModule, FormsModule]] });
4977
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, decorators: [{
4978
+ type: NgModule,
4979
+ args: [{
4980
+ imports: [ClarityModule, CommonModule, FormsModule],
4981
+ declarations: [ClrDateFilterComponent],
4982
+ exports: [ClrDateFilterComponent],
4983
+ }]
4984
+ }] });
4985
+
4807
4986
  /*
4808
4987
  * Copyright (c) 2018-2022 Porsche Informatik. All Rights Reserved.
4809
4988
  * This software is released under MIT license.
@@ -4840,7 +5019,8 @@ ClrAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
4840
5019
  ClrFormModule,
4841
5020
  ClrDropdownOverflowModule,
4842
5021
  ClrDatagridStatePersistenceModule,
4843
- ClrEnumFilterModule] });
5022
+ ClrEnumFilterModule,
5023
+ ClrDateFilterModule] });
4844
5024
  ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrAddonsModule, imports: [ClrViewEditSectionModule,
4845
5025
  ClrPagerModule,
4846
5026
  ClrDotPagerModule,
@@ -4869,7 +5049,8 @@ ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
4869
5049
  ClrFormModule,
4870
5050
  ClrDropdownOverflowModule,
4871
5051
  ClrDatagridStatePersistenceModule,
4872
- ClrEnumFilterModule] });
5052
+ ClrEnumFilterModule,
5053
+ ClrDateFilterModule] });
4873
5054
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrAddonsModule, decorators: [{
4874
5055
  type: NgModule,
4875
5056
  args: [{
@@ -4903,6 +5084,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
4903
5084
  ClrDropdownOverflowModule,
4904
5085
  ClrDatagridStatePersistenceModule,
4905
5086
  ClrEnumFilterModule,
5087
+ ClrDateFilterModule,
4906
5088
  ],
4907
5089
  }]
4908
5090
  }] });
@@ -5522,5 +5704,5 @@ const ClrAddonsIconShapes = {
5522
5704
  * Generated bundle index. Do not edit.
5523
5705
  */
5524
5706
 
5525
- export { ACShape, AcceptedBrands, AccessoriesShape, AccessoryPartsShape, AudiBrandShape, AwardWinnerPremiumShape, BlocksGroupForwardShape, BrochureShape, BundleForwardShape, BusinessCustomersCommercialShape, BusinessCustomersPrivateShape, BusinessPartnerWithCar, CLR_BLANK_OPTION, CONTENT_PROVIDER, CalculatorForwardShape, CaliforniaServiceShape, CaliforniaSpecialistShape, CarPickupServiceShape, CarWashShape, CertifiedRepairShape, CertifiedRetailerShape, ClrActiveNotification, ClrAddonsIconShapes, ClrAddonsLabel, ClrAddonsModule, ClrAutocompleteOff, ClrAutocompleteOffModule, ClrBackButton, ClrBackButtonModule, ClrBrandAvatar, ClrBrandAvatarModule, ClrBreadcrumb, ClrBreadcrumbModule, ClrBreadcrumbService, ClrCollapseExpandSection, ClrCollapseExpandSectionModule, ClrContentPanel, ClrContentPanelContainer, ClrContentPanelContainerContent, ClrContentPanelContainerFooter, ClrContentPanelModule, ClrContentRef, ClrDataListPredefinedValidatorDirective, ClrDataListValidatorModule, ClrDataListValidators, ClrDatagridStatePersistenceModule, ClrDateTimeContainer, ClrDateTimeModule, ClrDotPager, ClrDotPagerModule, ClrDropdownOverflowDirective, ClrDropdownOverflowModule, ClrEnumFilterComponent, ClrEnumFilterModule, ClrFlowBar, ClrFlowBarModule, ClrFormModule, ClrGenericQuickList, ClrGenericQuickListModule, ClrHistory, ClrHistoryModule, ClrHistoryPinned, ClrHistoryService, ClrLetterAvatar, ClrLetterAvatarModule, ClrLocationBarModule, ClrMainNavGroup, ClrMainNavGroupItem, ClrMainNavGroupModule, ClrMaxNumeric, ClrMinNumeric, ClrMultilingualInput, ClrMultilingualInputValidators, ClrMultilingualModule, ClrMultilingualSelector, ClrMultilingualTextarea, ClrNotification, ClrNotificationModule, ClrNotificationRef, ClrNotificationService, ClrNumericField, ClrNumericFieldModule, ClrNumericFieldValidators, ClrPagedSearchResultList, ClrPagedSearchResultListModule, ClrPager, ClrPagerModule, ClrProgressSpinnerComponent, ClrProgressSpinnerModule, ClrQuickList, ClrQuickListModule, ClrRequiredAllMultilang, ClrRequiredOneMultilang, ClrSearchField, ClrSearchFieldModule, ClrTimeInput, ClrTreetable, ClrTreetableActionOverflow, ClrTreetableCell, ClrTreetableColumn, ClrTreetableModule, ClrTreetablePlaceholder, ClrTreetableRow, ClrViewEditSection, ClrViewEditSectionModule, ColumnHiddenStatePersistenceDirective, ConfiguratorCommercialShape, ConfiguratorPrivateShape, ConsumptionShape, ContactDealerShape, CupraBrandShape, CustomersCenterShape, DWABrandShape, DatagridFieldDirective, DieselShape, DollarBillForwardShape, DollarBillPartialShape, DriversAssistanceShape, EfficiencyShape, ElectricCarsServiceShape, ElectricCarsShape, ElectricityShape, EmissionShape, EnergyShape, EngineShape, ExpressServiceShape, ExteriorShape, ExternalPartForwardShape, FindACarShape, FleetServiceCommercialShape, FleetServicePrivateShape, GasCarsServiceShape, GasShape, HybridShape, InternalPartForwardShape, ItemsForwardShape, ItemsRecieveShape, LoadingVolumeShape, LocateShape, LocationBarComponent, LocationBarContentProvider, LocationBarNode, NewCarCommercialShape, NewCarPrivateShape, NewCarUtilityVehicleShape, NightServiceShape, NodeId, OffersShape, OnCallDutyShape, OpenSatShape, PaintMaterialForwardShape, PaintMaterialShape, PaintShopShape, PartNonStockForwardShape, PartsForwardShape, PartsNonStockShape, PartsShape, PayloadShape, PerformanceShape, PetrolShape, PlusServiceShape, PorscheBrandShape, PowerShape, PowerTrainShape, PriceTypeSwitchShape, QualifiedWorkshopShape, RoadsideAssistanceShape, RouteShape, SeatAirShape, SeatBrandShape, SeatShape, ServiceBellShape, ServiceShape, SizeShape, SkodaBrandShape, StatePersistenceKeyDirective, StockLocatorCommercialShape, StockLocatorPrivateShape, TaskAndAppointment, TaxiDealerShape, TextForward, TopcardShape, TouaregServiceShape, TransmissionAutomaticShape, TransmissionManualShape, TreetableCellRenderer, TreetableHeaderRenderer, TreetableMainRenderer, TreetableRowRenderer, UsedCarCommercialShape, UsedCarPrivateShape, VWBrandShape, VWNBrandShape, VWShape, VehicleConversionShape, View360Shape, VirtualRealityShape, WheelToWheelShape, WindscreenWashShape, WrenchForward, clrIconSVG, escapeHtml, escapeRegex };
5707
+ export { ACShape, AcceptedBrands, AccessoriesShape, AccessoryPartsShape, AudiBrandShape, AwardWinnerPremiumShape, BlocksGroupForwardShape, BrochureShape, BundleForwardShape, BusinessCustomersCommercialShape, BusinessCustomersPrivateShape, BusinessPartnerWithCar, CLR_BLANK_OPTION, CONTENT_PROVIDER, CalculatorForwardShape, CaliforniaServiceShape, CaliforniaSpecialistShape, CarPickupServiceShape, CarWashShape, CertifiedRepairShape, CertifiedRetailerShape, ClrActiveNotification, ClrAddonsIconShapes, ClrAddonsLabel, ClrAddonsModule, ClrAutocompleteOff, ClrAutocompleteOffModule, ClrBackButton, ClrBackButtonModule, ClrBrandAvatar, ClrBrandAvatarModule, ClrBreadcrumb, ClrBreadcrumbModule, ClrBreadcrumbService, ClrCollapseExpandSection, ClrCollapseExpandSectionModule, ClrContentPanel, ClrContentPanelContainer, ClrContentPanelContainerContent, ClrContentPanelContainerFooter, ClrContentPanelModule, ClrContentRef, ClrDataListPredefinedValidatorDirective, ClrDataListValidatorModule, ClrDataListValidators, ClrDatagridStatePersistenceModule, ClrDateFilterComponent, ClrDateFilterModule, ClrDateTimeContainer, ClrDateTimeModule, ClrDotPager, ClrDotPagerModule, ClrDropdownOverflowDirective, ClrDropdownOverflowModule, ClrEnumFilterComponent, ClrEnumFilterModule, ClrFlowBar, ClrFlowBarModule, ClrFormModule, ClrGenericQuickList, ClrGenericQuickListModule, ClrHistory, ClrHistoryModule, ClrHistoryPinned, ClrHistoryService, ClrLetterAvatar, ClrLetterAvatarModule, ClrLocationBarModule, ClrMainNavGroup, ClrMainNavGroupItem, ClrMainNavGroupModule, ClrMaxNumeric, ClrMinNumeric, ClrMultilingualInput, ClrMultilingualInputValidators, ClrMultilingualModule, ClrMultilingualSelector, ClrMultilingualTextarea, ClrNotification, ClrNotificationModule, ClrNotificationRef, ClrNotificationService, ClrNumericField, ClrNumericFieldModule, ClrNumericFieldValidators, ClrPagedSearchResultList, ClrPagedSearchResultListModule, ClrPager, ClrPagerModule, ClrProgressSpinnerComponent, ClrProgressSpinnerModule, ClrQuickList, ClrQuickListModule, ClrRequiredAllMultilang, ClrRequiredOneMultilang, ClrSearchField, ClrSearchFieldModule, ClrTimeInput, ClrTreetable, ClrTreetableActionOverflow, ClrTreetableCell, ClrTreetableColumn, ClrTreetableModule, ClrTreetablePlaceholder, ClrTreetableRow, ClrViewEditSection, ClrViewEditSectionModule, ColumnHiddenStatePersistenceDirective, ConfiguratorCommercialShape, ConfiguratorPrivateShape, ConsumptionShape, ContactDealerShape, CupraBrandShape, CustomersCenterShape, DWABrandShape, DatagridFieldDirective, DieselShape, DollarBillForwardShape, DollarBillPartialShape, DriversAssistanceShape, EfficiencyShape, ElectricCarsServiceShape, ElectricCarsShape, ElectricityShape, EmissionShape, EnergyShape, EngineShape, ExpressServiceShape, ExteriorShape, ExternalPartForwardShape, FindACarShape, FleetServiceCommercialShape, FleetServicePrivateShape, GasCarsServiceShape, GasShape, HybridShape, InternalPartForwardShape, ItemsForwardShape, ItemsRecieveShape, LoadingVolumeShape, LocateShape, LocationBarComponent, LocationBarContentProvider, LocationBarNode, NewCarCommercialShape, NewCarPrivateShape, NewCarUtilityVehicleShape, NightServiceShape, NodeId, OffersShape, OnCallDutyShape, OpenSatShape, PaintMaterialForwardShape, PaintMaterialShape, PaintShopShape, PartNonStockForwardShape, PartsForwardShape, PartsNonStockShape, PartsShape, PayloadShape, PerformanceShape, PetrolShape, PlusServiceShape, PorscheBrandShape, PowerShape, PowerTrainShape, PriceTypeSwitchShape, QualifiedWorkshopShape, RoadsideAssistanceShape, RouteShape, SeatAirShape, SeatBrandShape, SeatShape, ServiceBellShape, ServiceShape, SizeShape, SkodaBrandShape, StatePersistenceKeyDirective, StockLocatorCommercialShape, StockLocatorPrivateShape, TaskAndAppointment, TaxiDealerShape, TextForward, TopcardShape, TouaregServiceShape, TransmissionAutomaticShape, TransmissionManualShape, TreetableCellRenderer, TreetableHeaderRenderer, TreetableMainRenderer, TreetableRowRenderer, UsedCarCommercialShape, UsedCarPrivateShape, VWBrandShape, VWNBrandShape, VWShape, VehicleConversionShape, View360Shape, VirtualRealityShape, WheelToWheelShape, WindscreenWashShape, WrenchForward, clrIconSVG, escapeHtml, escapeRegex };
5526
5708
  //# sourceMappingURL=clr-addons.mjs.map