@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';
|
|
@@ -3083,7 +3083,7 @@ function _isNumberValue(value) {
|
|
|
3083
3083
|
}
|
|
3084
3084
|
|
|
3085
3085
|
function sanitize(value) {
|
|
3086
|
-
return
|
|
3086
|
+
return sanitizeHtml(value, {
|
|
3087
3087
|
allowedTags: []
|
|
3088
3088
|
});
|
|
3089
3089
|
}
|
|
@@ -3204,6 +3204,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
3204
3204
|
*/
|
|
3205
3205
|
class IconComponent {
|
|
3206
3206
|
constructor() {
|
|
3207
|
+
this._loading = true;
|
|
3208
|
+
this._licensed = false;
|
|
3207
3209
|
/**
|
|
3208
3210
|
* The Font Awesome 5 icon style. Local development may fallback to a free available
|
|
3209
3211
|
* theme when possible.
|
|
@@ -3215,17 +3217,8 @@ class IconComponent {
|
|
|
3215
3217
|
*/
|
|
3216
3218
|
this.size = '1.8rem';
|
|
3217
3219
|
}
|
|
3218
|
-
get usingLicensed() {
|
|
3219
|
-
var _a, _b;
|
|
3220
|
-
if (!((_a = this.iconRef) === null || _a === void 0 ? void 0 : _a.nativeElement)) {
|
|
3221
|
-
return false;
|
|
3222
|
-
}
|
|
3223
|
-
const iconFontFamily = getComputedStyle((_b = this.iconRef) === null || _b === void 0 ? void 0 : _b.nativeElement).getPropertyValue('font-family');
|
|
3224
|
-
return (iconFontFamily.includes('Font Awesome') &&
|
|
3225
|
-
!iconFontFamily.includes('Free'));
|
|
3226
|
-
}
|
|
3227
3220
|
get typeClass() {
|
|
3228
|
-
if (this.
|
|
3221
|
+
if (this._licensed) {
|
|
3229
3222
|
switch (this.theme) {
|
|
3230
3223
|
case 'light':
|
|
3231
3224
|
return 'fal';
|
|
@@ -3249,6 +3242,16 @@ class IconComponent {
|
|
|
3249
3242
|
}
|
|
3250
3243
|
return `${this.size}px`;
|
|
3251
3244
|
}
|
|
3245
|
+
ngAfterContentChecked() {
|
|
3246
|
+
if (this._loading) {
|
|
3247
|
+
// During init and possibly a few checks, `iconFontFamily` will be an inherited font, later it will be Font Awesome.
|
|
3248
|
+
const iconFontFamily = getComputedStyle(this.iconRef.nativeElement).getPropertyValue('font-family');
|
|
3249
|
+
if (iconFontFamily.includes('Font Awesome')) {
|
|
3250
|
+
this._licensed = !iconFontFamily.includes('Free');
|
|
3251
|
+
this._loading = false;
|
|
3252
|
+
}
|
|
3253
|
+
}
|
|
3254
|
+
}
|
|
3252
3255
|
}
|
|
3253
3256
|
IconComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: IconComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
3254
3257
|
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 });
|
|
@@ -3516,10 +3519,7 @@ class ModalComponent {
|
|
|
3516
3519
|
constructor(_interactionService) {
|
|
3517
3520
|
this._interactionService = _interactionService;
|
|
3518
3521
|
this._interactableId = 0;
|
|
3519
|
-
|
|
3520
|
-
* Determines if the Modal should be shown immediately.
|
|
3521
|
-
*/
|
|
3522
|
-
this.show = false;
|
|
3522
|
+
this._show = false;
|
|
3523
3523
|
/**
|
|
3524
3524
|
* The theme of the Modal. Affects the layout of the Modal as well as some colors.
|
|
3525
3525
|
*/
|
|
@@ -3537,6 +3537,10 @@ class ModalComponent {
|
|
|
3537
3537
|
* The subject text of the Modal.
|
|
3538
3538
|
*/
|
|
3539
3539
|
this.titleText = '';
|
|
3540
|
+
/**
|
|
3541
|
+
* The fallback button text to accept the Modal. This is bypassed if you content-project the accept button.
|
|
3542
|
+
*/
|
|
3543
|
+
this.acceptText = 'OK';
|
|
3540
3544
|
/**
|
|
3541
3545
|
* Determines if the Modal should fade in/out.
|
|
3542
3546
|
*/
|
|
@@ -3559,6 +3563,12 @@ class ModalComponent {
|
|
|
3559
3563
|
this.accept = new EventEmitter();
|
|
3560
3564
|
this._interactableId = this._interactionService.add(this);
|
|
3561
3565
|
}
|
|
3566
|
+
/**
|
|
3567
|
+
* Determines if the Modal should be shown immediately.
|
|
3568
|
+
*/
|
|
3569
|
+
set show(show) {
|
|
3570
|
+
this._show = show;
|
|
3571
|
+
}
|
|
3562
3572
|
get interactableId() {
|
|
3563
3573
|
return this._interactableId;
|
|
3564
3574
|
}
|
|
@@ -3566,7 +3576,7 @@ class ModalComponent {
|
|
|
3566
3576
|
return this.interactableId > 0;
|
|
3567
3577
|
}
|
|
3568
3578
|
get shown() {
|
|
3569
|
-
return this.valid && this.
|
|
3579
|
+
return this.valid && this._show;
|
|
3570
3580
|
}
|
|
3571
3581
|
get showWorkingIcon() {
|
|
3572
3582
|
return !!this.iconName && this.theme === ModalTheme.Working;
|
|
@@ -3593,26 +3603,49 @@ class ModalComponent {
|
|
|
3593
3603
|
this._interactableId = 0;
|
|
3594
3604
|
}
|
|
3595
3605
|
handleDismiss(event) {
|
|
3596
|
-
|
|
3606
|
+
var _a, _b, _c;
|
|
3607
|
+
if (!this.dismissable ||
|
|
3608
|
+
!!((_c = (_b = (_a = this.dismissEl) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.firstChild) === null || _c === void 0 ? void 0 : _c.disabled)) {
|
|
3597
3609
|
return;
|
|
3598
3610
|
}
|
|
3599
|
-
this.
|
|
3611
|
+
this._show = false;
|
|
3600
3612
|
this.dismiss.emit(event);
|
|
3601
3613
|
}
|
|
3602
3614
|
handleDeny(event) {
|
|
3603
|
-
|
|
3615
|
+
var _a, _b, _c;
|
|
3616
|
+
if (!!((_c = (_b = (_a = this.denyEl) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.firstChild) === null || _c === void 0 ? void 0 : _c.disabled)) {
|
|
3617
|
+
return;
|
|
3618
|
+
}
|
|
3619
|
+
this._show = false;
|
|
3604
3620
|
this.deny.emit(event);
|
|
3605
3621
|
}
|
|
3606
3622
|
handleAccept(event) {
|
|
3607
|
-
|
|
3623
|
+
var _a, _b, _c;
|
|
3624
|
+
console.log('this.acceptEl', this.acceptEl);
|
|
3625
|
+
if (!!((_c = (_b = (_a = this.acceptEl) === null || _a === void 0 ? void 0 : _a.nativeElement) === null || _b === void 0 ? void 0 : _b.firstChild) === null || _c === void 0 ? void 0 : _c.disabled)) {
|
|
3626
|
+
return;
|
|
3627
|
+
}
|
|
3628
|
+
this._show = false;
|
|
3608
3629
|
this.accept.emit(event);
|
|
3609
3630
|
}
|
|
3631
|
+
/**
|
|
3632
|
+
* Opens/shows the modal programmatically.
|
|
3633
|
+
*/
|
|
3634
|
+
open() {
|
|
3635
|
+
this._show = true;
|
|
3636
|
+
}
|
|
3637
|
+
/**
|
|
3638
|
+
* Closes/hides the modal programmatically.
|
|
3639
|
+
*/
|
|
3640
|
+
close() {
|
|
3641
|
+
this._show = false;
|
|
3642
|
+
}
|
|
3610
3643
|
}
|
|
3611
3644
|
ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ModalComponent, deps: [{ token: InteractionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3612
|
-
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
|
|
3645
|
+
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"] }] });
|
|
3613
3646
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ModalComponent, decorators: [{
|
|
3614
3647
|
type: Component,
|
|
3615
|
-
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
|
|
3648
|
+
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"] }]
|
|
3616
3649
|
}], ctorParameters: function () { return [{ type: InteractionService }]; }, propDecorators: { show: [{
|
|
3617
3650
|
type: Input
|
|
3618
3651
|
}], theme: [{
|
|
@@ -3625,12 +3658,23 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
3625
3658
|
type: Input
|
|
3626
3659
|
}], titleText: [{
|
|
3627
3660
|
type: Input
|
|
3661
|
+
}], acceptText: [{
|
|
3662
|
+
type: Input
|
|
3628
3663
|
}], dismissable: [{
|
|
3629
3664
|
type: Input
|
|
3630
3665
|
}], fade: [{
|
|
3631
3666
|
type: Input
|
|
3632
3667
|
}], backdrop: [{
|
|
3633
3668
|
type: Input
|
|
3669
|
+
}], dismissEl: [{
|
|
3670
|
+
type: ViewChild,
|
|
3671
|
+
args: ['dismissEl', { static: false }]
|
|
3672
|
+
}], denyEl: [{
|
|
3673
|
+
type: ViewChild,
|
|
3674
|
+
args: ['denyEl', { static: false }]
|
|
3675
|
+
}], acceptEl: [{
|
|
3676
|
+
type: ViewChild,
|
|
3677
|
+
args: ['acceptEl', { static: false }]
|
|
3634
3678
|
}], dismiss: [{
|
|
3635
3679
|
type: Output
|
|
3636
3680
|
}], deny: [{
|
|
@@ -3658,9 +3702,15 @@ class BackdropComponent {
|
|
|
3658
3702
|
ngOnInit() {
|
|
3659
3703
|
this.interactionService.registerBackdrop(this);
|
|
3660
3704
|
}
|
|
3705
|
+
ngOnDestroy() {
|
|
3706
|
+
this.interactionService.unregisterBackdrop(this);
|
|
3707
|
+
}
|
|
3661
3708
|
invalidate() {
|
|
3662
3709
|
this._valid = false;
|
|
3663
3710
|
}
|
|
3711
|
+
validate() {
|
|
3712
|
+
this._valid = true;
|
|
3713
|
+
}
|
|
3664
3714
|
}
|
|
3665
3715
|
BackdropComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: BackdropComponent, deps: [{ token: InteractionService }], target: i0.ɵɵFactoryTarget.Component });
|
|
3666
3716
|
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"] }] });
|
|
@@ -5523,6 +5573,7 @@ class RadioGroupDirective extends _RadioGroupDirectiveBase {
|
|
|
5523
5573
|
/** @ignore */
|
|
5524
5574
|
emitChangesEvent() {
|
|
5525
5575
|
if (this._initialized) {
|
|
5576
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5526
5577
|
this.change.emit({ source: this._selected, value: this._value });
|
|
5527
5578
|
}
|
|
5528
5579
|
}
|
|
@@ -5869,6 +5920,7 @@ class SelectModel {
|
|
|
5869
5920
|
}
|
|
5870
5921
|
sort(predicateFunc) {
|
|
5871
5922
|
if (this._multiple && this.selected) {
|
|
5923
|
+
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
5872
5924
|
this._selected.sort(predicateFunc);
|
|
5873
5925
|
}
|
|
5874
5926
|
}
|
|
@@ -7694,8 +7746,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImpo
|
|
|
7694
7746
|
* `ScrollableModule` also imports and exports [BrandingModule](./?path=/docs/design-components-directives-impdcbranded).
|
|
7695
7747
|
*/
|
|
7696
7748
|
class ScrollableComponent {
|
|
7697
|
-
constructor(_cd) {
|
|
7749
|
+
constructor(_cd, _hostElementRef) {
|
|
7698
7750
|
this._cd = _cd;
|
|
7751
|
+
this._hostElementRef = _hostElementRef;
|
|
7752
|
+
this.GET_ANCESTOR_BG_SEARCH_DEPTH = 64;
|
|
7699
7753
|
/**
|
|
7700
7754
|
* The base amount to scroll.
|
|
7701
7755
|
*/
|
|
@@ -7740,13 +7794,12 @@ class ScrollableComponent {
|
|
|
7740
7794
|
this._cd.detectChanges();
|
|
7741
7795
|
}
|
|
7742
7796
|
}
|
|
7743
|
-
this._getBackgroundColorForButtons();
|
|
7744
7797
|
}
|
|
7745
7798
|
ngAfterViewInit() {
|
|
7746
7799
|
var _a;
|
|
7747
7800
|
this._width = (_a = this.contentRef) === null || _a === void 0 ? void 0 : _a.nativeElement.width;
|
|
7748
|
-
this._getBackgroundColorForButtons();
|
|
7749
7801
|
this._cd.detectChanges();
|
|
7802
|
+
Promise.resolve().then(() => this._getBackgroundColorForButtons());
|
|
7750
7803
|
}
|
|
7751
7804
|
scroll(direction) {
|
|
7752
7805
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -7809,29 +7862,21 @@ class ScrollableComponent {
|
|
|
7809
7862
|
});
|
|
7810
7863
|
}
|
|
7811
7864
|
_getBackgroundColorForButtons() {
|
|
7812
|
-
|
|
7813
|
-
return;
|
|
7814
|
-
}
|
|
7815
|
-
const projectedElementCollection = this.contentRef.nativeElement.children;
|
|
7816
|
-
if (!projectedElementCollection || !projectedElementCollection.length) {
|
|
7817
|
-
return;
|
|
7818
|
-
}
|
|
7819
|
-
const firstElement = projectedElementCollection[0];
|
|
7820
|
-
let backgroundColor = this._getBackGroundColor(firstElement);
|
|
7865
|
+
let backgroundColor = this._getBackGroundColor(this._hostElementRef.nativeElement);
|
|
7821
7866
|
if (!backgroundColor) {
|
|
7822
7867
|
backgroundColor = this._getAncestorBackgroundColor();
|
|
7823
7868
|
}
|
|
7824
|
-
this._scrollableBgColor
|
|
7869
|
+
if (this._scrollableBgColor !== backgroundColor) {
|
|
7870
|
+
this._scrollableBgColor = backgroundColor;
|
|
7871
|
+
this._cd.detectChanges();
|
|
7872
|
+
}
|
|
7825
7873
|
}
|
|
7826
7874
|
_getAncestorBackgroundColor() {
|
|
7827
|
-
if (!this.contentRef) {
|
|
7828
|
-
return null;
|
|
7829
|
-
}
|
|
7830
7875
|
let result = {
|
|
7831
|
-
parent: this.
|
|
7876
|
+
parent: this._hostElementRef.nativeElement.parentElement,
|
|
7832
7877
|
backgroundColor: null
|
|
7833
7878
|
};
|
|
7834
|
-
let count =
|
|
7879
|
+
let count = this.GET_ANCESTOR_BG_SEARCH_DEPTH;
|
|
7835
7880
|
function getParentBackgroundColor(currentContext, getBackgroundColor) {
|
|
7836
7881
|
const result = { parent: null, backgroundColor: null };
|
|
7837
7882
|
if (currentContext && currentContext.parent) {
|
|
@@ -7862,12 +7907,12 @@ class ScrollableComponent {
|
|
|
7862
7907
|
return element.style.backgroundColor;
|
|
7863
7908
|
}
|
|
7864
7909
|
}
|
|
7865
|
-
ScrollableComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ScrollableComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
7910
|
+
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 });
|
|
7866
7911
|
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 });
|
|
7867
7912
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.2.12", ngImport: i0, type: ScrollableComponent, decorators: [{
|
|
7868
7913
|
type: Component,
|
|
7869
7914
|
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"] }]
|
|
7870
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { scrollUnit: [{
|
|
7915
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i0.ElementRef }]; }, propDecorators: { scrollUnit: [{
|
|
7871
7916
|
type: Input
|
|
7872
7917
|
}], clickScrollMultiplier: [{
|
|
7873
7918
|
type: Input
|
|
@@ -8244,8 +8289,18 @@ class InteractionService {
|
|
|
8244
8289
|
if (!this._backdrop) {
|
|
8245
8290
|
this._backdrop = modalBackdrop;
|
|
8246
8291
|
}
|
|
8247
|
-
else {
|
|
8248
|
-
|
|
8292
|
+
else if (this._backdrop !== modalBackdrop) {
|
|
8293
|
+
this._backdrop.invalidate();
|
|
8294
|
+
this._backdrop = modalBackdrop;
|
|
8295
|
+
if (!modalBackdrop.valid) {
|
|
8296
|
+
// we invalidated and set backdrop to the same backdrop
|
|
8297
|
+
modalBackdrop.validate();
|
|
8298
|
+
}
|
|
8299
|
+
}
|
|
8300
|
+
}
|
|
8301
|
+
unregisterBackdrop(modalBackdrop) {
|
|
8302
|
+
if (this._backdrop === modalBackdrop) {
|
|
8303
|
+
this._backdrop = undefined;
|
|
8249
8304
|
}
|
|
8250
8305
|
}
|
|
8251
8306
|
add(interactable) {
|