@clr/angular 18.0.0-beta.2 → 18.0.0-beta.3
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/fesm2022/clr-angular-accordion.mjs +1 -1
- package/fesm2022/clr-angular-accordion.mjs.map +1 -1
- package/fesm2022/clr-angular-button.mjs +5 -5
- package/fesm2022/clr-angular-button.mjs.map +1 -1
- package/fesm2022/clr-angular-data-datagrid.mjs +10 -10
- package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -1
- package/fesm2022/clr-angular-data.mjs +11 -9102
- package/fesm2022/clr-angular-data.mjs.map +1 -1
- package/fesm2022/clr-angular-emphasis.mjs +12 -778
- package/fesm2022/clr-angular-emphasis.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-combobox.mjs +4 -4
- package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-common.mjs +8 -6
- package/fesm2022/clr-angular-forms-common.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-datepicker.mjs +5 -5
- package/fesm2022/clr-angular-forms-datepicker.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-file-input.mjs +8 -6
- package/fesm2022/clr-angular-forms-file-input.mjs.map +1 -1
- package/fesm2022/clr-angular-forms.mjs +68 -8460
- package/fesm2022/clr-angular-forms.mjs.map +1 -1
- package/fesm2022/clr-angular-layout-tabs.mjs +1 -1
- package/fesm2022/clr-angular-layout-tabs.mjs.map +1 -1
- package/fesm2022/clr-angular-layout.mjs +15 -2057
- package/fesm2022/clr-angular-layout.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-common.mjs +1 -1
- package/fesm2022/clr-angular-popover-common.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-signpost.mjs +4 -4
- package/fesm2022/clr-angular-popover-signpost.mjs.map +1 -1
- package/fesm2022/clr-angular-popover-tooltip.mjs +4 -4
- package/fesm2022/clr-angular-popover-tooltip.mjs.map +1 -1
- package/fesm2022/clr-angular-popover.mjs +12 -2326
- package/fesm2022/clr-angular-popover.mjs.map +1 -1
- package/fesm2022/clr-angular-stepper.mjs +1 -1
- package/fesm2022/clr-angular-stepper.mjs.map +1 -1
- package/fesm2022/clr-angular-utils.mjs +4 -439
- package/fesm2022/clr-angular-utils.mjs.map +1 -1
- package/fesm2022/clr-angular.mjs +94 -38683
- package/fesm2022/clr-angular.mjs.map +1 -1
- package/package.json +2 -2
- package/types/clr-angular-accordion.d.ts +1 -1
- package/types/clr-angular-button.d.ts +1 -1
- package/types/clr-angular-data-datagrid.d.ts +23 -23
- package/types/clr-angular-data.d.ts +4 -2126
- package/types/clr-angular-emphasis.d.ts +4 -220
- package/types/clr-angular-forms-combobox.d.ts +1 -1
- package/types/clr-angular-forms-datepicker.d.ts +1 -1
- package/types/clr-angular-forms.d.ts +26 -2078
- package/types/clr-angular-layout-tabs.d.ts +1 -1
- package/types/clr-angular-layout.d.ts +6 -463
- package/types/clr-angular-popover-common.d.ts +1 -1
- package/types/clr-angular-popover-signpost.d.ts +1 -1
- package/types/clr-angular-popover-tooltip.d.ts +1 -1
- package/types/clr-angular-popover.d.ts +7 -593
- package/types/clr-angular-stepper.d.ts +1 -1
- package/types/clr-angular-utils.d.ts +5 -162
- package/types/clr-angular.d.ts +22 -10270
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
2
2
|
import * as i0 from '@angular/core';
|
|
3
|
-
import { Injectable, EventEmitter, Output, Input, Directive, NgModule, TemplateRef, ViewChild, Component, ElementRef, HostListener, HostBinding,
|
|
3
|
+
import { Injectable, EventEmitter, Output, Input, Directive, NgModule, TemplateRef, ViewChild, Component, ElementRef, HostListener, HostBinding, InjectionToken, PLATFORM_ID, DOCUMENT, Inject, Optional, ContentChildren, SkipSelf, Renderer2 } from '@angular/core';
|
|
4
4
|
import { CommonModule, isPlatformBrowser } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/animations';
|
|
6
6
|
import { animation, style, animate, state, transition, trigger, useAnimation } from '@angular/animations';
|
|
7
|
+
export * from '@clr/angular/utils/loading';
|
|
8
|
+
export * from '@clr/angular/utils/conditional';
|
|
7
9
|
import { Subject, fromEvent, Observable, isObservable, of } from 'rxjs';
|
|
8
|
-
import { ClrLoadingState as ClrLoadingState$1 } from '@clr/angular/utils/loading';
|
|
9
10
|
import { takeUntil } from 'rxjs/operators';
|
|
10
11
|
import * as i1 from '@angular/cdk/a11y';
|
|
11
12
|
import { CdkTrapFocus } from '@angular/cdk/a11y';
|
|
@@ -698,442 +699,6 @@ function slide(direction) {
|
|
|
698
699
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
699
700
|
*/
|
|
700
701
|
|
|
701
|
-
/*
|
|
702
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
703
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
704
|
-
* This software is released under MIT license.
|
|
705
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
706
|
-
*/
|
|
707
|
-
/**
|
|
708
|
-
* This is an abstract class because we need it to still be a valid token for dependency injection after transpiling.
|
|
709
|
-
* This does not mean you should extend it, simply implementing it is fine.
|
|
710
|
-
*/
|
|
711
|
-
class LoadingListener {
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
/*
|
|
715
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
716
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
717
|
-
* This software is released under MIT license.
|
|
718
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
719
|
-
*/
|
|
720
|
-
var ClrLoadingState;
|
|
721
|
-
(function (ClrLoadingState) {
|
|
722
|
-
ClrLoadingState[ClrLoadingState["DEFAULT"] = 0] = "DEFAULT";
|
|
723
|
-
ClrLoadingState[ClrLoadingState["LOADING"] = 1] = "LOADING";
|
|
724
|
-
ClrLoadingState[ClrLoadingState["SUCCESS"] = 2] = "SUCCESS";
|
|
725
|
-
ClrLoadingState[ClrLoadingState["ERROR"] = 3] = "ERROR";
|
|
726
|
-
})(ClrLoadingState || (ClrLoadingState = {}));
|
|
727
|
-
class ClrLoading {
|
|
728
|
-
// We find the first parent that handles something loading
|
|
729
|
-
constructor(listener) {
|
|
730
|
-
this.listener = listener;
|
|
731
|
-
this._loadingState = ClrLoadingState.DEFAULT;
|
|
732
|
-
}
|
|
733
|
-
get loadingState() {
|
|
734
|
-
return this._loadingState;
|
|
735
|
-
}
|
|
736
|
-
set loadingState(value) {
|
|
737
|
-
if (value === true) {
|
|
738
|
-
value = ClrLoadingState.LOADING;
|
|
739
|
-
}
|
|
740
|
-
else if (!value) {
|
|
741
|
-
value = ClrLoadingState.DEFAULT;
|
|
742
|
-
}
|
|
743
|
-
if (value === this._loadingState) {
|
|
744
|
-
return;
|
|
745
|
-
}
|
|
746
|
-
this._loadingState = value;
|
|
747
|
-
if (this.listener) {
|
|
748
|
-
this.listener.loadingStateChange(value);
|
|
749
|
-
}
|
|
750
|
-
}
|
|
751
|
-
ngOnDestroy() {
|
|
752
|
-
this.loadingState = ClrLoadingState.DEFAULT;
|
|
753
|
-
}
|
|
754
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrLoading, deps: [{ token: LoadingListener, optional: true }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
755
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrLoading, isStandalone: false, selector: "[clrLoading]", inputs: { loadingState: ["clrLoading", "loadingState"] }, ngImport: i0 }); }
|
|
756
|
-
}
|
|
757
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrLoading, decorators: [{
|
|
758
|
-
type: Directive,
|
|
759
|
-
args: [{
|
|
760
|
-
selector: '[clrLoading]',
|
|
761
|
-
standalone: false,
|
|
762
|
-
}]
|
|
763
|
-
}], ctorParameters: () => [{ type: LoadingListener, decorators: [{
|
|
764
|
-
type: Optional
|
|
765
|
-
}] }], propDecorators: { loadingState: [{
|
|
766
|
-
type: Input,
|
|
767
|
-
args: ['clrLoading']
|
|
768
|
-
}] } });
|
|
769
|
-
|
|
770
|
-
/*
|
|
771
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
772
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
773
|
-
* This software is released under MIT license.
|
|
774
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
775
|
-
*/
|
|
776
|
-
const CLR_LOADING_DIRECTIVES = [ClrLoading];
|
|
777
|
-
class ClrLoadingModule {
|
|
778
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrLoadingModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
779
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrLoadingModule, declarations: [ClrLoading], imports: [CommonModule], exports: [ClrLoading] }); }
|
|
780
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrLoadingModule, imports: [CommonModule] }); }
|
|
781
|
-
}
|
|
782
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrLoadingModule, decorators: [{
|
|
783
|
-
type: NgModule,
|
|
784
|
-
args: [{
|
|
785
|
-
imports: [CommonModule],
|
|
786
|
-
declarations: [CLR_LOADING_DIRECTIVES],
|
|
787
|
-
exports: [CLR_LOADING_DIRECTIVES],
|
|
788
|
-
}]
|
|
789
|
-
}] });
|
|
790
|
-
|
|
791
|
-
/*
|
|
792
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
793
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
794
|
-
* This software is released under MIT license.
|
|
795
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
796
|
-
*/
|
|
797
|
-
|
|
798
|
-
/*
|
|
799
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
800
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
801
|
-
* This software is released under MIT license.
|
|
802
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
803
|
-
*/
|
|
804
|
-
let activeCounter = 0;
|
|
805
|
-
const IF_ACTIVE_ID = new InjectionToken('IF_ACTIVE_ID');
|
|
806
|
-
function tokenFactory() {
|
|
807
|
-
return ++activeCounter;
|
|
808
|
-
}
|
|
809
|
-
const IF_ACTIVE_ID_PROVIDER = {
|
|
810
|
-
provide: IF_ACTIVE_ID,
|
|
811
|
-
useFactory: tokenFactory,
|
|
812
|
-
};
|
|
813
|
-
/*********
|
|
814
|
-
* @class IfActiveService
|
|
815
|
-
*
|
|
816
|
-
* @description
|
|
817
|
-
* An injectable service used by IfActive structural directives and the components that implement IfActive in their
|
|
818
|
-
* templates. It holds the value of the current state and provides an Observable that both the directive and the
|
|
819
|
-
* implementing component can subscribe to in order to take action on current value changes.
|
|
820
|
-
*
|
|
821
|
-
*/
|
|
822
|
-
class IfActiveService {
|
|
823
|
-
constructor() {
|
|
824
|
-
/********
|
|
825
|
-
* @property _currentChange
|
|
826
|
-
*
|
|
827
|
-
* @description
|
|
828
|
-
* A RXJS Subject that updates and provides subscriptions to for the current current state of a component template
|
|
829
|
-
* implemting the IfActive structural directive.
|
|
830
|
-
*
|
|
831
|
-
*/
|
|
832
|
-
this._currentChange = new Subject();
|
|
833
|
-
}
|
|
834
|
-
/*********
|
|
835
|
-
*
|
|
836
|
-
* @description
|
|
837
|
-
* A getter function that provides an observable for the _current Subject.
|
|
838
|
-
*
|
|
839
|
-
*/
|
|
840
|
-
get currentChange() {
|
|
841
|
-
return this._currentChange.asObservable();
|
|
842
|
-
}
|
|
843
|
-
/*********
|
|
844
|
-
*
|
|
845
|
-
* @description
|
|
846
|
-
* A property that gets/sets the current state of _current for this instance of IfActive structural directive.
|
|
847
|
-
* And, broadcasts the new value to all subscribers.
|
|
848
|
-
*
|
|
849
|
-
*/
|
|
850
|
-
get current() {
|
|
851
|
-
return this._current;
|
|
852
|
-
}
|
|
853
|
-
set current(value) {
|
|
854
|
-
if (this._current !== value) {
|
|
855
|
-
this._current = value;
|
|
856
|
-
this._currentChange.next(value);
|
|
857
|
-
}
|
|
858
|
-
}
|
|
859
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IfActiveService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
860
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IfActiveService }); }
|
|
861
|
-
}
|
|
862
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IfActiveService, decorators: [{
|
|
863
|
-
type: Injectable
|
|
864
|
-
}] });
|
|
865
|
-
|
|
866
|
-
/*
|
|
867
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
868
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
869
|
-
* This software is released under MIT license.
|
|
870
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
871
|
-
*/
|
|
872
|
-
/**********
|
|
873
|
-
*
|
|
874
|
-
* @class ClrIfActive
|
|
875
|
-
*
|
|
876
|
-
* @description
|
|
877
|
-
* A structural directive that controls whether or not the associated TemplateRef is instantiated or not.
|
|
878
|
-
* It makes use of a Component instance level service: IfActiveService to maintain state between itself and
|
|
879
|
-
* the component using it in the component template.
|
|
880
|
-
*
|
|
881
|
-
*/
|
|
882
|
-
class ClrIfActive {
|
|
883
|
-
constructor(ifActiveService, id, template, container) {
|
|
884
|
-
this.ifActiveService = ifActiveService;
|
|
885
|
-
this.id = id;
|
|
886
|
-
this.template = template;
|
|
887
|
-
this.container = container;
|
|
888
|
-
/**********
|
|
889
|
-
* @property activeChange
|
|
890
|
-
*
|
|
891
|
-
* @description
|
|
892
|
-
* An event emitter that emits when the active property is set to allow for 2way binding when the directive is
|
|
893
|
-
* used with de-structured / de-sugared syntax.
|
|
894
|
-
*
|
|
895
|
-
*/
|
|
896
|
-
this.activeChange = new EventEmitter(false);
|
|
897
|
-
this.wasActive = false;
|
|
898
|
-
this.checkAndUpdateView(ifActiveService.current);
|
|
899
|
-
this.subscription = ifActiveService.currentChange.subscribe(newCurrentId => {
|
|
900
|
-
this.checkAndUpdateView(newCurrentId);
|
|
901
|
-
});
|
|
902
|
-
}
|
|
903
|
-
/**
|
|
904
|
-
* @description
|
|
905
|
-
* A property that gets/sets IfActiveService.active with value.
|
|
906
|
-
*
|
|
907
|
-
*/
|
|
908
|
-
get active() {
|
|
909
|
-
return this.ifActiveService.current === this.id;
|
|
910
|
-
}
|
|
911
|
-
set active(value) {
|
|
912
|
-
if (value) {
|
|
913
|
-
this.ifActiveService.current = this.id;
|
|
914
|
-
}
|
|
915
|
-
}
|
|
916
|
-
ngOnDestroy() {
|
|
917
|
-
this.subscription.unsubscribe();
|
|
918
|
-
}
|
|
919
|
-
/**
|
|
920
|
-
* @description
|
|
921
|
-
* Function that takes a any value and either created an embedded view for the associated ViewContainerRef or,
|
|
922
|
-
* Clears all views from the ViewContainerRef
|
|
923
|
-
*/
|
|
924
|
-
updateView(value) {
|
|
925
|
-
if (value) {
|
|
926
|
-
this.container.createEmbeddedView(this.template);
|
|
927
|
-
}
|
|
928
|
-
else {
|
|
929
|
-
this.container.clear();
|
|
930
|
-
}
|
|
931
|
-
}
|
|
932
|
-
checkAndUpdateView(currentId) {
|
|
933
|
-
const isNowActive = currentId === this.id;
|
|
934
|
-
// only emit if the new active state is changed since last time.
|
|
935
|
-
if (isNowActive !== this.wasActive) {
|
|
936
|
-
this.updateView(isNowActive);
|
|
937
|
-
this.activeChange.emit(isNowActive);
|
|
938
|
-
this.wasActive = isNowActive;
|
|
939
|
-
}
|
|
940
|
-
}
|
|
941
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfActive, deps: [{ token: IfActiveService }, { token: IF_ACTIVE_ID }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
942
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrIfActive, isStandalone: true, selector: "[clrIfActive]", inputs: { active: ["clrIfActive", "active"] }, outputs: { activeChange: "clrIfActiveChange" }, ngImport: i0 }); }
|
|
943
|
-
}
|
|
944
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfActive, decorators: [{
|
|
945
|
-
type: Directive,
|
|
946
|
-
args: [{
|
|
947
|
-
selector: '[clrIfActive]',
|
|
948
|
-
}]
|
|
949
|
-
}], ctorParameters: () => [{ type: IfActiveService }, { type: undefined, decorators: [{
|
|
950
|
-
type: Inject,
|
|
951
|
-
args: [IF_ACTIVE_ID]
|
|
952
|
-
}] }, { type: i0.TemplateRef }, { type: i0.ViewContainerRef }], propDecorators: { activeChange: [{
|
|
953
|
-
type: Output,
|
|
954
|
-
args: ['clrIfActiveChange']
|
|
955
|
-
}], active: [{
|
|
956
|
-
type: Input,
|
|
957
|
-
args: ['clrIfActive']
|
|
958
|
-
}] } });
|
|
959
|
-
|
|
960
|
-
/*
|
|
961
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
962
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
963
|
-
* This software is released under MIT license.
|
|
964
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
965
|
-
*/
|
|
966
|
-
class IfExpandService {
|
|
967
|
-
constructor() {
|
|
968
|
-
this.expandable = 0;
|
|
969
|
-
this.hasExpandTemplate = false;
|
|
970
|
-
this._loading = false;
|
|
971
|
-
this._expanded = false;
|
|
972
|
-
this._expandChange = new Subject();
|
|
973
|
-
}
|
|
974
|
-
get loading() {
|
|
975
|
-
return this._loading;
|
|
976
|
-
}
|
|
977
|
-
set loading(value) {
|
|
978
|
-
value = !!value;
|
|
979
|
-
if (value !== this._loading) {
|
|
980
|
-
this._loading = value;
|
|
981
|
-
}
|
|
982
|
-
}
|
|
983
|
-
get expanded() {
|
|
984
|
-
return this._expanded;
|
|
985
|
-
}
|
|
986
|
-
set expanded(value) {
|
|
987
|
-
value = !!value;
|
|
988
|
-
if (value !== this._expanded) {
|
|
989
|
-
this._expanded = value;
|
|
990
|
-
this._expandChange.next(value);
|
|
991
|
-
}
|
|
992
|
-
}
|
|
993
|
-
get expandChange() {
|
|
994
|
-
return this._expandChange.asObservable();
|
|
995
|
-
}
|
|
996
|
-
toggle() {
|
|
997
|
-
this.expanded = !this._expanded;
|
|
998
|
-
}
|
|
999
|
-
loadingStateChange(state) {
|
|
1000
|
-
switch (state) {
|
|
1001
|
-
case ClrLoadingState$1.LOADING:
|
|
1002
|
-
this.loading = true;
|
|
1003
|
-
break;
|
|
1004
|
-
default:
|
|
1005
|
-
this.loading = false;
|
|
1006
|
-
break;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IfExpandService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
1010
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IfExpandService }); }
|
|
1011
|
-
}
|
|
1012
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: IfExpandService, decorators: [{
|
|
1013
|
-
type: Injectable
|
|
1014
|
-
}] });
|
|
1015
|
-
|
|
1016
|
-
/*
|
|
1017
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
1018
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
1019
|
-
* This software is released under MIT license.
|
|
1020
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
1021
|
-
*/
|
|
1022
|
-
class ClrIfExpanded {
|
|
1023
|
-
constructor(template, container, el, renderer, expand) {
|
|
1024
|
-
this.template = template;
|
|
1025
|
-
this.container = container;
|
|
1026
|
-
this.el = el;
|
|
1027
|
-
this.renderer = renderer;
|
|
1028
|
-
this.expand = expand;
|
|
1029
|
-
this.expandedChange = new EventEmitter(true);
|
|
1030
|
-
this._expanded = false;
|
|
1031
|
-
/**
|
|
1032
|
-
* Subscriptions to all the services and queries changes
|
|
1033
|
-
*/
|
|
1034
|
-
this._subscriptions = [];
|
|
1035
|
-
this._subscriptions.push(expand.expandChange.subscribe(() => {
|
|
1036
|
-
this.updateView();
|
|
1037
|
-
this.expandedChange.emit(expand.expanded);
|
|
1038
|
-
}));
|
|
1039
|
-
expand.hasExpandTemplate = !!template;
|
|
1040
|
-
}
|
|
1041
|
-
get expanded() {
|
|
1042
|
-
return this._expanded;
|
|
1043
|
-
}
|
|
1044
|
-
set expanded(value) {
|
|
1045
|
-
if (typeof value === 'boolean') {
|
|
1046
|
-
this.expand.expanded = value;
|
|
1047
|
-
this._expanded = value;
|
|
1048
|
-
}
|
|
1049
|
-
}
|
|
1050
|
-
ngOnInit() {
|
|
1051
|
-
this.expand.expandable++;
|
|
1052
|
-
this.updateView();
|
|
1053
|
-
}
|
|
1054
|
-
ngOnDestroy() {
|
|
1055
|
-
this.expand.expandable--;
|
|
1056
|
-
this._subscriptions.forEach((sub) => sub.unsubscribe());
|
|
1057
|
-
}
|
|
1058
|
-
updateView() {
|
|
1059
|
-
if (this.expand.expanded && this.container.length !== 0) {
|
|
1060
|
-
return;
|
|
1061
|
-
}
|
|
1062
|
-
if (this.template) {
|
|
1063
|
-
if (this.expand.expanded) {
|
|
1064
|
-
// Should we pass a context? I don't see anything useful to pass right now,
|
|
1065
|
-
// but we can come back to it in the future as a solution for additional features.
|
|
1066
|
-
this.container.createEmbeddedView(this.template);
|
|
1067
|
-
}
|
|
1068
|
-
else {
|
|
1069
|
-
// TODO: Move when we move the animation logic to Datagrid Row Expand
|
|
1070
|
-
// We clear before the animation is over. Not ideal, but doing better would involve a much heavier
|
|
1071
|
-
// process for very little gain. Once Angular animations are dynamic enough, we should be able to
|
|
1072
|
-
// get the optimal behavior.
|
|
1073
|
-
this.container.clear();
|
|
1074
|
-
}
|
|
1075
|
-
}
|
|
1076
|
-
else {
|
|
1077
|
-
try {
|
|
1078
|
-
// If we don't have a template ref, we fallback to a crude display: none for now.
|
|
1079
|
-
if (this.expand.expanded) {
|
|
1080
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', null);
|
|
1081
|
-
}
|
|
1082
|
-
else {
|
|
1083
|
-
this.renderer.setStyle(this.el.nativeElement, 'display', 'none');
|
|
1084
|
-
}
|
|
1085
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
1086
|
-
}
|
|
1087
|
-
catch (e) {
|
|
1088
|
-
// We catch the case where clrIfExpanded was put on a non-DOM element, and we just do nothing
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
}
|
|
1092
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfExpanded, deps: [{ token: i0.TemplateRef, optional: true }, { token: i0.ViewContainerRef }, { token: i0.ElementRef }, { token: i0.Renderer2 }, { token: IfExpandService }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
1093
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrIfExpanded, isStandalone: true, selector: "[clrIfExpanded]", inputs: { expanded: ["clrIfExpanded", "expanded"] }, outputs: { expandedChange: "clrIfExpandedChange" }, ngImport: i0 }); }
|
|
1094
|
-
}
|
|
1095
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrIfExpanded, decorators: [{
|
|
1096
|
-
type: Directive,
|
|
1097
|
-
args: [{
|
|
1098
|
-
selector: '[clrIfExpanded]',
|
|
1099
|
-
}]
|
|
1100
|
-
}], ctorParameters: () => [{ type: i0.TemplateRef, decorators: [{
|
|
1101
|
-
type: Optional
|
|
1102
|
-
}] }, { type: i0.ViewContainerRef }, { type: i0.ElementRef }, { type: i0.Renderer2 }, { type: IfExpandService }], propDecorators: { expandedChange: [{
|
|
1103
|
-
type: Output,
|
|
1104
|
-
args: ['clrIfExpandedChange']
|
|
1105
|
-
}], expanded: [{
|
|
1106
|
-
type: Input,
|
|
1107
|
-
args: ['clrIfExpanded']
|
|
1108
|
-
}] } });
|
|
1109
|
-
|
|
1110
|
-
/*
|
|
1111
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
1112
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
1113
|
-
* This software is released under MIT license.
|
|
1114
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
1115
|
-
*/
|
|
1116
|
-
const CONDITIONAL_DIRECTIVES = [ClrIfActive, ClrIfExpanded];
|
|
1117
|
-
class ClrConditionalModule {
|
|
1118
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrConditionalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
1119
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrConditionalModule, imports: [CommonModule, ClrIfActive, ClrIfExpanded], exports: [ClrIfActive, ClrIfExpanded] }); }
|
|
1120
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrConditionalModule, imports: [CommonModule] }); }
|
|
1121
|
-
}
|
|
1122
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrConditionalModule, decorators: [{
|
|
1123
|
-
type: NgModule,
|
|
1124
|
-
args: [{
|
|
1125
|
-
imports: [CommonModule, CONDITIONAL_DIRECTIVES],
|
|
1126
|
-
exports: [CONDITIONAL_DIRECTIVES],
|
|
1127
|
-
}]
|
|
1128
|
-
}] });
|
|
1129
|
-
|
|
1130
|
-
/*
|
|
1131
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
1132
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
1133
|
-
* This software is released under MIT license.
|
|
1134
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
1135
|
-
*/
|
|
1136
|
-
|
|
1137
702
|
/*
|
|
1138
703
|
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
1139
704
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -2505,5 +2070,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2505
2070
|
* Generated bundle index. Do not edit.
|
|
2506
2071
|
*/
|
|
2507
2072
|
|
|
2508
|
-
export { ArrowKeyDirection, BASIC_FOCUSABLE_ITEM_PROVIDER, BaseExpandableAnimation, BasicFocusableItem,
|
|
2073
|
+
export { ArrowKeyDirection, BASIC_FOCUSABLE_ITEM_PROVIDER, BaseExpandableAnimation, BasicFocusableItem, CdkDragModule, CdkDragModule_CdkDrag, CdkTrapFocusModule, CdkTrapFocusModule_CdkTrapFocus, ClrCommonStringsService, ClrDestroyService, ClrExpandableAnimation, ClrExpandableAnimationDirective, ClrExpandableAnimationModule, ClrFocusOnViewInit, ClrFocusOnViewInitModule, ClrHostWrappingModule, ClrKeyFocus, ClrKeyFocusItem, ClrKeyFocusModule, ClrOutsideClickModule, ClrPosition, ClrRovingTabindex, ClrStandaloneCdkTrapFocus, ClrTemplateRefModule, DATEPICKER_ENABLE_BREAKPOINT, DomAdapter, EXPANDABLE_ANIMATION_DIRECTIVES, EXTRA_LARGE_BREAKPOINT, EmptyAnchor, FOCUS_ON_VIEW_INIT, FOCUS_ON_VIEW_INIT_DIRECTIVES, FOCUS_SERVICE_PROVIDER, FocusService, FocusableItem, HostWrapper, Keys, LARGE_BREAKPOINT, Linkers, MEDIUM_BREAKPOINT, MOCK_DOM_ADAPTER_PROVIDER, MockDomAdapter, MockFocusableItem, OUSTIDE_CLICK_DIRECTIVES, OompaLoompa, OutsideClick, SMALL_BREAKPOINT, ScrollingService, TemplateRefContainer, WillyWonka, assertNever, clrFocusServiceFactory, collapse, commonStringsDefault, customFocusableItemProvider, defaultAnimationTiming, defaultExpandAnimation, fade, fadeSlide, isBooleanAttributeSet, isKeyEitherLetterOrNumber, preventArrowKeyScroll, slide, triggerAllFormControlValidation, uniqueIdFactory, wrapObservable };
|
|
2509
2074
|
//# sourceMappingURL=clr-angular-utils.mjs.map
|