@taiga-ui/core 2.76.0 → 2.78.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/bundles/taiga-ui-core-components-dialog.umd.js +20 -22
- package/bundles/taiga-ui-core-components-dialog.umd.js.map +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js +1 -1
- package/bundles/taiga-ui-core-components-dialog.umd.min.js.map +1 -1
- package/components/dialog/taiga-ui-core-components-dialog.metadata.json +1 -1
- package/constants/version.d.ts +1 -1
- package/esm2015/components/dialog/dialog.component.js +1 -1
- package/esm2015/components/dialog/dialog.providers.js +22 -17
- package/esm5/components/dialog/dialog.component.js +1 -1
- package/esm5/components/dialog/dialog.providers.js +22 -24
- package/fesm2015/taiga-ui-core-components-dialog.js +22 -17
- package/fesm2015/taiga-ui-core-components-dialog.js.map +1 -1
- package/fesm5/taiga-ui-core-components-dialog.js +22 -24
- package/fesm5/taiga-ui-core-components-dialog.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"__symbolic":"module","version":4,"metadata":{"TuiDialogComponent":{"__symbolic":"class","arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"tui-dialog","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":18,"character":21},"member":"OnPush"},"providers":{"__symbolic":"reference","name":"TUI_DIALOG_PROVIDERS"},"animations":[{"__symbolic":"reference","module":"@taiga-ui/core/animations","name":"tuiSlideInTop","line":20,"character":17},{"__symbolic":"reference","module":"@taiga-ui/core/animations","name":"tuiFadeIn","line":20,"character":32}],"template":"<header\n *ngIf=\"header\"\n polymorpheus-outlet\n class=\"t-header\"\n [content]=\"header\"\n [context]=\"context\"\n></header>\n<div class=\"t-content\">\n <h2\n class=\"t-heading\"\n [id]=\"context.id\"\n [textContent]=\"context.label\"\n ></h2>\n <section\n polymorpheus-outlet\n [context]=\"context\"\n [content]=\"context.content\"\n >\n <ng-template let-text>\n {{ text }}\n <div class=\"t-buttons\">\n <button\n tuiButton\n size=\"m\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ $any(context.data)?.button || 'OK' }}\n </button>\n </div>\n </ng-template>\n </section>\n</div>\n<div\n *ngIf=\"context.closeable\"\n class=\"t-wrapper\"\n>\n <button\n tuiIconButton\n tuiPreventDefault=\"mousedown\"\n automation-id=\"tui-dialog__close\"\n size=\"s\"\n appearance=\"\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n class=\"t-close\"\n [title]=\"closeWord$ | async\"\n (click)=\"close()\"\n ></button>\n</div>\n","styles":[":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:2rem 1.5rem}:host :host-context(tui-root._mobile)[data-size] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}.t-heading{margin:0;word-wrap:break-word;font:var(--tui-font-heading-3)}.t-heading:empty{display:none}.t-header{display:flex;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden}:host[data-size=fullscreen] :host-context(tui-root._mobile) .t-header{flex:1}.t-content{border-radius:inherit;padding:2rem;background:var(--tui-base-01)}.t-content:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.t-wrapper{position:-webkit-sticky;position:sticky;top:0;order:-1}.t-close{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:fixed;top:1.5rem;right:1.5rem;color:var(--tui-base-01);background:rgba(104,104,104,.96)}.t-close:hover{background:rgba(159,159,159,.86)}:host:not([data-size=fullscreen]) .t-close{animation:tuiFadeIn var(--tui-duration)}:host:not([data-size=fullscreen]).ng-animating .t-close{display:none}:host-context(tui-root._mobile) .t-close{position:absolute;top:0;right:0;background:0 0;color:var(--tui-base-06)}:host-context(tui-root._mobile) .t-close:hover{color:var(--tui-base-07)}.t-buttons{margin-top:1.25rem;text-align:right}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":40,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_ANIMATIONS_DURATION","line":40,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":41,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TUI_IS_MOBILE","line":41,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":42,"character":9},"arguments":[{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"POLYMORPHEUS_CONTEXT","line":42,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":44,"character":9},"arguments":[{"__symbolic":"reference","name":"TUI_DIALOG_CLOSE_STREAM"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":46,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_CLOSE_WORD","line":46,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","name":"TuiDialog","module":"@taiga-ui/cdk","arguments":[{"__symbolic":"reference","name":"TuiDialogOptions","module":"@taiga-ui/core/interfaces","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":43,"character":53,"context":{"typeName":"I"},"module":"./dialog.component"}]},{"__symbolic":"error","message":"Could not resolve type","line":43,"character":57,"context":{"typeName":"O"},"module":"./dialog.component"}]},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"string"}]},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"string"}]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":53,"character":5},"arguments":["attr.data-size"]}]}],"header":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":58,"character":5},"arguments":["class._centered"]}]}],"slideInTop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":63,"character":5},"arguments":["@tuiSlideInTop"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":64,"character":5},"arguments":["@tuiFadeIn"]}]}],"close":[{"__symbolic":"method"}]}},"TuiDialogDirective":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"AbstractTuiDialogDirective","line":17,"character":43},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":6,"character":1},"arguments":[{"selector":"ng-template[tuiDialog]","providers":[{"provide":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"AbstractTuiDialogService","line":10,"character":21},"useExisting":{"__symbolic":"reference","name":"TuiDialogService"}}],"inputs":["options: tuiDialogOptions","open: tuiDialog"],"outputs":["openChange: tuiDialogChange"]}]}],"members":{}},"TuiDialogModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"PolymorpheusModule","line":11,"character":14},{"__symbolic":"reference","module":"@taiga-ui/core/components/button","name":"TuiButtonModule","line":11,"character":34},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":51},{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiPreventDefaultModule","line":11,"character":65}],"declarations":[{"__symbolic":"reference","name":"TuiDialogComponent"},{"__symbolic":"reference","name":"TuiDialogDirective"}],"exports":[{"__symbolic":"reference","name":"TuiDialogComponent"},{"__symbolic":"reference","name":"TuiDialogDirective"}],"entryComponents":[{"__symbolic":"reference","name":"TuiDialogComponent"}],"providers":[{"provide":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TUI_DIALOGS","line":17,"character":21},"useExisting":{"__symbolic":"reference","name":"TuiDialogService"},"multi":true}]}]}],"members":{}},"TUI_DIALOGS_CLOSE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":16,"character":37},"arguments":["A stream to close dialogs",{"__symbolic":"error","message":"Lambda not supported","line":19,"character":17,"module":"./dialog.providers"}]},"dialogCloseStreamFactory":{"__symbolic":"function","parameters":["documentRef","windowRef","nativeElement","close$","destroy$","dismissible"],"value":{"__symbolic":"if","condition":{"__symbolic":"reference","name":"dismissible"},"thenExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs","name":"merge","line":35,"character":10},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"typedFromEvent","line":36,"character":14},"arguments":[{"__symbolic":"reference","name":"nativeElement"},"click"]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"filter","line":36,"character":58},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"isCurrentTarget","line":36,"character":65}]}]},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"typedFromEvent","line":37,"character":14},"arguments":[{"__symbolic":"reference","name":"documentRef"},"keydown"]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"filter","line":39,"character":18},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":40,"character":22,"module":"./dialog.providers"}]}]},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"typedFromEvent","line":47,"character":14},"arguments":[{"__symbolic":"reference","name":"documentRef"},"mousedown"]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"filter","line":49,"character":18},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":50,"character":22,"module":"./dialog.providers"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"switchMapTo","line":56,"character":18},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"typedFromEvent","line":57,"character":22},"arguments":[{"__symbolic":"reference","name":"documentRef"},"mouseup"]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"take","line":58,"character":26},"arguments":[1]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"filter","line":60,"character":26},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":61,"character":30,"module":"./dialog.providers"}]}]}]}]},{"__symbolic":"reference","name":"close$"}]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"takeUntil","line":69,"character":17},"arguments":[{"__symbolic":"reference","name":"destroy$"}]}]},"elseExpression":{"__symbolic":"reference","name":"close$"}}},"TUI_DIALOG_CLOSE_STREAM":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":73,"character":43},"arguments":["Dialogs closing stream"]},"TUI_DIALOG_PROVIDERS":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiDestroyService","line":77,"character":4},{"provide":{"__symbolic":"reference","name":"TUI_DIALOG_CLOSE_STREAM"},"deps":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":81,"character":12},{"__symbolic":"reference","module":"@ng-web-apis/common","name":"WINDOW","line":82,"character":12},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":83,"character":12},{"__symbolic":"reference","name":"TUI_DIALOGS_CLOSE"},{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiDestroyService","line":85,"character":12},{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"POLYMORPHEUS_CONTEXT","line":86,"character":12}],"useFactory":{"__symbolic":"reference","name":"dialogCloseStreamFactory"}}],"TuiDialogService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"AbstractTuiDialogService","line":20,"character":38},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":17,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{},"statics":{"ɵprov":{}}}},"origins":{"TuiDialogComponent":"./dialog.component","TuiDialogDirective":"./dialog.directive","TuiDialogModule":"./dialog.module","TUI_DIALOGS_CLOSE":"./dialog.providers","dialogCloseStreamFactory":"./dialog.providers","TUI_DIALOG_CLOSE_STREAM":"./dialog.providers","TUI_DIALOG_PROVIDERS":"./dialog.providers","TuiDialogService":"./dialog.service"},"importAs":"@taiga-ui/core/components/dialog"}
|
|
1
|
+
{"__symbolic":"module","version":4,"metadata":{"TuiDialogComponent":{"__symbolic":"class","arity":2,"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":14,"character":1},"arguments":[{"selector":"tui-dialog","changeDetection":{"__symbolic":"select","expression":{"__symbolic":"reference","module":"@angular/core","name":"ChangeDetectionStrategy","line":18,"character":21},"member":"OnPush"},"providers":{"__symbolic":"reference","name":"TUI_DIALOG_PROVIDERS"},"animations":[{"__symbolic":"reference","module":"@taiga-ui/core/animations","name":"tuiSlideInTop","line":20,"character":17},{"__symbolic":"reference","module":"@taiga-ui/core/animations","name":"tuiFadeIn","line":20,"character":32}],"template":"<header\n *ngIf=\"header\"\n polymorpheus-outlet\n class=\"t-header\"\n [content]=\"header\"\n [context]=\"context\"\n></header>\n<div class=\"t-content\">\n <h2\n class=\"t-heading\"\n [id]=\"context.id\"\n [textContent]=\"context.label\"\n ></h2>\n <section\n polymorpheus-outlet\n [context]=\"context\"\n [content]=\"context.content\"\n >\n <ng-template let-text>\n {{ text }}\n <div class=\"t-buttons\">\n <button\n tuiButton\n size=\"m\"\n (click)=\"context.$implicit.complete()\"\n >\n {{ $any(context.data)?.button || 'OK' }}\n </button>\n </div>\n </ng-template>\n </section>\n</div>\n<div\n *ngIf=\"context.closeable\"\n class=\"t-wrapper\"\n>\n <button\n tuiIconButton\n tuiPreventDefault=\"mousedown\"\n automation-id=\"tui-dialog__close\"\n size=\"s\"\n appearance=\"\"\n icon=\"tuiIconCloseLarge\"\n shape=\"rounded\"\n class=\"t-close\"\n [title]=\"closeWord$ | async\"\n (click)=\"close()\"\n ></button>\n</div>\n","styles":[":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:1.5rem}:host :host-context(tui-root._mobile)[data-size] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}.t-heading{margin:0;word-wrap:break-word;font:var(--tui-font-heading-3)}.t-heading:empty{display:none}.t-header{display:flex;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden}:host[data-size=fullscreen] :host-context(tui-root._mobile) .t-header{flex:1}.t-content{border-radius:inherit;padding:2rem;background:var(--tui-base-01)}.t-content:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.t-wrapper{position:-webkit-sticky;position:sticky;top:0;order:-1}.t-close{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:fixed;top:1.5rem;right:1.5rem;color:var(--tui-base-01);background:rgba(104,104,104,.96)}.t-close:hover{background:rgba(159,159,159,.86)}:host:not([data-size=fullscreen]) .t-close{animation:tuiFadeIn var(--tui-duration)}:host:not([data-size=fullscreen]).ng-animating .t-close{display:none}:host-context(tui-root._mobile) .t-close{position:absolute;top:0;right:0;background:0 0;color:var(--tui-base-06)}:host-context(tui-root._mobile) .t-close:hover{color:var(--tui-base-07)}.t-buttons{margin-top:1.25rem;text-align:right}"]}]}],"members":{"__ctor__":[{"__symbolic":"constructor","parameterDecorators":[[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":40,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_ANIMATIONS_DURATION","line":40,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":41,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TUI_IS_MOBILE","line":41,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":42,"character":9},"arguments":[{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"POLYMORPHEUS_CONTEXT","line":42,"character":16}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":44,"character":9},"arguments":[{"__symbolic":"reference","name":"TUI_DIALOG_CLOSE_STREAM"}]}],[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Inject","line":46,"character":9},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/core/tokens","name":"TUI_CLOSE_WORD","line":46,"character":16}]}]],"parameters":[{"__symbolic":"reference","name":"number"},{"__symbolic":"reference","name":"boolean"},{"__symbolic":"reference","name":"TuiDialog","module":"@taiga-ui/cdk","arguments":[{"__symbolic":"reference","name":"TuiDialogOptions","module":"@taiga-ui/core/interfaces","arguments":[{"__symbolic":"error","message":"Could not resolve type","line":43,"character":53,"context":{"typeName":"I"},"module":"./dialog.component"}]},{"__symbolic":"error","message":"Could not resolve type","line":43,"character":57,"context":{"typeName":"O"},"module":"./dialog.component"}]},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"string"}]},{"__symbolic":"reference","name":"Observable","module":"rxjs","arguments":[{"__symbolic":"reference","name":"string"}]}]}],"size":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":53,"character":5},"arguments":["attr.data-size"]}]}],"header":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":58,"character":5},"arguments":["class._centered"]}]}],"slideInTop":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":63,"character":5},"arguments":["@tuiSlideInTop"]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"HostBinding","line":64,"character":5},"arguments":["@tuiFadeIn"]}]}],"close":[{"__symbolic":"method"}]}},"TuiDialogDirective":{"__symbolic":"class","arity":1,"extends":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"AbstractTuiDialogDirective","line":17,"character":43},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Directive","line":6,"character":1},"arguments":[{"selector":"ng-template[tuiDialog]","providers":[{"provide":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"AbstractTuiDialogService","line":10,"character":21},"useExisting":{"__symbolic":"reference","name":"TuiDialogService"}}],"inputs":["options: tuiDialogOptions","open: tuiDialog"],"outputs":["openChange: tuiDialogChange"]}]}],"members":{}},"TuiDialogModule":{"__symbolic":"class","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"NgModule","line":10,"character":1},"arguments":[{"imports":[{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"PolymorpheusModule","line":11,"character":14},{"__symbolic":"reference","module":"@taiga-ui/core/components/button","name":"TuiButtonModule","line":11,"character":34},{"__symbolic":"reference","module":"@angular/common","name":"CommonModule","line":11,"character":51},{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiPreventDefaultModule","line":11,"character":65}],"declarations":[{"__symbolic":"reference","name":"TuiDialogComponent"},{"__symbolic":"reference","name":"TuiDialogDirective"}],"exports":[{"__symbolic":"reference","name":"TuiDialogComponent"},{"__symbolic":"reference","name":"TuiDialogDirective"}],"entryComponents":[{"__symbolic":"reference","name":"TuiDialogComponent"}],"providers":[{"provide":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TUI_DIALOGS","line":17,"character":21},"useExisting":{"__symbolic":"reference","name":"TuiDialogService"},"multi":true}]}]}],"members":{}},"TUI_DIALOGS_CLOSE":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":18,"character":37},"arguments":["A stream to close dialogs",{"__symbolic":"error","message":"Lambda not supported","line":21,"character":17,"module":"./dialog.providers"}]},"dialogCloseStreamFactory":{"__symbolic":"function","parameters":["documentRef","windowRef","nativeElement","close$","destroy$","dismissible"],"value":{"__symbolic":"if","condition":{"__symbolic":"reference","name":"dismissible"},"thenExpression":{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs","name":"merge","line":37,"character":10},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"typedFromEvent","line":38,"character":14},"arguments":[{"__symbolic":"reference","name":"nativeElement"},"click"]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"filter","line":38,"character":58},"arguments":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"isCurrentTarget","line":38,"character":65}]}]},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"typedFromEvent","line":39,"character":14},"arguments":[{"__symbolic":"reference","name":"documentRef"},"keydown"]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"filter","line":40,"character":18},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":40,"character":25,"module":"./dialog.providers"}]}]},{"__symbolic":"call","expression":{"__symbolic":"select","expression":{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"typedFromEvent","line":52,"character":14},"arguments":[{"__symbolic":"reference","name":"documentRef"},"mousedown"]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"filter","line":53,"character":18},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":53,"character":25,"module":"./dialog.providers"}]},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"switchMap","line":64,"character":18},"arguments":[{"__symbolic":"error","message":"Lambda not supported","line":64,"character":28,"module":"./dialog.providers"}]}]},{"__symbolic":"reference","name":"close$"}]},"member":"pipe"},"arguments":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"rxjs/operators","name":"takeUntil","line":79,"character":17},"arguments":[{"__symbolic":"reference","name":"destroy$"}]}]},"elseExpression":{"__symbolic":"reference","name":"close$"}}},"TUI_DIALOG_CLOSE_STREAM":{"__symbolic":"new","expression":{"__symbolic":"reference","module":"@angular/core","name":"InjectionToken","line":83,"character":43},"arguments":["Dialogs closing stream"]},"TUI_DIALOG_PROVIDERS":[{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiDestroyService","line":87,"character":4},{"provide":{"__symbolic":"reference","name":"TUI_DIALOG_CLOSE_STREAM"},"deps":[{"__symbolic":"reference","module":"@angular/common","name":"DOCUMENT","line":91,"character":12},{"__symbolic":"reference","module":"@ng-web-apis/common","name":"WINDOW","line":92,"character":12},{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":93,"character":12},{"__symbolic":"reference","name":"TUI_DIALOGS_CLOSE"},{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"TuiDestroyService","line":95,"character":12},{"__symbolic":"reference","module":"@tinkoff/ng-polymorpheus","name":"POLYMORPHEUS_CONTEXT","line":96,"character":12}],"useFactory":{"__symbolic":"reference","name":"dialogCloseStreamFactory"}}],"TuiDialogService":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"@taiga-ui/cdk","name":"AbstractTuiDialogService","line":20,"character":38},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Injectable","line":17,"character":1},"arguments":[{"providedIn":"root"}]}],"members":{},"statics":{"ɵprov":{}}}},"origins":{"TuiDialogComponent":"./dialog.component","TuiDialogDirective":"./dialog.directive","TuiDialogModule":"./dialog.module","TUI_DIALOGS_CLOSE":"./dialog.providers","dialogCloseStreamFactory":"./dialog.providers","TUI_DIALOG_CLOSE_STREAM":"./dialog.providers","TUI_DIALOG_PROVIDERS":"./dialog.providers","TuiDialogService":"./dialog.service"},"importAs":"@taiga-ui/core/components/dialog"}
|
package/constants/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "2.
|
|
1
|
+
export declare const VERSION = "2.78.0";
|
|
@@ -76,7 +76,7 @@ TuiDialogComponent = __decorate([
|
|
|
76
76
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
77
77
|
providers: TUI_DIALOG_PROVIDERS,
|
|
78
78
|
animations: [tuiSlideInTop, tuiFadeIn],
|
|
79
|
-
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:
|
|
79
|
+
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:1.5rem}:host :host-context(tui-root._mobile)[data-size] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}.t-heading{margin:0;word-wrap:break-word;font:var(--tui-font-heading-3)}.t-heading:empty{display:none}.t-header{display:flex;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden}:host[data-size=fullscreen] :host-context(tui-root._mobile) .t-header{flex:1}.t-content{border-radius:inherit;padding:2rem;background:var(--tui-base-01)}.t-content:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.t-wrapper{position:-webkit-sticky;position:sticky;top:0;order:-1}.t-close{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:fixed;top:1.5rem;right:1.5rem;color:var(--tui-base-01);background:rgba(104,104,104,.96)}.t-close:hover{background:rgba(159,159,159,.86)}:host:not([data-size=fullscreen]) .t-close{animation:tuiFadeIn var(--tui-duration)}:host:not([data-size=fullscreen]).ng-animating .t-close{display:none}:host-context(tui-root._mobile) .t-close{position:absolute;top:0;right:0;background:0 0;color:var(--tui-base-06)}:host-context(tui-root._mobile) .t-close:hover{color:var(--tui-base-07)}.t-buttons{margin-top:1.25rem;text-align:right}"]
|
|
80
80
|
}),
|
|
81
81
|
__param(0, Inject(TUI_ANIMATIONS_DURATION)),
|
|
82
82
|
__param(1, Inject(TUI_IS_MOBILE)),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import { ElementRef, InjectionToken } from '@angular/core';
|
|
3
3
|
import { WINDOW } from '@ng-web-apis/common';
|
|
4
|
-
import {
|
|
4
|
+
import { getActualTarget, isCurrentTarget, tuiContainsOrAfter, TuiDestroyService, tuiIsElement, typedFromEvent, } from '@taiga-ui/cdk';
|
|
5
5
|
import { tuiGetViewportWidth } from '@taiga-ui/core/utils/dom';
|
|
6
6
|
import { POLYMORPHEUS_CONTEXT } from '@tinkoff/ng-polymorpheus';
|
|
7
7
|
import { EMPTY, merge } from 'rxjs';
|
|
8
|
-
import { filter,
|
|
8
|
+
import { filter, switchMap, take, takeUntil } from 'rxjs/operators';
|
|
9
9
|
export const TUI_DIALOGS_CLOSE = new InjectionToken(`A stream to close dialogs`, {
|
|
10
10
|
factory: () => EMPTY,
|
|
11
11
|
});
|
|
@@ -13,20 +13,25 @@ const SCROLLBAR_PLACEHOLDER = 17;
|
|
|
13
13
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
14
14
|
export function dialogCloseStreamFactory(documentRef, windowRef, { nativeElement }, close$, destroy$, { dismissible }) {
|
|
15
15
|
return dismissible
|
|
16
|
-
? merge(typedFromEvent(nativeElement, `click`).pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, `keydown`).pipe(
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
16
|
+
? merge(typedFromEvent(nativeElement, `click`).pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, `keydown`).pipe(filter(event => {
|
|
17
|
+
const key = event.key;
|
|
18
|
+
const target = getActualTarget(event);
|
|
19
|
+
return (key === `Escape` &&
|
|
20
|
+
tuiIsElement(target) &&
|
|
21
|
+
(!tuiContainsOrAfter(nativeElement, target) ||
|
|
22
|
+
nativeElement.contains(target)));
|
|
23
|
+
})), typedFromEvent(documentRef, `mousedown`).pipe(filter(event => {
|
|
24
|
+
const target = getActualTarget(event);
|
|
25
|
+
const clientX = event.clientX;
|
|
26
|
+
return (tuiIsElement(target) &&
|
|
27
|
+
tuiGetViewportWidth(windowRef) - clientX >
|
|
28
|
+
SCROLLBAR_PLACEHOLDER &&
|
|
29
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
30
|
+
}), switchMap(() => typedFromEvent(documentRef, `mouseup`).pipe(take(1), filter(event => {
|
|
31
|
+
const target = getActualTarget(event);
|
|
32
|
+
return (tuiIsElement(target) &&
|
|
33
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
34
|
+
})))), close$).pipe(takeUntil(destroy$))
|
|
30
35
|
: close$;
|
|
31
36
|
}
|
|
32
37
|
export const TUI_DIALOG_CLOSE_STREAM = new InjectionToken(`Dialogs closing stream`);
|
|
@@ -45,4 +50,4 @@ export const TUI_DIALOG_PROVIDERS = [
|
|
|
45
50
|
useFactory: dialogCloseStreamFactory,
|
|
46
51
|
},
|
|
47
52
|
];
|
|
48
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLnByb3ZpZGVycy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWlnYS11aS9jb3JlL2NvbXBvbmVudHMvZGlhbG9nLyIsInNvdXJjZXMiOlsiZGlhbG9nLnByb3ZpZGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDekMsT0FBTyxFQUFDLFVBQVUsRUFBRSxjQUFjLEVBQVcsTUFBTSxlQUFlLENBQUM7QUFDbkUsT0FBTyxFQUFDLE1BQU0sRUFBQyxNQUFNLHFCQUFxQixDQUFDO0FBQzNDLE9BQU8sRUFDSCxlQUFlLEVBQ2YsZUFBZSxFQUNmLGtCQUFrQixFQUNsQixpQkFBaUIsRUFFakIsWUFBWSxFQUNaLGNBQWMsR0FDakIsTUFBTSxlQUFlLENBQUM7QUFFdkIsT0FBTyxFQUFDLG1CQUFtQixFQUFDLE1BQU0sMEJBQTBCLENBQUM7QUFDN0QsT0FBTyxFQUFDLG9CQUFvQixFQUFDLE1BQU0sMEJBQTBCLENBQUM7QUFDOUQsT0FBTyxFQUFDL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ICAgICB0eXBlZEZyb21FdmVudChkb2N1bWVudFJlZiwgYGtleWRvd25gKS5waXBlKFxuICAgICAgICAgICAgICAgICAgZmlsdGVyKGV2ZW50ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICBjb25zdCBrZXkgPSBldmVudC5rZXk7XG4gICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGFyZ2V0ID0gZ2V0QWN0dWFsVGFyZ2V0KGV2ZW50KTtcblxuICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgIGtleSA9PT0gYEVzY2FwZWAgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHVpSXNFbGVtZW50KHRhcmdldCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgKCF0dWlDb250YWluc09yQWZ0ZXIobmF0aXZlRWxlbWVudCwgdGFyZ2V0KSB8fFxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmF0aXZlRWxlbWVudC5jb250YWlucyh0YXJnZXQpKVxuICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICB9KSxcbiAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgdHlwZWRGcm9tRXZlbnQoZG9jdW1lbnRSZWYsIGBtb3VzZWRvd25gKS5waXBlKFxuICAgICAgICAgICAgICAgICAgZmlsdGVyKGV2ZW50ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0YXJnZXQgPSBnZXRBY3R1YWxUYXJnZXQoZXZlbnQpO1xuICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNsaWVudFggPSBldmVudC5jbGllbnRYO1xuXG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHVpSXNFbGVtZW50KHRhcmdldCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdHVpR2V0Vmlld3BvcnRXaWR0aCh3aW5kb3dSZWYpIC0gY2xpZW50WCA+XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTQ1JPTExCQVJfUExBQ0VIT0xERVIgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgIXR1aUNvbnRhaW5zT3JBZnRlcihuYXRpdmVFbGVtZW50LCB0YXJnZXQpXG4gICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgc3dpdGNoTWFwKCgpID0+XG4gICAgICAgICAgICAgICAgICAgICAgdHlwZWRGcm9tRXZlbnQoZG9jdW1lbnRSZWYsIGBtb3VzZXVwYCkucGlwZShcbiAgICAgICAgICAgICAgICAgICAgICAgICAgdGFrZSgxKSxcbiAgICAgICAgICAgICAgICAgICAgICAgICAgZmlsdGVyKGV2ZW50ID0+IHtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldCA9IGdldEFjdHVhbFRhcmdldChldmVudCk7XG5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJldHVybiAoXG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdHVpSXNFbGVtZW50KHRhcmdldCkgJiZcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAhdHVpQ29udGFpbnNPckFmdGVyKG5hdGl2ZUVsZW1lbnQsIHRhcmdldClcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICk7XG4gICAgICAgICAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICBjbG9zZSQsXG4gICAgICAgICAgKS5waXBlKHRha2VVbnRpbChkZXN0cm95JCkpXG4gICAgICAgIDogY2xvc2UkO1xufVxuXG5leHBvcnQgY29uc3QgVFVJX0RJQUxPR19DTE9TRV9TVFJFQU0gPSBuZXcgSW5qZWN0aW9uVG9rZW48T2JzZXJ2YWJsZTx1bmtub3duPj4oXG4gICAgYERpYWxvZ3MgY2xvc2luZyBzdHJlYW1gLFxuKTtcbmV4cG9ydCBjb25zdCBUVUlfRElBTE9HX1BST1ZJREVSUzogUHJvdmlkZXJbXSA9IFtcbiAgICBUdWlEZXN0cm95U2VydmljZSxcbiAgICB7XG4gICAgICAgIHByb3ZpZGU6IFRVSV9ESUFMT0dfQ0xPU0VfU1RSRUFNLFxuICAgICAgICBkZXBzOiBbXG4gICAgICAgICAgICBET0NVTUVOVCxcbiAgICAgICAgICAgIFdJTkRPVyxcbiAgICAgICAgICAgIEVsZW1lbnRSZWYsXG4gICAgICAgICAgICBUVUlfRElBTE9HU19DTE9TRSxcbiAgICAgICAgICAgIFR1aURlc3Ryb3lTZXJ2aWNlLFxuICAgICAgICAgICAgUE9MWU1PUlBIRVVTX0NPTlRFWFQsXG4gICAgICAgIF0sXG4gICAgICAgIHVzZUZhY3Rvcnk6IGRpYWxvZ0Nsb3NlU3RyZWFtRmFjdG9yeSxcbiAgICB9LFxuXTtcbiJdfQ==
|
|
@@ -88,7 +88,7 @@ var TuiDialogComponent = /** @class */ (function () {
|
|
|
88
88
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
89
89
|
providers: TUI_DIALOG_PROVIDERS,
|
|
90
90
|
animations: [tuiSlideInTop, tuiFadeIn],
|
|
91
|
-
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:
|
|
91
|
+
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:1.5rem}:host :host-context(tui-root._mobile)[data-size] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}.t-heading{margin:0;word-wrap:break-word;font:var(--tui-font-heading-3)}.t-heading:empty{display:none}.t-header{display:flex;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden}:host[data-size=fullscreen] :host-context(tui-root._mobile) .t-header{flex:1}.t-content{border-radius:inherit;padding:2rem;background:var(--tui-base-01)}.t-content:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.t-wrapper{position:-webkit-sticky;position:sticky;top:0;order:-1}.t-close{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:fixed;top:1.5rem;right:1.5rem;color:var(--tui-base-01);background:rgba(104,104,104,.96)}.t-close:hover{background:rgba(159,159,159,.86)}:host:not([data-size=fullscreen]) .t-close{animation:tuiFadeIn var(--tui-duration)}:host:not([data-size=fullscreen]).ng-animating .t-close{display:none}:host-context(tui-root._mobile) .t-close{position:absolute;top:0;right:0;background:0 0;color:var(--tui-base-06)}:host-context(tui-root._mobile) .t-close:hover{color:var(--tui-base-07)}.t-buttons{margin-top:1.25rem;text-align:right}"]
|
|
92
92
|
}),
|
|
93
93
|
__param(0, Inject(TUI_ANIMATIONS_DURATION)),
|
|
94
94
|
__param(1, Inject(TUI_IS_MOBILE)),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { DOCUMENT } from '@angular/common';
|
|
2
2
|
import { ElementRef, InjectionToken } from '@angular/core';
|
|
3
3
|
import { WINDOW } from '@ng-web-apis/common';
|
|
4
|
-
import {
|
|
4
|
+
import { getActualTarget, isCurrentTarget, tuiContainsOrAfter, TuiDestroyService, tuiIsElement, typedFromEvent, } from '@taiga-ui/cdk';
|
|
5
5
|
import { tuiGetViewportWidth } from '@taiga-ui/core/utils/dom';
|
|
6
6
|
import { POLYMORPHEUS_CONTEXT } from '@tinkoff/ng-polymorpheus';
|
|
7
7
|
import { EMPTY, merge } from 'rxjs';
|
|
8
|
-
import { filter,
|
|
8
|
+
import { filter, switchMap, take, takeUntil } from 'rxjs/operators';
|
|
9
9
|
export var TUI_DIALOGS_CLOSE = new InjectionToken("A stream to close dialogs", {
|
|
10
10
|
factory: function () { return EMPTY; },
|
|
11
11
|
});
|
|
@@ -15,29 +15,27 @@ export function dialogCloseStreamFactory(documentRef, windowRef, _a, close$, des
|
|
|
15
15
|
var nativeElement = _a.nativeElement;
|
|
16
16
|
var dismissible = _b.dismissible;
|
|
17
17
|
return dismissible
|
|
18
|
-
? merge(typedFromEvent(nativeElement, "click").pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, "keydown").pipe(
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
target
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var target = _a.target, clientX = _a.clientX;
|
|
30
|
-
return target instanceof Element &&
|
|
18
|
+
? merge(typedFromEvent(nativeElement, "click").pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, "keydown").pipe(filter(function (event) {
|
|
19
|
+
var key = event.key;
|
|
20
|
+
var target = getActualTarget(event);
|
|
21
|
+
return (key === "Escape" &&
|
|
22
|
+
tuiIsElement(target) &&
|
|
23
|
+
(!tuiContainsOrAfter(nativeElement, target) ||
|
|
24
|
+
nativeElement.contains(target)));
|
|
25
|
+
})), typedFromEvent(documentRef, "mousedown").pipe(filter(function (event) {
|
|
26
|
+
var target = getActualTarget(event);
|
|
27
|
+
var clientX = event.clientX;
|
|
28
|
+
return (tuiIsElement(target) &&
|
|
31
29
|
tuiGetViewportWidth(windowRef) - clientX >
|
|
32
30
|
SCROLLBAR_PLACEHOLDER &&
|
|
33
|
-
!
|
|
34
|
-
}),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}))
|
|
31
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
32
|
+
}), switchMap(function () {
|
|
33
|
+
return typedFromEvent(documentRef, "mouseup").pipe(take(1), filter(function (event) {
|
|
34
|
+
var target = getActualTarget(event);
|
|
35
|
+
return (tuiIsElement(target) &&
|
|
36
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
37
|
+
}));
|
|
38
|
+
})), close$).pipe(takeUntil(destroy$))
|
|
41
39
|
: close$;
|
|
42
40
|
}
|
|
43
41
|
export var TUI_DIALOG_CLOSE_STREAM = new InjectionToken("Dialogs closing stream");
|
|
@@ -56,4 +54,4 @@ export var TUI_DIALOG_PROVIDERS = [
|
|
|
56
54
|
useFactory: dialogCloseStreamFactory,
|
|
57
55
|
},
|
|
58
56
|
];
|
|
59
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGlhbG9nLnByb3ZpZGVycy5qcyIsInNvdXJjZVJvb3QiOiJuZzovL0B0YWlnYS11aS9jb3JlL2NvbXBvbmVudHMvZGlhbG9nLyIsInNvdXJjZXMiOlsiZGlhbG9nLnByb3ZpZGVycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUMsUUFBUSxFQUFDLE1BQU0saUJBQWlCLENBQUM7QUFDekMsT0FBTyxFQUFDLFVBQVUsRUFBRSxjQUFjLEVBQVcsTUFBTSxlQUFlLENBQUM7QUFDbkUsT0FBTyxFQUFDLE1BQU0sRUFBQyxNQUFNLHFCQUFxQixDQUFDO0FBQzNDLE9BQU8sRUFDSCxlQUFlLEVBQ2YsZUFBZSxFQUNmLGtCQUFrQixFQUNsQixpQkFBaUIsRUFFakIsWUFBWSxFQUNaLGNBQWMsR0FDakIsTUFBTSxlQUFlLENBQUM7QUFFdkIsT0FBTyxFQUFDLG1CQUFtQixFQUFDLE1BQU0sMEJBQTBCLENBQUM7QUFDN0QsT0FBTyxFQUFDLG9CQUFvQixFQUFDLE1BQU0sMEJBQTBCLENBQUM7Q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FyZ2V0KSksXG4gICAgICAgICAgICAgIHR5cGVkRnJvbUV2ZW50KGRvY3VtZW50UmVmLCBga2V5ZG93bmApLnBpcGUoXG4gICAgICAgICAgICAgICAgICBmaWx0ZXIoZXZlbnQgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGtleSA9IGV2ZW50LmtleTtcbiAgICAgICAgICAgICAgICAgICAgICBjb25zdCB0YXJnZXQgPSBnZXRBY3R1YWxUYXJnZXQoZXZlbnQpO1xuXG4gICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAga2V5ID09PSBgRXNjYXBlYCAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICB0dWlJc0VsZW1lbnQodGFyZ2V0KSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAoIXR1aUNvbnRhaW5zT3JBZnRlcihuYXRpdmVFbGVtZW50LCB0YXJnZXQpIHx8XG4gICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuYXRpdmVFbGVtZW50LmNvbnRhaW5zKHRhcmdldCkpXG4gICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgIH0pLFxuICAgICAgICAgICAgICApLFxuICAgICAgICAgICAgICB0eXBlZEZyb21FdmVudChkb2N1bWVudFJlZiwgYG1vdXNlZG93bmApLnBpcGUoXG4gICAgICAgICAgICAgICAgICBmaWx0ZXIoZXZlbnQgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IHRhcmdldCA9IGdldEFjdHVhbFRhcmdldChldmVudCk7XG4gICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2xpZW50WCA9IGV2ZW50LmNsaWVudFg7XG5cbiAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gKFxuICAgICAgICAgICAgICAgICAgICAgICAgICB0dWlJc0VsZW1lbnQodGFyZ2V0KSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICB0dWlHZXRWaWV3cG9ydFdpZHRoKHdpbmRvd1JlZikgLSBjbGllbnRYID5cbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNDUk9MTEJBUl9QTEFDRUhPTERFUiAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAhdHVpQ29udGFpbnNPckFmdGVyKG5hdGl2ZUVsZW1lbnQsIHRhcmdldClcbiAgICAgICAgICAgICAgICAgICAgICApO1xuICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICBzd2l0Y2hNYXAoKCkgPT5cbiAgICAgICAgICAgICAgICAgICAgICB0eXBlZEZyb21FdmVudChkb2N1bWVudFJlZiwgYG1vdXNldXBgKS5waXBlKFxuICAgICAgICAgICAgICAgICAgICAgICAgICB0YWtlKDEpLFxuICAgICAgICAgICAgICAgICAgICAgICAgICBmaWx0ZXIoZXZlbnQgPT4ge1xuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgdGFyZ2V0ID0gZ2V0QWN0dWFsVGFyZ2V0KGV2ZW50KTtcblxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIChcbiAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0dWlJc0VsZW1lbnQodGFyZ2V0KSAmJlxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICF0dWlDb250YWluc09yQWZ0ZXIobmF0aXZlRWxlbWVudCwgdGFyZ2V0KVxuICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTtcbiAgICAgICAgICAgICAgICAgICAgICAgICAgfSksXG4gICAgICAgICAgICAgICAgICAgICAgKSxcbiAgICAgICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgICksXG4gICAgICAgICAgICAgIGNsb3NlJCxcbiAgICAgICAgICApLnBpcGUodGFrZVVudGlsKGRlc3Ryb3kkKSlcbiAgICAgICAgOiBjbG9zZSQ7XG59XG5cbmV4cG9ydCBjb25zdCBUVUlfRElBTE9HX0NMT1NFX1NUUkVBTSA9IG5ldyBJbmplY3Rpb25Ub2tlbjxPYnNlcnZhYmxlPHVua25vd24+PihcbiAgICBgRGlhbG9ncyBjbG9zaW5nIHN0cmVhbWAsXG4pO1xuZXhwb3J0IGNvbnN0IFRVSV9ESUFMT0dfUFJPVklERVJTOiBQcm92aWRlcltdID0gW1xuICAgIFR1aURlc3Ryb3lTZXJ2aWNlLFxuICAgIHtcbiAgICAgICAgcHJvdmlkZTogVFVJX0RJQUxPR19DTE9TRV9TVFJFQU0sXG4gICAgICAgIGRlcHM6IFtcbiAgICAgICAgICAgIERPQ1VNRU5ULFxuICAgICAgICAgICAgV0lORE9XLFxuICAgICAgICAgICAgRWxlbWVudFJlZixcbiAgICAgICAgICAgIFRVSV9ESUFMT0dTX0NMT1NFLFxuICAgICAgICAgICAgVHVpRGVzdHJveVNlcnZpY2UsXG4gICAgICAgICAgICBQT0xZTU9SUEhFVVNfQ09OVEVYVCxcbiAgICAgICAgXSxcbiAgICAgICAgdXNlRmFjdG9yeTogZGlhbG9nQ2xvc2VTdHJlYW1GYWN0b3J5LFxuICAgIH0sXG5dO1xuIl19
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param } from 'tslib';
|
|
2
2
|
import { InjectionToken, ElementRef, Inject, HostBinding, Component, ChangeDetectionStrategy, ɵɵdefineInjectable, ɵɵinject, Injectable, Directive, NgModule } from '@angular/core';
|
|
3
|
-
import { typedFromEvent, isCurrentTarget,
|
|
3
|
+
import { typedFromEvent, isCurrentTarget, getActualTarget, tuiIsElement, tuiContainsOrAfter, TuiDestroyService, TUI_IS_MOBILE, AbstractTuiDialogService, AbstractTuiDialogDirective, TuiPreventDefaultModule, TUI_DIALOGS } from '@taiga-ui/cdk';
|
|
4
4
|
import { tuiSlideInTop, tuiFadeIn } from '@taiga-ui/core/animations';
|
|
5
5
|
import { TUI_ANIMATIONS_DURATION, TUI_CLOSE_WORD } from '@taiga-ui/core/tokens';
|
|
6
6
|
import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent, PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
@@ -8,7 +8,7 @@ import { EMPTY, merge, Observable } from 'rxjs';
|
|
|
8
8
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
9
9
|
import { WINDOW } from '@ng-web-apis/common';
|
|
10
10
|
import { tuiGetViewportWidth } from '@taiga-ui/core/utils/dom';
|
|
11
|
-
import { filter,
|
|
11
|
+
import { filter, switchMap, take, takeUntil } from 'rxjs/operators';
|
|
12
12
|
import { TuiIdService } from '@taiga-ui/cdk/services';
|
|
13
13
|
import { TuiButtonModule } from '@taiga-ui/core/components/button';
|
|
14
14
|
|
|
@@ -19,20 +19,25 @@ const SCROLLBAR_PLACEHOLDER = 17;
|
|
|
19
19
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
20
|
function dialogCloseStreamFactory(documentRef, windowRef, { nativeElement }, close$, destroy$, { dismissible }) {
|
|
21
21
|
return dismissible
|
|
22
|
-
? merge(typedFromEvent(nativeElement, `click`).pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, `keydown`).pipe(
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
22
|
+
? merge(typedFromEvent(nativeElement, `click`).pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, `keydown`).pipe(filter(event => {
|
|
23
|
+
const key = event.key;
|
|
24
|
+
const target = getActualTarget(event);
|
|
25
|
+
return (key === `Escape` &&
|
|
26
|
+
tuiIsElement(target) &&
|
|
27
|
+
(!tuiContainsOrAfter(nativeElement, target) ||
|
|
28
|
+
nativeElement.contains(target)));
|
|
29
|
+
})), typedFromEvent(documentRef, `mousedown`).pipe(filter(event => {
|
|
30
|
+
const target = getActualTarget(event);
|
|
31
|
+
const clientX = event.clientX;
|
|
32
|
+
return (tuiIsElement(target) &&
|
|
33
|
+
tuiGetViewportWidth(windowRef) - clientX >
|
|
34
|
+
SCROLLBAR_PLACEHOLDER &&
|
|
35
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
36
|
+
}), switchMap(() => typedFromEvent(documentRef, `mouseup`).pipe(take(1), filter(event => {
|
|
37
|
+
const target = getActualTarget(event);
|
|
38
|
+
return (tuiIsElement(target) &&
|
|
39
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
40
|
+
})))), close$).pipe(takeUntil(destroy$))
|
|
36
41
|
: close$;
|
|
37
42
|
}
|
|
38
43
|
const TUI_DIALOG_CLOSE_STREAM = new InjectionToken(`Dialogs closing stream`);
|
|
@@ -122,7 +127,7 @@ TuiDialogComponent = __decorate([
|
|
|
122
127
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
123
128
|
providers: TUI_DIALOG_PROVIDERS,
|
|
124
129
|
animations: [tuiSlideInTop, tuiFadeIn],
|
|
125
|
-
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:
|
|
130
|
+
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:1.5rem}:host :host-context(tui-root._mobile)[data-size] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}.t-heading{margin:0;word-wrap:break-word;font:var(--tui-font-heading-3)}.t-heading:empty{display:none}.t-header{display:flex;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden}:host[data-size=fullscreen] :host-context(tui-root._mobile) .t-header{flex:1}.t-content{border-radius:inherit;padding:2rem;background:var(--tui-base-01)}.t-content:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.t-wrapper{position:-webkit-sticky;position:sticky;top:0;order:-1}.t-close{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:fixed;top:1.5rem;right:1.5rem;color:var(--tui-base-01);background:rgba(104,104,104,.96)}.t-close:hover{background:rgba(159,159,159,.86)}:host:not([data-size=fullscreen]) .t-close{animation:tuiFadeIn var(--tui-duration)}:host:not([data-size=fullscreen]).ng-animating .t-close{display:none}:host-context(tui-root._mobile) .t-close{position:absolute;top:0;right:0;background:0 0;color:var(--tui-base-06)}:host-context(tui-root._mobile) .t-close:hover{color:var(--tui-base-07)}.t-buttons{margin-top:1.25rem;text-align:right}"]
|
|
126
131
|
}),
|
|
127
132
|
__param(0, Inject(TUI_ANIMATIONS_DURATION)),
|
|
128
133
|
__param(1, Inject(TUI_IS_MOBILE)),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taiga-ui-core-components-dialog.js","sources":["ng://@taiga-ui/core/components/dialog/dialog.providers.ts","ng://@taiga-ui/core/components/dialog/dialog.component.ts","ng://@taiga-ui/core/components/dialog/dialog.service.ts","ng://@taiga-ui/core/components/dialog/dialog.directive.ts","ng://@taiga-ui/core/components/dialog/dialog.module.ts","ng://@taiga-ui/core/components/dialog/taiga-ui-core-components-dialog.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {ElementRef, InjectionToken, Provider} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n containsOrAfter,\n isCurrentTarget,\n TuiDestroyService,\n TuiDialog,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDialogOptions} from '@taiga-ui/core/interfaces';\nimport {tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\nimport {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {filter, switchMapTo, take, takeUntil} from 'rxjs/operators';\n\nexport const TUI_DIALOGS_CLOSE = new InjectionToken<Observable<unknown>>(\n `A stream to close dialogs`,\n {\n factory: () => EMPTY,\n },\n);\n\nconst SCROLLBAR_PLACEHOLDER = 17;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function dialogCloseStreamFactory(\n documentRef: Document,\n windowRef: Window,\n {nativeElement}: ElementRef<HTMLElement>,\n close$: Observable<void>,\n destroy$: Observable<void>,\n {dismissible}: TuiDialog<TuiDialogOptions<unknown>, unknown>,\n): Observable<unknown> {\n return dismissible\n ? merge(\n typedFromEvent(nativeElement, `click`).pipe(filter(isCurrentTarget)),\n typedFromEvent(documentRef, `keydown`).pipe(\n // TODO: iframe warning\n filter(\n ({key, target}) =>\n key === `Escape` &&\n target instanceof Element &&\n (!containsOrAfter(nativeElement, target) ||\n nativeElement.contains(target)),\n ),\n ),\n typedFromEvent(documentRef, `mousedown`).pipe(\n // TODO: iframe warning\n filter(\n ({target, clientX}) =>\n target instanceof Element &&\n tuiGetViewportWidth(windowRef) - clientX >\n SCROLLBAR_PLACEHOLDER &&\n !containsOrAfter(nativeElement, target),\n ),\n switchMapTo(\n typedFromEvent(documentRef, `mouseup`).pipe(\n take(1),\n // TODO: iframe warning\n filter(\n ({target}) =>\n target instanceof Element &&\n !containsOrAfter(nativeElement, target),\n ),\n ),\n ),\n ),\n close$,\n ).pipe(takeUntil(destroy$))\n : close$;\n}\n\nexport const TUI_DIALOG_CLOSE_STREAM = new InjectionToken<Observable<unknown>>(\n `Dialogs closing stream`,\n);\nexport const TUI_DIALOG_PROVIDERS: Provider[] = [\n TuiDestroyService,\n {\n provide: TUI_DIALOG_CLOSE_STREAM,\n deps: [\n DOCUMENT,\n WINDOW,\n ElementRef,\n TUI_DIALOGS_CLOSE,\n TuiDestroyService,\n POLYMORPHEUS_CONTEXT,\n ],\n useFactory: dialogCloseStreamFactory,\n },\n];\n","import {ChangeDetectionStrategy, Component, HostBinding, Inject} from '@angular/core';\nimport {TUI_IS_MOBILE, TuiDialog} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiSlideInTop} from '@taiga-ui/core/animations';\nimport {TuiAnimationOptions, TuiDialogOptions} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATIONS_DURATION, TUI_CLOSE_WORD} from '@taiga-ui/core/tokens';\nimport {TuiDialogSize} from '@taiga-ui/core/types';\nimport {POLYMORPHEUS_CONTEXT, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nimport {TUI_DIALOG_CLOSE_STREAM, TUI_DIALOG_PROVIDERS} from './dialog.providers';\n\nconst REQUIRED_ERROR = new Error('Required dialog was dismissed');\n\n// @dynamic\n@Component({\n selector: 'tui-dialog',\n templateUrl: './dialog.template.html',\n styleUrls: ['./dialog.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: TUI_DIALOG_PROVIDERS,\n animations: [tuiSlideInTop, tuiFadeIn],\n})\nexport class TuiDialogComponent<O, I> {\n private readonly animation = {\n value: '',\n params: {\n start: '40px',\n duration: this.duration,\n },\n } as const;\n\n private readonly fullscreenAnimation = {\n value: '',\n params: {\n start: '100vh',\n duration: this.duration,\n },\n } as const;\n\n constructor(\n @Inject(TUI_ANIMATIONS_DURATION) private readonly duration: number,\n @Inject(TUI_IS_MOBILE) private readonly isMobile: boolean,\n @Inject(POLYMORPHEUS_CONTEXT)\n readonly context: TuiDialog<TuiDialogOptions<I>, O>,\n @Inject(TUI_DIALOG_CLOSE_STREAM)\n close$: Observable<unknown>,\n @Inject(TUI_CLOSE_WORD) readonly closeWord$: Observable<string>,\n ) {\n close$.subscribe(() => {\n this.close();\n });\n }\n\n @HostBinding('attr.data-size')\n get size(): TuiDialogSize {\n return this.context.size;\n }\n\n @HostBinding('class._centered')\n get header(): PolymorpheusContent {\n return this.context.header;\n }\n\n @HostBinding('@tuiSlideInTop')\n @HostBinding('@tuiFadeIn')\n get slideInTop(): TuiAnimationOptions {\n return this.size === 'fullscreen' || this.size === 'page' || this.isMobile\n ? this.fullscreenAnimation\n : this.animation;\n }\n\n close(): void {\n if (this.context.required) {\n this.context.$implicit.error(REQUIRED_ERROR);\n } else {\n this.context.$implicit.complete();\n }\n }\n}\n","import {Injectable} from '@angular/core';\nimport {AbstractTuiDialogService} from '@taiga-ui/cdk';\nimport {TuiDialogOptions} from '@taiga-ui/core/interfaces';\nimport {PolymorpheusComponent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDialogComponent} from './dialog.component';\n\nconst DIALOG = new PolymorpheusComponent(TuiDialogComponent);\nconst DEFAULT_OPTIONS = {\n size: `m`,\n required: false,\n closeable: true,\n dismissible: true,\n label: ``,\n header: ``,\n} as const;\n\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiDialogService extends AbstractTuiDialogService<TuiDialogOptions<any>> {\n protected readonly component = DIALOG;\n protected readonly defaultOptions: TuiDialogOptions<any> = DEFAULT_OPTIONS as any;\n}\n","import {Directive} from '@angular/core';\nimport {AbstractTuiDialogDirective, AbstractTuiDialogService} from '@taiga-ui/cdk';\nimport {TuiDialogOptions} from '@taiga-ui/core/interfaces';\n\nimport {TuiDialogService} from './dialog.service';\n\n@Directive({\n selector: 'ng-template[tuiDialog]',\n providers: [\n {\n provide: AbstractTuiDialogService,\n useExisting: TuiDialogService,\n },\n ],\n inputs: ['options: tuiDialogOptions', 'open: tuiDialog'],\n outputs: ['openChange: tuiDialogChange'],\n})\nexport class TuiDialogDirective<T> extends AbstractTuiDialogDirective<\n TuiDialogOptions<T>\n> {}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TUI_DIALOGS, TuiPreventDefaultModule} from '@taiga-ui/cdk';\nimport {TuiButtonModule} from '@taiga-ui/core/components/button';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDialogComponent} from './dialog.component';\nimport {TuiDialogDirective} from './dialog.directive';\nimport {TuiDialogService} from './dialog.service';\n\n@NgModule({\n imports: [PolymorpheusModule, TuiButtonModule, CommonModule, TuiPreventDefaultModule],\n declarations: [TuiDialogComponent, TuiDialogDirective],\n exports: [TuiDialogComponent, TuiDialogDirective],\n entryComponents: [TuiDialogComponent],\n providers: [\n {\n provide: TUI_DIALOGS,\n useExisting: TuiDialogService,\n multi: true,\n },\n ],\n})\nexport class TuiDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAgBa,iBAAiB,GAAG,IAAI,cAAc,CAC/C,2BAA2B,EAC3B;IACI,OAAO,EAAE,MAAM,KAAK;CACvB,EACH;AAEF,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC;SACgB,wBAAwB,CACpC,WAAqB,EACrB,SAAiB,EACjB,EAAC,aAAa,EAA0B,EACxC,MAAwB,EACxB,QAA0B,EAC1B,EAAC,WAAW,EAAgD;IAE5D,OAAO,WAAW;UACZ,KAAK,CACD,cAAc,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC,EACpE,cAAc,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC,IAAI;;QAEvC,MAAM,CACF,CAAC,EAAC,GAAG,EAAE,MAAM,EAAC,KACV,GAAG,KAAK,QAAQ;YAChB,MAAM,YAAY,OAAO;aACxB,CAAC,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC;gBACpC,aAAa,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAC1C,CACJ,EACD,cAAc,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC,IAAI;;QAEzC,MAAM,CACF,CAAC,EAAC,MAAM,EAAE,OAAO,EAAC,KACd,MAAM,YAAY,OAAO;YACzB,mBAAmB,CAAC,SAAS,CAAC,GAAG,OAAO;gBACpC,qBAAqB;YACzB,CAAC,eAAe,CAAC,aAAa,EAAE,MAAM,CAAC,CAC9C,EACD,WAAW,CACP,cAAc,CAAC,WAAW,E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AAO,EAAE,WAAW;gBACpB,WAAW,EAAE,gBAAgB;gBAC7B,KAAK,EAAE,IAAI;aACd;SACJ;KACJ,CAAC;GACW,eAAe,CAAG;;ACvB/B;;;;;;"}
|
|
1
|
+
{"version":3,"file":"taiga-ui-core-components-dialog.js","sources":["ng://@taiga-ui/core/components/dialog/dialog.providers.ts","ng://@taiga-ui/core/components/dialog/dialog.component.ts","ng://@taiga-ui/core/components/dialog/dialog.service.ts","ng://@taiga-ui/core/components/dialog/dialog.directive.ts","ng://@taiga-ui/core/components/dialog/dialog.module.ts","ng://@taiga-ui/core/components/dialog/taiga-ui-core-components-dialog.ts"],"sourcesContent":["import {DOCUMENT} from '@angular/common';\nimport {ElementRef, InjectionToken, Provider} from '@angular/core';\nimport {WINDOW} from '@ng-web-apis/common';\nimport {\n getActualTarget,\n isCurrentTarget,\n tuiContainsOrAfter,\n TuiDestroyService,\n TuiDialog,\n tuiIsElement,\n typedFromEvent,\n} from '@taiga-ui/cdk';\nimport {TuiDialogOptions} from '@taiga-ui/core/interfaces';\nimport {tuiGetViewportWidth} from '@taiga-ui/core/utils/dom';\nimport {POLYMORPHEUS_CONTEXT} from '@tinkoff/ng-polymorpheus';\nimport {EMPTY, merge, Observable} from 'rxjs';\nimport {filter, switchMap, take, takeUntil} from 'rxjs/operators';\n\nexport const TUI_DIALOGS_CLOSE = new InjectionToken<Observable<unknown>>(\n `A stream to close dialogs`,\n {\n factory: () => EMPTY,\n },\n);\n\nconst SCROLLBAR_PLACEHOLDER = 17;\n\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport function dialogCloseStreamFactory(\n documentRef: Document,\n windowRef: Window,\n {nativeElement}: ElementRef<HTMLElement>,\n close$: Observable<void>,\n destroy$: Observable<void>,\n {dismissible}: TuiDialog<TuiDialogOptions<unknown>, unknown>,\n): Observable<unknown> {\n return dismissible\n ? merge(\n typedFromEvent(nativeElement, `click`).pipe(filter(isCurrentTarget)),\n typedFromEvent(documentRef, `keydown`).pipe(\n filter(event => {\n const key = event.key;\n const target = getActualTarget(event);\n\n return (\n key === `Escape` &&\n tuiIsElement(target) &&\n (!tuiContainsOrAfter(nativeElement, target) ||\n nativeElement.contains(target))\n );\n }),\n ),\n typedFromEvent(documentRef, `mousedown`).pipe(\n filter(event => {\n const target = getActualTarget(event);\n const clientX = event.clientX;\n\n return (\n tuiIsElement(target) &&\n tuiGetViewportWidth(windowRef) - clientX >\n SCROLLBAR_PLACEHOLDER &&\n !tuiContainsOrAfter(nativeElement, target)\n );\n }),\n switchMap(() =>\n typedFromEvent(documentRef, `mouseup`).pipe(\n take(1),\n filter(event => {\n const target = getActualTarget(event);\n\n return (\n tuiIsElement(target) &&\n !tuiContainsOrAfter(nativeElement, target)\n );\n }),\n ),\n ),\n ),\n close$,\n ).pipe(takeUntil(destroy$))\n : close$;\n}\n\nexport const TUI_DIALOG_CLOSE_STREAM = new InjectionToken<Observable<unknown>>(\n `Dialogs closing stream`,\n);\nexport const TUI_DIALOG_PROVIDERS: Provider[] = [\n TuiDestroyService,\n {\n provide: TUI_DIALOG_CLOSE_STREAM,\n deps: [\n DOCUMENT,\n WINDOW,\n ElementRef,\n TUI_DIALOGS_CLOSE,\n TuiDestroyService,\n POLYMORPHEUS_CONTEXT,\n ],\n useFactory: dialogCloseStreamFactory,\n },\n];\n","import {ChangeDetectionStrategy, Component, HostBinding, Inject} from '@angular/core';\nimport {TUI_IS_MOBILE, TuiDialog} from '@taiga-ui/cdk';\nimport {tuiFadeIn, tuiSlideInTop} from '@taiga-ui/core/animations';\nimport {TuiAnimationOptions, TuiDialogOptions} from '@taiga-ui/core/interfaces';\nimport {TUI_ANIMATIONS_DURATION, TUI_CLOSE_WORD} from '@taiga-ui/core/tokens';\nimport {TuiDialogSize} from '@taiga-ui/core/types';\nimport {POLYMORPHEUS_CONTEXT, PolymorpheusContent} from '@tinkoff/ng-polymorpheus';\nimport {Observable} from 'rxjs';\n\nimport {TUI_DIALOG_CLOSE_STREAM, TUI_DIALOG_PROVIDERS} from './dialog.providers';\n\nconst REQUIRED_ERROR = new Error('Required dialog was dismissed');\n\n// @dynamic\n@Component({\n selector: 'tui-dialog',\n templateUrl: './dialog.template.html',\n styleUrls: ['./dialog.style.less'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: TUI_DIALOG_PROVIDERS,\n animations: [tuiSlideInTop, tuiFadeIn],\n})\nexport class TuiDialogComponent<O, I> {\n private readonly animation = {\n value: '',\n params: {\n start: '40px',\n duration: this.duration,\n },\n } as const;\n\n private readonly fullscreenAnimation = {\n value: '',\n params: {\n start: '100vh',\n duration: this.duration,\n },\n } as const;\n\n constructor(\n @Inject(TUI_ANIMATIONS_DURATION) private readonly duration: number,\n @Inject(TUI_IS_MOBILE) private readonly isMobile: boolean,\n @Inject(POLYMORPHEUS_CONTEXT)\n readonly context: TuiDialog<TuiDialogOptions<I>, O>,\n @Inject(TUI_DIALOG_CLOSE_STREAM)\n close$: Observable<unknown>,\n @Inject(TUI_CLOSE_WORD) readonly closeWord$: Observable<string>,\n ) {\n close$.subscribe(() => {\n this.close();\n });\n }\n\n @HostBinding('attr.data-size')\n get size(): TuiDialogSize {\n return this.context.size;\n }\n\n @HostBinding('class._centered')\n get header(): PolymorpheusContent {\n return this.context.header;\n }\n\n @HostBinding('@tuiSlideInTop')\n @HostBinding('@tuiFadeIn')\n get slideInTop(): TuiAnimationOptions {\n return this.size === 'fullscreen' || this.size === 'page' || this.isMobile\n ? this.fullscreenAnimation\n : this.animation;\n }\n\n close(): void {\n if (this.context.required) {\n this.context.$implicit.error(REQUIRED_ERROR);\n } else {\n this.context.$implicit.complete();\n }\n }\n}\n","import {Injectable} from '@angular/core';\nimport {AbstractTuiDialogService} from '@taiga-ui/cdk';\nimport {TuiDialogOptions} from '@taiga-ui/core/interfaces';\nimport {PolymorpheusComponent} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDialogComponent} from './dialog.component';\n\nconst DIALOG = new PolymorpheusComponent(TuiDialogComponent);\nconst DEFAULT_OPTIONS = {\n size: `m`,\n required: false,\n closeable: true,\n dismissible: true,\n label: ``,\n header: ``,\n} as const;\n\n@Injectable({\n providedIn: `root`,\n})\nexport class TuiDialogService extends AbstractTuiDialogService<TuiDialogOptions<any>> {\n protected readonly component = DIALOG;\n protected readonly defaultOptions: TuiDialogOptions<any> = DEFAULT_OPTIONS as any;\n}\n","import {Directive} from '@angular/core';\nimport {AbstractTuiDialogDirective, AbstractTuiDialogService} from '@taiga-ui/cdk';\nimport {TuiDialogOptions} from '@taiga-ui/core/interfaces';\n\nimport {TuiDialogService} from './dialog.service';\n\n@Directive({\n selector: 'ng-template[tuiDialog]',\n providers: [\n {\n provide: AbstractTuiDialogService,\n useExisting: TuiDialogService,\n },\n ],\n inputs: ['options: tuiDialogOptions', 'open: tuiDialog'],\n outputs: ['openChange: tuiDialogChange'],\n})\nexport class TuiDialogDirective<T> extends AbstractTuiDialogDirective<\n TuiDialogOptions<T>\n> {}\n","import {CommonModule} from '@angular/common';\nimport {NgModule} from '@angular/core';\nimport {TUI_DIALOGS, TuiPreventDefaultModule} from '@taiga-ui/cdk';\nimport {TuiButtonModule} from '@taiga-ui/core/components/button';\nimport {PolymorpheusModule} from '@tinkoff/ng-polymorpheus';\n\nimport {TuiDialogComponent} from './dialog.component';\nimport {TuiDialogDirective} from './dialog.directive';\nimport {TuiDialogService} from './dialog.service';\n\n@NgModule({\n imports: [PolymorpheusModule, TuiButtonModule, CommonModule, TuiPreventDefaultModule],\n declarations: [TuiDialogComponent, TuiDialogDirective],\n exports: [TuiDialogComponent, TuiDialogDirective],\n entryComponents: [TuiDialogComponent],\n providers: [\n {\n provide: TUI_DIALOGS,\n useExisting: TuiDialogService,\n multi: true,\n },\n ],\n})\nexport class TuiDialogModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;MAkBa,iBAAiB,GAAG,IAAI,cAAc,CAC/C,2BAA2B,EAC3B;IACI,OAAO,EAAE,MAAM,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B;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { __decorate, __param, __extends } from 'tslib';
|
|
2
2
|
import { InjectionToken, ElementRef, Inject, HostBinding, Component, ChangeDetectionStrategy, ɵɵdefineInjectable, ɵɵinject, Injectable, Directive, NgModule } from '@angular/core';
|
|
3
|
-
import { typedFromEvent, isCurrentTarget,
|
|
3
|
+
import { typedFromEvent, isCurrentTarget, getActualTarget, tuiIsElement, tuiContainsOrAfter, TuiDestroyService, TUI_IS_MOBILE, AbstractTuiDialogService, AbstractTuiDialogDirective, TuiPreventDefaultModule, TUI_DIALOGS } from '@taiga-ui/cdk';
|
|
4
4
|
import { tuiSlideInTop, tuiFadeIn } from '@taiga-ui/core/animations';
|
|
5
5
|
import { TUI_ANIMATIONS_DURATION, TUI_CLOSE_WORD } from '@taiga-ui/core/tokens';
|
|
6
6
|
import { POLYMORPHEUS_CONTEXT, PolymorpheusComponent, PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
|
|
@@ -8,7 +8,7 @@ import { EMPTY, merge, Observable } from 'rxjs';
|
|
|
8
8
|
import { DOCUMENT, CommonModule } from '@angular/common';
|
|
9
9
|
import { WINDOW } from '@ng-web-apis/common';
|
|
10
10
|
import { tuiGetViewportWidth } from '@taiga-ui/core/utils/dom';
|
|
11
|
-
import { filter,
|
|
11
|
+
import { filter, switchMap, take, takeUntil } from 'rxjs/operators';
|
|
12
12
|
import { TuiIdService } from '@taiga-ui/cdk/services';
|
|
13
13
|
import { TuiButtonModule } from '@taiga-ui/core/components/button';
|
|
14
14
|
|
|
@@ -21,29 +21,27 @@ function dialogCloseStreamFactory(documentRef, windowRef, _a, close$, destroy$,
|
|
|
21
21
|
var nativeElement = _a.nativeElement;
|
|
22
22
|
var dismissible = _b.dismissible;
|
|
23
23
|
return dismissible
|
|
24
|
-
? merge(typedFromEvent(nativeElement, "click").pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, "keydown").pipe(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
target
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
var target = _a.target, clientX = _a.clientX;
|
|
36
|
-
return target instanceof Element &&
|
|
24
|
+
? merge(typedFromEvent(nativeElement, "click").pipe(filter(isCurrentTarget)), typedFromEvent(documentRef, "keydown").pipe(filter(function (event) {
|
|
25
|
+
var key = event.key;
|
|
26
|
+
var target = getActualTarget(event);
|
|
27
|
+
return (key === "Escape" &&
|
|
28
|
+
tuiIsElement(target) &&
|
|
29
|
+
(!tuiContainsOrAfter(nativeElement, target) ||
|
|
30
|
+
nativeElement.contains(target)));
|
|
31
|
+
})), typedFromEvent(documentRef, "mousedown").pipe(filter(function (event) {
|
|
32
|
+
var target = getActualTarget(event);
|
|
33
|
+
var clientX = event.clientX;
|
|
34
|
+
return (tuiIsElement(target) &&
|
|
37
35
|
tuiGetViewportWidth(windowRef) - clientX >
|
|
38
36
|
SCROLLBAR_PLACEHOLDER &&
|
|
39
|
-
!
|
|
40
|
-
}),
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}))
|
|
37
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
38
|
+
}), switchMap(function () {
|
|
39
|
+
return typedFromEvent(documentRef, "mouseup").pipe(take(1), filter(function (event) {
|
|
40
|
+
var target = getActualTarget(event);
|
|
41
|
+
return (tuiIsElement(target) &&
|
|
42
|
+
!tuiContainsOrAfter(nativeElement, target));
|
|
43
|
+
}));
|
|
44
|
+
})), close$).pipe(takeUntil(destroy$))
|
|
47
45
|
: close$;
|
|
48
46
|
}
|
|
49
47
|
var TUI_DIALOG_CLOSE_STREAM = new InjectionToken("Dialogs closing stream");
|
|
@@ -145,7 +143,7 @@ var TuiDialogComponent = /** @class */ (function () {
|
|
|
145
143
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
146
144
|
providers: TUI_DIALOG_PROVIDERS,
|
|
147
145
|
animations: [tuiSlideInTop, tuiFadeIn],
|
|
148
|
-
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:
|
|
146
|
+
styles: [":host{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}:host:after{position:absolute;top:0;left:0;width:100%;height:100%;box-shadow:0 1.125rem 1.875rem rgba(0,0,0,.48);content:'';border-radius:inherit;pointer-events:none}:host[data-size=auto]{width:auto}:host[data-size='s']{width:30rem}:host[data-size='s'] .t-content{padding:1.5rem}:host[data-size='s'] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}:host[data-size='m']{width:42.5rem}:host[data-size='m'] .t-heading{margin-bottom:.75rem;font:var(--tui-font-heading-4)}:host[data-size='l']{width:55rem}:host[data-size='l'] .t-heading{margin-bottom:1rem}:host[data-size=fullscreen],:host[data-size=page]{width:100%;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-base-01)}:host[data-size=fullscreen] .t-content,:host[data-size=page] .t-content{padding:3rem calc(50vw - (45rem / 2))}:host[data-size=fullscreen] .t-heading,:host[data-size=page] .t-heading{margin-bottom:1rem}:host[data-size=page] .t-content{padding:0}:host._centered{text-align:center}:host :host-context(tui-root._mobile)[data-size]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}:host :host-context(tui-root._mobile)[data-size] .t-content{padding:1.5rem}:host :host-context(tui-root._mobile)[data-size] .t-heading{margin-bottom:.5rem;font:var(--tui-font-heading-5)}.t-heading{margin:0;word-wrap:break-word;font:var(--tui-font-heading-3)}.t-heading:empty{display:none}.t-header{display:flex;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden}:host[data-size=fullscreen] :host-context(tui-root._mobile) .t-header{flex:1}.t-content{border-radius:inherit;padding:2rem;background:var(--tui-base-01)}.t-content:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.t-wrapper{position:-webkit-sticky;position:sticky;top:0;order:-1}.t-close{transition-property:background;transition-duration:var(--tui-duration,300ms);transition-timing-function:ease-in-out;position:fixed;top:1.5rem;right:1.5rem;color:var(--tui-base-01);background:rgba(104,104,104,.96)}.t-close:hover{background:rgba(159,159,159,.86)}:host:not([data-size=fullscreen]) .t-close{animation:tuiFadeIn var(--tui-duration)}:host:not([data-size=fullscreen]).ng-animating .t-close{display:none}:host-context(tui-root._mobile) .t-close{position:absolute;top:0;right:0;background:0 0;color:var(--tui-base-06)}:host-context(tui-root._mobile) .t-close:hover{color:var(--tui-base-07)}.t-buttons{margin-top:1.25rem;text-align:right}"]
|
|
149
147
|
}),
|
|
150
148
|
__param(0, Inject(TUI_ANIMATIONS_DURATION)),
|
|
151
149
|
__param(1, Inject(TUI_IS_MOBILE)),
|