@rossigee/clarity-angular 18.2.1-fixed → 18.2.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.
- package/fesm2022/clr-angular-accordion.mjs +355 -0
- package/fesm2022/clr-angular-accordion.mjs.map +1 -0
- package/fesm2022/clr-angular-button.mjs +713 -0
- package/fesm2022/clr-angular-button.mjs.map +1 -0
- package/fesm2022/clr-angular-collapsible-panel.mjs +201 -0
- package/fesm2022/clr-angular-collapsible-panel.mjs.map +1 -0
- package/fesm2022/clr-angular-data-datagrid.mjs +7635 -0
- package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -0
- package/fesm2022/clr-angular-data-stack-view.mjs +442 -0
- package/fesm2022/clr-angular-data-stack-view.mjs.map +1 -0
- package/fesm2022/clr-angular-data-tree-view.mjs +1106 -0
- package/fesm2022/clr-angular-data-tree-view.mjs.map +1 -0
- package/fesm2022/clr-angular-data.mjs +40 -0
- package/fesm2022/clr-angular-data.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-alert.mjs +624 -0
- package/fesm2022/clr-angular-emphasis-alert.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-badge.mjs +69 -0
- package/fesm2022/clr-angular-emphasis-badge.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-common.mjs +25 -0
- package/fesm2022/clr-angular-emphasis-common.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis-label.mjs +105 -0
- package/fesm2022/clr-angular-emphasis-label.mjs.map +1 -0
- package/fesm2022/clr-angular-emphasis.mjs +41 -0
- package/fesm2022/clr-angular-emphasis.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-checkbox.mjs +270 -0
- package/fesm2022/clr-angular-forms-checkbox.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-combobox.mjs +1775 -0
- package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-common.mjs +1251 -0
- package/fesm2022/clr-angular-forms-common.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-datalist.mjs +263 -0
- package/fesm2022/clr-angular-forms-datalist.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-datepicker.mjs +3274 -0
- package/fesm2022/clr-angular-forms-datepicker.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-file-input.mjs +826 -0
- package/fesm2022/clr-angular-forms-file-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-input.mjs +153 -0
- package/fesm2022/clr-angular-forms-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-number-input.mjs +236 -0
- package/fesm2022/clr-angular-forms-number-input.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-password.mjs +233 -0
- package/fesm2022/clr-angular-forms-password.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-radio.mjs +231 -0
- package/fesm2022/clr-angular-forms-radio.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-range.mjs +186 -0
- package/fesm2022/clr-angular-forms-range.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-select.mjs +153 -0
- package/fesm2022/clr-angular-forms-select.mjs.map +1 -0
- package/fesm2022/clr-angular-forms-textarea.mjs +136 -0
- package/fesm2022/clr-angular-forms-textarea.mjs.map +1 -0
- package/fesm2022/clr-angular-forms.mjs +100 -0
- package/fesm2022/clr-angular-forms.mjs.map +1 -0
- package/fesm2022/clr-angular-icon.mjs +7397 -0
- package/fesm2022/clr-angular-icon.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-breadcrumbs.mjs +120 -0
- package/fesm2022/clr-angular-layout-breadcrumbs.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-main-container.mjs +100 -0
- package/fesm2022/clr-angular-layout-main-container.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-nav.mjs +582 -0
- package/fesm2022/clr-angular-layout-nav.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-tabs.mjs +807 -0
- package/fesm2022/clr-angular-layout-tabs.mjs.map +1 -0
- package/fesm2022/clr-angular-layout-vertical-nav.mjs +507 -0
- package/fesm2022/clr-angular-layout-vertical-nav.mjs.map +1 -0
- package/fesm2022/clr-angular-layout.mjs +44 -0
- package/fesm2022/clr-angular-layout.mjs.map +1 -0
- package/fesm2022/clr-angular-modal.mjs +617 -0
- package/fesm2022/clr-angular-modal.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-common.mjs +1082 -0
- package/fesm2022/clr-angular-popover-common.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-dropdown.mjs +492 -0
- package/fesm2022/clr-angular-popover-dropdown.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-signpost.mjs +494 -0
- package/fesm2022/clr-angular-popover-signpost.mjs.map +1 -0
- package/fesm2022/clr-angular-popover-tooltip.mjs +293 -0
- package/fesm2022/clr-angular-popover-tooltip.mjs.map +1 -0
- package/fesm2022/clr-angular-popover.mjs +41 -0
- package/fesm2022/clr-angular-popover.mjs.map +1 -0
- package/fesm2022/clr-angular-progress-progress-bars.mjs +217 -0
- package/fesm2022/clr-angular-progress-progress-bars.mjs.map +1 -0
- package/fesm2022/clr-angular-progress-spinner.mjs +132 -0
- package/fesm2022/clr-angular-progress-spinner.mjs.map +1 -0
- package/fesm2022/clr-angular-stepper.mjs +694 -0
- package/fesm2022/clr-angular-stepper.mjs.map +1 -0
- package/fesm2022/clr-angular-timeline.mjs +316 -0
- package/fesm2022/clr-angular-timeline.mjs.map +1 -0
- package/fesm2022/clr-angular-utils-conditional.mjs +351 -0
- package/fesm2022/clr-angular-utils-conditional.mjs.map +1 -0
- package/fesm2022/clr-angular-utils-loading.mjs +107 -0
- package/fesm2022/clr-angular-utils-loading.mjs.map +1 -0
- package/fesm2022/clr-angular-utils.mjs +2079 -0
- package/fesm2022/clr-angular-utils.mjs.map +1 -0
- package/fesm2022/clr-angular-wizard.mjs +3074 -0
- package/fesm2022/clr-angular-wizard.mjs.map +1 -0
- package/fesm2022/{rossigee-clarity-angular.mjs → clr-angular.mjs} +2 -2
- package/fesm2022/clr-angular.mjs.map +1 -0
- package/package.json +105 -103
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +69 -0
- package/schematics/ng-update/index.js.map +1 -0
- package/schematics/ng-update/migrations/css-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/css-migration.js +177 -0
- package/schematics/ng-update/migrations/css-migration.js.map +1 -0
- package/schematics/ng-update/migrations/import-migration.d.ts +4 -0
- package/schematics/ng-update/migrations/import-migration.js +187 -0
- package/schematics/ng-update/migrations/import-migration.js.map +1 -0
- package/schematics/ng-update/migrations/template-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/template-migration.js +261 -0
- package/schematics/ng-update/migrations/template-migration.js.map +1 -0
- package/schematics/ng-update/replacements/css-replacements.d.ts +17 -0
- package/schematics/ng-update/replacements/css-replacements.js +74 -0
- package/schematics/ng-update/replacements/css-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/import-replacements.d.ts +13 -0
- package/schematics/ng-update/replacements/import-replacements.js +108 -0
- package/schematics/ng-update/replacements/import-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/symbol-replacements.d.ts +12 -0
- package/schematics/ng-update/replacements/symbol-replacements.js +67 -0
- package/schematics/ng-update/replacements/symbol-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/template-replacements.d.ts +19 -0
- package/schematics/ng-update/replacements/template-replacements.js +57 -0
- package/schematics/ng-update/replacements/template-replacements.js.map +1 -0
- package/schematics/ng-update/tests/test-helpers.d.ts +6 -0
- package/schematics/ng-update/tests/test-helpers.js +34 -0
- package/schematics/ng-update/tests/test-helpers.js.map +1 -0
- package/schematics/ng-update/utils/file-visitor.d.ts +8 -0
- package/schematics/ng-update/utils/file-visitor.js +44 -0
- package/schematics/ng-update/utils/file-visitor.js.map +1 -0
- package/schematics/ng-update/utils/regexp-utils.d.ts +16 -0
- package/schematics/ng-update/utils/regexp-utils.js +34 -0
- package/schematics/ng-update/utils/regexp-utils.js.map +1 -0
- package/schematics/vitest.config.d.ts +2 -0
- package/schematics/vitest.config.js +17 -0
- package/schematics/vitest.config.js.map +1 -0
- package/types/clr-angular-accordion.d.ts +100 -0
- package/types/clr-angular-button.d.ts +169 -0
- package/types/clr-angular-collapsible-panel.d.ts +73 -0
- package/types/clr-angular-data-datagrid.d.ts +1843 -0
- package/types/clr-angular-data-stack-view.d.ts +87 -0
- package/types/clr-angular-data-tree-view.d.ts +229 -0
- package/types/clr-angular-data.d.ts +15 -0
- package/types/clr-angular-emphasis-alert.d.ts +175 -0
- package/types/clr-angular-emphasis-badge.d.ts +25 -0
- package/types/clr-angular-emphasis-common.d.ts +6 -0
- package/types/clr-angular-emphasis-label.d.ts +29 -0
- package/types/clr-angular-emphasis.d.ts +15 -0
- package/types/clr-angular-forms-checkbox.d.ts +69 -0
- package/types/clr-angular-forms-combobox.d.ts +353 -0
- package/types/clr-angular-forms-common.d.ts +339 -0
- package/types/clr-angular-forms-datalist.d.ts +59 -0
- package/types/clr-angular-forms-datepicker.d.ts +986 -0
- package/types/clr-angular-forms-file-input.d.ts +193 -0
- package/types/clr-angular-forms-input.d.ts +29 -0
- package/types/clr-angular-forms-number-input.d.ts +43 -0
- package/types/clr-angular-forms-password.d.ts +52 -0
- package/types/clr-angular-forms-radio.d.ts +50 -0
- package/types/clr-angular-forms-range.d.ts +37 -0
- package/types/clr-angular-forms-select.d.ts +36 -0
- package/types/clr-angular-forms-textarea.d.ts +29 -0
- package/types/clr-angular-forms.d.ts +36 -0
- package/types/clr-angular-icon.d.ts +1498 -0
- package/types/clr-angular-layout-breadcrumbs.d.ts +45 -0
- package/types/clr-angular-layout-main-container.d.ts +28 -0
- package/types/clr-angular-layout-nav.d.ts +142 -0
- package/types/clr-angular-layout-tabs.d.ts +158 -0
- package/types/clr-angular-layout-vertical-nav.d.ts +128 -0
- package/types/clr-angular-layout.d.ts +19 -0
- package/types/clr-angular-modal.d.ts +160 -0
- package/types/clr-angular-popover-common.d.ts +254 -0
- package/types/clr-angular-popover-dropdown.d.ts +123 -0
- package/types/clr-angular-popover-signpost.d.ts +157 -0
- package/types/clr-angular-popover-tooltip.d.ts +83 -0
- package/types/clr-angular-popover.d.ts +16 -0
- package/types/clr-angular-progress-progress-bars.d.ts +57 -0
- package/types/clr-angular-progress-spinner.d.ts +44 -0
- package/types/clr-angular-stepper.d.ts +179 -0
- package/types/clr-angular-timeline.d.ts +86 -0
- package/types/clr-angular-utils-conditional.d.ts +132 -0
- package/types/clr-angular-utils-loading.d.ts +38 -0
- package/types/clr-angular-utils.d.ts +913 -0
- package/types/clr-angular-wizard.d.ts +1508 -0
- package/fesm2022/rossigee-clarity-angular.mjs.map +0 -1
- /package/types/{rossigee-clarity-angular.d.ts → clr-angular.d.ts} +0 -0
|
@@ -0,0 +1,617 @@
|
|
|
1
|
+
import { trigger, transition, style, animate } from '@angular/animations';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { PLATFORM_ID, Inject, Injectable, EventEmitter, ViewChild, ContentChild, Input, Output, HostBinding, Component, Directive, NgModule, HostListener } from '@angular/core';
|
|
4
|
+
import * as i1 from '@clr/angular/utils';
|
|
5
|
+
import { Keys, uniqueIdFactory, ScrollingService, CdkTrapFocusModule } from '@clr/angular/utils';
|
|
6
|
+
import * as i4 from '@angular/common';
|
|
7
|
+
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
8
|
+
import * as i5 from '@clr/angular/icon';
|
|
9
|
+
import { ClarityIcons, windowCloseIcon, ClrIcon } from '@clr/angular/icon';
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
13
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
14
|
+
* This software is released under MIT license.
|
|
15
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
16
|
+
*/
|
|
17
|
+
class ModalStackService {
|
|
18
|
+
constructor(platformId) {
|
|
19
|
+
this.platformId = platformId;
|
|
20
|
+
this.modalStack = [];
|
|
21
|
+
this.keyUpEventListener = this.onKeyUp.bind(this);
|
|
22
|
+
}
|
|
23
|
+
trackModalOpen(openedModal) {
|
|
24
|
+
if (this.modalStack.includes(openedModal) === false) {
|
|
25
|
+
this.modalStack.unshift(openedModal);
|
|
26
|
+
}
|
|
27
|
+
if (isPlatformBrowser(this.platformId)) {
|
|
28
|
+
document.body.addEventListener('keyup', this.keyUpEventListener);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
trackModalClose(closedModal) {
|
|
32
|
+
const closedModalIndex = this.modalStack.indexOf(closedModal);
|
|
33
|
+
if (closedModalIndex > -1) {
|
|
34
|
+
this.modalStack.splice(closedModalIndex, 1);
|
|
35
|
+
}
|
|
36
|
+
if (this.modalStack.length === 0 && isPlatformBrowser(this.platformId)) {
|
|
37
|
+
document.body.removeEventListener('keyup', this.keyUpEventListener);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
onKeyUp(event) {
|
|
41
|
+
if (this.modalStack.length && event.key === Keys.Escape) {
|
|
42
|
+
// We blur the active element because escaping with an input element in focus could cause
|
|
43
|
+
// an ExpressionChangedAfterItHasBeenCheckedError for the touched state. (CDE-1662)
|
|
44
|
+
document.activeElement.blur();
|
|
45
|
+
this.modalStack[0].close();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ModalStackService, deps: [{ token: PLATFORM_ID }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
49
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ModalStackService, providedIn: 'root' }); }
|
|
50
|
+
}
|
|
51
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ModalStackService, decorators: [{
|
|
52
|
+
type: Injectable,
|
|
53
|
+
args: [{ providedIn: 'root' }]
|
|
54
|
+
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
55
|
+
type: Inject,
|
|
56
|
+
args: [PLATFORM_ID]
|
|
57
|
+
}] }] });
|
|
58
|
+
|
|
59
|
+
/*
|
|
60
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
61
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
62
|
+
* This software is released under MIT license.
|
|
63
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
64
|
+
*/
|
|
65
|
+
class ClrModalConfigurationService {
|
|
66
|
+
constructor() {
|
|
67
|
+
this.fadeMove = 'fadeDown';
|
|
68
|
+
this.backdrop = true;
|
|
69
|
+
}
|
|
70
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalConfigurationService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
71
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalConfigurationService, providedIn: 'root' }); }
|
|
72
|
+
}
|
|
73
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalConfigurationService, decorators: [{
|
|
74
|
+
type: Injectable,
|
|
75
|
+
args: [{ providedIn: 'root' }]
|
|
76
|
+
}] });
|
|
77
|
+
|
|
78
|
+
/*
|
|
79
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
80
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
81
|
+
* This software is released under MIT license.
|
|
82
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
83
|
+
*/
|
|
84
|
+
class ClrModal {
|
|
85
|
+
constructor(_scrollingService, commonStrings, modalStackService, configuration) {
|
|
86
|
+
this._scrollingService = _scrollingService;
|
|
87
|
+
this.commonStrings = commonStrings;
|
|
88
|
+
this.modalStackService = modalStackService;
|
|
89
|
+
this.configuration = configuration;
|
|
90
|
+
this.modalId = uniqueIdFactory();
|
|
91
|
+
this._open = false;
|
|
92
|
+
this._openChanged = new EventEmitter(false);
|
|
93
|
+
this.closable = true;
|
|
94
|
+
this.closeButtonAriaLabel = this.commonStrings.keys.close;
|
|
95
|
+
this.size = 'md';
|
|
96
|
+
this.staticBackdrop = true;
|
|
97
|
+
this.skipAnimation = false;
|
|
98
|
+
this.stopClose = false;
|
|
99
|
+
this.altClose = new EventEmitter(false);
|
|
100
|
+
// presently this is only used by inline wizards
|
|
101
|
+
this.bypassScrollService = false;
|
|
102
|
+
}
|
|
103
|
+
get fadeMove() {
|
|
104
|
+
return this.skipAnimation ? '' : this.configuration.fadeMove;
|
|
105
|
+
}
|
|
106
|
+
set fadeMove(move) {
|
|
107
|
+
this.configuration.fadeMove = move;
|
|
108
|
+
}
|
|
109
|
+
get backdrop() {
|
|
110
|
+
return this.configuration.backdrop;
|
|
111
|
+
}
|
|
112
|
+
// Detect when _open is set to true and set no-scrolling to true
|
|
113
|
+
ngOnChanges(changes) {
|
|
114
|
+
if (!this.bypassScrollService && changes && Object.prototype.hasOwnProperty.call(changes, '_open')) {
|
|
115
|
+
if (changes._open.currentValue) {
|
|
116
|
+
this._scrollingService.stopScrolling();
|
|
117
|
+
this.modalStackService.trackModalOpen(this);
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
this._scrollingService.resumeScrolling();
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
ngOnDestroy() {
|
|
125
|
+
this._scrollingService.resumeScrolling();
|
|
126
|
+
}
|
|
127
|
+
open() {
|
|
128
|
+
if (this._open) {
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
this._open = true;
|
|
132
|
+
this._openChanged.emit(true);
|
|
133
|
+
this.modalStackService.trackModalOpen(this);
|
|
134
|
+
}
|
|
135
|
+
backdropClick() {
|
|
136
|
+
if (this.staticBackdrop) {
|
|
137
|
+
return;
|
|
138
|
+
}
|
|
139
|
+
this.close();
|
|
140
|
+
}
|
|
141
|
+
close() {
|
|
142
|
+
if (this.stopClose) {
|
|
143
|
+
this.altClose.emit(false);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
if (!this.closable || !this._open) {
|
|
147
|
+
return;
|
|
148
|
+
}
|
|
149
|
+
this._open = false;
|
|
150
|
+
}
|
|
151
|
+
fadeDone(e) {
|
|
152
|
+
if (e.toState === 'void') {
|
|
153
|
+
// TODO: Investigate if we can decouple from animation events
|
|
154
|
+
this._openChanged.emit(false);
|
|
155
|
+
this.modalStackService.trackModalClose(this);
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
scrollTop() {
|
|
159
|
+
this.bodyElementRef.nativeElement.scrollTo(0, 0);
|
|
160
|
+
}
|
|
161
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModal, deps: [{ token: i1.ScrollingService }, { token: i1.ClrCommonStringsService }, { token: ModalStackService }, { token: ClrModalConfigurationService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
162
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrModal, isStandalone: false, selector: "clr-modal", inputs: { _open: ["clrModalOpen", "_open"], closable: ["clrModalClosable", "closable"], closeButtonAriaLabel: ["clrModalCloseButtonAriaLabel", "closeButtonAriaLabel"], size: ["clrModalSize", "size"], staticBackdrop: ["clrModalStaticBackdrop", "staticBackdrop"], skipAnimation: ["clrModalSkipAnimation", "skipAnimation"], stopClose: ["clrModalPreventClose", "stopClose"], labelledBy: ["clrModalLabelledById", "labelledBy"], bypassScrollService: ["clrModalOverrideScrollService", "bypassScrollService"] }, outputs: { _openChanged: "clrModalOpenChange", altClose: "clrModalAlternateClose" }, host: { properties: { "class.open": "this._open" } }, queries: [{ propertyName: "modalContentTemplate", first: true, predicate: ["clrInternalModalContentTemplate"], descendants: true }], viewQueries: [{ propertyName: "title", first: true, predicate: ["title"], descendants: true }, { propertyName: "bodyElementRef", first: true, predicate: ["body"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n@if (_open) {\n<div class=\"modal\" [class.modal-full-screen]=\"size == 'full-screen'\">\n <!--fixme: revisit when ngClass works with exit animation-->\n <div\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n [@fadeMove]=\"fadeMove\"\n (@fadeMove.done)=\"fadeDone($event)\"\n class=\"modal-dialog\"\n [class.modal-sm]=\"size == 'sm'\"\n [class.modal-lg]=\"size == 'lg'\"\n [class.modal-xl]=\"size == 'xl'\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-hidden]=\"!_open\"\n [attr.aria-labelledby]=\"labelledBy || modalId\"\n >\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n <!-- This wizard is tightly coupled to the modal styles, so changes here could require changes in the wizard. -->\n @if (!modalContentTemplate) {\n <div class=\"modal-content-wrapper\">\n <div class=\"modal-content\">\n <div class=\"modal-header--accessible\">\n <ng-content select=\".leading-button\"></ng-content>\n <div class=\"modal-title-wrapper\" #title [id]=\"modalId\" cdkFocusInitial tabindex=\"-1\">\n <ng-content select=\".modal-title\"></ng-content>\n </div>\n @if (closable) {\n <button\n type=\"button\"\n [attr.aria-label]=\"closeButtonAriaLabel || commonStrings.keys.close\"\n class=\"close\"\n (click)=\"close()\"\n >\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n }\n </div>\n <div #body class=\"modal-body-wrapper\">\n <ng-content select=\".modal-body\"></ng-content>\n </div>\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n </div>\n } @else {\n <ng-template [ngTemplateOutlet]=\"modalContentTemplate\"></ng-template>\n }\n </div>\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n @if (backdrop) {\n <div\n [@fade]\n class=\"modal-backdrop\"\n [class.static]=\"staticBackdrop\"\n aria-hidden=\"true\"\n (click)=\"backdropClick()\"\n ></div>\n }\n</div>\n}\n", styles: [":host{display:none}:host.open{display:inline}\n"], dependencies: [{ kind: "directive", type: i4.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: i1.CdkTrapFocusModule_CdkTrapFocus, selector: "[cdkTrapFocus]" }, { kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }], viewProviders: [ScrollingService], animations: [
|
|
163
|
+
trigger('fadeMove', [
|
|
164
|
+
transition('* => fadeDown', [
|
|
165
|
+
style({ opacity: 0, transform: 'translate(0, -25%)' }),
|
|
166
|
+
animate('0.2s ease-in-out'),
|
|
167
|
+
]),
|
|
168
|
+
transition('fadeDown => *', [
|
|
169
|
+
animate('0.2s ease-in-out', style({ opacity: 0, transform: 'translate(0, -25%)' })),
|
|
170
|
+
]),
|
|
171
|
+
transition('* => fadeLeft', [style({ opacity: 0, transform: 'translate(25%, 0)' }), animate('0.2s ease-in-out')]),
|
|
172
|
+
transition('fadeLeft => *', [animate('0.2s ease-in-out', style({ opacity: 0, transform: 'translate(25%, 0)' }))]),
|
|
173
|
+
transition('* => fadeUp', [style({ opacity: 0, transform: 'translate(0, 50%)' }), animate('0.2s ease-in-out')]),
|
|
174
|
+
transition('fadeUp => *', [animate('0.2s ease-in-out', style({ opacity: 0, transform: 'translate(0, 50%)' }))]),
|
|
175
|
+
]),
|
|
176
|
+
trigger('fade', [
|
|
177
|
+
transition('void => *', [style({ opacity: 0 }), animate('0.2s ease-in-out', style({ opacity: 0.85 }))]),
|
|
178
|
+
transition('* => void', [animate('0.2s ease-in-out', style({ opacity: 0 }))]),
|
|
179
|
+
]),
|
|
180
|
+
] }); }
|
|
181
|
+
}
|
|
182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModal, decorators: [{
|
|
183
|
+
type: Component,
|
|
184
|
+
args: [{ selector: 'clr-modal', viewProviders: [ScrollingService], animations: [
|
|
185
|
+
trigger('fadeMove', [
|
|
186
|
+
transition('* => fadeDown', [
|
|
187
|
+
style({ opacity: 0, transform: 'translate(0, -25%)' }),
|
|
188
|
+
animate('0.2s ease-in-out'),
|
|
189
|
+
]),
|
|
190
|
+
transition('fadeDown => *', [
|
|
191
|
+
animate('0.2s ease-in-out', style({ opacity: 0, transform: 'translate(0, -25%)' })),
|
|
192
|
+
]),
|
|
193
|
+
transition('* => fadeLeft', [style({ opacity: 0, transform: 'translate(25%, 0)' }), animate('0.2s ease-in-out')]),
|
|
194
|
+
transition('fadeLeft => *', [animate('0.2s ease-in-out', style({ opacity: 0, transform: 'translate(25%, 0)' }))]),
|
|
195
|
+
transition('* => fadeUp', [style({ opacity: 0, transform: 'translate(0, 50%)' }), animate('0.2s ease-in-out')]),
|
|
196
|
+
transition('fadeUp => *', [animate('0.2s ease-in-out', style({ opacity: 0, transform: 'translate(0, 50%)' }))]),
|
|
197
|
+
]),
|
|
198
|
+
trigger('fade', [
|
|
199
|
+
transition('void => *', [style({ opacity: 0 }), animate('0.2s ease-in-out', style({ opacity: 0.85 }))]),
|
|
200
|
+
transition('* => void', [animate('0.2s ease-in-out', style({ opacity: 0 }))]),
|
|
201
|
+
]),
|
|
202
|
+
], standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n\n@if (_open) {\n<div class=\"modal\" [class.modal-full-screen]=\"size == 'full-screen'\">\n <!--fixme: revisit when ngClass works with exit animation-->\n <div\n cdkTrapFocus\n [cdkTrapFocusAutoCapture]=\"true\"\n [@fadeMove]=\"fadeMove\"\n (@fadeMove.done)=\"fadeDone($event)\"\n class=\"modal-dialog\"\n [class.modal-sm]=\"size == 'sm'\"\n [class.modal-lg]=\"size == 'lg'\"\n [class.modal-xl]=\"size == 'xl'\"\n role=\"dialog\"\n aria-modal=\"true\"\n [attr.aria-hidden]=\"!_open\"\n [attr.aria-labelledby]=\"labelledBy || modalId\"\n >\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentStart}}</div>\n <!-- This wizard is tightly coupled to the modal styles, so changes here could require changes in the wizard. -->\n @if (!modalContentTemplate) {\n <div class=\"modal-content-wrapper\">\n <div class=\"modal-content\">\n <div class=\"modal-header--accessible\">\n <ng-content select=\".leading-button\"></ng-content>\n <div class=\"modal-title-wrapper\" #title [id]=\"modalId\" cdkFocusInitial tabindex=\"-1\">\n <ng-content select=\".modal-title\"></ng-content>\n </div>\n @if (closable) {\n <button\n type=\"button\"\n [attr.aria-label]=\"closeButtonAriaLabel || commonStrings.keys.close\"\n class=\"close\"\n (click)=\"close()\"\n >\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n }\n </div>\n <div #body class=\"modal-body-wrapper\">\n <ng-content select=\".modal-body\"></ng-content>\n </div>\n <ng-content select=\".modal-footer\"></ng-content>\n </div>\n </div>\n } @else {\n <ng-template [ngTemplateOutlet]=\"modalContentTemplate\"></ng-template>\n }\n </div>\n <div class=\"clr-sr-only\">{{commonStrings.keys.modalContentEnd}}</div>\n @if (backdrop) {\n <div\n [@fade]\n class=\"modal-backdrop\"\n [class.static]=\"staticBackdrop\"\n aria-hidden=\"true\"\n (click)=\"backdropClick()\"\n ></div>\n }\n</div>\n}\n", styles: [":host{display:none}:host.open{display:inline}\n"] }]
|
|
203
|
+
}], ctorParameters: () => [{ type: i1.ScrollingService }, { type: i1.ClrCommonStringsService }, { type: ModalStackService }, { type: ClrModalConfigurationService }], propDecorators: { title: [{
|
|
204
|
+
type: ViewChild,
|
|
205
|
+
args: ['title']
|
|
206
|
+
}], _open: [{
|
|
207
|
+
type: Input,
|
|
208
|
+
args: ['clrModalOpen']
|
|
209
|
+
}, {
|
|
210
|
+
type: HostBinding,
|
|
211
|
+
args: ['class.open']
|
|
212
|
+
}], _openChanged: [{
|
|
213
|
+
type: Output,
|
|
214
|
+
args: ['clrModalOpenChange']
|
|
215
|
+
}], closable: [{
|
|
216
|
+
type: Input,
|
|
217
|
+
args: ['clrModalClosable']
|
|
218
|
+
}], closeButtonAriaLabel: [{
|
|
219
|
+
type: Input,
|
|
220
|
+
args: ['clrModalCloseButtonAriaLabel']
|
|
221
|
+
}], size: [{
|
|
222
|
+
type: Input,
|
|
223
|
+
args: ['clrModalSize']
|
|
224
|
+
}], staticBackdrop: [{
|
|
225
|
+
type: Input,
|
|
226
|
+
args: ['clrModalStaticBackdrop']
|
|
227
|
+
}], skipAnimation: [{
|
|
228
|
+
type: Input,
|
|
229
|
+
args: ['clrModalSkipAnimation']
|
|
230
|
+
}], stopClose: [{
|
|
231
|
+
type: Input,
|
|
232
|
+
args: ['clrModalPreventClose']
|
|
233
|
+
}], altClose: [{
|
|
234
|
+
type: Output,
|
|
235
|
+
args: ['clrModalAlternateClose']
|
|
236
|
+
}], labelledBy: [{
|
|
237
|
+
type: Input,
|
|
238
|
+
args: ['clrModalLabelledById']
|
|
239
|
+
}], bypassScrollService: [{
|
|
240
|
+
type: Input,
|
|
241
|
+
args: ['clrModalOverrideScrollService']
|
|
242
|
+
}], modalContentTemplate: [{
|
|
243
|
+
type: ContentChild,
|
|
244
|
+
args: ['clrInternalModalContentTemplate']
|
|
245
|
+
}], bodyElementRef: [{
|
|
246
|
+
type: ViewChild,
|
|
247
|
+
args: ['body']
|
|
248
|
+
}] } });
|
|
249
|
+
|
|
250
|
+
/*
|
|
251
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
252
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
253
|
+
* This software is released under MIT license.
|
|
254
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
255
|
+
*/
|
|
256
|
+
/**
|
|
257
|
+
* Allows modal overflow area to be scrollable via keyboard.
|
|
258
|
+
* The modal body will focus with keyboard navigation only.
|
|
259
|
+
* This allows inner focusable items to be focused without
|
|
260
|
+
* the overflow scroll being focused.
|
|
261
|
+
*/
|
|
262
|
+
class ClrModalBody {
|
|
263
|
+
constructor(renderer, host, ngZone) {
|
|
264
|
+
this.renderer = renderer;
|
|
265
|
+
this.host = host;
|
|
266
|
+
this.tabindex = '0';
|
|
267
|
+
this.unlisteners = [];
|
|
268
|
+
ngZone.runOutsideAngular(() => {
|
|
269
|
+
this.observer = new ResizeObserver(() => this.addOrRemoveTabIndex());
|
|
270
|
+
this.observer.observe(host.nativeElement);
|
|
271
|
+
this.unlisteners.push(renderer.listen(host.nativeElement, 'mouseup', () => {
|
|
272
|
+
// set the tabindex binding back when click is completed with mouseup
|
|
273
|
+
this.addOrRemoveTabIndex();
|
|
274
|
+
}), renderer.listen(host.nativeElement, 'mousedown', () => {
|
|
275
|
+
// tabindex = 0 binding should be removed
|
|
276
|
+
// so it won't be focused when click starts with mousedown
|
|
277
|
+
this.removeTabIndex();
|
|
278
|
+
}));
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
ngOnDestroy() {
|
|
282
|
+
while (this.unlisteners.length) {
|
|
283
|
+
this.unlisteners.pop()();
|
|
284
|
+
}
|
|
285
|
+
this.observer.disconnect();
|
|
286
|
+
this.observer = null;
|
|
287
|
+
}
|
|
288
|
+
addTabIndex() {
|
|
289
|
+
this.renderer.setAttribute(this.host.nativeElement, 'tabindex', this.tabindex);
|
|
290
|
+
}
|
|
291
|
+
removeTabIndex() {
|
|
292
|
+
this.renderer.removeAttribute(this.host.nativeElement, 'tabindex');
|
|
293
|
+
}
|
|
294
|
+
addOrRemoveTabIndex() {
|
|
295
|
+
const modalBody = this.host.nativeElement.parentElement;
|
|
296
|
+
if (modalBody && modalBody.clientHeight < modalBody.scrollHeight) {
|
|
297
|
+
this.addTabIndex();
|
|
298
|
+
}
|
|
299
|
+
else {
|
|
300
|
+
this.removeTabIndex();
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalBody, deps: [{ token: i0.Renderer2 }, { token: i0.ElementRef }, { token: i0.NgZone }], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
304
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.1.3", type: ClrModalBody, isStandalone: false, selector: ".modal-body", ngImport: i0 }); }
|
|
305
|
+
}
|
|
306
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalBody, decorators: [{
|
|
307
|
+
type: Directive,
|
|
308
|
+
args: [{
|
|
309
|
+
selector: '.modal-body',
|
|
310
|
+
standalone: false,
|
|
311
|
+
}]
|
|
312
|
+
}], ctorParameters: () => [{ type: i0.Renderer2 }, { type: i0.ElementRef }, { type: i0.NgZone }] });
|
|
313
|
+
|
|
314
|
+
/*
|
|
315
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
316
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
317
|
+
* This software is released under MIT license.
|
|
318
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
319
|
+
*/
|
|
320
|
+
class ClrModalHostComponent {
|
|
321
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalHostComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
322
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrModalHostComponent, isStandalone: false, selector: "[clrModalHost]", host: { properties: { "class.clr-modal-host": "true" } }, ngImport: i0, template: `
|
|
323
|
+
<div class="clr-modal-host-scrollable">
|
|
324
|
+
<ng-content></ng-content>
|
|
325
|
+
</div>
|
|
326
|
+
`, isInline: true }); }
|
|
327
|
+
}
|
|
328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalHostComponent, decorators: [{
|
|
329
|
+
type: Component,
|
|
330
|
+
args: [{
|
|
331
|
+
selector: '[clrModalHost]',
|
|
332
|
+
host: { '[class.clr-modal-host]': 'true' },
|
|
333
|
+
template: `
|
|
334
|
+
<div class="clr-modal-host-scrollable">
|
|
335
|
+
<ng-content></ng-content>
|
|
336
|
+
</div>
|
|
337
|
+
`,
|
|
338
|
+
standalone: false,
|
|
339
|
+
}]
|
|
340
|
+
}] });
|
|
341
|
+
|
|
342
|
+
/*
|
|
343
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
344
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
345
|
+
* This software is released under MIT license.
|
|
346
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
347
|
+
*/
|
|
348
|
+
const CLR_MODAL_DIRECTIVES = [ClrModal, ClrModalBody, ClrModalHostComponent];
|
|
349
|
+
class ClrModalModule {
|
|
350
|
+
constructor() {
|
|
351
|
+
ClarityIcons.addIcons(windowCloseIcon);
|
|
352
|
+
}
|
|
353
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
354
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrModalModule, declarations: [ClrModal, ClrModalBody, ClrModalHostComponent], imports: [CommonModule, CdkTrapFocusModule, ClrIcon], exports: [ClrModal, ClrModalBody, ClrModalHostComponent, ClrIcon] }); }
|
|
355
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalModule, imports: [CommonModule, CdkTrapFocusModule, ClrIcon] }); }
|
|
356
|
+
}
|
|
357
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrModalModule, decorators: [{
|
|
358
|
+
type: NgModule,
|
|
359
|
+
args: [{
|
|
360
|
+
imports: [CommonModule, CdkTrapFocusModule, ClrIcon],
|
|
361
|
+
declarations: [CLR_MODAL_DIRECTIVES],
|
|
362
|
+
exports: [CLR_MODAL_DIRECTIVES, ClrIcon],
|
|
363
|
+
}]
|
|
364
|
+
}], ctorParameters: () => [] });
|
|
365
|
+
|
|
366
|
+
/*
|
|
367
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
368
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
369
|
+
* This software is released under MIT license.
|
|
370
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
371
|
+
*/
|
|
372
|
+
class ClrSidePanel {
|
|
373
|
+
constructor(element, configuration, commonStrings) {
|
|
374
|
+
this.element = element;
|
|
375
|
+
this.configuration = configuration;
|
|
376
|
+
this.commonStrings = commonStrings;
|
|
377
|
+
this.openChange = new EventEmitter(false);
|
|
378
|
+
this.skipAnimation = false;
|
|
379
|
+
this.staticBackdrop = false;
|
|
380
|
+
this.closable = true;
|
|
381
|
+
this.preventClose = false;
|
|
382
|
+
this.altClose = new EventEmitter(false);
|
|
383
|
+
this._pinnable = false;
|
|
384
|
+
this._pinned = false;
|
|
385
|
+
this._position = 'right';
|
|
386
|
+
this.__open = false;
|
|
387
|
+
this._size = 'md';
|
|
388
|
+
}
|
|
389
|
+
get _open() {
|
|
390
|
+
return this.__open;
|
|
391
|
+
}
|
|
392
|
+
set _open(open) {
|
|
393
|
+
if (open !== this.__open) {
|
|
394
|
+
this.__open = open;
|
|
395
|
+
if (this.pinned) {
|
|
396
|
+
this.updateModalState();
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
}
|
|
400
|
+
get size() {
|
|
401
|
+
return this._size;
|
|
402
|
+
}
|
|
403
|
+
set size(value) {
|
|
404
|
+
if (!value) {
|
|
405
|
+
value = 'md';
|
|
406
|
+
}
|
|
407
|
+
if (this._size !== value) {
|
|
408
|
+
this._size = value;
|
|
409
|
+
if (this.pinned) {
|
|
410
|
+
this.updateModalState();
|
|
411
|
+
}
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
get position() {
|
|
415
|
+
return this._position;
|
|
416
|
+
}
|
|
417
|
+
set position(position) {
|
|
418
|
+
if (position && position !== this._position) {
|
|
419
|
+
this._position = position;
|
|
420
|
+
if (this._position === 'right') {
|
|
421
|
+
this.configuration.fadeMove = 'fadeLeft';
|
|
422
|
+
}
|
|
423
|
+
else if (this._position === 'bottom') {
|
|
424
|
+
this.configuration.fadeMove = 'fadeUp';
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
get pinned() {
|
|
429
|
+
return this._pinned;
|
|
430
|
+
}
|
|
431
|
+
set pinned(pinned) {
|
|
432
|
+
this._pinned = pinned;
|
|
433
|
+
if (this.modal) {
|
|
434
|
+
this.updateModalState();
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
get clrSidePanelBackdrop() {
|
|
438
|
+
return this.configuration.backdrop;
|
|
439
|
+
}
|
|
440
|
+
set clrSidePanelBackdrop(backdrop) {
|
|
441
|
+
if (backdrop !== undefined) {
|
|
442
|
+
this.configuration.backdrop = backdrop;
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
get clrSidePanelPinnable() {
|
|
446
|
+
return this._pinnable;
|
|
447
|
+
}
|
|
448
|
+
set clrSidePanelPinnable(pinnable) {
|
|
449
|
+
this._pinnable = pinnable;
|
|
450
|
+
}
|
|
451
|
+
get modal() {
|
|
452
|
+
return this._modal;
|
|
453
|
+
}
|
|
454
|
+
set modal(modal) {
|
|
455
|
+
this._modal = modal;
|
|
456
|
+
this.originalStopClose = this.modal.stopClose;
|
|
457
|
+
this.updateModalState();
|
|
458
|
+
}
|
|
459
|
+
get hostElement() {
|
|
460
|
+
return this.element.nativeElement.closest('.clr-modal-host') || document.body;
|
|
461
|
+
}
|
|
462
|
+
get bottomPositionCssClass() {
|
|
463
|
+
return this.position === 'bottom';
|
|
464
|
+
}
|
|
465
|
+
ngOnInit() {
|
|
466
|
+
this.configuration.fadeMove = 'fadeLeft';
|
|
467
|
+
if (this.position === 'bottom') {
|
|
468
|
+
this.configuration.fadeMove = 'fadeUp';
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
ngOnDestroy() {
|
|
472
|
+
this.cleanupPinnedClasses();
|
|
473
|
+
}
|
|
474
|
+
handleModalOpen(open) {
|
|
475
|
+
if (open) {
|
|
476
|
+
this.updateModalState();
|
|
477
|
+
}
|
|
478
|
+
else {
|
|
479
|
+
this.cleanupPinnedClasses();
|
|
480
|
+
}
|
|
481
|
+
this.openChange.emit(open);
|
|
482
|
+
}
|
|
483
|
+
open() {
|
|
484
|
+
this.modal.open();
|
|
485
|
+
}
|
|
486
|
+
close() {
|
|
487
|
+
this.modal.close();
|
|
488
|
+
}
|
|
489
|
+
togglePinned() {
|
|
490
|
+
this.pinned = !this.pinned;
|
|
491
|
+
}
|
|
492
|
+
documentClick(event) {
|
|
493
|
+
if (!this.element.nativeElement.contains(event.target) &&
|
|
494
|
+
this.modal._open &&
|
|
495
|
+
!this.configuration.backdrop) {
|
|
496
|
+
this.modal.close();
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
updateModalState() {
|
|
500
|
+
if (!this.modal) {
|
|
501
|
+
return;
|
|
502
|
+
}
|
|
503
|
+
if (this.pinned) {
|
|
504
|
+
this.modal.stopClose = true;
|
|
505
|
+
this.updatePinnedClasses();
|
|
506
|
+
}
|
|
507
|
+
else {
|
|
508
|
+
this.modal.stopClose = this.originalStopClose;
|
|
509
|
+
this.cleanupPinnedClasses();
|
|
510
|
+
}
|
|
511
|
+
}
|
|
512
|
+
cleanupPinnedClasses() {
|
|
513
|
+
[this.hostElement, document.body].forEach(host => {
|
|
514
|
+
host.classList.forEach(className => {
|
|
515
|
+
if (className.startsWith('clr-side-panel-pinned-')) {
|
|
516
|
+
host.classList.remove(className);
|
|
517
|
+
}
|
|
518
|
+
});
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
updatePinnedClasses() {
|
|
522
|
+
this.cleanupPinnedClasses();
|
|
523
|
+
this.hostElement.classList.add(`clr-side-panel-pinned-${this.position}-${this.size}`);
|
|
524
|
+
}
|
|
525
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSidePanel, deps: [{ token: i0.ElementRef }, { token: ClrModalConfigurationService }, { token: i1.ClrCommonStringsService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
526
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrSidePanel, isStandalone: false, selector: "clr-side-panel", inputs: { closeButtonAriaLabel: ["clrSidePanelCloseButtonAriaLabel", "closeButtonAriaLabel"], skipAnimation: ["clrSidePanelSkipAnimation", "skipAnimation"], labelledById: ["clrSidePanelLabelledById", "labelledById"], staticBackdrop: ["clrSidePanelStaticBackdrop", "staticBackdrop"], closable: ["clrSidePanelClosable", "closable"], preventClose: ["clrSidePanelPreventClose", "preventClose"], _open: ["clrSidePanelOpen", "_open"], size: ["clrSidePanelSize", "size"], position: ["clrSidePanelPosition", "position"], pinned: ["clrSidePanelPinned", "pinned"], clrSidePanelBackdrop: "clrSidePanelBackdrop", clrSidePanelPinnable: "clrSidePanelPinnable" }, outputs: { openChange: "clrSidePanelOpenChange", altClose: "clrSidePanelAlternateClose" }, host: { listeners: { "document:pointerup": "documentClick($event)" }, properties: { "class.side-panel": "true", "class.side-panel-bottom": "this.bottomPositionCssClass" } }, viewQueries: [{ propertyName: "modal", first: true, predicate: ClrModal, descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n<clr-modal\n [clrModalOpen]=\"_open\"\n (clrModalOpenChange)=\"handleModalOpen($event)\"\n [clrModalCloseButtonAriaLabel]=\"closeButtonAriaLabel\"\n [clrModalSize]=\"size\"\n [clrModalSkipAnimation]=\"skipAnimation\"\n [clrModalStaticBackdrop]=\"staticBackdrop\"\n [clrModalLabelledById]=\"labelledById\"\n [clrModalPreventClose]=\"preventClose\"\n [clrModalClosable]=\"closable\"\n (clrModalAlternateClose)=\"altClose.emit($event)\"\n [clrModalOverrideScrollService]=\"true\"\n>\n @if (clrSidePanelPinnable) {\n <button\n type=\"button\"\n [attr.aria-label]=\"commonStrings.keys.sidePanelPin\"\n class=\"leading-button pinnable\"\n (click)=\"togglePinned()\"\n >\n <cds-icon [shape]=\"pinned ? 'unpin' : 'pin'\"></cds-icon>\n </button>\n }\n <div class=\"modal-title\"><ng-content select=\".side-panel-title\"></ng-content></div>\n <div class=\"modal-body\"><ng-content select=\".side-panel-body\"></ng-content></div>\n <div class=\"modal-footer\"><ng-content select=\".side-panel-footer\"></ng-content></div>\n</clr-modal>\n", dependencies: [{ kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: ClrModal, selector: "clr-modal", inputs: ["clrModalOpen", "clrModalClosable", "clrModalCloseButtonAriaLabel", "clrModalSize", "clrModalStaticBackdrop", "clrModalSkipAnimation", "clrModalPreventClose", "clrModalLabelledById", "clrModalOverrideScrollService"], outputs: ["clrModalOpenChange", "clrModalAlternateClose"] }, { kind: "directive", type: ClrModalBody, selector: ".modal-body" }] }); }
|
|
527
|
+
}
|
|
528
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSidePanel, decorators: [{
|
|
529
|
+
type: Component,
|
|
530
|
+
args: [{ selector: 'clr-side-panel', host: {
|
|
531
|
+
'[class.side-panel]': 'true',
|
|
532
|
+
}, standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n<clr-modal\n [clrModalOpen]=\"_open\"\n (clrModalOpenChange)=\"handleModalOpen($event)\"\n [clrModalCloseButtonAriaLabel]=\"closeButtonAriaLabel\"\n [clrModalSize]=\"size\"\n [clrModalSkipAnimation]=\"skipAnimation\"\n [clrModalStaticBackdrop]=\"staticBackdrop\"\n [clrModalLabelledById]=\"labelledById\"\n [clrModalPreventClose]=\"preventClose\"\n [clrModalClosable]=\"closable\"\n (clrModalAlternateClose)=\"altClose.emit($event)\"\n [clrModalOverrideScrollService]=\"true\"\n>\n @if (clrSidePanelPinnable) {\n <button\n type=\"button\"\n [attr.aria-label]=\"commonStrings.keys.sidePanelPin\"\n class=\"leading-button pinnable\"\n (click)=\"togglePinned()\"\n >\n <cds-icon [shape]=\"pinned ? 'unpin' : 'pin'\"></cds-icon>\n </button>\n }\n <div class=\"modal-title\"><ng-content select=\".side-panel-title\"></ng-content></div>\n <div class=\"modal-body\"><ng-content select=\".side-panel-body\"></ng-content></div>\n <div class=\"modal-footer\"><ng-content select=\".side-panel-footer\"></ng-content></div>\n</clr-modal>\n" }]
|
|
533
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: ClrModalConfigurationService }, { type: i1.ClrCommonStringsService }], propDecorators: { openChange: [{
|
|
534
|
+
type: Output,
|
|
535
|
+
args: ['clrSidePanelOpenChange']
|
|
536
|
+
}], closeButtonAriaLabel: [{
|
|
537
|
+
type: Input,
|
|
538
|
+
args: ['clrSidePanelCloseButtonAriaLabel']
|
|
539
|
+
}], skipAnimation: [{
|
|
540
|
+
type: Input,
|
|
541
|
+
args: ['clrSidePanelSkipAnimation']
|
|
542
|
+
}], labelledById: [{
|
|
543
|
+
type: Input,
|
|
544
|
+
args: ['clrSidePanelLabelledById']
|
|
545
|
+
}], staticBackdrop: [{
|
|
546
|
+
type: Input,
|
|
547
|
+
args: ['clrSidePanelStaticBackdrop']
|
|
548
|
+
}], closable: [{
|
|
549
|
+
type: Input,
|
|
550
|
+
args: ['clrSidePanelClosable']
|
|
551
|
+
}], preventClose: [{
|
|
552
|
+
type: Input,
|
|
553
|
+
args: ['clrSidePanelPreventClose']
|
|
554
|
+
}], altClose: [{
|
|
555
|
+
type: Output,
|
|
556
|
+
args: ['clrSidePanelAlternateClose']
|
|
557
|
+
}], _open: [{
|
|
558
|
+
type: Input,
|
|
559
|
+
args: ['clrSidePanelOpen']
|
|
560
|
+
}], size: [{
|
|
561
|
+
type: Input,
|
|
562
|
+
args: ['clrSidePanelSize']
|
|
563
|
+
}], position: [{
|
|
564
|
+
type: Input,
|
|
565
|
+
args: ['clrSidePanelPosition']
|
|
566
|
+
}], pinned: [{
|
|
567
|
+
type: Input,
|
|
568
|
+
args: ['clrSidePanelPinned']
|
|
569
|
+
}], clrSidePanelBackdrop: [{
|
|
570
|
+
type: Input
|
|
571
|
+
}], clrSidePanelPinnable: [{
|
|
572
|
+
type: Input
|
|
573
|
+
}], modal: [{
|
|
574
|
+
type: ViewChild,
|
|
575
|
+
args: [ClrModal]
|
|
576
|
+
}], bottomPositionCssClass: [{
|
|
577
|
+
type: HostBinding,
|
|
578
|
+
args: ['class.side-panel-bottom']
|
|
579
|
+
}], documentClick: [{
|
|
580
|
+
type: HostListener,
|
|
581
|
+
args: ['document:pointerup', ['$event']]
|
|
582
|
+
}] } });
|
|
583
|
+
|
|
584
|
+
/*
|
|
585
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
586
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
587
|
+
* This software is released under MIT license.
|
|
588
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
589
|
+
*/
|
|
590
|
+
const CLR_SIDEPANEL_DIRECTIVES = [ClrSidePanel];
|
|
591
|
+
class ClrSidePanelModule {
|
|
592
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSidePanelModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
593
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.3", ngImport: i0, type: ClrSidePanelModule, declarations: [ClrSidePanel], imports: [CommonModule, CdkTrapFocusModule, ClrIcon, ClrModalModule], exports: [ClrSidePanel, ClrModalModule, ClrIcon] }); }
|
|
594
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSidePanelModule, imports: [CommonModule, CdkTrapFocusModule, ClrIcon, ClrModalModule, ClrModalModule] }); }
|
|
595
|
+
}
|
|
596
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrSidePanelModule, decorators: [{
|
|
597
|
+
type: NgModule,
|
|
598
|
+
args: [{
|
|
599
|
+
imports: [CommonModule, CdkTrapFocusModule, ClrIcon, ClrModalModule],
|
|
600
|
+
declarations: [CLR_SIDEPANEL_DIRECTIVES],
|
|
601
|
+
exports: [CLR_SIDEPANEL_DIRECTIVES, ClrModalModule, ClrIcon],
|
|
602
|
+
}]
|
|
603
|
+
}] });
|
|
604
|
+
|
|
605
|
+
/*
|
|
606
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
607
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
608
|
+
* This software is released under MIT license.
|
|
609
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
610
|
+
*/
|
|
611
|
+
|
|
612
|
+
/**
|
|
613
|
+
* Generated bundle index. Do not edit.
|
|
614
|
+
*/
|
|
615
|
+
|
|
616
|
+
export { CLR_MODAL_DIRECTIVES, CLR_SIDEPANEL_DIRECTIVES, ClrModal, ClrModalBody, ClrModalConfigurationService, ClrModalHostComponent, ClrModalModule, ClrSidePanel, ClrSidePanelModule, ModalStackService };
|
|
617
|
+
//# sourceMappingURL=clr-angular-modal.mjs.map
|