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