@porscheinformatik/clr-addons 12.8.4 → 12.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3392,6 +3392,7 @@ class ClrTreetable {
3392
3392
  }
3393
3393
  set ttRows(items) {
3394
3394
  this._ttRows = items;
3395
+ this.hasActionOverflow = false;
3395
3396
  this.initClickableRows();
3396
3397
  this.initEmpty();
3397
3398
  this.initActionOverflow();
@@ -3415,9 +3416,14 @@ class ClrTreetable {
3415
3416
  });
3416
3417
  }
3417
3418
  setActionOverflow(hasActionOverflow) {
3418
- this.hasActionOverflow = this.hasActionOverflow || hasActionOverflow;
3419
- if (this.hasActionOverflow) {
3420
- this._ttRows.forEach(ttRow => (ttRow.showActionOverflow = true));
3419
+ if (!this.hasActionOverflow && hasActionOverflow) {
3420
+ this.hasActionOverflow = true;
3421
+ // setTimeout needed, as this method needs to change data which shouldn't be changed anymore in this cycle
3422
+ setTimeout(() => {
3423
+ if (this.hasActionOverflow) {
3424
+ this._ttRows.forEach(ttRow => (ttRow.showActionOverflow = true));
3425
+ }
3426
+ });
3421
3427
  }
3422
3428
  }
3423
3429
  ngOnDestroy() {
@@ -4814,6 +4820,185 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
4814
4820
  }]
4815
4821
  }] });
4816
4822
 
4823
+ /*
4824
+ * Copyright (c) 2016-2022 VMware, Inc. All Rights Reserved.
4825
+ * This software is released under MIT license.
4826
+ * The full license information can be found in LICENSE in the root directory of this project.
4827
+ */
4828
+ /**
4829
+ * Generic accessor for deep object properties
4830
+ * that can be specified as simple dot-separated strings.
4831
+ */
4832
+ class NestedProperty {
4833
+ constructor(prop) {
4834
+ this.prop = prop;
4835
+ if (prop.indexOf('.') >= 0) {
4836
+ this.splitProp = prop.split('.');
4837
+ }
4838
+ }
4839
+ // Safe getter for a deep object property, will not throw an error but return
4840
+ // undefined if one of the intermediate properties is null or undefined.
4841
+ getPropValue(item) {
4842
+ if (this.splitProp) {
4843
+ let value = item;
4844
+ for (const nestedProp of this.splitProp) {
4845
+ if (value === null ||
4846
+ typeof value === 'undefined' ||
4847
+ typeof value[nestedProp] === 'undefined') {
4848
+ return undefined;
4849
+ }
4850
+ value = value[nestedProp];
4851
+ }
4852
+ return value;
4853
+ }
4854
+ else {
4855
+ return item[this.prop];
4856
+ }
4857
+ }
4858
+ }
4859
+
4860
+ class ClrDateFilterComponent {
4861
+ constructor(filterContainer, commonStrings) {
4862
+ this.commonStrings = commonStrings;
4863
+ this.filterValueChange = new EventEmitter();
4864
+ /**
4865
+ * Internal values and accessor
4866
+ */
4867
+ this._from = null;
4868
+ this._to = null;
4869
+ /**
4870
+ * The Observable required as part of the Filter interface
4871
+ */
4872
+ this._changes = new Subject();
4873
+ filterContainer.setFilter(this);
4874
+ }
4875
+ set property(value) {
4876
+ this.nestedProp = new NestedProperty(value);
4877
+ }
4878
+ get maxPlaceholderValue() {
4879
+ return this.maxPlaceholder || this.commonStrings.keys.maxValue;
4880
+ }
4881
+ get minPlaceholderValue() {
4882
+ return this.minPlaceholder || this.commonStrings.keys.minValue;
4883
+ }
4884
+ set value(values) {
4885
+ if (Array.isArray(values)) {
4886
+ if (values && (values[0] !== this._from || values[1] !== this._to)) {
4887
+ if (typeof values[0] === 'object') {
4888
+ this._from = values[0];
4889
+ }
4890
+ else {
4891
+ this._from = null;
4892
+ }
4893
+ if (typeof values[1] === 'object') {
4894
+ this._to = values[1];
4895
+ }
4896
+ else {
4897
+ this._to = null;
4898
+ }
4899
+ this._changes.next(values);
4900
+ }
4901
+ }
4902
+ }
4903
+ get from() {
4904
+ return this._from;
4905
+ }
4906
+ set from(from) {
4907
+ if (typeof from === 'object' && from !== this._from) {
4908
+ if (from && typeof from.setHours === 'function') {
4909
+ from.setHours(0, 0, 0, 0); // set from-date to start of day
4910
+ }
4911
+ this._from = from;
4912
+ this._changes.next([this._from, this._to]);
4913
+ this.filterValueChange.emit([this._from, this._to]);
4914
+ }
4915
+ }
4916
+ get to() {
4917
+ return this._to;
4918
+ }
4919
+ set to(to) {
4920
+ if (typeof to === 'object' && to !== this._to) {
4921
+ if (to && typeof to.setHours === 'function') {
4922
+ to.setHours(23, 59, 59, 999); // set to-date to end of day
4923
+ }
4924
+ this._to = to;
4925
+ this._changes.next([this._from, this._to]);
4926
+ this.filterValueChange.emit([this._from, this._to]);
4927
+ }
4928
+ }
4929
+ /**
4930
+ * Indicates if the filter is currently active, (at least one input is set)
4931
+ */
4932
+ isActive() {
4933
+ return this._from !== null || this._to !== null;
4934
+ }
4935
+ accepts(item) {
4936
+ const propValue = this.nestedProp.getPropValue(item);
4937
+ if (propValue === undefined) {
4938
+ return false;
4939
+ }
4940
+ if (this._from !== null && (!(propValue instanceof Date) || propValue.getTime() < this._from.getTime())) {
4941
+ return false;
4942
+ }
4943
+ if (this._to !== null && (!(propValue instanceof Date) || propValue.getTime() > this._to.getTime())) {
4944
+ return false;
4945
+ }
4946
+ return true;
4947
+ }
4948
+ // We do not want to expose the Subject itself, but the Observable which is read-only
4949
+ get changes() {
4950
+ return this._changes.asObservable();
4951
+ }
4952
+ get state() {
4953
+ return {
4954
+ property: this.nestedProp,
4955
+ from: this._from,
4956
+ to: this._to,
4957
+ };
4958
+ }
4959
+ equals(other) {
4960
+ return other === this;
4961
+ }
4962
+ ngOnDestroy() {
4963
+ throw new Error('Method not implemented.');
4964
+ }
4965
+ }
4966
+ 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 });
4967
+ 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"] }] });
4968
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterComponent, decorators: [{
4969
+ type: Component,
4970
+ 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: [""] }]
4971
+ }], ctorParameters: function () { return [{ type: i1.ClrDatagridFilter }, { type: i1.ClrCommonStringsService }]; }, propDecorators: { property: [{
4972
+ type: Input,
4973
+ args: ['clrProperty']
4974
+ }], maxPlaceholder: [{
4975
+ type: Input,
4976
+ args: ['clrFilterMaxPlaceholder']
4977
+ }], minPlaceholder: [{
4978
+ type: Input,
4979
+ args: ['clrFilterMinPlaceholder']
4980
+ }], value: [{
4981
+ type: Input,
4982
+ args: ['clrFilterValue']
4983
+ }], filterValueChange: [{
4984
+ type: Output,
4985
+ args: ['clrFilterValueChange']
4986
+ }] } });
4987
+
4988
+ class ClrDateFilterModule {
4989
+ }
4990
+ ClrDateFilterModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
4991
+ ClrDateFilterModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, declarations: [ClrDateFilterComponent], imports: [ClarityModule, CommonModule, FormsModule], exports: [ClrDateFilterComponent] });
4992
+ ClrDateFilterModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, imports: [[ClarityModule, CommonModule, FormsModule]] });
4993
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrDateFilterModule, decorators: [{
4994
+ type: NgModule,
4995
+ args: [{
4996
+ imports: [ClarityModule, CommonModule, FormsModule],
4997
+ declarations: [ClrDateFilterComponent],
4998
+ exports: [ClrDateFilterComponent],
4999
+ }]
5000
+ }] });
5001
+
4817
5002
  /*
4818
5003
  * Copyright (c) 2018-2022 Porsche Informatik. All Rights Reserved.
4819
5004
  * This software is released under MIT license.
@@ -4850,7 +5035,8 @@ ClrAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
4850
5035
  ClrFormModule,
4851
5036
  ClrDropdownOverflowModule,
4852
5037
  ClrDatagridStatePersistenceModule,
4853
- ClrEnumFilterModule] });
5038
+ ClrEnumFilterModule,
5039
+ ClrDateFilterModule] });
4854
5040
  ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrAddonsModule, imports: [ClrViewEditSectionModule,
4855
5041
  ClrPagerModule,
4856
5042
  ClrDotPagerModule,
@@ -4879,7 +5065,8 @@ ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
4879
5065
  ClrFormModule,
4880
5066
  ClrDropdownOverflowModule,
4881
5067
  ClrDatagridStatePersistenceModule,
4882
- ClrEnumFilterModule] });
5068
+ ClrEnumFilterModule,
5069
+ ClrDateFilterModule] });
4883
5070
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImport: i0, type: ClrAddonsModule, decorators: [{
4884
5071
  type: NgModule,
4885
5072
  args: [{
@@ -4913,6 +5100,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.11", ngImpo
4913
5100
  ClrDropdownOverflowModule,
4914
5101
  ClrDatagridStatePersistenceModule,
4915
5102
  ClrEnumFilterModule,
5103
+ ClrDateFilterModule,
4916
5104
  ],
4917
5105
  }]
4918
5106
  }] });
@@ -5522,5 +5710,5 @@ const ClrAddonsIconShapes = {
5522
5710
  * Generated bundle index. Do not edit.
5523
5711
  */
5524
5712
 
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 };
5713
+ 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
5714
  //# sourceMappingURL=clr-addons.mjs.map