ng-zorro-antd-popconfirm.mjs 26 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510
  1. import { __esDecorate, __runInitializers } from 'tslib';
  2. import * as i3 from '@angular/cdk/a11y';
  3. import { A11yModule } from '@angular/cdk/a11y';
  4. import * as i1 from '@angular/cdk/overlay';
  5. import { OverlayModule } from '@angular/cdk/overlay';
  6. import { DOCUMENT } from '@angular/common';
  7. import * as i0 from '@angular/core';
  8. import { EventEmitter, booleanAttribute, Output, Input, Directive, inject, ElementRef, ViewChildren, ViewEncapsulation, ChangeDetectionStrategy, Component, NgModule } from '@angular/core';
  9. import { Subject } from 'rxjs';
  10. import { takeUntil, first, finalize } from 'rxjs/operators';
  11. import * as i6 from 'ng-zorro-antd/button';
  12. import { NzButtonModule } from 'ng-zorro-antd/button';
  13. import { zoomBigMotion } from 'ng-zorro-antd/core/animation';
  14. import { WithConfig } from 'ng-zorro-antd/core/config';
  15. import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
  16. import * as i4 from 'ng-zorro-antd/core/outlet';
  17. import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
  18. import * as i2 from 'ng-zorro-antd/core/overlay';
  19. import { NzOverlayModule } from 'ng-zorro-antd/core/overlay';
  20. import { wrapIntoObservable } from 'ng-zorro-antd/core/util';
  21. import * as i9 from 'ng-zorro-antd/i18n';
  22. import { NzI18nModule } from 'ng-zorro-antd/i18n';
  23. import * as i5 from 'ng-zorro-antd/icon';
  24. import { NzIconModule } from 'ng-zorro-antd/icon';
  25. import { NzTooltipBaseDirective, NzToolTipComponent } from 'ng-zorro-antd/tooltip';
  26. import * as i7 from 'ng-zorro-antd/core/transition-patch';
  27. import * as i8 from 'ng-zorro-antd/core/wave';
  28. const NZ_CONFIG_MODULE_NAME = 'popconfirm';
  29. let NzPopconfirmDirective = (() => {
  30. let _classSuper = NzTooltipBaseDirective;
  31. let _nzPopconfirmBackdrop_decorators;
  32. let _nzPopconfirmBackdrop_initializers = [];
  33. let _nzPopconfirmBackdrop_extraInitializers = [];
  34. let _nzAutofocus_decorators;
  35. let _nzAutofocus_initializers = [];
  36. let _nzAutofocus_extraInitializers = [];
  37. return class NzPopconfirmDirective extends _classSuper {
  38. static {
  39. const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
  40. _nzPopconfirmBackdrop_decorators = [WithConfig()];
  41. _nzAutofocus_decorators = [WithConfig()];
  42. __esDecorate(null, null, _nzPopconfirmBackdrop_decorators, { kind: "field", name: "nzPopconfirmBackdrop", static: false, private: false, access: { has: obj => "nzPopconfirmBackdrop" in obj, get: obj => obj.nzPopconfirmBackdrop, set: (obj, value) => { obj.nzPopconfirmBackdrop = value; } }, metadata: _metadata }, _nzPopconfirmBackdrop_initializers, _nzPopconfirmBackdrop_extraInitializers);
  43. __esDecorate(null, null, _nzAutofocus_decorators, { kind: "field", name: "nzAutofocus", static: false, private: false, access: { has: obj => "nzAutofocus" in obj, get: obj => obj.nzAutofocus, set: (obj, value) => { obj.nzAutofocus = value; } }, metadata: _metadata }, _nzAutofocus_initializers, _nzAutofocus_extraInitializers);
  44. if (_metadata) Object.defineProperty(this, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
  45. }
  46. _nzModuleName = NZ_CONFIG_MODULE_NAME;
  47. /* eslint-disable @angular-eslint/no-input-rename, @angular-eslint/no-output-rename */
  48. arrowPointAtCenter;
  49. title;
  50. titleContext = null;
  51. directiveTitle;
  52. trigger = 'click';
  53. placement = 'top';
  54. origin;
  55. mouseEnterDelay;
  56. mouseLeaveDelay;
  57. overlayClassName;
  58. overlayStyle;
  59. visible;
  60. nzOkText;
  61. nzOkType;
  62. nzOkDisabled;
  63. nzOkDanger;
  64. nzCancelText;
  65. nzBeforeConfirm;
  66. nzIcon;
  67. nzCondition = false;
  68. nzPopconfirmShowArrow = true;
  69. nzPopconfirmBackdrop = __runInitializers(this, _nzPopconfirmBackdrop_initializers, false);
  70. nzAutofocus = (__runInitializers(this, _nzPopconfirmBackdrop_extraInitializers), __runInitializers(this, _nzAutofocus_initializers, null));
  71. directiveContent = (__runInitializers(this, _nzAutofocus_extraInitializers), null);
  72. content = null;
  73. overlayClickable;
  74. visibleChange = new EventEmitter();
  75. nzOnCancel = new EventEmitter();
  76. nzOnConfirm = new EventEmitter();
  77. getProxyPropertyMap() {
  78. return {
  79. nzOkText: ['nzOkText', () => this.nzOkText],
  80. nzOkType: ['nzOkType', () => this.nzOkType],
  81. nzOkDanger: ['nzOkDanger', () => this.nzOkDanger],
  82. nzOkDisabled: ['nzOkDisabled', () => this.nzOkDisabled],
  83. nzCancelText: ['nzCancelText', () => this.nzCancelText],
  84. nzBeforeConfirm: ['nzBeforeConfirm', () => this.nzBeforeConfirm],
  85. nzCondition: ['nzCondition', () => this.nzCondition],
  86. nzIcon: ['nzIcon', () => this.nzIcon],
  87. nzPopconfirmShowArrow: ['nzPopconfirmShowArrow', () => this.nzPopconfirmShowArrow],
  88. nzPopconfirmBackdrop: ['nzBackdrop', () => this.nzPopconfirmBackdrop],
  89. nzPopconfirmContext: ['nzTitleContext', () => this.titleContext],
  90. nzAutoFocus: ['nzAutoFocus', () => this.nzAutofocus],
  91. ...super.getProxyPropertyMap()
  92. };
  93. }
  94. constructor() {
  95. super(NzPopconfirmComponent);
  96. }
  97. /**
  98. * @override
  99. */
  100. createComponent() {
  101. super.createComponent();
  102. this.component.nzOnCancel.pipe(takeUntil(this.destroy$)).subscribe(() => {
  103. this.nzOnCancel.emit();
  104. });
  105. this.component.nzOnConfirm.pipe(takeUntil(this.destroy$)).subscribe(() => {
  106. this.nzOnConfirm.emit();
  107. });
  108. }
  109. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
  110. static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "16.1.0", version: "19.2.2", type: NzPopconfirmDirective, isStandalone: true, selector: "[nz-popconfirm]", inputs: { arrowPointAtCenter: ["nzPopconfirmArrowPointAtCenter", "arrowPointAtCenter", booleanAttribute], title: ["nzPopconfirmTitle", "title"], titleContext: ["nzPopconfirmTitleContext", "titleContext"], directiveTitle: ["nz-popconfirm", "directiveTitle"], trigger: ["nzPopconfirmTrigger", "trigger"], placement: ["nzPopconfirmPlacement", "placement"], origin: ["nzPopconfirmOrigin", "origin"], mouseEnterDelay: ["nzPopconfirmMouseEnterDelay", "mouseEnterDelay"], mouseLeaveDelay: ["nzPopconfirmMouseLeaveDelay", "mouseLeaveDelay"], overlayClassName: ["nzPopconfirmOverlayClassName", "overlayClassName"], overlayStyle: ["nzPopconfirmOverlayStyle", "overlayStyle"], visible: ["nzPopconfirmVisible", "visible"], nzOkText: "nzOkText", nzOkType: "nzOkType", nzOkDisabled: ["nzOkDisabled", "nzOkDisabled", booleanAttribute], nzOkDanger: ["nzOkDanger", "nzOkDanger", booleanAttribute], nzCancelText: "nzCancelText", nzBeforeConfirm: "nzBeforeConfirm", nzIcon: "nzIcon", nzCondition: ["nzCondition", "nzCondition", booleanAttribute], nzPopconfirmShowArrow: ["nzPopconfirmShowArrow", "nzPopconfirmShowArrow", booleanAttribute], nzPopconfirmBackdrop: "nzPopconfirmBackdrop", nzAutofocus: "nzAutofocus" }, outputs: { visibleChange: "nzPopconfirmVisibleChange", nzOnCancel: "nzOnCancel", nzOnConfirm: "nzOnConfirm" }, host: { properties: { "class.ant-popover-open": "visible" } }, exportAs: ["nzPopconfirm"], usesInheritance: true, ngImport: i0 });
  111. };
  112. })();
  113. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmDirective, decorators: [{
  114. type: Directive,
  115. args: [{
  116. selector: '[nz-popconfirm]',
  117. exportAs: 'nzPopconfirm',
  118. host: {
  119. '[class.ant-popover-open]': 'visible'
  120. }
  121. }]
  122. }], ctorParameters: () => [], propDecorators: { arrowPointAtCenter: [{
  123. type: Input,
  124. args: [{ alias: 'nzPopconfirmArrowPointAtCenter', transform: booleanAttribute }]
  125. }], title: [{
  126. type: Input,
  127. args: ['nzPopconfirmTitle']
  128. }], titleContext: [{
  129. type: Input,
  130. args: ['nzPopconfirmTitleContext']
  131. }], directiveTitle: [{
  132. type: Input,
  133. args: ['nz-popconfirm']
  134. }], trigger: [{
  135. type: Input,
  136. args: ['nzPopconfirmTrigger']
  137. }], placement: [{
  138. type: Input,
  139. args: ['nzPopconfirmPlacement']
  140. }], origin: [{
  141. type: Input,
  142. args: ['nzPopconfirmOrigin']
  143. }], mouseEnterDelay: [{
  144. type: Input,
  145. args: ['nzPopconfirmMouseEnterDelay']
  146. }], mouseLeaveDelay: [{
  147. type: Input,
  148. args: ['nzPopconfirmMouseLeaveDelay']
  149. }], overlayClassName: [{
  150. type: Input,
  151. args: ['nzPopconfirmOverlayClassName']
  152. }], overlayStyle: [{
  153. type: Input,
  154. args: ['nzPopconfirmOverlayStyle']
  155. }], visible: [{
  156. type: Input,
  157. args: ['nzPopconfirmVisible']
  158. }], nzOkText: [{
  159. type: Input
  160. }], nzOkType: [{
  161. type: Input
  162. }], nzOkDisabled: [{
  163. type: Input,
  164. args: [{ transform: booleanAttribute }]
  165. }], nzOkDanger: [{
  166. type: Input,
  167. args: [{ transform: booleanAttribute }]
  168. }], nzCancelText: [{
  169. type: Input
  170. }], nzBeforeConfirm: [{
  171. type: Input
  172. }], nzIcon: [{
  173. type: Input
  174. }], nzCondition: [{
  175. type: Input,
  176. args: [{ transform: booleanAttribute }]
  177. }], nzPopconfirmShowArrow: [{
  178. type: Input,
  179. args: [{ transform: booleanAttribute }]
  180. }], nzPopconfirmBackdrop: [{
  181. type: Input
  182. }], nzAutofocus: [{
  183. type: Input
  184. }], visibleChange: [{
  185. type: Output,
  186. args: ['nzPopconfirmVisibleChange']
  187. }], nzOnCancel: [{
  188. type: Output
  189. }], nzOnConfirm: [{
  190. type: Output
  191. }] } });
  192. class NzPopconfirmComponent extends NzToolTipComponent {
  193. elementRef;
  194. okBtn;
  195. cancelBtn;
  196. nzCancelText;
  197. nzCondition = false;
  198. nzPopconfirmShowArrow = true;
  199. nzIcon;
  200. nzOkText;
  201. nzOkType = 'primary';
  202. nzOkDanger = false;
  203. nzOkDisabled = false;
  204. nzAutoFocus = null;
  205. nzBeforeConfirm = null;
  206. nzOnCancel = new Subject();
  207. nzOnConfirm = new Subject();
  208. _trigger = 'click';
  209. elementFocusedBeforeModalWasOpened = null;
  210. document = inject(DOCUMENT);
  211. _prefix = 'ant-popover';
  212. confirmLoading = false;
  213. constructor(elementRef) {
  214. super();
  215. this.elementRef = elementRef;
  216. }
  217. ngOnDestroy() {
  218. super.ngOnDestroy();
  219. this.nzOnCancel.complete();
  220. this.nzOnConfirm.complete();
  221. }
  222. /**
  223. * @override
  224. */
  225. show() {
  226. if (!this.nzCondition) {
  227. this.capturePreviouslyFocusedElement();
  228. super.show();
  229. }
  230. else {
  231. this.onConfirm();
  232. }
  233. }
  234. hide() {
  235. super.hide();
  236. this.restoreFocus();
  237. }
  238. handleConfirm() {
  239. this.nzOnConfirm.next();
  240. super.hide();
  241. }
  242. onCancel() {
  243. this.nzOnCancel.next();
  244. super.hide();
  245. }
  246. onConfirm() {
  247. if (this.nzBeforeConfirm) {
  248. const observable = wrapIntoObservable(this.nzBeforeConfirm()).pipe(first());
  249. this.confirmLoading = true;
  250. observable
  251. .pipe(finalize(() => {
  252. this.confirmLoading = false;
  253. this.cdr.markForCheck();
  254. }), takeUntil(this.nzVisibleChange), takeUntil(this.destroy$))
  255. .subscribe(value => {
  256. if (value) {
  257. this.handleConfirm();
  258. }
  259. });
  260. }
  261. else {
  262. this.handleConfirm();
  263. }
  264. }
  265. capturePreviouslyFocusedElement() {
  266. if (this.document) {
  267. this.elementFocusedBeforeModalWasOpened = this.document.activeElement;
  268. }
  269. }
  270. restoreFocus() {
  271. const toFocus = this.elementFocusedBeforeModalWasOpened;
  272. // We need the extra check, because IE can set the `activeElement` to null in some cases.
  273. if (toFocus && typeof toFocus.focus === 'function') {
  274. const activeElement = this.document.activeElement;
  275. const element = this.elementRef.nativeElement;
  276. if (!activeElement ||
  277. activeElement === this.document.body ||
  278. activeElement === element ||
  279. element.contains(activeElement)) {
  280. toFocus.focus();
  281. }
  282. }
  283. }
  284. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component });
  285. static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.2", type: NzPopconfirmComponent, isStandalone: true, selector: "nz-popconfirm", viewQueries: [{ propertyName: "okBtn", predicate: ["okBtn"], descendants: true, read: ElementRef }, { propertyName: "cancelBtn", predicate: ["cancelBtn"], descendants: true, read: ElementRef }], exportAs: ["nzPopconfirmComponent"], usesInheritance: true, ngImport: i0, template: `
  286. <ng-template
  287. #overlay="cdkConnectedOverlay"
  288. cdkConnectedOverlay
  289. nzConnectedOverlay
  290. [cdkConnectedOverlayHasBackdrop]="nzBackdrop"
  291. [cdkConnectedOverlayOrigin]="origin"
  292. (overlayOutsideClick)="onClickOutside($event)"
  293. (detach)="hide()"
  294. (positionChange)="onPositionChange($event)"
  295. [cdkConnectedOverlayPositions]="_positions"
  296. [cdkConnectedOverlayOpen]="_visible"
  297. [cdkConnectedOverlayPush]="cdkConnectedOverlayPush"
  298. [nzArrowPointAtCenter]="nzArrowPointAtCenter"
  299. >
  300. <div
  301. cdkTrapFocus
  302. [cdkTrapFocusAutoCapture]="nzAutoFocus !== null"
  303. class="ant-popover"
  304. [class]="_classMap"
  305. [class.ant-popover-rtl]="dir === 'rtl'"
  306. [style]="nzOverlayStyle"
  307. [@.disabled]="!!noAnimation?.nzNoAnimation"
  308. [nzNoAnimation]="noAnimation?.nzNoAnimation"
  309. [@zoomBigMotion]="'active'"
  310. >
  311. <div class="ant-popover-content">
  312. @if (nzPopconfirmShowArrow) {
  313. <div class="ant-popover-arrow">
  314. <span class="ant-popover-arrow-content"></span>
  315. </div>
  316. }
  317. <div class="ant-popover-inner">
  318. <div>
  319. <div class="ant-popover-inner-content">
  320. <div class="ant-popover-message">
  321. <ng-container *nzStringTemplateOutlet="nzTitle; context: nzTitleContext">
  322. <ng-container *nzStringTemplateOutlet="nzIcon; let icon">
  323. <span class="ant-popover-message-icon">
  324. <nz-icon [nzType]="icon || 'exclamation-circle'" nzTheme="fill" />
  325. </span>
  326. </ng-container>
  327. <div class="ant-popover-message-title">{{ nzTitle }}</div>
  328. </ng-container>
  329. </div>
  330. <div class="ant-popover-buttons">
  331. <button
  332. nz-button
  333. #cancelBtn
  334. [nzSize]="'small'"
  335. (click)="onCancel()"
  336. [attr.cdkFocusInitial]="nzAutoFocus === 'cancel' || null"
  337. >
  338. @if (nzCancelText) {
  339. {{ nzCancelText }}
  340. } @else {
  341. {{ 'Modal.cancelText' | nzI18n }}
  342. }
  343. </button>
  344. <button
  345. nz-button
  346. #okBtn
  347. [nzSize]="'small'"
  348. [nzType]="nzOkType !== 'danger' ? nzOkType : 'primary'"
  349. [nzDanger]="nzOkDanger || nzOkType === 'danger'"
  350. [nzLoading]="confirmLoading"
  351. [disabled]="nzOkDisabled"
  352. (click)="onConfirm()"
  353. [attr.cdkFocusInitial]="nzAutoFocus === 'ok' || null"
  354. >
  355. @if (nzOkText) {
  356. {{ nzOkText }}
  357. } @else {
  358. {{ 'Modal.okText' | nzI18n }}
  359. }
  360. </button>
  361. </div>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. </div>
  367. </ng-template>
  368. `, isInline: true, dependencies: [{ kind: "ngmodule", type: OverlayModule }, { kind: "directive", type: i1.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "ngmodule", type: NzOverlayModule }, { kind: "directive", type: i2.NzConnectedOverlayDirective, selector: "[cdkConnectedOverlay][nzConnectedOverlay]", inputs: ["nzArrowPointAtCenter"], exportAs: ["nzConnectedOverlay"] }, { kind: "ngmodule", type: A11yModule }, { kind: "directive", type: i3.CdkTrapFocus, selector: "[cdkTrapFocus]", inputs: ["cdkTrapFocus", "cdkTrapFocusAutoCapture"], exportAs: ["cdkTrapFocus"] }, { kind: "directive", type: NzNoAnimationDirective, selector: "[nzNoAnimation]", inputs: ["nzNoAnimation"], exportAs: ["nzNoAnimation"] }, { kind: "ngmodule", type: NzOutletModule }, { kind: "directive", type: i4.NzStringTemplateOutletDirective, selector: "[nzStringTemplateOutlet]", inputs: ["nzStringTemplateOutletContext", "nzStringTemplateOutlet"], exportAs: ["nzStringTemplateOutlet"] }, { kind: "ngmodule", type: NzIconModule }, { kind: "directive", type: i5.NzIconDirective, selector: "nz-icon,[nz-icon]", inputs: ["nzSpin", "nzRotate", "nzType", "nzTheme", "nzTwotoneColor", "nzIconfont"], exportAs: ["nzIcon"] }, { kind: "ngmodule", type: NzButtonModule }, { kind: "component", type: i6.NzButtonComponent, selector: "button[nz-button], a[nz-button]", inputs: ["nzBlock", "nzGhost", "nzSearch", "nzLoading", "nzDanger", "disabled", "tabIndex", "nzType", "nzShape", "nzSize"], exportAs: ["nzButton"] }, { kind: "directive", type: i7.ɵNzTransitionPatchDirective, selector: "[nz-button], nz-button-group, [nz-icon], nz-icon, [nz-menu-item], [nz-submenu], nz-select-top-control, nz-select-placeholder, nz-input-group", inputs: ["hidden"] }, { kind: "directive", type: i8.NzWaveDirective, selector: "[nz-wave],button[nz-button]:not([nzType=\"link\"]):not([nzType=\"text\"])", inputs: ["nzWaveExtraNode"], exportAs: ["nzWave"] }, { kind: "ngmodule", type: NzI18nModule }, { kind: "pipe", type: i9.NzI18nPipe, name: "nzI18n" }], animations: [zoomBigMotion], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
  369. }
  370. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmComponent, decorators: [{
  371. type: Component,
  372. args: [{
  373. changeDetection: ChangeDetectionStrategy.OnPush,
  374. encapsulation: ViewEncapsulation.None,
  375. selector: 'nz-popconfirm',
  376. exportAs: 'nzPopconfirmComponent',
  377. preserveWhitespaces: false,
  378. animations: [zoomBigMotion],
  379. template: `
  380. <ng-template
  381. #overlay="cdkConnectedOverlay"
  382. cdkConnectedOverlay
  383. nzConnectedOverlay
  384. [cdkConnectedOverlayHasBackdrop]="nzBackdrop"
  385. [cdkConnectedOverlayOrigin]="origin"
  386. (overlayOutsideClick)="onClickOutside($event)"
  387. (detach)="hide()"
  388. (positionChange)="onPositionChange($event)"
  389. [cdkConnectedOverlayPositions]="_positions"
  390. [cdkConnectedOverlayOpen]="_visible"
  391. [cdkConnectedOverlayPush]="cdkConnectedOverlayPush"
  392. [nzArrowPointAtCenter]="nzArrowPointAtCenter"
  393. >
  394. <div
  395. cdkTrapFocus
  396. [cdkTrapFocusAutoCapture]="nzAutoFocus !== null"
  397. class="ant-popover"
  398. [class]="_classMap"
  399. [class.ant-popover-rtl]="dir === 'rtl'"
  400. [style]="nzOverlayStyle"
  401. [@.disabled]="!!noAnimation?.nzNoAnimation"
  402. [nzNoAnimation]="noAnimation?.nzNoAnimation"
  403. [@zoomBigMotion]="'active'"
  404. >
  405. <div class="ant-popover-content">
  406. @if (nzPopconfirmShowArrow) {
  407. <div class="ant-popover-arrow">
  408. <span class="ant-popover-arrow-content"></span>
  409. </div>
  410. }
  411. <div class="ant-popover-inner">
  412. <div>
  413. <div class="ant-popover-inner-content">
  414. <div class="ant-popover-message">
  415. <ng-container *nzStringTemplateOutlet="nzTitle; context: nzTitleContext">
  416. <ng-container *nzStringTemplateOutlet="nzIcon; let icon">
  417. <span class="ant-popover-message-icon">
  418. <nz-icon [nzType]="icon || 'exclamation-circle'" nzTheme="fill" />
  419. </span>
  420. </ng-container>
  421. <div class="ant-popover-message-title">{{ nzTitle }}</div>
  422. </ng-container>
  423. </div>
  424. <div class="ant-popover-buttons">
  425. <button
  426. nz-button
  427. #cancelBtn
  428. [nzSize]="'small'"
  429. (click)="onCancel()"
  430. [attr.cdkFocusInitial]="nzAutoFocus === 'cancel' || null"
  431. >
  432. @if (nzCancelText) {
  433. {{ nzCancelText }}
  434. } @else {
  435. {{ 'Modal.cancelText' | nzI18n }}
  436. }
  437. </button>
  438. <button
  439. nz-button
  440. #okBtn
  441. [nzSize]="'small'"
  442. [nzType]="nzOkType !== 'danger' ? nzOkType : 'primary'"
  443. [nzDanger]="nzOkDanger || nzOkType === 'danger'"
  444. [nzLoading]="confirmLoading"
  445. [disabled]="nzOkDisabled"
  446. (click)="onConfirm()"
  447. [attr.cdkFocusInitial]="nzAutoFocus === 'ok' || null"
  448. >
  449. @if (nzOkText) {
  450. {{ nzOkText }}
  451. } @else {
  452. {{ 'Modal.okText' | nzI18n }}
  453. }
  454. </button>
  455. </div>
  456. </div>
  457. </div>
  458. </div>
  459. </div>
  460. </div>
  461. </ng-template>
  462. `,
  463. imports: [
  464. OverlayModule,
  465. NzOverlayModule,
  466. A11yModule,
  467. NzNoAnimationDirective,
  468. NzOutletModule,
  469. NzIconModule,
  470. NzButtonModule,
  471. NzI18nModule
  472. ]
  473. }]
  474. }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { okBtn: [{
  475. type: ViewChildren,
  476. args: ['okBtn', { read: ElementRef }]
  477. }], cancelBtn: [{
  478. type: ViewChildren,
  479. args: ['cancelBtn', { read: ElementRef }]
  480. }] } });
  481. /**
  482. * Use of this source code is governed by an MIT-style license that can be
  483. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  484. */
  485. class NzPopconfirmModule {
  486. static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
  487. static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmModule, imports: [NzPopconfirmComponent, NzPopconfirmDirective], exports: [NzPopconfirmComponent, NzPopconfirmDirective] });
  488. static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmModule, imports: [NzPopconfirmComponent] });
  489. }
  490. i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.2", ngImport: i0, type: NzPopconfirmModule, decorators: [{
  491. type: NgModule,
  492. args: [{
  493. imports: [NzPopconfirmComponent, NzPopconfirmDirective],
  494. exports: [NzPopconfirmComponent, NzPopconfirmDirective]
  495. }]
  496. }] });
  497. /**
  498. * Use of this source code is governed by an MIT-style license that can be
  499. * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
  500. */
  501. /**
  502. * Generated bundle index. Do not edit.
  503. */
  504. export { NzPopconfirmComponent, NzPopconfirmDirective, NzPopconfirmModule };
  505. //# sourceMappingURL=ng-zorro-antd-popconfirm.mjs.map