@impartner/design-components 1.0.0 → 1.0.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/README.md +1 -1
- package/esm2020/lib/alert/alert.component.mjs +1 -1
- package/esm2020/lib/avatar/avatar.component.mjs +1 -1
- package/esm2020/lib/backdrop/backdrop.component.mjs +7 -1
- package/esm2020/lib/badge/badge.component.mjs +1 -1
- package/esm2020/lib/breadcrumb/breadcrumb.component.mjs +1 -1
- package/esm2020/lib/button/button.component.mjs +1 -1
- package/esm2020/lib/button-group/button-group.component.mjs +1 -1
- package/esm2020/lib/card-heading/card-heading.component.mjs +1 -1
- package/esm2020/lib/dropdown/components/dropdown-item/dropdown-item.component.mjs +1 -1
- package/esm2020/lib/dropdown/dropdown.component.mjs +1 -1
- package/esm2020/lib/file-upload/directives/file-drop.directive.mjs +1 -1
- package/esm2020/lib/file-upload/file-upload.component.mjs +1 -1
- package/esm2020/lib/form-field/controls/checkbox/checkbox.component.mjs +1 -1
- package/esm2020/lib/form-field/controls/input/input.directive.mjs +1 -1
- package/esm2020/lib/form-field/controls/radio/radio-button/radio-button.component.mjs +1 -1
- package/esm2020/lib/form-field/controls/radio/radio-group/radio-group.directive.mjs +2 -1
- package/esm2020/lib/form-field/controls/select/option/select-option.component.mjs +1 -1
- package/esm2020/lib/form-field/controls/select/select-model.mjs +2 -1
- package/esm2020/lib/form-field/controls/select/select.component.mjs +1 -1
- package/esm2020/lib/form-field/controls/shared/toggle/toggle.component.mjs +1 -1
- package/esm2020/lib/form-field/directives/error.directive.mjs +1 -1
- package/esm2020/lib/form-field/directives/hint.directive.mjs +1 -1
- package/esm2020/lib/form-field/shared/disabled.mixin.mjs +1 -1
- package/esm2020/lib/form-field/shared/error-state.mixin.mjs +1 -1
- package/esm2020/lib/icon/icon.component.mjs +14 -10
- package/esm2020/lib/modal/modal.component.mjs +51 -13
- package/esm2020/lib/pagination/pagination.component.mjs +1 -1
- package/esm2020/lib/progress-bar/progress-bar.component.mjs +1 -1
- package/esm2020/lib/scrollable/scrollable.component.mjs +14 -21
- package/esm2020/lib/select-icon/select-icon.component.mjs +1 -1
- package/esm2020/lib/spinner/spinner.component.mjs +1 -1
- package/esm2020/lib/table/table.component.mjs +1 -1
- package/esm2020/lib/text-highlight/text-highlight.component.mjs +1 -1
- package/esm2020/services/interaction.service.mjs +13 -3
- package/esm2020/utilities/sanitize.mjs +3 -3
- package/fesm2015/impartner-design-components.mjs +100 -45
- package/fesm2015/impartner-design-components.mjs.map +1 -1
- package/fesm2020/impartner-design-components.mjs +97 -44
- package/fesm2020/impartner-design-components.mjs.map +1 -1
- package/lib/backdrop/backdrop.component.d.ts +5 -3
- package/lib/icon/icon.component.d.ts +6 -4
- package/lib/modal/modal.component.d.ts +32 -7
- package/lib/scrollable/scrollable.component.d.ts +3 -1
- package/package.json +2 -2
- package/services/interaction.service.d.ts +1 -0
|
@@ -4,7 +4,7 @@ import * as i1 from '@angular/common';
|
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
5
|
import * as i2 from '@angular/forms';
|
|
6
6
|
import { FormsModule, Validators, ReactiveFormsModule, FormControl } from '@angular/forms';
|
|
7
|
-
import
|
|
7
|
+
import sanitizeHtml from 'sanitize-html';
|
|
8
8
|
import { nanoid } from 'nanoid';
|
|
9
9
|
import { Subject, defer, startWith, switchMap, merge, take, takeUntil, BehaviorSubject, debounceTime, distinctUntilChanged, combineLatest, map } from 'rxjs';
|
|
10
10
|
import * as i4 from '@ng-bootstrap/ng-bootstrap';
|
|
@@ -3082,7 +3082,7 @@ function _isNumberValue(value) {
|
|
|
3082
3082
|
}
|
|
3083
3083
|
|
|
3084
3084
|
function sanitize(value) {
|
|
3085
|
-
return
|
|
3085
|
+
return sanitizeHtml(value, {
|
|
3086
3086
|
allowedTags: []
|
|
3087
3087
|
});
|
|
3088
3088
|
}
|
|
@@ -3203,6 +3203,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
3203
3203
|
*/
|
|
3204
3204
|
class IconComponent {
|
|
3205
3205
|
constructor() {
|
|
3206
|
+
this._loading = true;
|
|
3207
|
+
this._licensed = false;
|
|
3206
3208
|
/**
|
|
3207
3209
|
* The Font Awesome 5 icon style. Local development may fallback to a free available
|
|
3208
3210
|
* theme when possible.
|
|
@@ -3214,16 +3216,8 @@ class IconComponent {
|
|
|
3214
3216
|
*/
|
|
3215
3217
|
this.size = '1.8rem';
|
|
3216
3218
|
}
|
|
3217
|
-
get usingLicensed() {
|
|
3218
|
-
if (!this.iconRef?.nativeElement) {
|
|
3219
|
-
return false;
|
|
3220
|
-
}
|
|
3221
|
-
const iconFontFamily = getComputedStyle(this.iconRef?.nativeElement).getPropertyValue('font-family');
|
|
3222
|
-
return (iconFontFamily.includes('Font Awesome') &&
|
|
3223
|
-
!iconFontFamily.includes('Free'));
|
|
3224
|
-
}
|
|
3225
3219
|
get typeClass() {
|
|
3226
|
-
if (this.
|
|
3220
|
+
if (this._licensed) {
|
|
3227
3221
|
switch (this.theme) {
|
|
3228
3222
|
case 'light':
|
|
3229
3223
|
return 'fal';
|
|
@@ -3247,6 +3241,16 @@ class IconComponent {
|
|
|
3247
3241
|
}
|
|
3248
3242
|
return `${this.size}px`;
|
|
3249
3243
|
}
|
|
3244
|
+
ngAfterContentChecked() {
|
|
3245
|
+
if (this._loading) {
|
|
3246
|
+
// During init and possibly a few checks, `iconFontFamily` will be an inherited font, later it will be Font Awesome.
|
|
3247
|
+
const iconFontFamily = getComputedStyle(this.iconRef.nativeElement).getPropertyValue('font-family');
|
|
3248
|
+
if (iconFontFamily.includes('Font Awesome')) {
|
|
3249
|
+
this._licensed = !iconFontFamily.includes('Free');
|
|
3250
|
+
this._loading = false;
|
|
3251
|
+
}
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3250
3254
|
}
|
|
3251
3255
|
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3252
3256
|
IconComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: IconComponent, selector: "impdc-icon, [impdc-icon]", inputs: { name: "name", theme: "theme", size: "size" }, viewQueries: [{ propertyName: "iconRef", first: true, predicate: ["icon"], descendants: true, static: true }], ngImport: i0, template: "<i\n #icon\n class=\"{{ typeClass }} fa-{{ name }}\"\n [style.font-size]=\"computedSize\"></i>\n", encapsulation: i0.ViewEncapsulation.None });
|
|
@@ -3514,10 +3518,7 @@ class ModalComponent {
|
|
|
3514
3518
|
constructor(_interactionService) {
|
|
3515
3519
|
this._interactionService = _interactionService;
|
|
3516
3520
|
this._interactableId = 0;
|
|
3517
|
-
|
|
3518
|
-
* Determines if the Modal should be shown immediately.
|
|
3519
|
-
*/
|
|
3520
|
-
this.show = false;
|
|
3521
|
+
this._show = false;
|
|
3521
3522
|
/**
|
|
3522
3523
|
* The theme of the Modal. Affects the layout of the Modal as well as some colors.
|
|
3523
3524
|
*/
|
|
@@ -3535,6 +3536,10 @@ class ModalComponent {
|
|
|
3535
3536
|
* The subject text of the Modal.
|
|
3536
3537
|
*/
|
|
3537
3538
|
this.titleText = '';
|
|
3539
|
+
/**
|
|
3540
|
+
* The fallback button text to accept the Modal. This is bypassed if you content-project the accept button.
|
|
3541
|
+
*/
|
|
3542
|
+
this.acceptText = 'OK';
|
|
3538
3543
|
/**
|
|
3539
3544
|
* Determines if the Modal should fade in/out.
|
|
3540
3545
|
*/
|
|
@@ -3557,6 +3562,12 @@ class ModalComponent {
|
|
|
3557
3562
|
this.accept = new EventEmitter();
|
|
3558
3563
|
this._interactableId = this._interactionService.add(this);
|
|
3559
3564
|
}
|
|
3565
|
+
/**
|
|
3566
|
+
* Determines if the Modal should be shown immediately.
|
|
3567
|
+
*/
|
|
3568
|
+
set show(show) {
|
|
3569
|
+
this._show = show;
|
|
3570
|
+
}
|
|
3560
3571
|
get interactableId() {
|
|
3561
3572
|
return this._interactableId;
|
|
3562
3573
|
}
|
|
@@ -3564,7 +3575,7 @@ class ModalComponent {
|
|
|
3564
3575
|
return this.interactableId > 0;
|
|
3565
3576
|
}
|
|
3566
3577
|
get shown() {
|
|
3567
|
-
return this.valid && this.
|
|
3578
|
+
return this.valid && this._show;
|
|
3568
3579
|
}
|
|
3569
3580
|
get showWorkingIcon() {
|
|
3570
3581
|
return !!this.iconName && this.theme === ModalTheme.Working;
|
|
@@ -3591,26 +3602,46 @@ class ModalComponent {
|
|
|
3591
3602
|
this._interactableId = 0;
|
|
3592
3603
|
}
|
|
3593
3604
|
handleDismiss(event) {
|
|
3594
|
-
if (!this.dismissable
|
|
3605
|
+
if (!this.dismissable ||
|
|
3606
|
+
!!this.dismissEl?.nativeElement?.firstChild?.disabled) {
|
|
3595
3607
|
return;
|
|
3596
3608
|
}
|
|
3597
|
-
this.
|
|
3609
|
+
this._show = false;
|
|
3598
3610
|
this.dismiss.emit(event);
|
|
3599
3611
|
}
|
|
3600
3612
|
handleDeny(event) {
|
|
3601
|
-
this.
|
|
3613
|
+
if (!!this.denyEl?.nativeElement?.firstChild?.disabled) {
|
|
3614
|
+
return;
|
|
3615
|
+
}
|
|
3616
|
+
this._show = false;
|
|
3602
3617
|
this.deny.emit(event);
|
|
3603
3618
|
}
|
|
3604
3619
|
handleAccept(event) {
|
|
3605
|
-
this.
|
|
3620
|
+
console.log('this.acceptEl', this.acceptEl);
|
|
3621
|
+
if (!!this.acceptEl?.nativeElement?.firstChild?.disabled) {
|
|
3622
|
+
return;
|
|
3623
|
+
}
|
|
3624
|
+
this._show = false;
|
|
3606
3625
|
this.accept.emit(event);
|
|
3607
3626
|
}
|
|
3627
|
+
/**
|
|
3628
|
+
* Opens/shows the modal programmatically.
|
|
3629
|
+
*/
|
|
3630
|
+
open() {
|
|
3631
|
+
this._show = true;
|
|
3632
|
+
}
|
|
3633
|
+
/**
|
|
3634
|
+
* Closes/hides the modal programmatically.
|
|
3635
|
+
*/
|
|
3636
|
+
close() {
|
|
3637
|
+
this._show = false;
|
|
3638
|
+
}
|
|
3608
3639
|
}
|
|
3609
3640
|
ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ModalComponent, deps: [{ token: InteractionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3610
|
-
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ModalComponent, selector: "impdc-modal", inputs: { show: "show", theme: "theme", size: "size", iconName: "iconName", iconTheme: "iconTheme", titleText: "titleText", dismissable: "dismissable", fade: "fade", backdrop: "backdrop" }, outputs: { dismiss: "dismiss", deny: "deny", accept: "accept" }, ngImport: i0, template: "<div\n *ngIf=\"valid\"\n class=\"impdc modal\"\n [class.fade]=\"fade\"\n [class.in]=\"fade && shown\"\n [class.show]=\"shown\"\n [class.dismissable]=\"dismissable\"\n tabindex=\"-1\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.escape)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.enter)=\"handleAccept($event); $event.stopPropagation()\">\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable modal-theme-{{\n theme\n }}\"\n [class.modal-sm]=\"size === 'sm'\"\n [class.modal-lg]=\"size === 'lg'\"\n [class.modal-xl]=\"size === 'xl'\"\n [class.modal-fullscreen]=\"size === 'fs'\"\n [class.modal-fullscreen-lg-down]=\"size !== 'fs'\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"modal-content\">\n <div *ngIf=\"showDestructiveIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </div>\n <div #header class=\"modal-header\" [class.hide]=\"hideHeader\">\n <h3 class=\"modal-title\">\n <span *ngIf=\"showWorkingIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </span>\n <span>{{ titleText }}</span>\n </h3>\n <button\n impdcButton\n *ngIf=\"dismissable\"\n theme=\"close\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"></button>\n </div>\n <div #bodyEl class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <div #footer class=\"modal-footer\">\n <span\n #dismissEl\n *ngIf=\"dismissable\"\n [class.hide]=\"!dismissEl.children.length\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\">\n <ng-content select=\"[dismiss]\"></ng-content>\n </span>\n <span\n #denyEl\n [class.hide]=\"!denyEl.children.length\"\n (click)=\"handleDeny($event); $event.stopPropagation()\">\n <ng-content select=\"[deny]\"></ng-content>\n </span>\n <span\n #acceptEl\n [class.hide]=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <ng-content select=\"[accept]\"></ng-content>\n </span>\n <span\n #acceptFallbackEl\n *ngIf=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <button
|
|
3641
|
+
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ModalComponent, selector: "impdc-modal", inputs: { show: "show", theme: "theme", size: "size", iconName: "iconName", iconTheme: "iconTheme", titleText: "titleText", acceptText: "acceptText", dismissable: "dismissable", fade: "fade", backdrop: "backdrop" }, outputs: { dismiss: "dismiss", deny: "deny", accept: "accept" }, viewQueries: [{ propertyName: "dismissEl", first: true, predicate: ["dismissEl"], descendants: true }, { propertyName: "denyEl", first: true, predicate: ["denyEl"], descendants: true }, { propertyName: "acceptEl", first: true, predicate: ["acceptEl"], descendants: true }], ngImport: i0, template: "<div\n *ngIf=\"valid\"\n class=\"impdc modal\"\n [class.fade]=\"fade\"\n [class.in]=\"fade && shown\"\n [class.show]=\"shown\"\n [class.dismissable]=\"dismissable\"\n tabindex=\"-1\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.escape)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.enter)=\"handleAccept($event); $event.stopPropagation()\">\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable modal-theme-{{\n theme\n }}\"\n [class.modal-sm]=\"size === 'sm'\"\n [class.modal-lg]=\"size === 'lg'\"\n [class.modal-xl]=\"size === 'xl'\"\n [class.modal-fullscreen]=\"size === 'fs'\"\n [class.modal-fullscreen-lg-down]=\"size !== 'fs'\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"modal-content\">\n <div *ngIf=\"showDestructiveIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </div>\n <div #header class=\"modal-header\" [class.hide]=\"hideHeader\">\n <h3 class=\"modal-title\">\n <span *ngIf=\"showWorkingIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </span>\n <span>{{ titleText }}</span>\n </h3>\n <button\n impdcButton\n *ngIf=\"dismissable\"\n theme=\"close\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"></button>\n </div>\n <div #bodyEl class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <div #footer class=\"modal-footer\">\n <span\n #dismissEl\n *ngIf=\"dismissable\"\n [class.hide]=\"!dismissEl.children.length\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\">\n <ng-content select=\"[dismiss]\"></ng-content>\n </span>\n <span\n #denyEl\n [class.hide]=\"!denyEl.children.length\"\n (click)=\"handleDeny($event); $event.stopPropagation()\">\n <ng-content select=\"[deny]\"></ng-content>\n </span>\n <span\n #acceptEl\n [class.hide]=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <ng-content select=\"[accept]\"></ng-content>\n </span>\n <span\n #acceptFallbackEl\n *ngIf=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <button\n impdcButton\n [text]=\"acceptText\"\n [theme]=\"acceptFallbackTheme\"></button>\n </span>\n </div>\n </div>\n </div>\n</div>\n", styles: [".impdc.modal{-webkit-user-select:none;user-select:none}.impdc.modal .modal-icon{display:inline-flex;justify-content:center;align-items:center;height:40px;width:40px;color:var(--impd-color-gray-500);background:var(--impd-color-gray-100);border-radius:50%;flex-shrink:0}.impdc.modal .modal-icon .fa,.impdc.modal .modal-icon .fa-brands,.impdc.modal .modal-icon .fa-duotone,.impdc.modal .modal-icon .fa-light,.impdc.modal .modal-icon .fa-regular,.impdc.modal .modal-icon .fa-solid,.impdc.modal .modal-icon .fa-thin,.impdc.modal .modal-icon .fab,.impdc.modal .modal-icon .fad,.impdc.modal .modal-icon .fal,.impdc.modal .modal-icon .far,.impdc.modal .modal-icon .fas,.impdc.modal .modal-icon .fat{line-height:var(--impartner-hex-modal-title-line-height)}.impdc.modal.fade.in{background-color:transparent}.impdc.modal.show{display:block;opacity:1}.impdc.modal:not(.show),.impdc.modal.hide,.impdc.modal .hide{display:none}.impdc.modal.dismissable{cursor:pointer}.impdc.modal.dismissable .modal-dialog{cursor:default}.impdc.modal .modal-dialog{cursor:default;-webkit-user-select:auto;user-select:auto}.impdc.modal .modal-theme-simple .modal-header,.impdc.modal .modal-theme-destructive .modal-header{border:0;padding-bottom:0}.impdc.modal .modal-theme-simple .modal-body,.impdc.modal .modal-theme-destructive .modal-body{padding:calc(var(--impartner-hex-modal-padding) * .5) var(--impartner-hex-modal-padding) var(--impartner-hex-modal-padding)}.impdc.modal .modal-theme-simple .modal-footer,.impdc.modal .modal-theme-destructive .modal-footer{border:0;padding-top:0}.impdc.modal .modal-theme-working .modal-footer{padding:calc(var(--impartner-hex-modal-padding) * .5 - var(--impartner-hex-modal-footer-gap) * .5) calc(var(--impartner-hex-modal-padding) - var(--impartner-hex-modal-footer-gap) * .5)}.impdc.modal .modal-theme-destructive .modal-content{display:grid;grid-template-areas:\"modal-icon modal-header\" \"modal-icon modal-body\" \"modal-footer modal-footer\";grid-template-columns:auto 1fr;grid-template-rows:auto 1fr auto}.impdc.modal .modal-theme-destructive .modal-content>.modal-icon{grid-area:modal-icon;margin:var(--impartner-hex-modal-header-padding);margin-right:0;margin-bottom:0}.impdc.modal .modal-theme-destructive .modal-content>.modal-header{grid-area:modal-header;padding-left:16px;margin-top:8px;justify-content:unset}.impdc.modal .modal-theme-destructive .modal-content>.modal-body{grid-area:modal-body;padding-left:16px}.impdc.modal .modal-theme-destructive .modal-content>.modal-footer{grid-area:modal-footer}.impdc.modal .modal-theme-destructive .modal-icon{color:var(--impd-color-red-600);background:var(--impd-color-red-100)}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: ButtonComponent, selector: "button[impdcButton]", inputs: ["type", "theme", "text", "disabled", "titleText", "ariaLabel"] }, { kind: "component", type: IconComponent, selector: "impdc-icon, [impdc-icon]", inputs: ["name", "theme", "size"] }] });
|
|
3611
3642
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ModalComponent, decorators: [{
|
|
3612
3643
|
type: Component,
|
|
3613
|
-
args: [{ selector: 'impdc-modal', template: "<div\n *ngIf=\"valid\"\n class=\"impdc modal\"\n [class.fade]=\"fade\"\n [class.in]=\"fade && shown\"\n [class.show]=\"shown\"\n [class.dismissable]=\"dismissable\"\n tabindex=\"-1\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.escape)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.enter)=\"handleAccept($event); $event.stopPropagation()\">\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable modal-theme-{{\n theme\n }}\"\n [class.modal-sm]=\"size === 'sm'\"\n [class.modal-lg]=\"size === 'lg'\"\n [class.modal-xl]=\"size === 'xl'\"\n [class.modal-fullscreen]=\"size === 'fs'\"\n [class.modal-fullscreen-lg-down]=\"size !== 'fs'\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"modal-content\">\n <div *ngIf=\"showDestructiveIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </div>\n <div #header class=\"modal-header\" [class.hide]=\"hideHeader\">\n <h3 class=\"modal-title\">\n <span *ngIf=\"showWorkingIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </span>\n <span>{{ titleText }}</span>\n </h3>\n <button\n impdcButton\n *ngIf=\"dismissable\"\n theme=\"close\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"></button>\n </div>\n <div #bodyEl class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <div #footer class=\"modal-footer\">\n <span\n #dismissEl\n *ngIf=\"dismissable\"\n [class.hide]=\"!dismissEl.children.length\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\">\n <ng-content select=\"[dismiss]\"></ng-content>\n </span>\n <span\n #denyEl\n [class.hide]=\"!denyEl.children.length\"\n (click)=\"handleDeny($event); $event.stopPropagation()\">\n <ng-content select=\"[deny]\"></ng-content>\n </span>\n <span\n #acceptEl\n [class.hide]=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <ng-content select=\"[accept]\"></ng-content>\n </span>\n <span\n #acceptFallbackEl\n *ngIf=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <button
|
|
3644
|
+
args: [{ selector: 'impdc-modal', template: "<div\n *ngIf=\"valid\"\n class=\"impdc modal\"\n [class.fade]=\"fade\"\n [class.in]=\"fade && shown\"\n [class.show]=\"shown\"\n [class.dismissable]=\"dismissable\"\n tabindex=\"-1\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.escape)=\"handleDismiss($event); $event.stopPropagation()\"\n (keydown.enter)=\"handleAccept($event); $event.stopPropagation()\">\n <div\n class=\"modal-dialog modal-dialog-centered modal-dialog-scrollable modal-theme-{{\n theme\n }}\"\n [class.modal-sm]=\"size === 'sm'\"\n [class.modal-lg]=\"size === 'lg'\"\n [class.modal-xl]=\"size === 'xl'\"\n [class.modal-fullscreen]=\"size === 'fs'\"\n [class.modal-fullscreen-lg-down]=\"size !== 'fs'\"\n (click)=\"$event.stopPropagation()\">\n <div class=\"modal-content\">\n <div *ngIf=\"showDestructiveIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </div>\n <div #header class=\"modal-header\" [class.hide]=\"hideHeader\">\n <h3 class=\"modal-title\">\n <span *ngIf=\"showWorkingIcon\" class=\"modal-icon\">\n <span impdc-icon [name]=\"iconName\" [theme]=\"iconTheme\"></span>\n </span>\n <span>{{ titleText }}</span>\n </h3>\n <button\n impdcButton\n *ngIf=\"dismissable\"\n theme=\"close\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\"></button>\n </div>\n <div #bodyEl class=\"modal-body\">\n <ng-content></ng-content>\n </div>\n <div #footer class=\"modal-footer\">\n <span\n #dismissEl\n *ngIf=\"dismissable\"\n [class.hide]=\"!dismissEl.children.length\"\n (click)=\"handleDismiss($event); $event.stopPropagation()\">\n <ng-content select=\"[dismiss]\"></ng-content>\n </span>\n <span\n #denyEl\n [class.hide]=\"!denyEl.children.length\"\n (click)=\"handleDeny($event); $event.stopPropagation()\">\n <ng-content select=\"[deny]\"></ng-content>\n </span>\n <span\n #acceptEl\n [class.hide]=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <ng-content select=\"[accept]\"></ng-content>\n </span>\n <span\n #acceptFallbackEl\n *ngIf=\"!acceptEl.children.length\"\n (click)=\"handleAccept($event); $event.stopPropagation()\">\n <button\n impdcButton\n [text]=\"acceptText\"\n [theme]=\"acceptFallbackTheme\"></button>\n </span>\n </div>\n </div>\n </div>\n</div>\n", styles: [".impdc.modal{-webkit-user-select:none;user-select:none}.impdc.modal .modal-icon{display:inline-flex;justify-content:center;align-items:center;height:40px;width:40px;color:var(--impd-color-gray-500);background:var(--impd-color-gray-100);border-radius:50%;flex-shrink:0}.impdc.modal .modal-icon .fa,.impdc.modal .modal-icon .fa-brands,.impdc.modal .modal-icon .fa-duotone,.impdc.modal .modal-icon .fa-light,.impdc.modal .modal-icon .fa-regular,.impdc.modal .modal-icon .fa-solid,.impdc.modal .modal-icon .fa-thin,.impdc.modal .modal-icon .fab,.impdc.modal .modal-icon .fad,.impdc.modal .modal-icon .fal,.impdc.modal .modal-icon .far,.impdc.modal .modal-icon .fas,.impdc.modal .modal-icon .fat{line-height:var(--impartner-hex-modal-title-line-height)}.impdc.modal.fade.in{background-color:transparent}.impdc.modal.show{display:block;opacity:1}.impdc.modal:not(.show),.impdc.modal.hide,.impdc.modal .hide{display:none}.impdc.modal.dismissable{cursor:pointer}.impdc.modal.dismissable .modal-dialog{cursor:default}.impdc.modal .modal-dialog{cursor:default;-webkit-user-select:auto;user-select:auto}.impdc.modal .modal-theme-simple .modal-header,.impdc.modal .modal-theme-destructive .modal-header{border:0;padding-bottom:0}.impdc.modal .modal-theme-simple .modal-body,.impdc.modal .modal-theme-destructive .modal-body{padding:calc(var(--impartner-hex-modal-padding) * .5) var(--impartner-hex-modal-padding) var(--impartner-hex-modal-padding)}.impdc.modal .modal-theme-simple .modal-footer,.impdc.modal .modal-theme-destructive .modal-footer{border:0;padding-top:0}.impdc.modal .modal-theme-working .modal-footer{padding:calc(var(--impartner-hex-modal-padding) * .5 - var(--impartner-hex-modal-footer-gap) * .5) calc(var(--impartner-hex-modal-padding) - var(--impartner-hex-modal-footer-gap) * .5)}.impdc.modal .modal-theme-destructive .modal-content{display:grid;grid-template-areas:\"modal-icon modal-header\" \"modal-icon modal-body\" \"modal-footer modal-footer\";grid-template-columns:auto 1fr;grid-template-rows:auto 1fr auto}.impdc.modal .modal-theme-destructive .modal-content>.modal-icon{grid-area:modal-icon;margin:var(--impartner-hex-modal-header-padding);margin-right:0;margin-bottom:0}.impdc.modal .modal-theme-destructive .modal-content>.modal-header{grid-area:modal-header;padding-left:16px;margin-top:8px;justify-content:unset}.impdc.modal .modal-theme-destructive .modal-content>.modal-body{grid-area:modal-body;padding-left:16px}.impdc.modal .modal-theme-destructive .modal-content>.modal-footer{grid-area:modal-footer}.impdc.modal .modal-theme-destructive .modal-icon{color:var(--impd-color-red-600);background:var(--impd-color-red-100)}\n"] }]
|
|
3614
3645
|
}], ctorParameters: function () { return [{ type: InteractionService }]; }, propDecorators: { show: [{
|
|
3615
3646
|
type: Input
|
|
3616
3647
|
}], theme: [{
|
|
@@ -3623,12 +3654,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
3623
3654
|
type: Input
|
|
3624
3655
|
}], titleText: [{
|
|
3625
3656
|
type: Input
|
|
3657
|
+
}], acceptText: [{
|
|
3658
|
+
type: Input
|
|
3626
3659
|
}], dismissable: [{
|
|
3627
3660
|
type: Input
|
|
3628
3661
|
}], fade: [{
|
|
3629
3662
|
type: Input
|
|
3630
3663
|
}], backdrop: [{
|
|
3631
3664
|
type: Input
|
|
3665
|
+
}], dismissEl: [{
|
|
3666
|
+
type: ViewChild,
|
|
3667
|
+
args: ['dismissEl', { static: false }]
|
|
3668
|
+
}], denyEl: [{
|
|
3669
|
+
type: ViewChild,
|
|
3670
|
+
args: ['denyEl', { static: false }]
|
|
3671
|
+
}], acceptEl: [{
|
|
3672
|
+
type: ViewChild,
|
|
3673
|
+
args: ['acceptEl', { static: false }]
|
|
3632
3674
|
}], dismiss: [{
|
|
3633
3675
|
type: Output
|
|
3634
3676
|
}], deny: [{
|
|
@@ -3656,9 +3698,15 @@ class BackdropComponent {
|
|
|
3656
3698
|
ngOnInit() {
|
|
3657
3699
|
this.interactionService.registerBackdrop(this);
|
|
3658
3700
|
}
|
|
3701
|
+
ngOnDestroy() {
|
|
3702
|
+
this.interactionService.unregisterBackdrop(this);
|
|
3703
|
+
}
|
|
3659
3704
|
invalidate() {
|
|
3660
3705
|
this._valid = false;
|
|
3661
3706
|
}
|
|
3707
|
+
validate() {
|
|
3708
|
+
this._valid = true;
|
|
3709
|
+
}
|
|
3662
3710
|
}
|
|
3663
3711
|
BackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: BackdropComponent, deps: [{ token: InteractionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3664
3712
|
BackdropComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: BackdropComponent, selector: "impdc-backdrop", ngImport: i0, template: "<div *ngIf=\"valid\" class=\"impdc modal-backdrop fade\" [class.show]=\"show\"></div>\n", styles: [".impdc.modal-backdrop{position:fixed;left:0;top:0;width:100vw;height:100vh;-webkit-user-select:none;user-select:none}.impdc.modal-backdrop.fade{transition:opacity .3s linear}.impdc.modal-backdrop:not(.show){height:0;opacity:0;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
@@ -5508,6 +5556,7 @@ class RadioGroupDirective extends _RadioGroupDirectiveBase {
|
|
|
5508
5556
|
/** @ignore */
|
|
5509
5557
|
emitChangesEvent() {
|
|
5510
5558
|
if (this._initialized) {
|
|
5559
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5511
5560
|
this.change.emit({ source: this._selected, value: this._value });
|
|
5512
5561
|
}
|
|
5513
5562
|
}
|
|
@@ -5850,6 +5899,7 @@ class SelectModel {
|
|
|
5850
5899
|
}
|
|
5851
5900
|
sort(predicateFunc) {
|
|
5852
5901
|
if (this._multiple && this.selected) {
|
|
5902
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5853
5903
|
this._selected.sort(predicateFunc);
|
|
5854
5904
|
}
|
|
5855
5905
|
}
|
|
@@ -7670,8 +7720,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
7670
7720
|
* `ScrollableModule` also imports and exports [BrandingModule](./?path=/docs/design-components-directives-impdcbranded).
|
|
7671
7721
|
*/
|
|
7672
7722
|
class ScrollableComponent {
|
|
7673
|
-
constructor(_cd) {
|
|
7723
|
+
constructor(_cd, _hostElementRef) {
|
|
7674
7724
|
this._cd = _cd;
|
|
7725
|
+
this._hostElementRef = _hostElementRef;
|
|
7726
|
+
this.GET_ANCESTOR_BG_SEARCH_DEPTH = 64;
|
|
7675
7727
|
/**
|
|
7676
7728
|
* The base amount to scroll.
|
|
7677
7729
|
*/
|
|
@@ -7715,12 +7767,11 @@ class ScrollableComponent {
|
|
|
7715
7767
|
this._cd.detectChanges();
|
|
7716
7768
|
}
|
|
7717
7769
|
}
|
|
7718
|
-
this._getBackgroundColorForButtons();
|
|
7719
7770
|
}
|
|
7720
7771
|
ngAfterViewInit() {
|
|
7721
7772
|
this._width = this.contentRef?.nativeElement.width;
|
|
7722
|
-
this._getBackgroundColorForButtons();
|
|
7723
7773
|
this._cd.detectChanges();
|
|
7774
|
+
Promise.resolve().then(() => this._getBackgroundColorForButtons());
|
|
7724
7775
|
}
|
|
7725
7776
|
async scroll(direction) {
|
|
7726
7777
|
if (!this._contentElement) {
|
|
@@ -7779,29 +7830,21 @@ class ScrollableComponent {
|
|
|
7779
7830
|
return promise;
|
|
7780
7831
|
}
|
|
7781
7832
|
_getBackgroundColorForButtons() {
|
|
7782
|
-
|
|
7783
|
-
return;
|
|
7784
|
-
}
|
|
7785
|
-
const projectedElementCollection = this.contentRef.nativeElement.children;
|
|
7786
|
-
if (!projectedElementCollection || !projectedElementCollection.length) {
|
|
7787
|
-
return;
|
|
7788
|
-
}
|
|
7789
|
-
const firstElement = projectedElementCollection[0];
|
|
7790
|
-
let backgroundColor = this._getBackGroundColor(firstElement);
|
|
7833
|
+
let backgroundColor = this._getBackGroundColor(this._hostElementRef.nativeElement);
|
|
7791
7834
|
if (!backgroundColor) {
|
|
7792
7835
|
backgroundColor = this._getAncestorBackgroundColor();
|
|
7793
7836
|
}
|
|
7794
|
-
this._scrollableBgColor
|
|
7837
|
+
if (this._scrollableBgColor !== backgroundColor) {
|
|
7838
|
+
this._scrollableBgColor = backgroundColor;
|
|
7839
|
+
this._cd.detectChanges();
|
|
7840
|
+
}
|
|
7795
7841
|
}
|
|
7796
7842
|
_getAncestorBackgroundColor() {
|
|
7797
|
-
if (!this.contentRef) {
|
|
7798
|
-
return null;
|
|
7799
|
-
}
|
|
7800
7843
|
let result = {
|
|
7801
|
-
parent: this.
|
|
7844
|
+
parent: this._hostElementRef.nativeElement.parentElement,
|
|
7802
7845
|
backgroundColor: null
|
|
7803
7846
|
};
|
|
7804
|
-
let count =
|
|
7847
|
+
let count = this.GET_ANCESTOR_BG_SEARCH_DEPTH;
|
|
7805
7848
|
function getParentBackgroundColor(currentContext, getBackgroundColor) {
|
|
7806
7849
|
const result = { parent: null, backgroundColor: null };
|
|
7807
7850
|
if (currentContext && currentContext.parent) {
|
|
@@ -7832,12 +7875,12 @@ class ScrollableComponent {
|
|
|
7832
7875
|
return element.style.backgroundColor;
|
|
7833
7876
|
}
|
|
7834
7877
|
}
|
|
7835
|
-
ScrollableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ScrollableComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7878
|
+
ScrollableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ScrollableComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7836
7879
|
ScrollableComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.2.12", type: ScrollableComponent, selector: "impdc-scrollable, div[impdc-scrollable]", inputs: { scrollUnit: "scrollUnit", clickScrollMultiplier: "clickScrollMultiplier" }, host: { properties: { "style.--impdc-scrollable-bg": "this._scrollableBgColor" } }, viewQueries: [{ propertyName: "containerRef", first: true, predicate: ["container"], descendants: true }, { propertyName: "contentRef", first: true, predicate: ["content"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"impdc-scrollable\"\n #container\n impdcSizeDetector\n (resized)=\"widthChanged($event)\">\n <a class=\"impdc-scrollable-left\" (click)=\"scroll(-1)\" *ngIf=\"canScrollLeft\">\n <i class=\"fas fa-chevron-left default\"></i>\n </a>\n <div #content class=\"content-container\">\n <ng-content></ng-content>\n </div>\n <a class=\"impdc-scrollable-right\" (click)=\"scroll(1)\" *ngIf=\"canScrollRight\">\n <i class=\"fas fa-chevron-right default\"></i>\n </a>\n</div>\n", styles: [".impdc-scrollable{position:relative;overflow-y:hidden}.impdc-scrollable .impdc-scrollable-base,.impdc-scrollable .impdc-scrollable-right,.impdc-scrollable .impdc-scrollable-left{position:absolute;top:0px;bottom:0px;display:flex;align-items:center;text-align:center;width:6.9rem;z-index:1;color:var(--impd-color-motion-blue-600, #01606d)}.impdc-scrollable .impdc-scrollable-left{justify-content:left;padding-left:1.5rem;background-image:linear-gradient(to right,var(--impdc-scrollable-bg, #fff) 50%,rgba(255,255,255,.0001) 86.46%)}.impdc-scrollable .impdc-scrollable-right{right:0;padding-right:1.5rem;justify-content:right;background-image:linear-gradient(to left,var(--impdc-scrollable-bg, #fff) 50%,rgba(255,255,255,.0001) 86.46%)}.impdc-scrollable .content-container{overflow-x:hidden;-webkit-overflow-scrolling:touch;white-space:nowrap}:host(.branded) .impdc-scrollable .impdc-scrollable-left,:host(.branded) .impdc-scrollable .impdc-scrollable-right{color:var(--px-primary-color, var(--impd-color-motion-blue-600, #01606d))}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: SizeDetectorDirective, selector: "[impdcSizeDetector]", outputs: ["resized"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
7837
7880
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ScrollableComponent, decorators: [{
|
|
7838
7881
|
type: Component,
|
|
7839
7882
|
args: [{ selector: 'impdc-scrollable, div[impdc-scrollable]', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"impdc-scrollable\"\n #container\n impdcSizeDetector\n (resized)=\"widthChanged($event)\">\n <a class=\"impdc-scrollable-left\" (click)=\"scroll(-1)\" *ngIf=\"canScrollLeft\">\n <i class=\"fas fa-chevron-left default\"></i>\n </a>\n <div #content class=\"content-container\">\n <ng-content></ng-content>\n </div>\n <a class=\"impdc-scrollable-right\" (click)=\"scroll(1)\" *ngIf=\"canScrollRight\">\n <i class=\"fas fa-chevron-right default\"></i>\n </a>\n</div>\n", styles: [".impdc-scrollable{position:relative;overflow-y:hidden}.impdc-scrollable .impdc-scrollable-base,.impdc-scrollable .impdc-scrollable-right,.impdc-scrollable .impdc-scrollable-left{position:absolute;top:0px;bottom:0px;display:flex;align-items:center;text-align:center;width:6.9rem;z-index:1;color:var(--impd-color-motion-blue-600, #01606d)}.impdc-scrollable .impdc-scrollable-left{justify-content:left;padding-left:1.5rem;background-image:linear-gradient(to right,var(--impdc-scrollable-bg, #fff) 50%,rgba(255,255,255,.0001) 86.46%)}.impdc-scrollable .impdc-scrollable-right{right:0;padding-right:1.5rem;justify-content:right;background-image:linear-gradient(to left,var(--impdc-scrollable-bg, #fff) 50%,rgba(255,255,255,.0001) 86.46%)}.impdc-scrollable .content-container{overflow-x:hidden;-webkit-overflow-scrolling:touch;white-space:nowrap}:host(.branded) .impdc-scrollable .impdc-scrollable-left,:host(.branded) .impdc-scrollable .impdc-scrollable-right{color:var(--px-primary-color, var(--impd-color-motion-blue-600, #01606d))}\n"] }]
|
|
7840
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { scrollUnit: [{
|
|
7883
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { scrollUnit: [{
|
|
7841
7884
|
type: Input
|
|
7842
7885
|
}], clickScrollMultiplier: [{
|
|
7843
7886
|
type: Input
|
|
@@ -8213,8 +8256,18 @@ class InteractionService {
|
|
|
8213
8256
|
if (!this._backdrop) {
|
|
8214
8257
|
this._backdrop = modalBackdrop;
|
|
8215
8258
|
}
|
|
8216
|
-
else {
|
|
8217
|
-
|
|
8259
|
+
else if (this._backdrop !== modalBackdrop) {
|
|
8260
|
+
this._backdrop.invalidate();
|
|
8261
|
+
this._backdrop = modalBackdrop;
|
|
8262
|
+
if (!modalBackdrop.valid) {
|
|
8263
|
+
// we invalidated and set backdrop to the same backdrop
|
|
8264
|
+
modalBackdrop.validate();
|
|
8265
|
+
}
|
|
8266
|
+
}
|
|
8267
|
+
}
|
|
8268
|
+
unregisterBackdrop(modalBackdrop) {
|
|
8269
|
+
if (this._backdrop === modalBackdrop) {
|
|
8270
|
+
this._backdrop = undefined;
|
|
8218
8271
|
}
|
|
8219
8272
|
}
|
|
8220
8273
|
add(interactable) {
|