@covalent/core 6.3.0 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/breadcrumbs/breadcrumbs.component.d.ts +1 -1
- package/dialogs/window-dialog/window-dialog.component.d.ts +1 -1
- package/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.d.ts +1 -1
- package/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.d.ts +1 -1
- package/dynamic-menu/dynamic-menu.component.d.ts +1 -1
- package/esm2022/breadcrumbs/breadcrumb/breadcrumb.component.mjs +94 -0
- package/esm2022/breadcrumbs/breadcrumbs.component.mjs +135 -0
- package/{esm2020 → esm2022}/breadcrumbs/breadcrumbs.module.mjs +5 -5
- package/esm2022/common/behaviors/control-value-accesor.mixin.mjs +43 -0
- package/esm2022/common/behaviors/disable-ripple.mixin.mjs +24 -0
- package/{esm2020 → esm2022}/common/behaviors/disabled.mixin.mjs +2 -2
- package/{esm2020 → esm2022}/common/common.module.mjs +17 -17
- package/esm2022/common/directives/fullscreen/fullscreen.directive.mjs +87 -0
- package/esm2022/common/forms/auto-trim/auto-trim.directive.mjs +37 -0
- package/esm2022/common/functions/convert.mjs +84 -0
- package/esm2022/common/functions/download.mjs +75 -0
- package/esm2022/common/pipes/bytes/bytes.pipe.mjs +42 -0
- package/esm2022/common/pipes/decimal-bytes/decimal-bytes.pipe.mjs +42 -0
- package/esm2022/common/pipes/digits/digits.pipe.mjs +41 -0
- package/{esm2020 → esm2022}/common/pipes/time-ago/time-ago.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/common/pipes/time-difference/time-difference.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/common/pipes/time-until/time-until.pipe.mjs +4 -4
- package/esm2022/common/pipes/truncate/truncate.pipe.mjs +27 -0
- package/esm2022/common/services/icon.service.mjs +1087 -0
- package/esm2022/common/services/router-path.service.mjs +30 -0
- package/esm2022/dialogs/alert-dialog/alert-dialog.component.mjs +26 -0
- package/esm2022/dialogs/confirm-dialog/confirm-dialog.component.mjs +31 -0
- package/esm2022/dialogs/dialog.component.mjs +60 -0
- package/{esm2020 → esm2022}/dialogs/dialogs.module.mjs +39 -39
- package/esm2022/dialogs/prompt-dialog/prompt-dialog.component.mjs +84 -0
- package/esm2022/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.mjs +220 -0
- package/esm2022/dialogs/services/dialog.service.mjs +179 -0
- package/esm2022/dialogs/window-dialog/window-dialog.component.mjs +40 -0
- package/esm2022/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.mjs +30 -0
- package/esm2022/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.mjs +23 -0
- package/esm2022/dynamic-menu/dynamic-menu.component.mjs +28 -0
- package/{esm2020 → esm2022}/dynamic-menu/dynamic-menu.module.mjs +19 -19
- package/esm2022/file/directives/file-drop.directive.mjs +145 -0
- package/esm2022/file/directives/file-select.directive.mjs +78 -0
- package/esm2022/file/file-input/file-input.component.mjs +146 -0
- package/esm2022/file/file-upload/file-upload.component.mjs +185 -0
- package/{esm2020 → esm2022}/file/file.module.mjs +21 -21
- package/esm2022/file/services/file.service.mjs +66 -0
- package/esm2022/json-formatter/json-formatter.component.mjs +222 -0
- package/{esm2020 → esm2022}/json-formatter/json-formatter.module.mjs +5 -5
- package/esm2022/layout/layout-card-over/layout-card-over.component.mjs +50 -0
- package/esm2022/layout/layout-footer/layout-footer.component.mjs +36 -0
- package/esm2022/layout/layout-manage-list/layout-manage-list.component.mjs +92 -0
- package/{esm2020 → esm2022}/layout/layout-manage-list/layout-manage-list.directives.mjs +10 -10
- package/esm2022/layout/layout-nav/layout-nav.component.mjs +76 -0
- package/esm2022/layout/layout-nav-list/layout-nav-list.component.mjs +154 -0
- package/{esm2020 → esm2022}/layout/layout-nav-list/layout-nav-list.directives.mjs +10 -10
- package/esm2022/layout/layout-toggle.class.mjs +96 -0
- package/esm2022/layout/layout.component.mjs +91 -0
- package/{esm2020 → esm2022}/layout/layout.directives.mjs +10 -10
- package/{esm2020 → esm2022}/layout/layout.module.mjs +55 -55
- package/esm2022/layout/navigation-drawer/navigation-drawer.component.mjs +221 -0
- package/esm2022/loading/directives/loading.directive.mjs +133 -0
- package/esm2022/loading/loading.component.mjs +193 -0
- package/{esm2020 → esm2022}/loading/loading.module.mjs +13 -13
- package/esm2022/loading/services/loading.factory.mjs +210 -0
- package/esm2022/loading/services/loading.service.mjs +219 -0
- package/{esm2020 → esm2022}/menu/menu.component.mjs +4 -4
- package/{esm2020 → esm2022}/menu/menu.module.mjs +5 -5
- package/esm2022/message/message.component.mjs +222 -0
- package/{esm2020 → esm2022}/message/message.module.mjs +7 -7
- package/esm2022/search/search-box/search-box.component.mjs +198 -0
- package/esm2022/search/search-input/search-input.component.mjs +214 -0
- package/{esm2020 → esm2022}/search/search.module.mjs +13 -13
- package/esm2022/side-sheet/side-sheet-container.mjs +285 -0
- package/esm2022/side-sheet/side-sheet-ref.mjs +30 -0
- package/{esm2020 → esm2022}/side-sheet/side-sheet.config.mjs +2 -5
- package/esm2022/side-sheet/side-sheet.content-directives.mjs +206 -0
- package/esm2022/side-sheet/side-sheet.mjs +236 -0
- package/{esm2020 → esm2022}/side-sheet/side-sheet.module.mjs +14 -14
- package/esm2022/user-profile/user-profile-menu/user-profile-menu.component.mjs +25 -0
- package/esm2022/user-profile/user-profile.component.mjs +21 -0
- package/{esm2020 → esm2022}/user-profile/user-profile.module.mjs +15 -15
- package/{fesm2015 → fesm2022}/covalent-core-breadcrumbs.mjs +28 -22
- package/{fesm2015 → fesm2022}/covalent-core-breadcrumbs.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/covalent-core-common.mjs +1131 -1125
- package/fesm2022/covalent-core-common.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/covalent-core-dialogs.mjs +109 -80
- package/{fesm2020 → fesm2022}/covalent-core-dialogs.mjs.map +1 -1
- package/fesm2022/covalent-core-dynamic-menu.mjs +125 -0
- package/{fesm2015 → fesm2022}/covalent-core-dynamic-menu.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/covalent-core-file.mjs +148 -110
- package/{fesm2020 → fesm2022}/covalent-core-file.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/covalent-core-json-formatter.mjs +26 -21
- package/{fesm2020 → fesm2022}/covalent-core-json-formatter.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/covalent-core-layout.mjs +396 -271
- package/{fesm2015 → fesm2022}/covalent-core-layout.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/covalent-core-loading.mjs +100 -78
- package/{fesm2020 → fesm2022}/covalent-core-loading.mjs.map +1 -1
- package/{fesm2015 → fesm2022}/covalent-core-menu.mjs +7 -7
- package/{fesm2015 → fesm2022}/covalent-core-menu.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/covalent-core-message.mjs +42 -23
- package/{fesm2020 → fesm2022}/covalent-core-message.mjs.map +1 -1
- package/fesm2022/covalent-core-search.mjs +438 -0
- package/fesm2022/covalent-core-search.mjs.map +1 -0
- package/{fesm2020 → fesm2022}/covalent-core-side-sheet.mjs +124 -99
- package/{fesm2020 → fesm2022}/covalent-core-side-sheet.mjs.map +1 -1
- package/fesm2022/covalent-core-user-profile.mjs +87 -0
- package/fesm2022/covalent-core-user-profile.mjs.map +1 -0
- package/file/directives/file-drop.directive.d.ts +1 -1
- package/file/directives/file-select.directive.d.ts +1 -1
- package/file/file-input/file-input.component.d.ts +1 -1
- package/file/file-upload/file-upload.component.d.ts +1 -1
- package/json-formatter/json-formatter.component.d.ts +1 -1
- package/layout/layout-card-over/layout-card-over.component.d.ts +1 -1
- package/layout/layout-footer/layout-footer.component.d.ts +1 -1
- package/layout/layout-manage-list/layout-manage-list.component.d.ts +1 -1
- package/layout/layout-manage-list/layout-manage-list.directives.d.ts +3 -3
- package/layout/layout-nav/layout-nav.component.d.ts +1 -1
- package/layout/layout-nav-list/layout-nav-list.component.d.ts +1 -1
- package/layout/layout-nav-list/layout-nav-list.directives.d.ts +3 -3
- package/layout/layout-toggle.class.d.ts +1 -1
- package/layout/layout.component.d.ts +1 -1
- package/layout/layout.directives.d.ts +3 -3
- package/layout/navigation-drawer/navigation-drawer.component.d.ts +1 -1
- package/loading/directives/loading.directive.d.ts +1 -1
- package/message/message.component.d.ts +1 -1
- package/package.json +55 -91
- package/search/search-box/search-box.component.d.ts +1 -1
- package/search/search-input/search-input.component.d.ts +1 -1
- package/side-sheet/side-sheet.content-directives.d.ts +2 -2
- package/user-profile/user-profile-menu/user-profile-menu.component.d.ts +1 -1
- package/user-profile/user-profile.component.d.ts +1 -1
- package/common/styles/font/README.md +0 -11
- package/dialogs/src/README.md +0 -223
- package/esm2020/breadcrumbs/breadcrumb/breadcrumb.component.mjs +0 -92
- package/esm2020/breadcrumbs/breadcrumbs.component.mjs +0 -131
- package/esm2020/common/behaviors/control-value-accesor.mixin.mjs +0 -41
- package/esm2020/common/behaviors/disable-ripple.mixin.mjs +0 -24
- package/esm2020/common/directives/fullscreen/fullscreen.directive.mjs +0 -85
- package/esm2020/common/forms/auto-trim/auto-trim.directive.mjs +0 -36
- package/esm2020/common/functions/convert.mjs +0 -84
- package/esm2020/common/functions/download.mjs +0 -75
- package/esm2020/common/pipes/bytes/bytes.pipe.mjs +0 -42
- package/esm2020/common/pipes/decimal-bytes/decimal-bytes.pipe.mjs +0 -42
- package/esm2020/common/pipes/digits/digits.pipe.mjs +0 -39
- package/esm2020/common/pipes/truncate/truncate.pipe.mjs +0 -27
- package/esm2020/common/services/icon.service.mjs +0 -1089
- package/esm2020/common/services/router-path.service.mjs +0 -29
- package/esm2020/dialogs/alert-dialog/alert-dialog.component.mjs +0 -23
- package/esm2020/dialogs/confirm-dialog/confirm-dialog.component.mjs +0 -28
- package/esm2020/dialogs/dialog.component.mjs +0 -57
- package/esm2020/dialogs/prompt-dialog/prompt-dialog.component.mjs +0 -75
- package/esm2020/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.mjs +0 -216
- package/esm2020/dialogs/services/dialog.service.mjs +0 -174
- package/esm2020/dialogs/window-dialog/window-dialog.component.mjs +0 -38
- package/esm2020/dynamic-menu/dynamic-menu-item/dynamic-menu-item.component.mjs +0 -30
- package/esm2020/dynamic-menu/dynamic-menu-item/dynamic-menu-link/dynamic-menu-link.component.mjs +0 -24
- package/esm2020/dynamic-menu/dynamic-menu.component.mjs +0 -28
- package/esm2020/file/directives/file-drop.directive.mjs +0 -139
- package/esm2020/file/directives/file-select.directive.mjs +0 -77
- package/esm2020/file/file-input/file-input.component.mjs +0 -128
- package/esm2020/file/file-upload/file-upload.component.mjs +0 -174
- package/esm2020/file/services/file.service.mjs +0 -64
- package/esm2020/json-formatter/json-formatter.component.mjs +0 -217
- package/esm2020/layout/layout-card-over/layout-card-over.component.mjs +0 -40
- package/esm2020/layout/layout-footer/layout-footer.component.mjs +0 -33
- package/esm2020/layout/layout-manage-list/layout-manage-list.component.mjs +0 -93
- package/esm2020/layout/layout-nav/layout-nav.component.mjs +0 -50
- package/esm2020/layout/layout-nav-list/layout-nav-list.component.mjs +0 -128
- package/esm2020/layout/layout-toggle.class.mjs +0 -92
- package/esm2020/layout/layout.component.mjs +0 -92
- package/esm2020/layout/navigation-drawer/navigation-drawer.component.mjs +0 -163
- package/esm2020/loading/directives/loading.directive.mjs +0 -126
- package/esm2020/loading/loading.component.mjs +0 -187
- package/esm2020/loading/services/loading.factory.mjs +0 -207
- package/esm2020/loading/services/loading.service.mjs +0 -213
- package/esm2020/message/message.component.mjs +0 -203
- package/esm2020/search/search-box/search-box.component.mjs +0 -194
- package/esm2020/search/search-input/search-input.component.mjs +0 -207
- package/esm2020/side-sheet/side-sheet-container.mjs +0 -274
- package/esm2020/side-sheet/side-sheet-ref.mjs +0 -26
- package/esm2020/side-sheet/side-sheet.content-directives.mjs +0 -201
- package/esm2020/side-sheet/side-sheet.mjs +0 -228
- package/esm2020/user-profile/user-profile-menu/user-profile-menu.component.mjs +0 -23
- package/esm2020/user-profile/user-profile.component.mjs +0 -19
- package/fesm2015/covalent-core-common.mjs +0 -2281
- package/fesm2015/covalent-core-common.mjs.map +0 -1
- package/fesm2015/covalent-core-dialogs.mjs +0 -668
- package/fesm2015/covalent-core-dialogs.mjs.map +0 -1
- package/fesm2015/covalent-core-dynamic-menu.mjs +0 -126
- package/fesm2015/covalent-core-file.mjs +0 -621
- package/fesm2015/covalent-core-file.mjs.map +0 -1
- package/fesm2015/covalent-core-json-formatter.mjs +0 -298
- package/fesm2015/covalent-core-json-formatter.mjs.map +0 -1
- package/fesm2015/covalent-core-layout.mjs +0 -1024
- package/fesm2015/covalent-core-loading.mjs +0 -766
- package/fesm2015/covalent-core-loading.mjs.map +0 -1
- package/fesm2015/covalent-core-message.mjs +0 -284
- package/fesm2015/covalent-core-message.mjs.map +0 -1
- package/fesm2015/covalent-core-search.mjs +0 -430
- package/fesm2015/covalent-core-search.mjs.map +0 -1
- package/fesm2015/covalent-core-side-sheet.mjs +0 -784
- package/fesm2015/covalent-core-side-sheet.mjs.map +0 -1
- package/fesm2015/covalent-core-user-profile.mjs +0 -83
- package/fesm2015/covalent-core-user-profile.mjs.map +0 -1
- package/fesm2020/covalent-core-breadcrumbs.mjs +0 -243
- package/fesm2020/covalent-core-breadcrumbs.mjs.map +0 -1
- package/fesm2020/covalent-core-common.mjs.map +0 -1
- package/fesm2020/covalent-core-dynamic-menu.mjs +0 -126
- package/fesm2020/covalent-core-dynamic-menu.mjs.map +0 -1
- package/fesm2020/covalent-core-layout.mjs.map +0 -1
- package/fesm2020/covalent-core-menu.mjs +0 -37
- package/fesm2020/covalent-core-menu.mjs.map +0 -1
- package/fesm2020/covalent-core-search.mjs +0 -427
- package/fesm2020/covalent-core-search.mjs.map +0 -1
- package/fesm2020/covalent-core-user-profile.mjs +0 -83
- package/fesm2020/covalent-core-user-profile.mjs.map +0 -1
- package/fesm2020/covalent-core.mjs +0 -4
- package/fesm2020/covalent-core.mjs.map +0 -1
- package/file/src/file-input/README.md +0 -147
- package/file/src/file-upload/README.md +0 -136
- package/layout/src/layout-card-over/README.md +0 -43
- package/layout/src/layout-manage-list/README.md +0 -80
- package/layout/src/layout-nav/README.md +0 -50
- package/layout/src/layout-nav-list/README.md +0 -105
- package/search/src/search-box/README.md +0 -73
- package/search/src/search-input/README.md +0 -74
- /package/{esm2020 → esm2022}/breadcrumbs/covalent-core-breadcrumbs.mjs +0 -0
- /package/{esm2020 → esm2022}/breadcrumbs/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/bounce/bounce.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/collapse/collapse.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/common/interfaces.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/fade/fadeInOut.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/flash/flash.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/headshake/headshake.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/jello/jello.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/pulse/pulse.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/animations/rotate/rotate.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/common/covalent-core-common.mjs +0 -0
- /package/{esm2020 → esm2022}/common/forms/validators/validators.mjs +0 -0
- /package/{esm2020 → esm2022}/common/functions/clipboard.mjs +0 -0
- /package/{esm2020 → esm2022}/common/functions/file.mjs +0 -0
- /package/{esm2020 → esm2022}/common/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/covalent-core.mjs +0 -0
- /package/{esm2020 → esm2022}/dialogs/covalent-core-dialogs.mjs +0 -0
- /package/{esm2020 → esm2022}/dialogs/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/dynamic-menu/covalent-core-dynamic-menu.mjs +0 -0
- /package/{esm2020 → esm2022}/dynamic-menu/dynamic-menu.menu.mjs +0 -0
- /package/{esm2020 → esm2022}/dynamic-menu/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/file/covalent-core-file.mjs +0 -0
- /package/{esm2020 → esm2022}/file/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/json-formatter/collapse.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/json-formatter/covalent-core-json-formatter.mjs +0 -0
- /package/{esm2020 → esm2022}/json-formatter/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/layout/covalent-core-layout.mjs +0 -0
- /package/{esm2020 → esm2022}/layout/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/loading/covalent-core-loading.mjs +0 -0
- /package/{esm2020 → esm2022}/loading/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/menu/covalent-core-menu.mjs +0 -0
- /package/{esm2020 → esm2022}/menu/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/message/collapse.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/message/covalent-core-message.mjs +0 -0
- /package/{esm2020 → esm2022}/message/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/search/covalent-core-search.mjs +0 -0
- /package/{esm2020 → esm2022}/search/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/side-sheet/covalent-core-side-sheet.mjs +0 -0
- /package/{esm2020 → esm2022}/side-sheet/public_api.mjs +0 -0
- /package/{esm2020 → esm2022}/side-sheet/side-sheet.animation.mjs +0 -0
- /package/{esm2020 → esm2022}/user-profile/covalent-core-user-profile.mjs +0 -0
- /package/{esm2020 → esm2022}/user-profile/public_api.mjs +0 -0
- /package/{fesm2015 → fesm2022}/covalent-core.mjs +0 -0
- /package/{fesm2015 → fesm2022}/covalent-core.mjs.map +0 -0
@@ -1,668 +0,0 @@
|
|
1
|
-
import * as i0 from '@angular/core';
|
2
|
-
import { Directive, Component, ContentChildren, ElementRef, ViewChild, Injectable, Inject, EventEmitter, ChangeDetectionStrategy, Input, Output, NgModule } from '@angular/core';
|
3
|
-
import * as i2 from '@angular/common';
|
4
|
-
import { DOCUMENT, CommonModule } from '@angular/common';
|
5
|
-
import * as i2$1 from '@angular/forms';
|
6
|
-
import { FormsModule } from '@angular/forms';
|
7
|
-
import * as i1 from '@angular/material/dialog';
|
8
|
-
import { MatDialogConfig, MatDialogModule } from '@angular/material/dialog';
|
9
|
-
import * as i4 from '@angular/material/input';
|
10
|
-
import { MatInputModule } from '@angular/material/input';
|
11
|
-
import * as i3 from '@angular/material/button';
|
12
|
-
import { MatButtonModule } from '@angular/material/button';
|
13
|
-
import { RIGHT_ARROW, LEFT_ARROW } from '@angular/cdk/keycodes';
|
14
|
-
import { Subject, fromEvent, takeUntil, merge } from 'rxjs';
|
15
|
-
import * as i5 from '@angular/material/form-field';
|
16
|
-
import * as i2$2 from '@angular/cdk/drag-drop';
|
17
|
-
import * as i2$3 from '@angular/material/toolbar';
|
18
|
-
import { MatToolbarModule } from '@angular/material/toolbar';
|
19
|
-
import * as i3$1 from '@angular/material/tooltip';
|
20
|
-
import { MatTooltipModule } from '@angular/material/tooltip';
|
21
|
-
import * as i4$1 from '@angular/material/icon';
|
22
|
-
import { MatIconModule } from '@angular/material/icon';
|
23
|
-
|
24
|
-
class TdDialogTitleDirective {
|
25
|
-
}
|
26
|
-
TdDialogTitleDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogTitleDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
27
|
-
TdDialogTitleDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: TdDialogTitleDirective, selector: "[tdDialogTitle]", ngImport: i0 });
|
28
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogTitleDirective, decorators: [{
|
29
|
-
type: Directive,
|
30
|
-
args: [{ selector: '[tdDialogTitle]' }]
|
31
|
-
}] });
|
32
|
-
class TdDialogContentDirective {
|
33
|
-
}
|
34
|
-
TdDialogContentDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogContentDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
35
|
-
TdDialogContentDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: TdDialogContentDirective, selector: "[tdDialogContent]", ngImport: i0 });
|
36
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogContentDirective, decorators: [{
|
37
|
-
type: Directive,
|
38
|
-
args: [{ selector: '[tdDialogContent]' }]
|
39
|
-
}] });
|
40
|
-
class TdDialogActionsDirective {
|
41
|
-
}
|
42
|
-
TdDialogActionsDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogActionsDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
43
|
-
TdDialogActionsDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.5", type: TdDialogActionsDirective, selector: "[tdDialogActions]", ngImport: i0 });
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogActionsDirective, decorators: [{
|
45
|
-
type: Directive,
|
46
|
-
args: [{ selector: '[tdDialogActions]' }]
|
47
|
-
}] });
|
48
|
-
class TdDialogComponent {
|
49
|
-
ngAfterContentInit() {
|
50
|
-
if (this.dialogTitle.length > 1) {
|
51
|
-
throw new Error('Duplicate td-dialog-title component at in td-dialog.');
|
52
|
-
}
|
53
|
-
if (this.dialogContent.length > 1) {
|
54
|
-
throw new Error('Duplicate td-dialog-content component at in td-dialog.');
|
55
|
-
}
|
56
|
-
if (this.dialogActions.length > 1) {
|
57
|
-
throw new Error('Duplicate td-dialog-actions component at in td-dialog.');
|
58
|
-
}
|
59
|
-
}
|
60
|
-
}
|
61
|
-
TdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
62
|
-
TdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: TdDialogComponent, selector: "td-dialog", queries: [{ propertyName: "dialogTitle", predicate: TdDialogTitleDirective, descendants: true }, { propertyName: "dialogContent", predicate: TdDialogContentDirective, descendants: true }, { propertyName: "dialogActions", predicate: TdDialogActionsDirective, descendants: true }], ngImport: i0, template: "<div mat-dialog-title *ngIf=\"dialogTitle.length > 0\">\n <ng-content select=\"[tdDialogTitle]\"></ng-content>\n</div>\n<mat-dialog-content class=\"td-dialog-content\" *ngIf=\"dialogContent.length > 0\">\n <ng-content select=\"[tdDialogContent]\"></ng-content>\n</mat-dialog-content>\n<mat-dialog-actions class=\"td-dialog-actions\" *ngIf=\"dialogActions.length > 0\">\n <span class=\"td-dialog-spacer\"></span>\n <ng-content select=\"[tdDialogActions]\"></ng-content>\n</mat-dialog-actions>\n", styles: [".td-dialog-actions{flex-direction:row;box-sizing:border-box;display:flex}.td-dialog-actions .td-dialog-spacer{flex:1}.td-dialog-actions ::ng-deep button{text-transform:uppercase;margin-left:8px;padding-left:8px;padding-right:8px;min-width:64px}[dir=rtl] .td-dialog-actions ::ng-deep button{margin-right:8px;margin-left:inherit}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: i1.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }] });
|
63
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogComponent, decorators: [{
|
64
|
-
type: Component,
|
65
|
-
args: [{ selector: 'td-dialog', template: "<div mat-dialog-title *ngIf=\"dialogTitle.length > 0\">\n <ng-content select=\"[tdDialogTitle]\"></ng-content>\n</div>\n<mat-dialog-content class=\"td-dialog-content\" *ngIf=\"dialogContent.length > 0\">\n <ng-content select=\"[tdDialogContent]\"></ng-content>\n</mat-dialog-content>\n<mat-dialog-actions class=\"td-dialog-actions\" *ngIf=\"dialogActions.length > 0\">\n <span class=\"td-dialog-spacer\"></span>\n <ng-content select=\"[tdDialogActions]\"></ng-content>\n</mat-dialog-actions>\n", styles: [".td-dialog-actions{flex-direction:row;box-sizing:border-box;display:flex}.td-dialog-actions .td-dialog-spacer{flex:1}.td-dialog-actions ::ng-deep button{text-transform:uppercase;margin-left:8px;padding-left:8px;padding-right:8px;min-width:64px}[dir=rtl] .td-dialog-actions ::ng-deep button{margin-right:8px;margin-left:inherit}\n"] }]
|
66
|
-
}], propDecorators: { dialogTitle: [{
|
67
|
-
type: ContentChildren,
|
68
|
-
args: [TdDialogTitleDirective, { descendants: true }]
|
69
|
-
}], dialogContent: [{
|
70
|
-
type: ContentChildren,
|
71
|
-
args: [TdDialogContentDirective, { descendants: true }]
|
72
|
-
}], dialogActions: [{
|
73
|
-
type: ContentChildren,
|
74
|
-
args: [TdDialogActionsDirective, { descendants: true }]
|
75
|
-
}] } });
|
76
|
-
|
77
|
-
class TdAlertDialogComponent {
|
78
|
-
constructor(_dialogRef) {
|
79
|
-
this._dialogRef = _dialogRef;
|
80
|
-
this.closeButton = 'CLOSE';
|
81
|
-
}
|
82
|
-
close() {
|
83
|
-
this._dialogRef.close();
|
84
|
-
}
|
85
|
-
}
|
86
|
-
TdAlertDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdAlertDialogComponent, deps: [{ token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
87
|
-
TdAlertDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: TdAlertDialogComponent, selector: "td-alert-dialog", ngImport: i0, template: "<td-dialog>\n <ng-container tdDialogTitle *ngIf=\"title\">{{ title }}</ng-container>\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">{{ message }}</span>\n </ng-container>\n <ng-container tdDialogActions>\n <button mat-button color=\"accent\" (click)=\"close()\">\n {{ closeButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: [".td-dialog-message{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TdDialogComponent, selector: "td-dialog" }, { kind: "directive", type: TdDialogTitleDirective, selector: "[tdDialogTitle]" }, { kind: "directive", type: TdDialogActionsDirective, selector: "[tdDialogActions]" }, { kind: "directive", type: TdDialogContentDirective, selector: "[tdDialogContent]" }] });
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdAlertDialogComponent, decorators: [{
|
89
|
-
type: Component,
|
90
|
-
args: [{ selector: 'td-alert-dialog', template: "<td-dialog>\n <ng-container tdDialogTitle *ngIf=\"title\">{{ title }}</ng-container>\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">{{ message }}</span>\n </ng-container>\n <ng-container tdDialogActions>\n <button mat-button color=\"accent\" (click)=\"close()\">\n {{ closeButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: [".td-dialog-message{word-break:break-word}\n"] }]
|
91
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialogRef }]; } });
|
92
|
-
|
93
|
-
class TdConfirmDialogComponent {
|
94
|
-
constructor(_dialogRef) {
|
95
|
-
this._dialogRef = _dialogRef;
|
96
|
-
this.cancelButton = 'CANCEL';
|
97
|
-
this.acceptButton = 'ACCEPT';
|
98
|
-
this.isDestructive = false;
|
99
|
-
}
|
100
|
-
cancel() {
|
101
|
-
this._dialogRef.close(false);
|
102
|
-
}
|
103
|
-
accept() {
|
104
|
-
this._dialogRef.close(true);
|
105
|
-
}
|
106
|
-
}
|
107
|
-
TdConfirmDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdConfirmDialogComponent, deps: [{ token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
108
|
-
TdConfirmDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: TdConfirmDialogComponent, selector: "td-confirm-dialog", ngImport: i0, template: "<td-dialog>\n <ng-container tdDialogTitle *ngIf=\"title\">{{ title }}</ng-container>\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">{{ message }}</span>\n </ng-container>\n <ng-container tdDialogActions>\n <button\n mat-button\n #closeBtn\n (keydown.arrowright)=\"acceptBtn.focus()\"\n (click)=\"cancel()\"\n >\n {{ cancelButton }}\n </button>\n <button\n mat-button\n [color]=\"isDestructive ? 'warn' : 'accent'\"\n #acceptBtn\n (keydown.arrowleft)=\"closeBtn.focus()\"\n (click)=\"accept()\"\n >\n {{ acceptButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: [".td-dialog-message{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TdDialogComponent, selector: "td-dialog" }, { kind: "directive", type: TdDialogTitleDirective, selector: "[tdDialogTitle]" }, { kind: "directive", type: TdDialogActionsDirective, selector: "[tdDialogActions]" }, { kind: "directive", type: TdDialogContentDirective, selector: "[tdDialogContent]" }] });
|
109
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdConfirmDialogComponent, decorators: [{
|
110
|
-
type: Component,
|
111
|
-
args: [{ selector: 'td-confirm-dialog', template: "<td-dialog>\n <ng-container tdDialogTitle *ngIf=\"title\">{{ title }}</ng-container>\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">{{ message }}</span>\n </ng-container>\n <ng-container tdDialogActions>\n <button\n mat-button\n #closeBtn\n (keydown.arrowright)=\"acceptBtn.focus()\"\n (click)=\"cancel()\"\n >\n {{ cancelButton }}\n </button>\n <button\n mat-button\n [color]=\"isDestructive ? 'warn' : 'accent'\"\n #acceptBtn\n (keydown.arrowleft)=\"closeBtn.focus()\"\n (click)=\"accept()\"\n >\n {{ acceptButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: [".td-dialog-message{word-break:break-word}\n"] }]
|
112
|
-
}], ctorParameters: function () { return [{ type: i1.MatDialogRef }]; } });
|
113
|
-
|
114
|
-
class TdPromptDialogComponent {
|
115
|
-
constructor(_ngZone, _dialogRef) {
|
116
|
-
this._ngZone = _ngZone;
|
117
|
-
this._dialogRef = _dialogRef;
|
118
|
-
this.cancelButton = 'CANCEL';
|
119
|
-
this.acceptButton = 'ACCEPT';
|
120
|
-
this._destroy$ = new Subject();
|
121
|
-
}
|
122
|
-
ngAfterViewInit() {
|
123
|
-
this._ngZone.runOutsideAngular(() => {
|
124
|
-
// Note: `element.focus()` causes re-layout and this may lead to frame drop on slower devices.
|
125
|
-
// `Promise` is a microtask and microtask are executed within the current rendering frame.
|
126
|
-
// Animation tasks are executed within the next rendering frame.
|
127
|
-
// We focus input once everything is rendered and good to go.
|
128
|
-
requestAnimationFrame(() => this._input.nativeElement.focus());
|
129
|
-
fromEvent(this._input.nativeElement, 'focus')
|
130
|
-
.pipe(takeUntil(this._destroy$))
|
131
|
-
.subscribe(() => {
|
132
|
-
// This is executed when the input is focused, selects all text.
|
133
|
-
this._input.nativeElement.select();
|
134
|
-
});
|
135
|
-
fromEvent(this._closeBtn.nativeElement, 'keydown')
|
136
|
-
.pipe(takeUntil(this._destroy$))
|
137
|
-
.subscribe((event) => {
|
138
|
-
if (event.keyCode === RIGHT_ARROW) {
|
139
|
-
this._acceptBtn.nativeElement.focus();
|
140
|
-
}
|
141
|
-
});
|
142
|
-
fromEvent(this._acceptBtn.nativeElement, 'keydown')
|
143
|
-
.pipe(takeUntil(this._destroy$))
|
144
|
-
.subscribe((event) => {
|
145
|
-
if (event.keyCode === LEFT_ARROW) {
|
146
|
-
this._closeBtn.nativeElement.focus();
|
147
|
-
}
|
148
|
-
});
|
149
|
-
});
|
150
|
-
}
|
151
|
-
ngOnDestroy() {
|
152
|
-
this._destroy$.next();
|
153
|
-
}
|
154
|
-
cancel() {
|
155
|
-
this._dialogRef.close();
|
156
|
-
}
|
157
|
-
accept() {
|
158
|
-
this._dialogRef.close(this.value);
|
159
|
-
}
|
160
|
-
}
|
161
|
-
TdPromptDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdPromptDialogComponent, deps: [{ token: i0.NgZone }, { token: i1.MatDialogRef }], target: i0.ɵɵFactoryTarget.Component });
|
162
|
-
TdPromptDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: TdPromptDialogComponent, selector: "td-prompt-dialog", viewQueries: [{ propertyName: "_input", first: true, predicate: ["input"], descendants: true, static: true }, { propertyName: "_closeBtn", first: true, predicate: ["closeBtn"], descendants: true, read: ElementRef, static: true }, { propertyName: "_acceptBtn", first: true, predicate: ["acceptBtn"], descendants: true, read: ElementRef, static: true }], ngImport: i0, template: "<td-dialog>\n <ng-container tdDialogTitle *ngIf=\"title\">{{ title }}</ng-container>\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">{{ message }}</span>\n <form #form=\"ngForm\" novalidate>\n <div class=\"td-dialog-input-wrapper\">\n <mat-form-field class=\"td-dialog-input\">\n <input\n matInput\n #input\n (keydown.enter)=\"$event.preventDefault(); form.valid && accept()\"\n [(ngModel)]=\"value\"\n name=\"value\"\n required\n />\n </mat-form-field>\n </div>\n </form>\n </ng-container>\n <ng-container tdDialogActions>\n <button mat-button #closeBtn (click)=\"cancel()\">{{ cancelButton }}</button>\n <button\n mat-button\n color=\"accent\"\n #acceptBtn\n [disabled]=\"!form.valid\"\n (click)=\"accept()\"\n >\n {{ acceptButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: [".td-dialog-input-wrapper{flex-direction:row;box-sizing:border-box;display:flex}.td-dialog-input-wrapper .td-dialog-input{flex:1;box-sizing:border-box}.td-dialog-message{word-break:break-word}\n"], dependencies: [{ kind: "directive", type: i2$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2$1.RequiredValidator, selector: ":not([type=checkbox])[required][formControlName],:not([type=checkbox])[required][formControl],:not([type=checkbox])[required][ngModel]", inputs: ["required"] }, { kind: "directive", type: i2$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2$1.NgForm, selector: "form:not([ngNoForm]):not([formGroup]),ng-form,[ngForm]", inputs: ["ngFormOptions"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: i3.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: TdDialogComponent, selector: "td-dialog" }, { kind: "directive", type: TdDialogTitleDirective, selector: "[tdDialogTitle]" }, { kind: "directive", type: TdDialogActionsDirective, selector: "[tdDialogActions]" }, { kind: "directive", type: TdDialogContentDirective, selector: "[tdDialogContent]" }] });
|
163
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdPromptDialogComponent, decorators: [{
|
164
|
-
type: Component,
|
165
|
-
args: [{ selector: 'td-prompt-dialog', template: "<td-dialog>\n <ng-container tdDialogTitle *ngIf=\"title\">{{ title }}</ng-container>\n <ng-container tdDialogContent>\n <span class=\"td-dialog-message\">{{ message }}</span>\n <form #form=\"ngForm\" novalidate>\n <div class=\"td-dialog-input-wrapper\">\n <mat-form-field class=\"td-dialog-input\">\n <input\n matInput\n #input\n (keydown.enter)=\"$event.preventDefault(); form.valid && accept()\"\n [(ngModel)]=\"value\"\n name=\"value\"\n required\n />\n </mat-form-field>\n </div>\n </form>\n </ng-container>\n <ng-container tdDialogActions>\n <button mat-button #closeBtn (click)=\"cancel()\">{{ cancelButton }}</button>\n <button\n mat-button\n color=\"accent\"\n #acceptBtn\n [disabled]=\"!form.valid\"\n (click)=\"accept()\"\n >\n {{ acceptButton }}\n </button>\n </ng-container>\n</td-dialog>\n", styles: [".td-dialog-input-wrapper{flex-direction:row;box-sizing:border-box;display:flex}.td-dialog-input-wrapper .td-dialog-input{flex:1;box-sizing:border-box}.td-dialog-message{word-break:break-word}\n"] }]
|
166
|
-
}], ctorParameters: function () { return [{ type: i0.NgZone }, { type: i1.MatDialogRef }]; }, propDecorators: { _input: [{
|
167
|
-
type: ViewChild,
|
168
|
-
args: ['input', { static: true }]
|
169
|
-
}], _closeBtn: [{
|
170
|
-
type: ViewChild,
|
171
|
-
args: ['closeBtn', { static: true, read: ElementRef }]
|
172
|
-
}], _acceptBtn: [{
|
173
|
-
type: ViewChild,
|
174
|
-
args: ['acceptBtn', { static: true, read: ElementRef }]
|
175
|
-
}] } });
|
176
|
-
|
177
|
-
class TdDialogService {
|
178
|
-
constructor(_document, _dialogService, _dragDrop, rendererFactory) {
|
179
|
-
this._document = _document;
|
180
|
-
this._dialogService = _dialogService;
|
181
|
-
this._dragDrop = _dragDrop;
|
182
|
-
this.rendererFactory = rendererFactory;
|
183
|
-
this._renderer2 = rendererFactory.createRenderer(undefined, null);
|
184
|
-
}
|
185
|
-
/**
|
186
|
-
* params:
|
187
|
-
* - component: ComponentType<T>
|
188
|
-
* - config: MatDialogConfig
|
189
|
-
* Wrapper function over the open() method in MatDialog.
|
190
|
-
* Opens a modal dialog containing the given component.
|
191
|
-
*/
|
192
|
-
open(component, config) {
|
193
|
-
return this._dialogService.open(component, config);
|
194
|
-
}
|
195
|
-
/**
|
196
|
-
* Wrapper function over the closeAll() method in MatDialog.
|
197
|
-
* Closes all of the currently-open dialogs.
|
198
|
-
*/
|
199
|
-
closeAll() {
|
200
|
-
this._dialogService.closeAll();
|
201
|
-
}
|
202
|
-
/**
|
203
|
-
* params:
|
204
|
-
* - config: IAlertConfig {
|
205
|
-
* message: string;
|
206
|
-
* title?: string;
|
207
|
-
* viewContainerRef?: ViewContainerRef;
|
208
|
-
* closeButton?: string;
|
209
|
-
* }
|
210
|
-
*
|
211
|
-
* Opens an alert dialog with the provided config.
|
212
|
-
* Returns an MatDialogRef<TdAlertDialogComponent> object.
|
213
|
-
*/
|
214
|
-
openAlert(config) {
|
215
|
-
const dialogConfig = this._createConfig(config);
|
216
|
-
const dialogRef = this._dialogService.open(TdAlertDialogComponent, dialogConfig);
|
217
|
-
const alertDialogComponent = dialogRef.componentInstance;
|
218
|
-
alertDialogComponent.title = config.title;
|
219
|
-
alertDialogComponent.message = config.message;
|
220
|
-
if (config.closeButton) {
|
221
|
-
alertDialogComponent.closeButton = config.closeButton;
|
222
|
-
}
|
223
|
-
return dialogRef;
|
224
|
-
}
|
225
|
-
/**
|
226
|
-
* params:
|
227
|
-
* - config: IConfirmConfig {
|
228
|
-
* message: string;
|
229
|
-
* title?: string;
|
230
|
-
* viewContainerRef?: ViewContainerRef;
|
231
|
-
* acceptButton?: string;
|
232
|
-
* cancelButton?: string;
|
233
|
-
* isDestructive?: boolean;
|
234
|
-
* }
|
235
|
-
*
|
236
|
-
* Opens a confirm dialog with the provided config.
|
237
|
-
* Returns an MatDialogRef<TdConfirmDialogComponent> object.
|
238
|
-
*/
|
239
|
-
openConfirm(config) {
|
240
|
-
const dialogConfig = this._createConfig(config);
|
241
|
-
const dialogRef = this._dialogService.open(TdConfirmDialogComponent, dialogConfig);
|
242
|
-
const confirmDialogComponent = dialogRef.componentInstance;
|
243
|
-
confirmDialogComponent.title = config.title;
|
244
|
-
confirmDialogComponent.message = config.message;
|
245
|
-
if (config.acceptButton) {
|
246
|
-
confirmDialogComponent.acceptButton = config.acceptButton;
|
247
|
-
}
|
248
|
-
if (config.isDestructive) {
|
249
|
-
confirmDialogComponent.isDestructive = config.isDestructive;
|
250
|
-
}
|
251
|
-
if (config.cancelButton) {
|
252
|
-
confirmDialogComponent.cancelButton = config.cancelButton;
|
253
|
-
}
|
254
|
-
return dialogRef;
|
255
|
-
}
|
256
|
-
/**
|
257
|
-
* params:
|
258
|
-
* - config: IPromptConfig {
|
259
|
-
* message: string;
|
260
|
-
* title?: string;
|
261
|
-
* value?: string;
|
262
|
-
* viewContainerRef?: ViewContainerRef;
|
263
|
-
* acceptButton?: string;
|
264
|
-
* cancelButton?: string;
|
265
|
-
* }
|
266
|
-
*
|
267
|
-
* Opens a prompt dialog with the provided config.
|
268
|
-
* Returns an MatDialogRef<TdPromptDialogComponent> object.
|
269
|
-
*/
|
270
|
-
openPrompt(config) {
|
271
|
-
const dialogConfig = this._createConfig(config);
|
272
|
-
const dialogRef = this._dialogService.open(TdPromptDialogComponent, dialogConfig);
|
273
|
-
const promptDialogComponent = dialogRef.componentInstance;
|
274
|
-
promptDialogComponent.title = config.title;
|
275
|
-
promptDialogComponent.message = config.message;
|
276
|
-
promptDialogComponent.value = config.value;
|
277
|
-
if (config.acceptButton) {
|
278
|
-
promptDialogComponent.acceptButton = config.acceptButton;
|
279
|
-
}
|
280
|
-
if (config.cancelButton) {
|
281
|
-
promptDialogComponent.cancelButton = config.cancelButton;
|
282
|
-
}
|
283
|
-
return dialogRef;
|
284
|
-
}
|
285
|
-
/**
|
286
|
-
* Opens a draggable dialog containing the given component.
|
287
|
-
*/
|
288
|
-
openDraggable({ component, config, dragHandleSelectors, draggableClass, }) {
|
289
|
-
const matDialogRef = this._dialogService.open(component, config);
|
290
|
-
const dragRefSubject = new Subject();
|
291
|
-
const CDK_OVERLAY_PANE_SELECTOR = '.cdk-overlay-pane';
|
292
|
-
const CDK_OVERLAY_CONTAINER_SELECTOR = '.cdk-overlay-container';
|
293
|
-
matDialogRef.afterOpened().subscribe(() => {
|
294
|
-
const dialogElement = (this._document.getElementById(matDialogRef.id));
|
295
|
-
if (!dialogElement) {
|
296
|
-
return;
|
297
|
-
}
|
298
|
-
const draggableElement = this._dragDrop.createDrag(dialogElement);
|
299
|
-
if (draggableClass) {
|
300
|
-
const childComponent = dialogElement.firstElementChild;
|
301
|
-
this._renderer2.addClass(childComponent, draggableClass);
|
302
|
-
}
|
303
|
-
if (dragHandleSelectors && dragHandleSelectors.length) {
|
304
|
-
const dragHandles = dragHandleSelectors.reduce((acc, curr) => [
|
305
|
-
...acc,
|
306
|
-
...Array.from(dialogElement.querySelectorAll(curr)),
|
307
|
-
], []);
|
308
|
-
if (dragHandles.length > 0) {
|
309
|
-
draggableElement.withHandles(dragHandles);
|
310
|
-
}
|
311
|
-
}
|
312
|
-
const rootElement = dialogElement.closest(CDK_OVERLAY_PANE_SELECTOR);
|
313
|
-
if (rootElement) {
|
314
|
-
draggableElement.withRootElement(rootElement);
|
315
|
-
}
|
316
|
-
const boundaryElement = dialogElement.closest(CDK_OVERLAY_CONTAINER_SELECTOR);
|
317
|
-
if (boundaryElement) {
|
318
|
-
draggableElement.withBoundaryElement(boundaryElement);
|
319
|
-
}
|
320
|
-
dragRefSubject.next(draggableElement);
|
321
|
-
});
|
322
|
-
return { matDialogRef, dragRefSubject };
|
323
|
-
}
|
324
|
-
_createConfig(config) {
|
325
|
-
const dialogConfig = new MatDialogConfig();
|
326
|
-
dialogConfig.width = '400px';
|
327
|
-
Object.assign(dialogConfig, config);
|
328
|
-
return dialogConfig;
|
329
|
-
}
|
330
|
-
}
|
331
|
-
TdDialogService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogService, deps: [{ token: DOCUMENT }, { token: i1.MatDialog }, { token: i2$2.DragDrop }, { token: i0.RendererFactory2 }], target: i0.ɵɵFactoryTarget.Injectable });
|
332
|
-
TdDialogService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogService });
|
333
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdDialogService, decorators: [{
|
334
|
-
type: Injectable
|
335
|
-
}], ctorParameters: function () {
|
336
|
-
return [{ type: undefined, decorators: [{
|
337
|
-
type: Inject,
|
338
|
-
args: [DOCUMENT]
|
339
|
-
}] }, { type: i1.MatDialog }, { type: i2$2.DragDrop }, { type: i0.RendererFactory2 }];
|
340
|
-
} });
|
341
|
-
|
342
|
-
class TdWindowDialogComponent {
|
343
|
-
constructor() {
|
344
|
-
this.docked = false;
|
345
|
-
this.dockToggled = new EventEmitter();
|
346
|
-
this.closed = new EventEmitter();
|
347
|
-
this.toolbarHeight = 56;
|
348
|
-
}
|
349
|
-
toggleDockedState() {
|
350
|
-
this.dockToggled.emit(this.docked);
|
351
|
-
}
|
352
|
-
}
|
353
|
-
TdWindowDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdWindowDialogComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
354
|
-
TdWindowDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.5", type: TdWindowDialogComponent, selector: "td-window-dialog", inputs: { toolbarColor: "toolbarColor", docked: "docked", title: "title", toggleDockedStateLabel: "toggleDockedStateLabel", closeLabel: "closeLabel" }, outputs: { dockToggled: "dockToggled", closed: "closed" }, ngImport: i0, template: "<mat-toolbar\n [color]=\"toolbarColor\"\n class=\"td-window-dialog-toolbar\"\n [style.min-height.px]=\"toolbarHeight\"\n [style.cursor]=\"docked ? 'inherit' : 'move'\"\n>\n <mat-toolbar-row [style.height.px]=\"toolbarHeight\">\n <div layout=\"row\" layout-align=\"start center\" flex>\n <span class=\"mat-title td-window-dialog-title truncate\" flex>\n {{ title }}\n </span>\n <!-- TODO: Resizing a drag-and-drop element was not working so removed docking/undocking for now-->\n <!-- <button mat-icon-button [matTooltip]=\"toggleDockedStateLabel\" (click)=\"toggleDockedState()\">\n <mat-icon [attr.aria-label]=\"toggleDockedStateLabel\">\n {{ docked ? 'unfold_more' : 'unfold_less' }}\n </mat-icon>\n </button> -->\n\n <button\n mat-icon-button\n [matTooltip]=\"closeLabel ?? ''\"\n (click)=\"closed.emit()\"\n class=\"td-window-dialog-close\"\n [attr.data-test]=\"'close-button'\"\n >\n <mat-icon [attr.aria-label]=\"closeLabel\">close</mat-icon>\n </button>\n </div>\n </mat-toolbar-row>\n</mat-toolbar>\n<ng-content></ng-content>\n", styles: [":host{height:100%;display:flex;flex-direction:column}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.td-window-dialog-toolbar{background:none}.td-window-dialog-title{margin-bottom:0}.td-window-dialog-close{margin-right:-8px}::ng-deep .td-window-dialog .mat-dialog-container{padding:0}\n"], dependencies: [{ kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i2$3.MatToolbar, selector: "mat-toolbar", inputs: ["color"], exportAs: ["matToolbar"] }, { kind: "directive", type: i2$3.MatToolbarRow, selector: "mat-toolbar-row", exportAs: ["matToolbarRow"] }, { kind: "directive", type: i3$1.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }, { kind: "component", type: i4$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
355
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: TdWindowDialogComponent, decorators: [{
|
356
|
-
type: Component,
|
357
|
-
args: [{ selector: 'td-window-dialog', changeDetection: ChangeDetectionStrategy.OnPush, template: "<mat-toolbar\n [color]=\"toolbarColor\"\n class=\"td-window-dialog-toolbar\"\n [style.min-height.px]=\"toolbarHeight\"\n [style.cursor]=\"docked ? 'inherit' : 'move'\"\n>\n <mat-toolbar-row [style.height.px]=\"toolbarHeight\">\n <div layout=\"row\" layout-align=\"start center\" flex>\n <span class=\"mat-title td-window-dialog-title truncate\" flex>\n {{ title }}\n </span>\n <!-- TODO: Resizing a drag-and-drop element was not working so removed docking/undocking for now-->\n <!-- <button mat-icon-button [matTooltip]=\"toggleDockedStateLabel\" (click)=\"toggleDockedState()\">\n <mat-icon [attr.aria-label]=\"toggleDockedStateLabel\">\n {{ docked ? 'unfold_more' : 'unfold_less' }}\n </mat-icon>\n </button> -->\n\n <button\n mat-icon-button\n [matTooltip]=\"closeLabel ?? ''\"\n (click)=\"closed.emit()\"\n class=\"td-window-dialog-close\"\n [attr.data-test]=\"'close-button'\"\n >\n <mat-icon [attr.aria-label]=\"closeLabel\">close</mat-icon>\n </button>\n </div>\n </mat-toolbar-row>\n</mat-toolbar>\n<ng-content></ng-content>\n", styles: [":host{height:100%;display:flex;flex-direction:column}.truncate{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.td-window-dialog-toolbar{background:none}.td-window-dialog-title{margin-bottom:0}.td-window-dialog-close{margin-right:-8px}::ng-deep .td-window-dialog .mat-dialog-container{padding:0}\n"] }]
|
358
|
-
}], propDecorators: { toolbarColor: [{
|
359
|
-
type: Input
|
360
|
-
}], docked: [{
|
361
|
-
type: Input
|
362
|
-
}], title: [{
|
363
|
-
type: Input
|
364
|
-
}], toggleDockedStateLabel: [{
|
365
|
-
type: Input
|
366
|
-
}], closeLabel: [{
|
367
|
-
type: Input
|
368
|
-
}], dockToggled: [{
|
369
|
-
type: Output
|
370
|
-
}], closed: [{
|
371
|
-
type: Output
|
372
|
-
}] } });
|
373
|
-
|
374
|
-
const TD_DIALOGS = [
|
375
|
-
TdAlertDialogComponent,
|
376
|
-
TdConfirmDialogComponent,
|
377
|
-
TdPromptDialogComponent,
|
378
|
-
TdDialogComponent,
|
379
|
-
TdDialogTitleDirective,
|
380
|
-
TdDialogActionsDirective,
|
381
|
-
TdDialogContentDirective,
|
382
|
-
TdWindowDialogComponent,
|
383
|
-
TdAlertDialogComponent,
|
384
|
-
TdConfirmDialogComponent,
|
385
|
-
TdPromptDialogComponent,
|
386
|
-
];
|
387
|
-
class CovalentDialogsModule {
|
388
|
-
}
|
389
|
-
CovalentDialogsModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: CovalentDialogsModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
390
|
-
CovalentDialogsModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.5", ngImport: i0, type: CovalentDialogsModule, declarations: [TdAlertDialogComponent,
|
391
|
-
TdConfirmDialogComponent,
|
392
|
-
TdPromptDialogComponent,
|
393
|
-
TdDialogComponent,
|
394
|
-
TdDialogTitleDirective,
|
395
|
-
TdDialogActionsDirective,
|
396
|
-
TdDialogContentDirective,
|
397
|
-
TdWindowDialogComponent,
|
398
|
-
TdAlertDialogComponent,
|
399
|
-
TdConfirmDialogComponent,
|
400
|
-
TdPromptDialogComponent], imports: [FormsModule,
|
401
|
-
CommonModule,
|
402
|
-
MatDialogModule,
|
403
|
-
MatInputModule,
|
404
|
-
MatButtonModule,
|
405
|
-
MatToolbarModule,
|
406
|
-
MatTooltipModule,
|
407
|
-
MatIconModule], exports: [TdAlertDialogComponent,
|
408
|
-
TdConfirmDialogComponent,
|
409
|
-
TdPromptDialogComponent,
|
410
|
-
TdDialogComponent,
|
411
|
-
TdDialogTitleDirective,
|
412
|
-
TdDialogActionsDirective,
|
413
|
-
TdDialogContentDirective,
|
414
|
-
TdWindowDialogComponent,
|
415
|
-
TdAlertDialogComponent,
|
416
|
-
TdConfirmDialogComponent,
|
417
|
-
TdPromptDialogComponent] });
|
418
|
-
CovalentDialogsModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: CovalentDialogsModule, providers: [TdDialogService], imports: [FormsModule,
|
419
|
-
CommonModule,
|
420
|
-
MatDialogModule,
|
421
|
-
MatInputModule,
|
422
|
-
MatButtonModule,
|
423
|
-
MatToolbarModule,
|
424
|
-
MatTooltipModule,
|
425
|
-
MatIconModule] });
|
426
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.5", ngImport: i0, type: CovalentDialogsModule, decorators: [{
|
427
|
-
type: NgModule,
|
428
|
-
args: [{
|
429
|
-
imports: [
|
430
|
-
FormsModule,
|
431
|
-
CommonModule,
|
432
|
-
MatDialogModule,
|
433
|
-
MatInputModule,
|
434
|
-
MatButtonModule,
|
435
|
-
MatToolbarModule,
|
436
|
-
MatTooltipModule,
|
437
|
-
MatIconModule,
|
438
|
-
],
|
439
|
-
declarations: [...TD_DIALOGS],
|
440
|
-
exports: [...TD_DIALOGS],
|
441
|
-
providers: [TdDialogService],
|
442
|
-
}]
|
443
|
-
}] });
|
444
|
-
|
445
|
-
var corners;
|
446
|
-
(function (corners) {
|
447
|
-
corners["topRight"] = "topRight";
|
448
|
-
corners["bottomRight"] = "bottomRight";
|
449
|
-
corners["bottomLeft"] = "bottomLeft";
|
450
|
-
corners["topLeft"] = "topLeft";
|
451
|
-
})(corners || (corners = {}));
|
452
|
-
var cursors;
|
453
|
-
(function (cursors) {
|
454
|
-
cursors["nesw"] = "nesw-resize";
|
455
|
-
cursors["nwse"] = "nwse-resize";
|
456
|
-
})(cursors || (cursors = {}));
|
457
|
-
var verticalAlignment;
|
458
|
-
(function (verticalAlignment) {
|
459
|
-
verticalAlignment["top"] = "top";
|
460
|
-
verticalAlignment["bottom"] = "bottom";
|
461
|
-
})(verticalAlignment || (verticalAlignment = {}));
|
462
|
-
var horizontalAlignment;
|
463
|
-
(function (horizontalAlignment) {
|
464
|
-
horizontalAlignment["right"] = "right";
|
465
|
-
horizontalAlignment["left"] = "left";
|
466
|
-
})(horizontalAlignment || (horizontalAlignment = {}));
|
467
|
-
const cornerWidth = '16px';
|
468
|
-
const offset = '0px';
|
469
|
-
const minWidth = 200;
|
470
|
-
const minHeight = 200;
|
471
|
-
function getPixels(sizeString) {
|
472
|
-
return parseFloat((sizeString || '').replace('px', ''));
|
473
|
-
}
|
474
|
-
function clamp(min, num, max) {
|
475
|
-
return Math.min(Math.max(num, min), max);
|
476
|
-
}
|
477
|
-
class ResizableDraggableDialog {
|
478
|
-
constructor(_document, _renderer2, _dialogRef, _dragRef) {
|
479
|
-
this._document = _document;
|
480
|
-
this._renderer2 = _renderer2;
|
481
|
-
this._dialogRef = _dialogRef;
|
482
|
-
this._dragRef = _dragRef;
|
483
|
-
this.cornerElements = [];
|
484
|
-
this.pointerDownSubs = [];
|
485
|
-
this._initialPositionReset();
|
486
|
-
this._attachCorners();
|
487
|
-
}
|
488
|
-
attach() {
|
489
|
-
this.detach();
|
490
|
-
this._attachCorners();
|
491
|
-
}
|
492
|
-
detach() {
|
493
|
-
this.pointerDownSubs.forEach((sub) => sub.unsubscribe());
|
494
|
-
this.pointerDownSubs = [];
|
495
|
-
this.cornerElements.forEach((elem) => this._renderer2.removeChild(this._getDialogWrapper(), elem));
|
496
|
-
this.cornerElements = [];
|
497
|
-
}
|
498
|
-
_getDialogWrapper() {
|
499
|
-
return (this._document.getElementById(this._dialogRef.id) || {}).parentElement;
|
500
|
-
}
|
501
|
-
_getViewportDimensions() {
|
502
|
-
var _a, _b;
|
503
|
-
return (_b = (_a = this._getDialogWrapper()) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.getBoundingClientRect();
|
504
|
-
}
|
505
|
-
_getDialogWrapperDimensions() {
|
506
|
-
const wrapper = this._getDialogWrapper();
|
507
|
-
if (!wrapper) {
|
508
|
-
return { width: 0, height: 0 };
|
509
|
-
}
|
510
|
-
const dimensions = getComputedStyle(wrapper);
|
511
|
-
return {
|
512
|
-
width: getPixels(dimensions.width),
|
513
|
-
height: getPixels(dimensions.height),
|
514
|
-
};
|
515
|
-
}
|
516
|
-
_initialPositionReset() {
|
517
|
-
var _a, _b, _c, _d, _e;
|
518
|
-
const viewportWidth = (_b = (_a = this._getViewportDimensions()) === null || _a === void 0 ? void 0 : _a.right) !== null && _b !== void 0 ? _b : 0;
|
519
|
-
const viewportHeight = (_d = (_c = this._getViewportDimensions()) === null || _c === void 0 ? void 0 : _c.bottom) !== null && _d !== void 0 ? _d : 0;
|
520
|
-
const { width, height } = this._getDialogWrapperDimensions();
|
521
|
-
const wrapperStyle = (_e = this._getDialogWrapper()) === null || _e === void 0 ? void 0 : _e.style;
|
522
|
-
const originalDialogRight = wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.marginRight;
|
523
|
-
const originalDialogLeft = wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.marginLeft;
|
524
|
-
const originalDialogBottom = wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.marginBottom;
|
525
|
-
const originalDialogTop = wrapperStyle === null || wrapperStyle === void 0 ? void 0 : wrapperStyle.marginTop;
|
526
|
-
let x;
|
527
|
-
if (originalDialogLeft) {
|
528
|
-
x = getPixels(originalDialogLeft);
|
529
|
-
}
|
530
|
-
else if (originalDialogRight) {
|
531
|
-
x = viewportWidth - getPixels(originalDialogRight) - width;
|
532
|
-
}
|
533
|
-
else {
|
534
|
-
x = (viewportWidth - width) / 2;
|
535
|
-
}
|
536
|
-
let y;
|
537
|
-
if (originalDialogTop) {
|
538
|
-
y = getPixels(originalDialogTop);
|
539
|
-
}
|
540
|
-
else if (originalDialogBottom) {
|
541
|
-
y = viewportHeight - getPixels(originalDialogBottom) - height;
|
542
|
-
}
|
543
|
-
else {
|
544
|
-
y = (viewportHeight - height) / 2;
|
545
|
-
}
|
546
|
-
// use drag ref's mechanisms for positioning instead of the dialog's
|
547
|
-
this._dialogRef.updatePosition({
|
548
|
-
top: '0px',
|
549
|
-
right: '0px',
|
550
|
-
bottom: '0px',
|
551
|
-
left: '0px',
|
552
|
-
});
|
553
|
-
this._dragRef.setFreeDragPosition({ x, y });
|
554
|
-
}
|
555
|
-
_attachCorners() {
|
556
|
-
Object.values(corners).forEach((corner) => {
|
557
|
-
const element = this._renderer2.createElement('div');
|
558
|
-
this.cornerElements = [...this.cornerElements, element];
|
559
|
-
this._renderer2.setStyle(element, 'position', 'absolute');
|
560
|
-
this._renderer2.setStyle(element, 'width', cornerWidth);
|
561
|
-
this._renderer2.setStyle(element, 'height', cornerWidth);
|
562
|
-
this._renderer2.appendChild(this._getDialogWrapper(), element);
|
563
|
-
let cursor;
|
564
|
-
let topBottom;
|
565
|
-
let rightLeft;
|
566
|
-
if (corner === corners.topRight) {
|
567
|
-
cursor = cursors.nesw;
|
568
|
-
topBottom = verticalAlignment.top;
|
569
|
-
rightLeft = horizontalAlignment.right;
|
570
|
-
}
|
571
|
-
else if (corner === corners.bottomRight) {
|
572
|
-
cursor = cursors.nwse;
|
573
|
-
topBottom = verticalAlignment.bottom;
|
574
|
-
rightLeft = horizontalAlignment.right;
|
575
|
-
const icon = this._renderer2.createElement('i');
|
576
|
-
this._renderer2.addClass(icon, 'material-icons');
|
577
|
-
this._renderer2.appendChild(icon, this._renderer2.createText('filter_list'));
|
578
|
-
this._renderer2.appendChild(element, icon);
|
579
|
-
this._renderer2.setStyle(icon, 'transform', `rotate(${315}deg) translate(0px, ${offset})`);
|
580
|
-
this._renderer2.setStyle(icon, 'font-size', cornerWidth);
|
581
|
-
}
|
582
|
-
else if (corner === corners.bottomLeft) {
|
583
|
-
cursor = cursors.nesw;
|
584
|
-
topBottom = verticalAlignment.bottom;
|
585
|
-
rightLeft = horizontalAlignment.left;
|
586
|
-
}
|
587
|
-
else {
|
588
|
-
cursor = cursors.nwse;
|
589
|
-
topBottom = verticalAlignment.top;
|
590
|
-
rightLeft = horizontalAlignment.left;
|
591
|
-
}
|
592
|
-
this._renderer2.setStyle(element, topBottom, offset);
|
593
|
-
this._renderer2.setStyle(element, rightLeft, offset);
|
594
|
-
this._renderer2.setStyle(element, 'cursor', cursor);
|
595
|
-
const pointerDownSub = fromEvent(element, 'pointerdown').subscribe((event) => {
|
596
|
-
this._handleMouseDown(event, corner);
|
597
|
-
});
|
598
|
-
this.pointerDownSubs = [...this.pointerDownSubs, pointerDownSub];
|
599
|
-
});
|
600
|
-
}
|
601
|
-
_handleMouseDown(event, corner) {
|
602
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
603
|
-
this._renderer2.setStyle(this._document.body, 'user-select', 'none');
|
604
|
-
const { width: originalWidth, height: originalHeight } = this._getDialogWrapperDimensions();
|
605
|
-
const originalMouseX = event.pageX;
|
606
|
-
const originalMouseY = event.pageY;
|
607
|
-
const { x: currentTransformX, y: currentTransformY } = this._dragRef.getFreeDragPosition();
|
608
|
-
const wrapper = (_a = this._getDialogWrapper()) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
|
609
|
-
const distanceFromBottom = (_b = wrapper === null || wrapper === void 0 ? void 0 : wrapper.bottom) !== null && _b !== void 0 ? _b : 0;
|
610
|
-
const distanceFromRight = (_c = wrapper === null || wrapper === void 0 ? void 0 : wrapper.right) !== null && _c !== void 0 ? _c : 0;
|
611
|
-
const viewportWidth = (_e = (_d = this._getViewportDimensions()) === null || _d === void 0 ? void 0 : _d.right) !== null && _e !== void 0 ? _e : 0;
|
612
|
-
const viewportHeight = (_g = (_f = this._getViewportDimensions()) === null || _f === void 0 ? void 0 : _f.bottom) !== null && _g !== void 0 ? _g : 0;
|
613
|
-
const mouseMoveSub = fromEvent(window, 'pointermove').subscribe((e) => {
|
614
|
-
e.preventDefault(); // prevent highlighting of text when dragging
|
615
|
-
const yDelta = clamp(0, e.pageY, viewportHeight) - originalMouseY;
|
616
|
-
const xDelta = clamp(0, e.pageX, viewportWidth) - originalMouseX;
|
617
|
-
let newHeight;
|
618
|
-
let newWidth;
|
619
|
-
let newTransformY = 0;
|
620
|
-
let newTransformX = 0;
|
621
|
-
// top right
|
622
|
-
if (corner === corners.topRight) {
|
623
|
-
newHeight = clamp(minHeight, originalHeight - yDelta, viewportHeight);
|
624
|
-
newWidth = clamp(minWidth, originalWidth + xDelta, viewportWidth);
|
625
|
-
newTransformY = clamp(0, currentTransformY + yDelta, distanceFromBottom - newHeight);
|
626
|
-
newTransformX = currentTransformX;
|
627
|
-
}
|
628
|
-
// bottom right
|
629
|
-
else if (corner === corners.bottomRight) {
|
630
|
-
newHeight = clamp(minHeight, originalHeight + yDelta, viewportHeight);
|
631
|
-
newWidth = clamp(minWidth, originalWidth + xDelta, viewportWidth);
|
632
|
-
newTransformY = currentTransformY;
|
633
|
-
newTransformX = currentTransformX;
|
634
|
-
}
|
635
|
-
// bottom left
|
636
|
-
else if (corner === corners.bottomLeft) {
|
637
|
-
newHeight = clamp(minHeight, originalHeight + yDelta, viewportHeight);
|
638
|
-
newWidth = clamp(minWidth, originalWidth - xDelta, viewportWidth);
|
639
|
-
newTransformY = currentTransformY;
|
640
|
-
newTransformX = clamp(0, currentTransformX + xDelta, distanceFromRight - newWidth);
|
641
|
-
}
|
642
|
-
// top left
|
643
|
-
else {
|
644
|
-
newHeight = clamp(minHeight, originalHeight - yDelta, viewportHeight);
|
645
|
-
newWidth = clamp(minWidth, originalWidth - xDelta, viewportWidth);
|
646
|
-
newTransformX = clamp(0, currentTransformX + xDelta, distanceFromRight - newWidth);
|
647
|
-
newTransformY = clamp(0, currentTransformY + yDelta, distanceFromBottom - newHeight);
|
648
|
-
}
|
649
|
-
this._dialogRef.updateSize(`${newWidth}px`, `${newHeight}px`);
|
650
|
-
this._dragRef.setFreeDragPosition({
|
651
|
-
x: newTransformX,
|
652
|
-
y: newTransformY,
|
653
|
-
});
|
654
|
-
});
|
655
|
-
const mouseUpSub = merge(fromEvent(window, 'pointerup'), fromEvent(window, 'pointercancel')).subscribe(() => {
|
656
|
-
this._renderer2.removeStyle(this._document.body, 'user-select');
|
657
|
-
mouseMoveSub.unsubscribe();
|
658
|
-
mouseUpSub.unsubscribe();
|
659
|
-
});
|
660
|
-
}
|
661
|
-
}
|
662
|
-
|
663
|
-
/**
|
664
|
-
* Generated bundle index. Do not edit.
|
665
|
-
*/
|
666
|
-
|
667
|
-
export { CovalentDialogsModule, ResizableDraggableDialog, TdAlertDialogComponent, TdConfirmDialogComponent, TdDialogActionsDirective, TdDialogComponent, TdDialogContentDirective, TdDialogService, TdDialogTitleDirective, TdPromptDialogComponent, TdWindowDialogComponent };
|
668
|
-
//# sourceMappingURL=covalent-core-dialogs.mjs.map
|