@porscheinformatik/clr-addons 12.4.2 → 12.5.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.
- package/clr-addons.module.d.ts +2 -1
- package/datagrid-state-persistence/column-hidden-state-persistence.directive.d.ts +17 -0
- package/datagrid-state-persistence/datagrid-field.directive.d.ts +6 -0
- package/datagrid-state-persistence/datagrid-state-persistence.module.d.ts +9 -0
- package/datagrid-state-persistence/index.d.ts +4 -0
- package/datagrid-state-persistence/state-persistence-key.directive.d.ts +6 -0
- package/esm2020/clr-addons.module.mjs +7 -3
- package/esm2020/datagrid-state-persistence/column-hidden-state-persistence.directive.mjs +74 -0
- package/esm2020/datagrid-state-persistence/datagrid-field.directive.mjs +15 -0
- package/esm2020/datagrid-state-persistence/datagrid-state-persistence.module.mjs +18 -0
- package/esm2020/datagrid-state-persistence/index.mjs +5 -0
- package/esm2020/datagrid-state-persistence/state-persistence-key.directive.mjs +15 -0
- package/esm2020/index.mjs +2 -1
- package/fesm2015/clr-addons.mjs +115 -3
- package/fesm2015/clr-addons.mjs.map +1 -1
- package/fesm2020/clr-addons.mjs +111 -3
- package/fesm2020/clr-addons.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/package.json +1 -1
package/fesm2020/clr-addons.mjs
CHANGED
|
@@ -4562,6 +4562,111 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
4562
4562
|
}]
|
|
4563
4563
|
}] });
|
|
4564
4564
|
|
|
4565
|
+
class DatagridFieldDirective {
|
|
4566
|
+
}
|
|
4567
|
+
DatagridFieldDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DatagridFieldDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4568
|
+
DatagridFieldDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: DatagridFieldDirective, selector: "[clrDgField]", inputs: { clrDgField: "clrDgField" }, ngImport: i0 });
|
|
4569
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: DatagridFieldDirective, decorators: [{
|
|
4570
|
+
type: Directive,
|
|
4571
|
+
args: [{
|
|
4572
|
+
selector: '[clrDgField]',
|
|
4573
|
+
}]
|
|
4574
|
+
}], propDecorators: { clrDgField: [{
|
|
4575
|
+
type: Input
|
|
4576
|
+
}] } });
|
|
4577
|
+
|
|
4578
|
+
class StatePersistenceKeyDirective {
|
|
4579
|
+
}
|
|
4580
|
+
StatePersistenceKeyDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: StatePersistenceKeyDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
4581
|
+
StatePersistenceKeyDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: StatePersistenceKeyDirective, selector: "[clrStatePersistenceKey]", inputs: { clrStatePersistenceKey: "clrStatePersistenceKey" }, ngImport: i0 });
|
|
4582
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: StatePersistenceKeyDirective, decorators: [{
|
|
4583
|
+
type: Directive,
|
|
4584
|
+
args: [{
|
|
4585
|
+
selector: '[clrStatePersistenceKey]',
|
|
4586
|
+
}]
|
|
4587
|
+
}], propDecorators: { clrStatePersistenceKey: [{
|
|
4588
|
+
type: Input
|
|
4589
|
+
}] } });
|
|
4590
|
+
|
|
4591
|
+
class ColumnHiddenStatePersistenceDirective {
|
|
4592
|
+
constructor(columnDirective, statePersistenceKey, datagrid, hideableColumnDirective) {
|
|
4593
|
+
this.columnDirective = columnDirective;
|
|
4594
|
+
this.statePersistenceKey = statePersistenceKey;
|
|
4595
|
+
this.datagrid = datagrid;
|
|
4596
|
+
this.hideableColumnDirective = hideableColumnDirective;
|
|
4597
|
+
}
|
|
4598
|
+
ngOnInit() {
|
|
4599
|
+
if (this.statePersistenceKey?.clrStatePersistenceKey && this.columnDirective?.clrDgField) {
|
|
4600
|
+
/* set hidden states from local storage (if existing) */
|
|
4601
|
+
this.initHiddenState();
|
|
4602
|
+
/* listen to state changes and persist in local storage */
|
|
4603
|
+
this.hideableColumnDirective.hiddenChange.subscribe(hidden => {
|
|
4604
|
+
this.setHiddenState(hidden);
|
|
4605
|
+
});
|
|
4606
|
+
}
|
|
4607
|
+
}
|
|
4608
|
+
initHiddenState() {
|
|
4609
|
+
/* read grid state if existing */
|
|
4610
|
+
const persistedGridStateJson = localStorage.getItem(this.statePersistenceKey.clrStatePersistenceKey);
|
|
4611
|
+
if (persistedGridStateJson !== null) {
|
|
4612
|
+
const persistedGridState = JSON.parse(persistedGridStateJson);
|
|
4613
|
+
/* read column state if existing */
|
|
4614
|
+
const persistedColumnState = persistedGridState[this.columnDirective.clrDgField];
|
|
4615
|
+
if (persistedColumnState) {
|
|
4616
|
+
/* read column hidden state if existing */
|
|
4617
|
+
const persistedColumnHiddenState = persistedColumnState.hidden;
|
|
4618
|
+
if (persistedColumnHiddenState) {
|
|
4619
|
+
this.hideableColumnDirective.clrDgHidden = persistedColumnHiddenState === true;
|
|
4620
|
+
}
|
|
4621
|
+
}
|
|
4622
|
+
}
|
|
4623
|
+
}
|
|
4624
|
+
setHiddenState(hidden) {
|
|
4625
|
+
if (!this.datagrid?.detailService?.isOpen) {
|
|
4626
|
+
/* read grid state if existing */
|
|
4627
|
+
const persistedGridStateJson = localStorage.getItem(this.statePersistenceKey.clrStatePersistenceKey);
|
|
4628
|
+
let persistedGridState = {};
|
|
4629
|
+
if (persistedGridStateJson !== null) {
|
|
4630
|
+
persistedGridState = JSON.parse(persistedGridStateJson);
|
|
4631
|
+
}
|
|
4632
|
+
/* read column state if existing */
|
|
4633
|
+
let persistedColumnState = persistedGridState[this.columnDirective.clrDgField];
|
|
4634
|
+
if (!persistedColumnState) {
|
|
4635
|
+
persistedColumnState = {};
|
|
4636
|
+
persistedGridState[this.columnDirective.clrDgField] = persistedColumnState;
|
|
4637
|
+
}
|
|
4638
|
+
/* set column hidden state and persist in local storage */
|
|
4639
|
+
persistedColumnState.hidden = hidden;
|
|
4640
|
+
localStorage.setItem(this.statePersistenceKey.clrStatePersistenceKey, JSON.stringify(persistedGridState));
|
|
4641
|
+
}
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
ColumnHiddenStatePersistenceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ColumnHiddenStatePersistenceDirective, deps: [{ token: DatagridFieldDirective, optional: true }, { token: StatePersistenceKeyDirective, optional: true }, { token: i1.ClrDatagrid }, { token: i1.ClrDatagridHideableColumn }], target: i0.ɵɵFactoryTarget.Directive });
|
|
4645
|
+
ColumnHiddenStatePersistenceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.3.8", type: ColumnHiddenStatePersistenceDirective, selector: "[clrDgHideableColumn]", ngImport: i0 });
|
|
4646
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ColumnHiddenStatePersistenceDirective, decorators: [{
|
|
4647
|
+
type: Directive,
|
|
4648
|
+
args: [{
|
|
4649
|
+
selector: '[clrDgHideableColumn]',
|
|
4650
|
+
}]
|
|
4651
|
+
}], ctorParameters: function () { return [{ type: DatagridFieldDirective, decorators: [{
|
|
4652
|
+
type: Optional
|
|
4653
|
+
}] }, { type: StatePersistenceKeyDirective, decorators: [{
|
|
4654
|
+
type: Optional
|
|
4655
|
+
}] }, { type: i1.ClrDatagrid }, { type: i1.ClrDatagridHideableColumn }]; } });
|
|
4656
|
+
|
|
4657
|
+
class ClrDatagridStatePersistenceModule {
|
|
4658
|
+
}
|
|
4659
|
+
ClrDatagridStatePersistenceModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
4660
|
+
ClrDatagridStatePersistenceModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, declarations: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective], exports: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective] });
|
|
4661
|
+
ClrDatagridStatePersistenceModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule });
|
|
4662
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrDatagridStatePersistenceModule, decorators: [{
|
|
4663
|
+
type: NgModule,
|
|
4664
|
+
args: [{
|
|
4665
|
+
declarations: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective],
|
|
4666
|
+
exports: [ColumnHiddenStatePersistenceDirective, DatagridFieldDirective, StatePersistenceKeyDirective],
|
|
4667
|
+
}]
|
|
4668
|
+
}] });
|
|
4669
|
+
|
|
4565
4670
|
/*
|
|
4566
4671
|
* Copyright (c) 2018-2022 Porsche Informatik. All Rights Reserved.
|
|
4567
4672
|
* This software is released under MIT license.
|
|
@@ -4596,7 +4701,8 @@ ClrAddonsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version
|
|
|
4596
4701
|
ClrBrandAvatarModule,
|
|
4597
4702
|
ClrLocationBarModule,
|
|
4598
4703
|
ClrFormModule,
|
|
4599
|
-
ClrDropdownOverflowModule
|
|
4704
|
+
ClrDropdownOverflowModule,
|
|
4705
|
+
ClrDatagridStatePersistenceModule] });
|
|
4600
4706
|
ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrAddonsModule, imports: [ClrViewEditSectionModule,
|
|
4601
4707
|
ClrPagerModule,
|
|
4602
4708
|
ClrDotPagerModule,
|
|
@@ -4623,7 +4729,8 @@ ClrAddonsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version
|
|
|
4623
4729
|
ClrBrandAvatarModule,
|
|
4624
4730
|
ClrLocationBarModule,
|
|
4625
4731
|
ClrFormModule,
|
|
4626
|
-
ClrDropdownOverflowModule
|
|
4732
|
+
ClrDropdownOverflowModule,
|
|
4733
|
+
ClrDatagridStatePersistenceModule] });
|
|
4627
4734
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImport: i0, type: ClrAddonsModule, decorators: [{
|
|
4628
4735
|
type: NgModule,
|
|
4629
4736
|
args: [{
|
|
@@ -4655,6 +4762,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.3.8", ngImpor
|
|
|
4655
4762
|
ClrLocationBarModule,
|
|
4656
4763
|
ClrFormModule,
|
|
4657
4764
|
ClrDropdownOverflowModule,
|
|
4765
|
+
ClrDatagridStatePersistenceModule,
|
|
4658
4766
|
],
|
|
4659
4767
|
}]
|
|
4660
4768
|
}] });
|
|
@@ -5260,5 +5368,5 @@ const ClrAddonsIconShapes = {
|
|
|
5260
5368
|
* Generated bundle index. Do not edit.
|
|
5261
5369
|
*/
|
|
5262
5370
|
|
|
5263
|
-
export { ACShape, AcceptedBrands, AccessoriesShape, AccessoryPartsShape, AudiBrandShape, AwardWinnerPremiumShape, BlocksGroupForwardShape, BrochureShape, BundleForwardShape, BusinessCustomersCommercialShape, BusinessCustomersPrivateShape, 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, ClrDateTimeContainer, ClrDateTimeModule, ClrDotPager, ClrDotPagerModule, ClrDropdownOverflowDirective, ClrDropdownOverflowModule, 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, ConfiguratorCommercialShape, ConfiguratorPrivateShape, ConsumptionShape, ContactDealerShape, CupraBrandShape, CustomersCenterShape, DWABrandShape, DieselShape, DollarBillForwardShape, DollarBillShape, DriversAssistanceShape, EfficiencyShape, ElectricCarsServiceShape, ElectricCarsShape, ElectricityShape, EmissionShape, EnergyShape, EngineShape, ExpressServiceShape, ExteriorShape, FindACarShape, FleetServiceCommercialShape, FleetServicePrivateShape, GasCarsServiceShape, GasShape, HybridShape, 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, 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 };
|
|
5371
|
+
export { ACShape, AcceptedBrands, AccessoriesShape, AccessoryPartsShape, AudiBrandShape, AwardWinnerPremiumShape, BlocksGroupForwardShape, BrochureShape, BundleForwardShape, BusinessCustomersCommercialShape, BusinessCustomersPrivateShape, 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, 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, DollarBillShape, DriversAssistanceShape, EfficiencyShape, ElectricCarsServiceShape, ElectricCarsShape, ElectricityShape, EmissionShape, EnergyShape, EngineShape, ExpressServiceShape, ExteriorShape, FindACarShape, FleetServiceCommercialShape, FleetServicePrivateShape, GasCarsServiceShape, GasShape, HybridShape, 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 };
|
|
5264
5372
|
//# sourceMappingURL=clr-addons.mjs.map
|