@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.
@@ -4814,6 +4814,185 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
4814
4814
  }]
4815
4815
  }] });
4816
4816
 
4817
+ /*
4818
+ * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
4819
+ * This software is released under MIT license.
4820
+ * The full license information can be found in LICENSE in the root directory of this project.
4821
+ */
4822
+ /**
4823
+ * Generic accessor for deep object properties
4824
+ * that can be specified as simple dot-separated strings.
4825
+ */
4826
+ class NestedProperty {
4827
+ constructor(prop) {
4828
+ this.prop = prop;
4829
+ if (prop.indexOf('.') >= 0) {
4830
+ this.splitProp = prop.split('.');
4831
+ }
4832
+ }
4833
+ // Safe getter for a deep object property, will not throw an error but return
4834
+ // undefined if one of the intermediate properties is null or undefined.
4835
+ getPropValue(item) {
4836
+ if (this.splitProp) {
4837
+ let value = item;
4838
+ for (const nestedProp of this.splitProp) {
4839
+ if (value === null ||
4840
+ typeof value === 'undefined' ||
4841
+ typeof value[nestedProp] === 'undefined') {
4842
+ return undefined;
4843
+ }
4844
+ value = value[nestedProp];
4845
+ }
4846
+ return value;
4847
+ }
4848
+ else {
4849
+ return item[this.prop];
4850
+ }
4851
+ }
4852
+ }
4853
+
4854
+ class ClrDateFilterComponent {
4855
+ constructor(filterContainer, commonStrings) {
4856
+ this.commonStrings = commonStrings;
4857
+ this.filterValueChange = new EventEmitter();
4858
+ /**
4859
+ * Internal values and accessor
4860
+ */
4861
+ this._from = null;
4862
+ this._to = null;
4863
+ /**
4864
+ * The Observable required as part of the Filter interface
4865
+ */
4866
+ this._changes = new Subject();
4867
+ filterContainer.setFilter(this);
4868
+ }
4869
+ set property(value) {
4870
+ this.nestedProp = new NestedProperty(value);
4871
+ }
4872
+ get maxPlaceholderValue() {
4873
+ return this.maxPlaceholder || this.commonStrings.keys.maxValue;
4874
+ }
4875
+ get minPlaceholderValue() {
4876
+ return this.minPlaceholder || this.commonStrings.keys.minValue;
4877
+ }
4878
+ set value(values) {
4879
+ if (Array.isArray(values)) {
4880
+ if (values && (values[0] !== this._from || values[1] !== this._to)) {
4881
+ if (typeof values[0] === 'object') {
4882
+ this._from = values[0];
4883
+ }
4884
+ else {
4885
+ this._from = null;
4886
+ }
4887
+ if (typeof values[1] === 'object') {
4888
+ this._to = values[1];
4889
+ }
4890
+ else {
4891
+ this._to = null;
4892
+ }
4893
+ this._changes.next(values);
4894
+ }
4895
+ }
4896
+ }
4897
+ get from() {
4898
+ return this._from;
4899
+ }
4900
+ set from(from) {
4901
+ if (typeof from === 'object' && from !== this._from) {
4902
+ if (from && typeof from.setHours === 'function') {
4903
+ from.setHours(0, 0, 0, 0); // set from-date to start of day
4904
+ }
4905
+ this._from = from;
4906
+ this._changes.next([this._from, this._to]);
4907
+ this.filterValueChange.emit([this._from, this._to]);
4908
+ }
4909
+ }
4910
+ get to() {
4911
+ return this._to;
4912
+ }
4913
+ set to(to) {
4914
+ if (typeof to === 'object' && to !== this._to) {
4915
+ if (to && typeof to.setHours === 'function') {
4916
+ to.setHours(23, 59, 59, 999); // set to-date to end of day
4917
+ }
4918
+ this._to = to;
4919
+ this._changes.next([this._from, this._to]);
4920
+ this.filterValueChange.emit([this._from, this._to]);
4921
+ }
4922
+ }
4923
+ /**
4924
+ * Indicates if the filter is currently active, (at least one input is set)
4925
+ */
4926
+ isActive() {
4927
+ return this._from !== null || this._to !== null;
4928
+ }
4929
+ accepts(item) {
4930
+ const propValue = this.nestedProp.getPropValue(item);
4931
+ if (propValue === undefined) {
4932
+ return false;
4933
+ }
4934
+ if (this._from !== null && (!(propValue instanceof Date) || propValue.getTime() < this._from.getTime())) {
4935
+ return false;
4936
+ }
4937
+ if (this._to !== null && (!(propValue instanceof Date) || propValue.getTime() > this._to.getTime())) {
4938
+ return false;
4939
+ }
4940
+ return true;
4941
+ }
4942
+ // We do not want to expose the Subject itself, but the Observable which is read-only
4943
+ get changes() {
4944
+ return this._changes.asObservable();
4945
+ }
4946
+ get state() {
4947
+ return {
4948
+ property: this.nestedProp,
4949
+ from: this._from,
4950
+ to: this._to,
4951
+ };
4952
+ }
4953
+ equals(other) {
4954
+ return other === this;
4955
+ }
4956
+ ngOnDestroy() {
4957
+ throw new Error('Method not implemented.');
4958
+ }
4959
+ }
4960
+ 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 });
4961
+ 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"] }] });
4962
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterComponent, decorators: [{
4963
+ type: Component,
4964
+ 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: [""] }]
4965
+ }], ctorParameters: function () { return [{ type: i1.ClrDatagridFilter }, { type: i1.ClrCommonStringsService }]; }, propDecorators: { property: [{
4966
+ type: Input,
4967
+ args: ['clrProperty']
4968
+ }], maxPlaceholder: [{
4969
+ type: Input,
4970
+ args: ['clrFilterMaxPlaceholder']
4971
+ }], minPlaceholder: [{
4972
+ type: Input,
4973
+ args: ['clrFilterMinPlaceholder']
4974
+ }], value: [{
4975
+ type: Input,
4976
+ args: ['clrFilterValue']
4977
+ }], filterValueChange: [{
4978
+ type: Output,
4979
+ args: ['clrFilterValueChange']
4980
+ }] } });
4981
+
4982
+ class ClrDateFilterModule {
4983
+ }
4984
+ ClrDateFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4985
+ ClrDateFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, declarations: [ClrDateFilterComponent], imports: [ClarityModule, CommonModule, FormsModule], exports: [ClrDateFilterComponent] });
4986
+ ClrDateFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, imports: [[ClarityModule, CommonModule, FormsModule]] });
4987
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, decorators: [{
4988
+ type: NgModule,
4989
+ args: [{
4990
+ imports: [ClarityModule, CommonModule, FormsModule],
4991
+ declarations: [ClrDateFilterComponent],
4992
+ exports: [ClrDateFilterComponent],
4993
+ }]
4994
+ }] });
4995
+
4817
4996
  /*
4818
4997
  * Copyright (c) 2018-2022 Porsche Informatik. All Rights Reserved.
4819
4998
  * This software is released under MIT license.
@@ -4850,7 +5029,8 @@ ClrAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
4850
5029
  ClrFormModule,
4851
5030
  ClrDropdownOverflowModule,
4852
5031
  ClrDatagridStatePersistenceModule,
4853
- ClrEnumFilterModule] });
5032
+ ClrEnumFilterModule,
5033
+ ClrDateFilterModule] });
4854
5034
  ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrAddonsModule, imports: [ClrViewEditSectionModule,
4855
5035
  ClrPagerModule,
4856
5036
  ClrDotPagerModule,
@@ -4879,7 +5059,8 @@ ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
4879
5059
  ClrFormModule,
4880
5060
  ClrDropdownOverflowModule,
4881
5061
  ClrDatagridStatePersistenceModule,
4882
- ClrEnumFilterModule] });
5062
+ ClrEnumFilterModule,
5063
+ ClrDateFilterModule] });
4883
5064
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrAddonsModule, decorators: [{
4884
5065
  type: NgModule,
4885
5066
  args: [{
@@ -4913,6 +5094,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
4913
5094
  ClrDropdownOverflowModule,
4914
5095
  ClrDatagridStatePersistenceModule,
4915
5096
  ClrEnumFilterModule,
5097
+ ClrDateFilterModule,
4916
5098
  ],
4917
5099
  }]
4918
5100
  }] });
@@ -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