blob: f5efbcf4aa89f1bd029611b8f087998a39d1dcc6 [file] [log] [blame]
{"version":3,"sources":["../../../../src/platform/core/dialogs/dialog.component.ts","../../../src/platform/core/dialogs/alert-dialog/alert-dialog.component.ts","../../../src/platform/core/dialogs/confirm-dialog/confirm-dialog.component.ts","../../../src/platform/core/dialogs/prompt-dialog/prompt-dialog.component.ts","../../../../node_modules/tslib/tslib.es6.js","../../../src/platform/core/dialogs/services/dialog.service.ts","../../../src/platform/core/dialogs/window-dialog/window-dialog.component.ts","../../../../src/platform/core/dialogs/dialogs.module.ts","../../../src/platform/core/dialogs/resizable-draggable-dialog/resizable-draggable-dialog.ts"],"names":["Directive","args","selector","TdDialogComponent","prototype","ngAfterContentInit","this","dialogTitle","length","Error","dialogContent","dialogActions","Component","template","ContentChildren","TdDialogTitleDirective","descendants","TdDialogContentDirective","TdDialogActionsDirective","TdAlertDialogComponent","_dialogRef","closeButton","close","MatDialogRef","TdConfirmDialogComponent","cancelButton","acceptButton","isDestructive","cancel","accept","TdPromptDialogComponent","ngAfterViewInit","_this","Promise","resolve","then","_input","focus","handleInputFocus","select","value","ViewChild","static","Object","create","__read","o","n","m","Symbol","iterator","r","e","i","call","ar","next","done","push","error","__spread","arguments","concat","TdDialogService","_document","_dialogService","_dragDrop","rendererFactory","_renderer2","createRenderer","undefined","open","component","config","closeAll","openAlert","dialogConfig","_createConfig","dialogRef","alertDialogComponent","componentInstance","title","message","openConfirm","confirmDialogComponent","openPrompt","promptDialogComponent","openDraggable","_a","dragHandleSelectors","draggableClass","matDialogRef","dragRefSubject","Subject","afterOpened","subscribe","dialogElement","getElementById","id","draggableElement","createDrag","childComponent","firstElementChild","addClass","dragHandles","reduce","acc","curr","Array","from","querySelectorAll","withHandles","rootElement","closest","withRootElement","boundaryElement","withBoundaryElement","MatDialogConfig","width","assign","Injectable","Inject","DOCUMENT","MatDialog","DragDrop","RendererFactory2","TdWindowDialogComponent","docked","dockToggled","EventEmitter","closed","toolbarHeight","toggleDockedState","emit","changeDetection","ChangeDetectionStrategy","OnPush","Input","Output","TD_DIALOGS","NgModule","imports","FormsModule","CommonModule","MatDialogModule","MatInputModule","MatButtonModule","MatToolbarModule","MatTooltipModule","MatIconModule","declarations","exports","providers","corners","topRight","bottomRight","bottomLeft","topLeft","cursors","verticalAlignment","horizontalAlignment","cornerWidth","offset","minWidth","minHeight","getPixels","sizeString","parseFloat","replace","clamp","min","num","max","Math","ResizableDraggableDialog","_dragRef","cornerElements","pointerDownSubs","_initialPositionReset","_attachCorners","attach","detach","forEach","sub","unsubscribe","elem","removeChild","_getDialogWrapper","parentElement","_getViewportDimensions","getBoundingClientRect","_getDialogWrapperDimensions","dimensions","getComputedStyle","height","x","y","viewportWidth","right","viewportHeight","bottom","_b","_c","style","originalDialogRight","marginRight","originalDialogLeft","marginLeft","originalDialogBottom","marginBottom","originalDialogTop","marginTop","updatePosition","top","left","setFreeDragPosition","values","corner","cursor","topBottom","rightLeft","element","createElement","setStyle","appendChild","icon","createText","pointerDownSub","fromEvent","event","_handleMouseDown","originalWidth","originalHeight","originalMouseX","pageX","originalMouseY","pageY","getFreeDragPosition","currentTransformX","currentTransformY","distanceFromBottom","distanceFromRight","_d","mouseMoveSub","window","preventDefault","newHeight","newWidth","yDelta","xDelta","newTransformY","newTransformX","updateSize","mouseUpSub","merge","removeStyle"],"mappings":"onCAGA,iCADCA,EAAAA,UAASC,KAAA,CAAC,CAAEC,SAAU,4BAIvB,iCADCF,EAAAA,UAASC,KAAA,CAAC,CAAEC,SAAU,8BAIvB,iCADCF,EAAAA,UAASC,KAAA,CAAC,CAAEC,SAAU,yCAQvB,SAAAC,YAKEA,EAAAC,UAAAC,mBAAA,WACE,GAAIC,KAAKC,YAAYC,OAAS,EAC5B,MAAM,IAAIC,MAAM,wDAElB,GAAIH,KAAKI,cAAcF,OAAS,EAC9B,MAAM,IAAIC,MAAM,0DAElB,GAAIH,KAAKK,cAAcH,OAAS,EAC9B,MAAM,IAAIC,MAAM,oFAlBrBG,EAAA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OAIDG,EAA2BC,EAAAA,MAC/B1B,EAAAA,UAAUgB,OAAQ,aAClBhB,EAAAA,UAAUgB,OAAQ,kBAClBrJ,WAAS,WACT/D,EAAKoC,WAAW2L,YAAyB/N,EAAKgC,UAAc,KAAE,eAC9DmL,EAAa3D,cACbqE,EAAWrE","sourcesContent":["import { Component, Directive, ContentChildren, QueryList, AfterContentInit } from '@angular/core';\n\n@Directive({ selector: 'td-dialog-title' })\nexport class TdDialogTitleDirective {}\n\n@Directive({ selector: 'td-dialog-content' })\nexport class TdDialogContentDirective {}\n\n@Directive({ selector: 'td-dialog-actions' })\nexport class TdDialogActionsDirective {}\n\n@Component({\n selector: 'td-dialog',\n templateUrl: './dialog.component.html',\n styleUrls: ['./dialog.component.scss'],\n})\nexport class TdDialogComponent implements AfterContentInit {\n @ContentChildren(TdDialogTitleDirective, { descendants: true }) dialogTitle: QueryList<TdDialogTitleDirective>;\n @ContentChildren(TdDialogContentDirective, { descendants: true }) dialogContent: QueryList<TdDialogContentDirective>;\n @ContentChildren(TdDialogActionsDirective, { descendants: true }) dialogActions: QueryList<TdDialogActionsDirective>;\n\n ngAfterContentInit(): void {\n if (this.dialogTitle.length > 1) {\n throw new Error('Duplicate td-dialog-title component at in td-dialog.');\n }\n if (this.dialogContent.length > 1) {\n throw new Error('Duplicate td-dialog-content component at in td-dialog.');\n }\n if (this.dialogActions.length > 1) {\n throw new Error('Duplicate td-dialog-actions component at in td-dialog.');\n }\n }\n}\n","import { Component } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'td-alert-dialog',\n templateUrl: './alert-dialog.component.html',\n styleUrls: ['./alert-dialog.component.scss'],\n})\nexport class TdAlertDialogComponent {\n title: string;\n message: string;\n closeButton: string = 'CLOSE';\n\n constructor(private _dialogRef: MatDialogRef<TdAlertDialogComponent>) {}\n\n close(): void {\n this._dialogRef.close();\n }\n}\n","import { Component } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'td-confirm-dialog',\n templateUrl: './confirm-dialog.component.html',\n styleUrls: ['./confirm-dialog.component.scss'],\n})\nexport class TdConfirmDialogComponent {\n title: string;\n message: string;\n cancelButton: string = 'CANCEL';\n acceptButton: string = 'ACCEPT';\n isDestructive: boolean = false;\n\n constructor(private _dialogRef: MatDialogRef<TdConfirmDialogComponent>) {}\n\n cancel(): void {\n this._dialogRef.close(false);\n }\n\n accept(): void {\n this._dialogRef.close(true);\n }\n}\n","import { Component, ViewChild, ElementRef, AfterViewInit } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\n\n@Component({\n selector: 'td-prompt-dialog',\n templateUrl: './prompt-dialog.component.html',\n styleUrls: ['./prompt-dialog.component.scss'],\n})\nexport class TdPromptDialogComponent implements AfterViewInit {\n title: string;\n message: string;\n value: string;\n cancelButton: string = 'CANCEL';\n acceptButton: string = 'ACCEPT';\n\n @ViewChild('input', { static: true }) _input: ElementRef;\n\n constructor(private _dialogRef: MatDialogRef<TdPromptDialogComponent>) {}\n\n ngAfterViewInit(): void {\n // focus input once everything is rendered and good to go\n Promise.resolve().then(() => {\n (<HTMLInputElement>this._input.nativeElement).focus();\n });\n }\n\n /**\n * Method executed when input is focused\n * Selects all text\n */\n handleInputFocus(): void {\n (<HTMLInputElement>this._input.nativeElement).select();\n }\n\n cancel(): void {\n this._dialogRef.close();\n }\n\n accept(): void {\n this._dialogRef.close(this.value);\n }\n}\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nexport function __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n","import { Injectable, Inject, Renderer2, RendererFactory2 } from '@angular/core';\nimport { MatDialog, MatDialogRef, MatDialogConfig } from '@angular/material/dialog';\nimport { ComponentType } from '@angular/cdk/portal';\n\nimport { TdAlertDialogComponent } from '../alert-dialog/alert-dialog.component';\nimport { TdConfirmDialogComponent } from '../confirm-dialog/confirm-dialog.component';\nimport { TdPromptDialogComponent } from '../prompt-dialog/prompt-dialog.component';\nimport { DragDrop, DragRef } from '@angular/cdk/drag-drop';\nimport { DOCUMENT } from '@angular/common';\nimport { Subject } from 'rxjs';\n\nexport interface IDialogConfig extends MatDialogConfig {\n title?: string;\n message: string;\n}\n\nexport interface IAlertConfig extends IDialogConfig {\n closeButton?: string;\n}\n\nexport interface IConfirmConfig extends IDialogConfig {\n acceptButton?: string;\n cancelButton?: string;\n isDestructive?: boolean;\n}\n\nexport interface IPromptConfig extends IConfirmConfig {\n value?: string;\n}\n\nexport interface IDraggableConfig<T> {\n component: ComponentType<T>;\n config?: MatDialogConfig;\n // CSS selectors of element(s) inside the component meant to be drag handle(s)\n dragHandleSelectors?: string[];\n // Class that will be added to the component signifying drag-ability\n draggableClass?: string;\n}\n\nexport interface IDraggableRefs<T> {\n matDialogRef: MatDialogRef<T>;\n dragRefSubject: Subject<DragRef>;\n}\n\n@Injectable()\nexport class TdDialogService {\n private _renderer2: Renderer2;\n\n constructor(\n @Inject(DOCUMENT) private _document: any,\n private _dialogService: MatDialog,\n private _dragDrop: DragDrop,\n private rendererFactory: RendererFactory2,\n ) {\n this._renderer2 = rendererFactory.createRenderer(undefined, undefined);\n }\n\n /**\n * params:\n * - component: ComponentType<T>\n * - config: MatDialogConfig\n * Wrapper function over the open() method in MatDialog.\n * Opens a modal dialog containing the given component.\n */\n public open<T>(component: ComponentType<T>, config?: MatDialogConfig): MatDialogRef<T> {\n return this._dialogService.open(component, config);\n }\n\n /**\n * Wrapper function over the closeAll() method in MatDialog.\n * Closes all of the currently-open dialogs.\n */\n public closeAll(): void {\n this._dialogService.closeAll();\n }\n\n /**\n * params:\n * - config: IAlertConfig {\n * message: string;\n * title?: string;\n * viewContainerRef?: ViewContainerRef;\n * closeButton?: string;\n * }\n *\n * Opens an alert dialog with the provided config.\n * Returns an MatDialogRef<TdAlertDialogComponent> object.\n */\n public openAlert(config: IAlertConfig): MatDialogRef<TdAlertDialogComponent> {\n const dialogConfig: MatDialogConfig = this._createConfig(config);\n const dialogRef: MatDialogRef<TdAlertDialogComponent> = this._dialogService.open(\n TdAlertDialogComponent,\n dialogConfig,\n );\n const alertDialogComponent: TdAlertDialogComponent = dialogRef.componentInstance;\n alertDialogComponent.title = config.title;\n alertDialogComponent.message = config.message;\n if (config.closeButton) {\n alertDialogComponent.closeButton = config.closeButton;\n }\n return dialogRef;\n }\n\n /**\n * params:\n * - config: IConfirmConfig {\n * message: string;\n * title?: string;\n * viewContainerRef?: ViewContainerRef;\n * acceptButton?: string;\n * cancelButton?: string;\n * isDestructive?: boolean;\n * }\n *\n * Opens a confirm dialog with the provided config.\n * Returns an MatDialogRef<TdConfirmDialogComponent> object.\n */\n public openConfirm(config: IConfirmConfig): MatDialogRef<TdConfirmDialogComponent> {\n const dialogConfig: MatDialogConfig = this._createConfig(config);\n const dialogRef: MatDialogRef<TdConfirmDialogComponent> = this._dialogService.open(\n TdConfirmDialogComponent,\n dialogConfig,\n );\n const confirmDialogComponent: TdConfirmDialogComponent = dialogRef.componentInstance;\n confirmDialogComponent.title = config.title;\n confirmDialogComponent.message = config.message;\n if (config.acceptButton) {\n confirmDialogComponent.acceptButton = config.acceptButton;\n }\n if (config.isDestructive) {\n confirmDialogComponent.isDestructive = config.isDestructive;\n }\n if (config.cancelButton) {\n confirmDialogComponent.cancelButton = config.cancelButton;\n }\n return dialogRef;\n }\n\n /**\n * params:\n * - config: IPromptConfig {\n * message: string;\n * title?: string;\n * value?: string;\n * viewContainerRef?: ViewContainerRef;\n * acceptButton?: string;\n * cancelButton?: string;\n * }\n *\n * Opens a prompt dialog with the provided config.\n * Returns an MatDialogRef<TdPromptDialogComponent> object.\n */\n public openPrompt(config: IPromptConfig): MatDialogRef<TdPromptDialogComponent> {\n const dialogConfig: MatDialogConfig = this._createConfig(config);\n const dialogRef: MatDialogRef<TdPromptDialogComponent> = this._dialogService.open(\n TdPromptDialogComponent,\n dialogConfig,\n );\n const promptDialogComponent: TdPromptDialogComponent = dialogRef.componentInstance;\n promptDialogComponent.title = config.title;\n promptDialogComponent.message = config.message;\n promptDialogComponent.value = config.value;\n if (config.acceptButton) {\n promptDialogComponent.acceptButton = config.acceptButton;\n }\n if (config.cancelButton) {\n promptDialogComponent.cancelButton = config.cancelButton;\n }\n return dialogRef;\n }\n\n /**\n * Opens a draggable dialog containing the given component.\n */\n public openDraggable<T>({\n component,\n config,\n dragHandleSelectors,\n draggableClass,\n }: IDraggableConfig<T>): IDraggableRefs<T> {\n const matDialogRef: MatDialogRef<T, any> = this._dialogService.open(component, config);\n\n const dragRefSubject: Subject<DragRef> = new Subject<DragRef>();\n\n const CDK_OVERLAY_PANE_SELECTOR: string = '.cdk-overlay-pane';\n const CDK_OVERLAY_CONTAINER_SELECTOR: string = '.cdk-overlay-container';\n\n matDialogRef.afterOpened().subscribe(() => {\n const dialogElement: HTMLElement = <HTMLElement>this._document.getElementById(matDialogRef.id);\n const draggableElement: DragRef = this._dragDrop.createDrag(dialogElement);\n\n if (draggableClass) {\n const childComponent: Element = dialogElement.firstElementChild;\n this._renderer2.addClass(childComponent, draggableClass);\n }\n if (dragHandleSelectors && dragHandleSelectors.length) {\n const dragHandles: Element[] = dragHandleSelectors.reduce(\n (acc: Element[], curr: string) => [...acc, ...Array.from(dialogElement.querySelectorAll(curr))],\n [],\n );\n if (dragHandles.length > 0) {\n draggableElement.withHandles(<HTMLElement[]>dragHandles);\n }\n }\n const rootElement: Element = dialogElement.closest(CDK_OVERLAY_PANE_SELECTOR);\n if (rootElement) {\n draggableElement.withRootElement(<HTMLElement>rootElement);\n }\n\n const boundaryElement: Element = dialogElement.closest(CDK_OVERLAY_CONTAINER_SELECTOR);\n if (boundaryElement) {\n draggableElement.withBoundaryElement(<HTMLElement>boundaryElement);\n }\n dragRefSubject.next(draggableElement);\n });\n\n return { matDialogRef, dragRefSubject };\n }\n\n private _createConfig(config: IDialogConfig): MatDialogConfig {\n const dialogConfig: MatDialogConfig = new MatDialogConfig();\n dialogConfig.width = '400px';\n Object.assign(dialogConfig, config);\n return dialogConfig;\n }\n}\n","import { Component, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';\nimport { ThemePalette } from '@angular/material/core';\n\n@Component({\n selector: 'td-window-dialog',\n templateUrl: './window-dialog.component.html',\n styleUrls: ['./window-dialog.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class TdWindowDialogComponent {\n @Input() toolbarColor: ThemePalette;\n @Input() docked: boolean = false;\n\n @Input() title: string;\n @Input() toggleDockedStateLabel: string;\n @Input() closeLabel: string;\n\n @Output() dockToggled: EventEmitter<boolean> = new EventEmitter();\n @Output() closed: EventEmitter<void> = new EventEmitter();\n\n toolbarHeight: number = 56;\n\n toggleDockedState(): void {\n this.dockToggled.emit(this.docked);\n }\n}\n","import { Type } from '@angular/core';\nimport { NgModule } from '@angular/core';\n\nimport { CommonModule } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport { MatDialogModule } from '@angular/material/dialog';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatButtonModule } from '@angular/material/button';\n\nimport {\n TdDialogComponent,\n TdDialogTitleDirective,\n TdDialogActionsDirective,\n TdDialogContentDirective,\n} from './dialog.component';\nimport { TdAlertDialogComponent } from './alert-dialog/alert-dialog.component';\nimport { TdConfirmDialogComponent } from './confirm-dialog/confirm-dialog.component';\nimport { TdPromptDialogComponent } from './prompt-dialog/prompt-dialog.component';\nimport { TdDialogService } from './services/dialog.service';\nimport { TdWindowDialogComponent } from './window-dialog/window-dialog.component';\nimport { MatToolbarModule } from '@angular/material/toolbar';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { MatIconModule } from '@angular/material/icon';\n\nconst TD_DIALOGS: Type<any>[] = [\n TdAlertDialogComponent,\n TdConfirmDialogComponent,\n TdPromptDialogComponent,\n TdDialogComponent,\n TdDialogTitleDirective,\n TdDialogActionsDirective,\n TdDialogContentDirective,\n TdWindowDialogComponent,\n];\n\nconst TD_DIALOGS_ENTRY_COMPONENTS: Type<any>[] = [\n TdAlertDialogComponent,\n TdConfirmDialogComponent,\n TdPromptDialogComponent,\n];\n\n@NgModule({\n imports: [\n FormsModule,\n CommonModule,\n MatDialogModule,\n MatInputModule,\n MatButtonModule,\n\n MatToolbarModule,\n MatTooltipModule,\n MatIconModule,\n ],\n declarations: [TD_DIALOGS],\n exports: [TD_DIALOGS],\n providers: [TdDialogService],\n})\nexport class CovalentDialogsModule {}\n","import { Renderer2 } from '@angular/core';\nimport { MatDialogRef } from '@angular/material/dialog';\nimport { DragRef } from '@angular/cdk/drag-drop';\nimport { merge, Subscription, fromEvent } from 'rxjs';\nimport { Point } from '@angular/cdk/drag-drop/drag-ref';\n\nenum corners {\n topRight = 'topRight',\n bottomRight = 'bottomRight',\n bottomLeft = 'bottomLeft',\n topLeft = 'topLeft',\n}\nenum cursors {\n nesw = 'nesw-resize',\n nwse = 'nwse-resize',\n}\nenum verticalAlignment {\n top = 'top',\n bottom = 'bottom',\n}\nenum horizontalAlignment {\n right = 'right',\n left = 'left',\n}\n\nconst cornerWidth: string = '16px';\nconst offset: string = '0px';\nconst minWidth: number = 200;\nconst minHeight: number = 200;\n\nfunction getPixels(sizeString: string): number {\n return parseFloat((sizeString || '').replace('px', ''));\n}\n\nfunction clamp(min: number, num: number, max: number): number {\n return Math.min(Math.max(num, min), max);\n}\n\nexport class ResizableDraggableDialog {\n cornerElements: HTMLElement[] = [];\n pointerDownSubs: Subscription[] = [];\n\n constructor(\n private _document: any,\n private _renderer2: Renderer2,\n private _dialogRef: MatDialogRef<any>,\n private _dragRef: DragRef,\n ) {\n this._initialPositionReset();\n this._attachCorners();\n }\n\n public attach(): void {\n this.detach();\n this._attachCorners();\n }\n\n public detach(): void {\n this.pointerDownSubs.forEach((sub: Subscription) => sub.unsubscribe());\n this.pointerDownSubs = [];\n this.cornerElements.forEach((elem: HTMLElement) => this._renderer2.removeChild(this._getDialogWrapper(), elem));\n this.cornerElements = [];\n }\n\n private _getDialogWrapper(): HTMLElement {\n return (<HTMLElement>this._document.getElementById(this._dialogRef.id) || {}).parentElement;\n }\n\n private _getViewportDimensions(): ClientRect {\n return this._getDialogWrapper().parentElement.getBoundingClientRect();\n }\n\n private _getDialogWrapperDimensions(): { width: number; height: number } {\n const dimensions: CSSStyleDeclaration = getComputedStyle(this._getDialogWrapper());\n return {\n width: getPixels(dimensions.width),\n height: getPixels(dimensions.height),\n };\n }\n\n private _initialPositionReset(): void {\n const { right: viewportWidth, bottom: viewportHeight }: ClientRect = this._getViewportDimensions();\n const { width, height } = this._getDialogWrapperDimensions();\n const {\n marginRight: originalDialogRight,\n marginLeft: originalDialogLeft,\n marginBottom: originalDialogBottom,\n marginTop: originalDialogTop,\n } = this._getDialogWrapper().style;\n let x: number;\n if (originalDialogLeft) {\n x = getPixels(originalDialogLeft);\n } else if (originalDialogRight) {\n x = viewportWidth - getPixels(originalDialogRight) - width;\n } else {\n x = (viewportWidth - width) / 2;\n }\n let y: number;\n if (originalDialogTop) {\n y = getPixels(originalDialogTop);\n } else if (originalDialogBottom) {\n y = viewportHeight - getPixels(originalDialogBottom) - height;\n } else {\n y = (viewportHeight - height) / 2;\n }\n // use drag ref's mechanisms for positioning instead of the dialog's\n this._dialogRef.updatePosition({ top: '0px', right: '0px', bottom: '0px', left: '0px' });\n this._dragRef.setFreeDragPosition({ x, y });\n }\n\n private _attachCorners(): void {\n Object.values(corners).forEach((corner: corners) => {\n const element: HTMLElement = this._renderer2.createElement('div');\n this.cornerElements = [...this.cornerElements, element];\n this._renderer2.setStyle(element, 'position', 'absolute');\n this._renderer2.setStyle(element, 'width', cornerWidth);\n this._renderer2.setStyle(element, 'height', cornerWidth);\n this._renderer2.appendChild(this._getDialogWrapper(), element);\n\n let cursor: cursors;\n let topBottom: verticalAlignment;\n let rightLeft: horizontalAlignment;\n\n if (corner === corners.topRight) {\n cursor = cursors.nesw;\n topBottom = verticalAlignment.top;\n rightLeft = horizontalAlignment.right;\n } else if (corner === corners.bottomRight) {\n cursor = cursors.nwse;\n topBottom = verticalAlignment.bottom;\n rightLeft = horizontalAlignment.right;\n\n const icon: HTMLElement = this._renderer2.createElement('i');\n this._renderer2.addClass(icon, 'material-icons');\n this._renderer2.appendChild(icon, this._renderer2.createText('filter_list'));\n this._renderer2.appendChild(element, icon);\n this._renderer2.setStyle(icon, 'transform', `rotate(${315}deg) translate(0px, ${offset})`);\n this._renderer2.setStyle(icon, 'font-size', cornerWidth);\n } else if (corner === corners.bottomLeft) {\n cursor = cursors.nesw;\n topBottom = verticalAlignment.bottom;\n rightLeft = horizontalAlignment.left;\n } else if (corner === corners.topLeft) {\n cursor = cursors.nwse;\n topBottom = verticalAlignment.top;\n rightLeft = horizontalAlignment.left;\n }\n this._renderer2.setStyle(element, topBottom, offset);\n this._renderer2.setStyle(element, rightLeft, offset);\n this._renderer2.setStyle(element, 'cursor', cursor);\n\n const pointerDownSub: Subscription = fromEvent(element, 'pointerdown').subscribe((event: PointerEvent) => {\n this._handleMouseDown(event, corner);\n });\n this.pointerDownSubs = [...this.pointerDownSubs, pointerDownSub];\n });\n }\n\n private _handleMouseDown(event: PointerEvent, corner: corners): void {\n this._renderer2.setStyle(<HTMLElement>this._document.body, 'user-select', 'none');\n const { width: originalWidth, height: originalHeight } = this._getDialogWrapperDimensions();\n const originalMouseX: number = event.pageX;\n const originalMouseY: number = event.pageY;\n const { x: currentTransformX, y: currentTransformY }: Point = this._dragRef.getFreeDragPosition();\n const { bottom: distanceFromBottom, right: distanceFromRight }: ClientRect =\n this._getDialogWrapper().getBoundingClientRect();\n const { right: viewportWidth, bottom: viewportHeight }: ClientRect = this._getViewportDimensions();\n\n const mouseMoveSub: Subscription = fromEvent(window, 'pointermove').subscribe((e: PointerEvent) => {\n e.preventDefault(); // prevent highlighting of text when dragging\n\n const yDelta: number = clamp(0, e.pageY, viewportHeight) - originalMouseY;\n const xDelta: number = clamp(0, e.pageX, viewportWidth) - originalMouseX;\n let newHeight: number;\n let newWidth: number;\n let newTransformY: number = 0;\n let newTransformX: number = 0;\n\n // top right\n if (corner === corners.topRight) {\n newHeight = clamp(minHeight, originalHeight - yDelta, viewportHeight);\n newWidth = clamp(minWidth, originalWidth + xDelta, viewportWidth);\n newTransformY = clamp(0, currentTransformY + yDelta, distanceFromBottom - newHeight);\n newTransformX = currentTransformX;\n }\n // bottom right\n else if (corner === corners.bottomRight) {\n newHeight = clamp(minHeight, originalHeight + yDelta, viewportHeight);\n newWidth = clamp(minWidth, originalWidth + xDelta, viewportWidth);\n newTransformY = currentTransformY;\n newTransformX = currentTransformX;\n }\n // bottom left\n else if (corner === corners.bottomLeft) {\n newHeight = clamp(minHeight, originalHeight + yDelta, viewportHeight);\n newWidth = clamp(minWidth, originalWidth - xDelta, viewportWidth);\n newTransformY = currentTransformY;\n newTransformX = clamp(0, currentTransformX + xDelta, distanceFromRight - newWidth);\n }\n // top left\n else if (corner === corners.topLeft) {\n newHeight = clamp(minHeight, originalHeight - yDelta, viewportHeight);\n newWidth = clamp(minWidth, originalWidth - xDelta, viewportWidth);\n\n newTransformX = clamp(0, currentTransformX + xDelta, distanceFromRight - newWidth);\n newTransformY = clamp(0, currentTransformY + yDelta, distanceFromBottom - newHeight);\n }\n this._dialogRef.updateSize(`${newWidth}px`, `${newHeight}px`);\n this._dragRef.setFreeDragPosition({\n x: newTransformX,\n y: newTransformY,\n });\n });\n\n const mouseUpSub: Subscription = merge(\n fromEvent(window, 'pointerup'),\n fromEvent(window, 'pointercancel'),\n ).subscribe(() => {\n this._renderer2.removeStyle(<HTMLElement>this._document.body, 'user-select');\n mouseMoveSub.unsubscribe();\n mouseUpSub.unsubscribe();\n });\n }\n}\n"]}