@ngneers/controls 0.0.1-pre1 → 0.0.1-pre3

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.
Files changed (195) hide show
  1. package/LICENSE +21 -0
  2. package/fesm2022/ngneers-controls-accordion.mjs +194 -0
  3. package/fesm2022/ngneers-controls-accordion.mjs.map +1 -0
  4. package/fesm2022/ngneers-controls-api-ng.mjs +668 -0
  5. package/fesm2022/ngneers-controls-api-ng.mjs.map +1 -0
  6. package/fesm2022/ngneers-controls-api.mjs +256 -227
  7. package/fesm2022/ngneers-controls-api.mjs.map +1 -1
  8. package/fesm2022/ngneers-controls-avatar.mjs +70 -0
  9. package/fesm2022/ngneers-controls-avatar.mjs.map +1 -0
  10. package/fesm2022/ngneers-controls-base.mjs +397 -0
  11. package/fesm2022/ngneers-controls-base.mjs.map +1 -0
  12. package/fesm2022/ngneers-controls-breadcrumb.mjs +74 -0
  13. package/fesm2022/ngneers-controls-breadcrumb.mjs.map +1 -0
  14. package/fesm2022/ngneers-controls-button-group.mjs +51 -0
  15. package/fesm2022/ngneers-controls-button-group.mjs.map +1 -0
  16. package/fesm2022/ngneers-controls-button.mjs +62 -0
  17. package/fesm2022/ngneers-controls-button.mjs.map +1 -0
  18. package/fesm2022/ngneers-controls-calendar-time-C7UnIFzU.mjs +63 -0
  19. package/fesm2022/ngneers-controls-calendar-time-C7UnIFzU.mjs.map +1 -0
  20. package/fesm2022/ngneers-controls-calendar.mjs +468 -0
  21. package/fesm2022/ngneers-controls-calendar.mjs.map +1 -0
  22. package/fesm2022/ngneers-controls-checkbox.mjs +58 -0
  23. package/fesm2022/ngneers-controls-checkbox.mjs.map +1 -0
  24. package/fesm2022/ngneers-controls-chip.mjs +52 -0
  25. package/fesm2022/ngneers-controls-chip.mjs.map +1 -0
  26. package/fesm2022/ngneers-controls-defer.mjs +43 -0
  27. package/fesm2022/ngneers-controls-defer.mjs.map +1 -0
  28. package/fesm2022/ngneers-controls-dialog.mjs +329 -33
  29. package/fesm2022/ngneers-controls-dialog.mjs.map +1 -1
  30. package/fesm2022/ngneers-controls-directives.mjs +443 -0
  31. package/fesm2022/ngneers-controls-directives.mjs.map +1 -0
  32. package/fesm2022/ngneers-controls-drawer.mjs +232 -0
  33. package/fesm2022/ngneers-controls-drawer.mjs.map +1 -0
  34. package/fesm2022/ngneers-controls-edit-inplace.mjs +120 -0
  35. package/fesm2022/ngneers-controls-edit-inplace.mjs.map +1 -0
  36. package/fesm2022/ngneers-controls-filter.mjs +516 -0
  37. package/fesm2022/ngneers-controls-filter.mjs.map +1 -0
  38. package/fesm2022/ngneers-controls-i18n-de-CdTPeBiR.mjs +87 -0
  39. package/fesm2022/ngneers-controls-i18n-de-CdTPeBiR.mjs.map +1 -0
  40. package/fesm2022/ngneers-controls-i18n-en-Cfp2pOLY.mjs +87 -0
  41. package/fesm2022/ngneers-controls-i18n-en-Cfp2pOLY.mjs.map +1 -0
  42. package/fesm2022/ngneers-controls-i18n.mjs +57 -0
  43. package/fesm2022/ngneers-controls-i18n.mjs.map +1 -0
  44. package/fesm2022/ngneers-controls-icon-calendar-z5xA9wTT.mjs +4 -0
  45. package/fesm2022/ngneers-controls-icon-calendar-z5xA9wTT.mjs.map +1 -0
  46. package/fesm2022/ngneers-controls-icon-check-DdAQ9k-T.mjs +4 -0
  47. package/fesm2022/ngneers-controls-icon-check-DdAQ9k-T.mjs.map +1 -0
  48. package/fesm2022/ngneers-controls-icon-chevron_down-HO-z-xOr.mjs +4 -0
  49. package/fesm2022/ngneers-controls-icon-chevron_down-HO-z-xOr.mjs.map +1 -0
  50. package/fesm2022/ngneers-controls-icon-chevron_left-CC5psi16.mjs +4 -0
  51. package/fesm2022/ngneers-controls-icon-chevron_left-CC5psi16.mjs.map +1 -0
  52. package/fesm2022/ngneers-controls-icon-chevron_right-BRxlzx4G.mjs +4 -0
  53. package/fesm2022/ngneers-controls-icon-chevron_right-BRxlzx4G.mjs.map +1 -0
  54. package/fesm2022/ngneers-controls-icon-chevron_up-cqhPO7g2.mjs +4 -0
  55. package/fesm2022/ngneers-controls-icon-chevron_up-cqhPO7g2.mjs.map +1 -0
  56. package/fesm2022/ngneers-controls-icon-ellipsis-DXIGA1sk.mjs +4 -0
  57. package/fesm2022/ngneers-controls-icon-ellipsis-DXIGA1sk.mjs.map +1 -0
  58. package/fesm2022/ngneers-controls-icon-filter-oU7E6Xgr.mjs +4 -0
  59. package/fesm2022/ngneers-controls-icon-filter-oU7E6Xgr.mjs.map +1 -0
  60. package/fesm2022/ngneers-controls-icon-filter_solid-CqIKuR4N.mjs +4 -0
  61. package/fesm2022/ngneers-controls-icon-filter_solid-CqIKuR4N.mjs.map +1 -0
  62. package/fesm2022/ngneers-controls-icon-magnifying_glass-T4Hzbkig.mjs +4 -0
  63. package/fesm2022/ngneers-controls-icon-magnifying_glass-T4Hzbkig.mjs.map +1 -0
  64. package/fesm2022/ngneers-controls-icon-minus-oGDEFO4E.mjs +4 -0
  65. package/fesm2022/ngneers-controls-icon-minus-oGDEFO4E.mjs.map +1 -0
  66. package/fesm2022/ngneers-controls-icon-sort-CRD4tafz.mjs +4 -0
  67. package/fesm2022/ngneers-controls-icon-sort-CRD4tafz.mjs.map +1 -0
  68. package/fesm2022/ngneers-controls-icon-sort_down-DiFB1P6R.mjs +4 -0
  69. package/fesm2022/ngneers-controls-icon-sort_down-DiFB1P6R.mjs.map +1 -0
  70. package/fesm2022/ngneers-controls-icon-sort_up-Bq_q3hIi.mjs +4 -0
  71. package/fesm2022/ngneers-controls-icon-sort_up-Bq_q3hIi.mjs.map +1 -0
  72. package/fesm2022/ngneers-controls-icon-xmark-BZKZORiu.mjs +4 -0
  73. package/fesm2022/ngneers-controls-icon-xmark-BZKZORiu.mjs.map +1 -0
  74. package/fesm2022/ngneers-controls-icon.mjs +60 -18
  75. package/fesm2022/ngneers-controls-icon.mjs.map +1 -1
  76. package/fesm2022/ngneers-controls-inplace.mjs +107 -0
  77. package/fesm2022/ngneers-controls-inplace.mjs.map +1 -0
  78. package/fesm2022/ngneers-controls-input-field.mjs +141 -0
  79. package/fesm2022/ngneers-controls-input-field.mjs.map +1 -0
  80. package/fesm2022/ngneers-controls-input-mask.mjs +282 -0
  81. package/fesm2022/ngneers-controls-input-mask.mjs.map +1 -0
  82. package/fesm2022/ngneers-controls-input.mjs +69 -0
  83. package/fesm2022/ngneers-controls-input.mjs.map +1 -0
  84. package/fesm2022/ngneers-controls-item-view.mjs +441 -0
  85. package/fesm2022/ngneers-controls-item-view.mjs.map +1 -0
  86. package/fesm2022/ngneers-controls-list-box.mjs +157 -53
  87. package/fesm2022/ngneers-controls-list-box.mjs.map +1 -1
  88. package/fesm2022/ngneers-controls-menu.mjs +332 -0
  89. package/fesm2022/ngneers-controls-menu.mjs.map +1 -0
  90. package/fesm2022/ngneers-controls-message.mjs +29 -0
  91. package/fesm2022/ngneers-controls-message.mjs.map +1 -0
  92. package/fesm2022/ngneers-controls-paginator.mjs +111 -0
  93. package/fesm2022/ngneers-controls-paginator.mjs.map +1 -0
  94. package/fesm2022/ngneers-controls-popover.mjs +129 -40
  95. package/fesm2022/ngneers-controls-popover.mjs.map +1 -1
  96. package/fesm2022/ngneers-controls-progress.mjs +82 -0
  97. package/fesm2022/ngneers-controls-progress.mjs.map +1 -0
  98. package/fesm2022/ngneers-controls-scroller.mjs +162 -78
  99. package/fesm2022/ngneers-controls-scroller.mjs.map +1 -1
  100. package/fesm2022/ngneers-controls-select-button.mjs +55 -0
  101. package/fesm2022/ngneers-controls-select-button.mjs.map +1 -0
  102. package/fesm2022/ngneers-controls-select.mjs +313 -103
  103. package/fesm2022/ngneers-controls-select.mjs.map +1 -1
  104. package/fesm2022/ngneers-controls-slider.mjs +155 -0
  105. package/fesm2022/ngneers-controls-slider.mjs.map +1 -0
  106. package/fesm2022/ngneers-controls-spinner.mjs +169 -0
  107. package/fesm2022/ngneers-controls-spinner.mjs.map +1 -0
  108. package/fesm2022/ngneers-controls-splitter.mjs +717 -0
  109. package/fesm2022/ngneers-controls-splitter.mjs.map +1 -0
  110. package/fesm2022/ngneers-controls-switch.mjs +39 -0
  111. package/fesm2022/ngneers-controls-switch.mjs.map +1 -0
  112. package/fesm2022/ngneers-controls-table.mjs +379 -0
  113. package/fesm2022/ngneers-controls-table.mjs.map +1 -0
  114. package/fesm2022/ngneers-controls-tabs.mjs +287 -0
  115. package/fesm2022/ngneers-controls-tabs.mjs.map +1 -0
  116. package/fesm2022/ngneers-controls-tag.mjs +29 -0
  117. package/fesm2022/ngneers-controls-tag.mjs.map +1 -0
  118. package/fesm2022/ngneers-controls-toast.mjs +184 -0
  119. package/fesm2022/ngneers-controls-toast.mjs.map +1 -0
  120. package/fesm2022/ngneers-controls-toggle-button.mjs +65 -0
  121. package/fesm2022/ngneers-controls-toggle-button.mjs.map +1 -0
  122. package/fesm2022/ngneers-controls-tooltip.mjs +454 -0
  123. package/fesm2022/ngneers-controls-tooltip.mjs.map +1 -0
  124. package/fesm2022/ngneers-controls-utils-ng.mjs +227 -0
  125. package/fesm2022/ngneers-controls-utils-ng.mjs.map +1 -0
  126. package/fesm2022/ngneers-controls-utils.mjs +217 -60
  127. package/fesm2022/ngneers-controls-utils.mjs.map +1 -1
  128. package/fesm2022/ngneers-controls.mjs.map +1 -1
  129. package/package.json +167 -32
  130. package/types/ngneers-controls-accordion.d.ts +114 -0
  131. package/types/ngneers-controls-api-ng.d.ts +291 -0
  132. package/types/ngneers-controls-api.d.ts +99 -0
  133. package/types/ngneers-controls-avatar.d.ts +50 -0
  134. package/types/ngneers-controls-base.d.ts +166 -0
  135. package/types/ngneers-controls-breadcrumb.d.ts +86 -0
  136. package/types/ngneers-controls-button-group.d.ts +30 -0
  137. package/types/ngneers-controls-button.d.ts +34 -0
  138. package/types/ngneers-controls-calendar.d.ts +275 -0
  139. package/types/ngneers-controls-checkbox.d.ts +38 -0
  140. package/types/ngneers-controls-chip.d.ts +37 -0
  141. package/types/ngneers-controls-defer.d.ts +22 -0
  142. package/types/ngneers-controls-dialog.d.ts +218 -0
  143. package/types/ngneers-controls-directives.d.ts +146 -0
  144. package/types/ngneers-controls-drawer.d.ts +220 -0
  145. package/types/ngneers-controls-edit-inplace.d.ts +182 -0
  146. package/types/ngneers-controls-filter.d.ts +304 -0
  147. package/types/ngneers-controls-i18n.d.ts +108 -0
  148. package/types/ngneers-controls-icon.d.ts +74 -0
  149. package/types/ngneers-controls-inplace.d.ts +95 -0
  150. package/types/ngneers-controls-input-field.d.ts +159 -0
  151. package/types/ngneers-controls-input-mask.d.ts +83 -0
  152. package/types/ngneers-controls-input.d.ts +27 -0
  153. package/types/ngneers-controls-item-view.d.ts +211 -0
  154. package/types/ngneers-controls-list-box.d.ts +216 -0
  155. package/types/ngneers-controls-menu.d.ts +178 -0
  156. package/types/ngneers-controls-message.d.ts +19 -0
  157. package/types/ngneers-controls-paginator.d.ts +162 -0
  158. package/types/ngneers-controls-popover.d.ts +101 -0
  159. package/types/ngneers-controls-progress.d.ts +44 -0
  160. package/types/ngneers-controls-scroller.d.ts +137 -0
  161. package/types/ngneers-controls-select-button.d.ts +37 -0
  162. package/types/ngneers-controls-select.d.ts +314 -0
  163. package/types/ngneers-controls-slider.d.ts +53 -0
  164. package/types/ngneers-controls-spinner.d.ts +105 -0
  165. package/types/ngneers-controls-splitter.d.ts +391 -0
  166. package/types/ngneers-controls-switch.d.ts +18 -0
  167. package/types/ngneers-controls-table.d.ts +157 -0
  168. package/types/ngneers-controls-tabs.d.ts +106 -0
  169. package/types/ngneers-controls-tag.d.ts +19 -0
  170. package/types/ngneers-controls-toast.d.ts +70 -0
  171. package/types/ngneers-controls-toggle-button.d.ts +46 -0
  172. package/types/ngneers-controls-tooltip.d.ts +188 -0
  173. package/types/ngneers-controls-utils-ng.d.ts +57 -0
  174. package/types/ngneers-controls-utils.d.ts +130 -0
  175. package/api/index.d.ts +0 -134
  176. package/custom-types/index.d.ts +0 -7
  177. package/dialog/index.d.ts +0 -43
  178. package/fesm2022/ngneers-controls-custom-types.mjs +0 -4
  179. package/fesm2022/ngneers-controls-custom-types.mjs.map +0 -1
  180. package/fesm2022/ngneers-controls-form-field.mjs +0 -33
  181. package/fesm2022/ngneers-controls-form-field.mjs.map +0 -1
  182. package/fesm2022/ngneers-controls-lazy-cacher.mjs +0 -30
  183. package/fesm2022/ngneers-controls-lazy-cacher.mjs.map +0 -1
  184. package/fesm2022/ngneers-controls-text-field.mjs +0 -23
  185. package/fesm2022/ngneers-controls-text-field.mjs.map +0 -1
  186. package/form-field/index.d.ts +0 -19
  187. package/icon/index.d.ts +0 -30
  188. package/lazy-cacher/index.d.ts +0 -14
  189. package/list-box/index.d.ts +0 -58
  190. package/popover/index.d.ts +0 -41
  191. package/scroller/index.d.ts +0 -95
  192. package/select/index.d.ts +0 -86
  193. package/text-field/index.d.ts +0 -10
  194. package/utils/index.d.ts +0 -36
  195. /package/{index.d.ts → types/ngneers-controls.d.ts} +0 -0
@@ -1,44 +1,193 @@
1
- import { NgTemplateOutlet } from '@angular/common';
2
1
  import * as i0 from '@angular/core';
3
- import { viewChild, contentChild, input, computed, Component, output, afterRenderEffect, untracked, ChangeDetectionStrategy } from '@angular/core';
4
- import { templateTypesFn, NgnTemplate } from '@ngneers/controls/api';
5
- import { LazyCacher } from '@ngneers/controls/lazy-cacher';
6
- import { generateElementId } from '@ngneers/controls/utils';
2
+ import { contentChild, input, computed, viewChild, Directive, effect, ChangeDetectionStrategy, Component, model, booleanAttribute, output, signal, TemplateRef, afterRenderEffect, untracked, ViewContainerRef } from '@angular/core';
3
+ import { templateTypesFn, toModalCloseBy, toPopoverCloseBy, NgnTemplate, setComponentInput } from '@ngneers/controls/api/ng';
4
+ import { Subject } from 'rxjs';
5
+ import { NgTemplateOutlet, NgComponentOutlet } from '@angular/common';
6
+ import { NgnBase, NgnPt, provideSelf } from '@ngneers/controls/base';
7
+ import { NgnButton, NgnActionButton } from '@ngneers/controls/button';
8
+ import { NgnDefer } from '@ngneers/controls/defer';
9
+ import { NgnMovable, NgnResizable } from '@ngneers/controls/directives';
10
+ import { NgnIcon } from '@ngneers/controls/icon';
11
+ import { generateElementId } from '@ngneers/controls/utils-ng';
12
+ import { dialogControlTemplate } from '@ngneers/controls-themes/templates/dialog';
7
13
 
8
- class DialogTemplates {
14
+ class DialogTemplates extends NgnBase {
15
+ _userContentTemplate = contentChild('content', ...(ngDevMode ? [{ debugName: "_userContentTemplate" }] : []));
16
+ /**
17
+ * The content of the dialog.
18
+ * Can be a string, a component type, or a template reference.
19
+ * Can also be set using an `<ng-template>` element with `#content` template reference variable.
20
+ */
21
+ content = input(null, ...(ngDevMode ? [{ debugName: "content" }] : []));
22
+ contentTemplate = computed(() => this._userContentTemplate() ?? this.content(), ...(ngDevMode ? [{ debugName: "contentTemplate" }] : []));
9
23
  _defaultHeaderTemplate = viewChild.required('defaultHeaderTemplate');
10
- _userHeaderTemplate = contentChild('header');
11
- templateHeader = input(null);
12
- headerTemplate = computed(() => this._userHeaderTemplate() ?? this.templateHeader() ?? this._defaultHeaderTemplate());
24
+ _userHeaderTemplate = contentChild('header', ...(ngDevMode ? [{ debugName: "_userHeaderTemplate" }] : []));
25
+ /**
26
+ * Set a custom template for the header of the dialog.
27
+ * Can also be set using an `<ng-template>` element with `#header` template reference variable.
28
+ */
29
+ templateHeader = input(null, ...(ngDevMode ? [{ debugName: "templateHeader" }] : []));
30
+ headerTemplate = computed(() => this._userHeaderTemplate() ?? this.templateHeader() ?? this._defaultHeaderTemplate(), ...(ngDevMode ? [{ debugName: "headerTemplate" }] : []));
13
31
  _defaultFooterTemplate = viewChild.required('defaultFooterTemplate');
14
- _userFooterTemplate = contentChild('footer');
15
- templateFooter = input(null);
16
- footerTemplate = computed(() => this._userFooterTemplate() ?? this.templateFooter() ?? this._defaultFooterTemplate());
32
+ _userFooterTemplate = contentChild('footer', ...(ngDevMode ? [{ debugName: "_userFooterTemplate" }] : []));
33
+ /**
34
+ * Set a custom template for the footer of the dialog.
35
+ * Can also be set using an `<ng-template>` element with `#footer` template reference variable.
36
+ */
37
+ templateFooter = input(null, ...(ngDevMode ? [{ debugName: "templateFooter" }] : []));
38
+ footerTemplate = computed(() => this._userFooterTemplate() ?? this.templateFooter() ?? this._defaultFooterTemplate(), ...(ngDevMode ? [{ debugName: "footerTemplate" }] : []));
17
39
  /**
18
40
  * Types for the dialog templates.
19
41
  */
20
42
  templateTypes = templateTypesFn();
21
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DialogTemplates, deps: [], target: i0.ɵɵFactoryTarget.Component });
22
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "20.0.5", type: DialogTemplates, isStandalone: true, selector: "ng-component", inputs: { templateHeader: { classPropertyName: "templateHeader", publicName: "templateHeader", isSignal: true, isRequired: false, transformFunction: null }, templateFooter: { classPropertyName: "templateFooter", publicName: "templateFooter", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_userHeaderTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "_userFooterTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_defaultHeaderTemplate", first: true, predicate: ["defaultHeaderTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultFooterTemplate", first: true, predicate: ["defaultFooterTemplate"], descendants: true, isSignal: true }], ngImport: i0, template: '', isInline: true });
43
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DialogTemplates, deps: null, target: i0.ɵɵFactoryTarget.Directive });
44
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "21.1.0", type: DialogTemplates, isStandalone: true, inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: false, transformFunction: null }, templateHeader: { classPropertyName: "templateHeader", publicName: "templateHeader", isSignal: true, isRequired: false, transformFunction: null }, templateFooter: { classPropertyName: "templateFooter", publicName: "templateFooter", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "_userContentTemplate", first: true, predicate: ["content"], descendants: true, isSignal: true }, { propertyName: "_userHeaderTemplate", first: true, predicate: ["header"], descendants: true, isSignal: true }, { propertyName: "_userFooterTemplate", first: true, predicate: ["footer"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_defaultHeaderTemplate", first: true, predicate: ["defaultHeaderTemplate"], descendants: true, isSignal: true }, { propertyName: "_defaultFooterTemplate", first: true, predicate: ["defaultFooterTemplate"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0 });
23
45
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: DialogTemplates, decorators: [{
46
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: DialogTemplates, decorators: [{
47
+ type: Directive
48
+ }], propDecorators: { _userContentTemplate: [{ type: i0.ContentChild, args: ['content', { isSignal: true }] }], content: [{ type: i0.Input, args: [{ isSignal: true, alias: "content", required: false }] }], _defaultHeaderTemplate: [{ type: i0.ViewChild, args: ['defaultHeaderTemplate', { isSignal: true }] }], _userHeaderTemplate: [{ type: i0.ContentChild, args: ['header', { isSignal: true }] }], templateHeader: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateHeader", required: false }] }], _defaultFooterTemplate: [{ type: i0.ViewChild, args: ['defaultFooterTemplate', { isSignal: true }] }], _userFooterTemplate: [{ type: i0.ContentChild, args: ['footer', { isSignal: true }] }], templateFooter: [{ type: i0.Input, args: [{ isSignal: true, alias: "templateFooter", required: false }] }] } });
49
+
50
+ class PromptDialogBase {
51
+ ngnPromptDialogResolveFn = input(...(ngDevMode ? [undefined, { debugName: "ngnPromptDialogResolveFn" }] : []));
52
+ constructor() {
53
+ effect(() => {
54
+ const fn = this.ngnPromptDialogResolveFn(); // trigger
55
+ if (fn) {
56
+ this.onDialogButtonClicked(fn.button);
57
+ }
58
+ });
59
+ }
60
+ fulfilPrompt(data) {
61
+ this.ngnPromptDialogResolveFn()?.fn(data ?? null);
62
+ }
63
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PromptDialogBase, deps: [], target: i0.ɵɵFactoryTarget.Component });
64
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.1.0", type: PromptDialogBase, isStandalone: true, selector: "ng-component", inputs: { ngnPromptDialogResolveFn: { classPropertyName: "ngnPromptDialogResolveFn", publicName: "ngnPromptDialogResolveFn", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: '', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
65
+ }
66
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: PromptDialogBase, decorators: [{
25
67
  type: Component,
26
68
  args: [{
69
+ changeDetection: ChangeDetectionStrategy.OnPush,
27
70
  template: '',
28
71
  }]
29
- }] });
72
+ }], ctorParameters: () => [], propDecorators: { ngnPromptDialogResolveFn: [{ type: i0.Input, args: [{ isSignal: true, alias: "ngnPromptDialogResolveFn", required: false }] }] } });
30
73
 
31
- class Dialog extends DialogTemplates {
74
+ /**
75
+ * @category control
76
+ */
77
+ class NgnDialog extends DialogTemplates {
78
+ theme = this.injectThemeTemplate(dialogControlTemplate);
32
79
  headerId = generateElementId();
33
80
  _dialogElement = viewChild.required('dialog');
34
- lazyContent = contentChild('lazy');
35
- open = input(true);
36
- cache = input(false);
37
- modal = input(false);
38
- autofocus = input(this.modal());
39
- title = input(null);
40
- closeOnEscape = input(true);
81
+ /**
82
+ * Shows or hides the dialog.
83
+ *
84
+ * You probably want to react to openChange events from outside to update your variable accordingly.
85
+ */
86
+ open = model(true, ...(ngDevMode ? [{ debugName: "open" }] : []));
87
+ /**
88
+ * When `true`, the content will be loaded lazily when the dialog is opened for the first time.
89
+ * Only applies when using a template for the content.
90
+ */
91
+ lazy = input(false, { ...(ngDevMode ? { debugName: "lazy" } : {}), transform: booleanAttribute });
92
+ /**
93
+ * When {@link lazy} is `true`, setting this to `true` will cache the content after the first load.
94
+ */
95
+ cache = input(false, { ...(ngDevMode ? { debugName: "cache" } : {}), transform: booleanAttribute });
96
+ /**
97
+ * When `true`, the dialog will be shown as a modal dialog making the background content non-interactable.
98
+ * @default false
99
+ */
100
+ modal = input(false, { ...(ngDevMode ? { debugName: "modal" } : {}), transform: booleanAttribute });
101
+ /**
102
+ * When `true`, the dialog will automatically receive focus when opened.
103
+ * @default modal()
104
+ */
105
+ autofocus = input(this.modal(), ...(ngDevMode ? [{ debugName: "autofocus" }] : []));
106
+ /**
107
+ * The title of the dialog. Displayed in the default header template.
108
+ */
109
+ title = input(null, ...(ngDevMode ? [{ debugName: "title" }] : []));
110
+ /**
111
+ * Determines how the dialog can be closed by the user.
112
+ * - `'any'` - The dialog can be closed by clicking outside the dialog or pressing the Escape key.
113
+ * - `'escape'` - The dialog can only be closed by pressing the Escape key.
114
+ * - `'none'` - The dialog cannot be closed by user interaction. It can only be closed programmatically.
115
+ * @default 'any'
116
+ */
117
+ closeBy = input('any', ...(ngDevMode ? [{ debugName: "closeBy" }] : []));
118
+ /**
119
+ * The size of the dialog. You can set any CSS size value (e.g. `300px`, `50%`, `auto`, `min-content`, etc.) for each property.
120
+ */
121
+ size = input({}, ...(ngDevMode ? [{ debugName: "size" }] : []));
122
+ /**
123
+ * Action buttons to be displayed in the footer of the dialog.
124
+ */
125
+ footerButtons = input(...(ngDevMode ? [undefined, { debugName: "footerButtons" }] : []));
126
+ /**
127
+ * Whether the dialog is movable by dragging its header.
128
+ */
129
+ movable = input(false, ...(ngDevMode ? [{ debugName: "movable" }] : []));
130
+ /**
131
+ * Whether the dialog is resizable.
132
+ */
133
+ resizable = input(false, ...(ngDevMode ? [{ debugName: "resizable" }] : []));
134
+ /**
135
+ * The result of the dialog, which is the `value` of the button that was clicked to close the dialog or null.
136
+ */
137
+ buttonClicked = output();
138
+ /**
139
+ * Emits when the dialog has fully closed.
140
+ */
41
141
  closed = output();
142
+ promptResult = output();
143
+ _latestClickedButtonValue = signal(null, ...(ngDevMode ? [{ debugName: "_latestClickedButtonValue" }] : []));
144
+ contentComponentInputs = computed(() => {
145
+ const component = this.typedContent().component;
146
+ if (!component || !(component.prototype instanceof PromptDialogBase)) {
147
+ return {};
148
+ }
149
+ const latestButton = this._latestClickedButtonValue();
150
+ if (latestButton === null) {
151
+ return {};
152
+ }
153
+ return {
154
+ ngnPromptDialogResolveFn: {
155
+ button: latestButton.button,
156
+ fn: (result) => {
157
+ this.promptResult.emit({
158
+ value: result,
159
+ button: latestButton.button,
160
+ });
161
+ this._latestClickedButtonValue.set(null);
162
+ this.open.set(false);
163
+ },
164
+ },
165
+ };
166
+ }, ...(ngDevMode ? [{ debugName: "contentComponentInputs" }] : []));
167
+ /**
168
+ * How a modal dialog can be closed by the user.
169
+ */
170
+ modalClosedBy = computed(() => toModalCloseBy(this.closeBy()), ...(ngDevMode ? [{ debugName: "modalClosedBy" }] : []));
171
+ /**
172
+ * How a popover dialog can be closed by the user.
173
+ */
174
+ popoverClosedBy = computed(() => toPopoverCloseBy(this.closeBy()), ...(ngDevMode ? [{ debugName: "popoverClosedBy" }] : []));
175
+ isFullyClosed = signal(true, ...(ngDevMode ? [{ debugName: "isFullyClosed" }] : []));
176
+ typedContent = computed(() => {
177
+ const content = this.contentTemplate();
178
+ if (!content) {
179
+ return {};
180
+ }
181
+ if (typeof content === 'string') {
182
+ return { string: content };
183
+ }
184
+ else if (content instanceof TemplateRef) {
185
+ return { template: content };
186
+ }
187
+ else {
188
+ return { component: content };
189
+ }
190
+ }, ...(ngDevMode ? [{ debugName: "typedContent" }] : []));
42
191
  constructor() {
43
192
  super();
44
193
  afterRenderEffect(() => {
@@ -47,28 +196,175 @@ class Dialog extends DialogTemplates {
47
196
  this._dialogElement().nativeElement.showModal();
48
197
  }
49
198
  else {
50
- this._dialogElement().nativeElement.show();
199
+ this._dialogElement().nativeElement.showPopover();
51
200
  }
52
201
  }
53
202
  else {
54
203
  this._dialogElement().nativeElement.close();
204
+ this._dialogElement().nativeElement.hidePopover();
55
205
  }
56
206
  });
57
207
  }
58
- onCancel() {
59
- this.closed.emit();
208
+ /**
209
+ * Different cancel handlers for different event types. Required for modal and popover dialogs.
210
+ */
211
+ onCancel(event) {
212
+ if (event instanceof KeyboardEvent) {
213
+ // Modal dialogs handle this on their own
214
+ if (this.modal()) {
215
+ this.cancelPrompt();
216
+ this.setStateToClosed();
217
+ return;
218
+ }
219
+ if (event.key !== 'Escape' || event.target.tagName !== 'DIALOG') {
220
+ // TODO: limitation: when focus is inside a different element, we cannot know if it is safe to close, so we skip it
221
+ return;
222
+ }
223
+ if (this.closeBy() === 'escape') {
224
+ this.setStateToClosed();
225
+ }
226
+ return;
227
+ }
228
+ if (event instanceof ToggleEvent && event.newState !== 'closed') {
229
+ // This is also just for popover dialogs
230
+ return;
231
+ }
232
+ /**
233
+ * In case the dialog is closed with the same click event that tries to open it again immediately,
234
+ * we need to wait for the next animation frame to avoid a stuck state where the outside thinks it's opened
235
+ * but inside `open` is set to false.
236
+ */
237
+ requestAnimationFrame(() => {
238
+ this.setStateToClosed();
239
+ });
240
+ }
241
+ setStateToClosed() {
242
+ this.open.set(false);
243
+ this.cancelPrompt();
244
+ requestAnimationFrame(() => {
245
+ const allAnimationsDone = Promise.all(this.element.nativeElement.getAnimations().map(x => x.finished));
246
+ allAnimationsDone
247
+ .then(() => {
248
+ this.isFullyClosed.set(true);
249
+ this.closed.emit();
250
+ })
251
+ .catch(() => {
252
+ // ignore cancelled animation
253
+ });
254
+ });
60
255
  }
61
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: Dialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
62
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.0.5", type: Dialog, isStandalone: true, selector: "ngn-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, cache: { classPropertyName: "cache", publicName: "cache", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, closeOnEscape: { classPropertyName: "closeOnEscape", publicName: "closeOnEscape", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { closed: "closed" }, queries: [{ propertyName: "lazyContent", first: true, predicate: ["lazy"], descendants: true, isSignal: true }], viewQueries: [{ propertyName: "_dialogElement", first: true, predicate: ["dialog"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!-- eslint-disable @angular-eslint/template/no-autofocus -->\n<dialog\n #dialog\n [attr.closedby]=\"closeOnEscape() ? 'closerequest' : 'none'\"\n [autofocus]=\"autofocus()\"\n [attr.aria-labelledby]=\"headerId\"\n (cancel)=\"onCancel()\"\n>\n <header>\n <ng-template\n [ngTemplateOutlet]=\"headerTemplate()\"\n [ngTemplateOutletContext]=\"{ headerId, title: title() }\"\n ></ng-template>\n </header>\n\n <ngn-lazy-cacher [lazyContent]=\"lazyContent()\" [open]=\"open()\" [cache]=\"cache()\">\n <ng-content />\n </ngn-lazy-cacher>\n\n <footer>\n <ng-template [ngTemplateOutlet]=\"footerTemplate()\"></ng-template>\n </footer>\n</dialog>\n\n<ng-template\n #defaultHeaderTemplate\n [ngnTemplate]=\"templateTypes.header\"\n let-headerId=\"headerId\"\n let-title=\"title\"\n>\n @if (title) {\n <h2 [id]=\"headerId\">{{ title }}</h2>\n }\n</ng-template>\n\n<ng-template #defaultFooterTemplate></ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgnTemplate, selector: "ng-template[ngnTemplate]", inputs: ["ngnTemplate"] }, { kind: "component", type: LazyCacher, selector: "ngn-lazy-cacher", inputs: ["lazyContent", "open", "cache"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
256
+ cancelPrompt() {
257
+ if (this.contentComponentInputs()) {
258
+ this.promptResult.emit({
259
+ value: null,
260
+ button: null,
261
+ });
262
+ this._latestClickedButtonValue.set(null);
263
+ }
264
+ }
265
+ closeWithButton() {
266
+ this.open.set(false);
267
+ this.cancelPrompt();
268
+ }
269
+ /**
270
+ * Opens the dialog. Alternatively, you can also set the `open` input to `true`.
271
+ */
272
+ show() {
273
+ this.open.set(true);
274
+ }
275
+ hide() {
276
+ this.open.set(false);
277
+ }
278
+ toggle() {
279
+ this.open.update(open => !open);
280
+ }
281
+ singleButtonTypeFix(button) {
282
+ return button;
283
+ }
284
+ buttonClick(button) {
285
+ this.buttonClicked.emit(button);
286
+ this._latestClickedButtonValue.set({ button });
287
+ }
288
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgnDialog, deps: [], target: i0.ɵɵFactoryTarget.Component });
289
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: NgnDialog, isStandalone: true, selector: "ngn-dialog", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, lazy: { classPropertyName: "lazy", publicName: "lazy", isSignal: true, isRequired: false, transformFunction: null }, cache: { classPropertyName: "cache", publicName: "cache", isSignal: true, isRequired: false, transformFunction: null }, modal: { classPropertyName: "modal", publicName: "modal", isSignal: true, isRequired: false, transformFunction: null }, autofocus: { classPropertyName: "autofocus", publicName: "autofocus", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, closeBy: { classPropertyName: "closeBy", publicName: "closeBy", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, footerButtons: { classPropertyName: "footerButtons", publicName: "footerButtons", isSignal: true, isRequired: false, transformFunction: null }, movable: { classPropertyName: "movable", publicName: "movable", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", buttonClicked: "buttonClicked", closed: "closed", promptResult: "promptResult" }, providers: [provideSelf(NgnDialog)], viewQueries: [{ propertyName: "_dialogElement", first: true, predicate: ["dialog"], descendants: true, isSignal: true }], usesInheritance: true, ngImport: i0, template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\r\n<dialog\r\n #dialog\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{ root: true, modal: modal() }\"\r\n [attr.closedby]=\"modalClosedBy()\"\r\n [autofocus]=\"autofocus()\"\r\n [attr.aria-labelledby]=\"headerId\"\r\n (cancel)=\"onCancel()\"\r\n (toggle)=\"onCancel($event)\"\r\n (keydown)=\"onCancel($event)\"\r\n [style.minWidth]=\"size().minWidth\"\r\n [style.maxWidth]=\"size().maxWidth\"\r\n [style.width]=\"size().width\"\r\n [style.minHeight]=\"size().minHeight\"\r\n [style.maxHeight]=\"size().maxHeight\"\r\n [ngnMovable]=\"movable()\"\r\n [ngnResizable]=\"resizable()\"\r\n [ngnResizableSizeLimits]=\"{\r\n minWidth: size().minWidth,\r\n minHeight: size().minHeight,\r\n maxWidth: size().maxWidth,\r\n maxHeight: size().maxHeight,\r\n }\"\r\n [ngnMovableDragHandle]=\"header\"\r\n [attr.popover]=\"popoverClosedBy()\"\r\n>\r\n <header #header [ptInt]=\"this\" [ptClass]=\"'header'\">\r\n <ng-template\r\n [ngTemplateOutlet]=\"headerTemplate()\"\r\n [ngTemplateOutletContext]=\"{ headerId, title: title() }\"\r\n ></ng-template>\r\n <button ngnButton [kind]=\"'icon'\" (click)=\"closeWithButton()\" tabindex=\"-1\">\r\n <ngn-icon [defaultIcon]=\"'xmark'\"></ngn-icon>\r\n </button>\r\n </header>\r\n\r\n @if (typedContent().template; as template) {\r\n <ngn-defer\r\n [lazyContent]=\"template\"\r\n [lazy]=\"lazy()\"\r\n [open]=\"open() || !isFullyClosed()\"\r\n [cache]=\"cache()\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'content'\"\r\n />\r\n } @else if (typedContent().string; as string) {\r\n <div [ptInt]=\"this\" [ptClass]=\"'content'\">\r\n {{ string }}\r\n </div>\r\n } @else if (typedContent().component; as component) {\r\n <div [ptInt]=\"this\" [ptClass]=\"'content'\">\r\n <ng-container *ngComponentOutlet=\"component; inputs: contentComponentInputs()\" />\r\n </div>\r\n } @else {\r\n <ng-content />\r\n }\r\n\r\n <footer [ptInt]=\"this\" [ptClass]=\"'footer'\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate()\"></ng-template>\r\n </footer>\r\n</dialog>\r\n\r\n<ng-template\r\n #defaultHeaderTemplate\r\n [ngnTemplate]=\"templateTypes.header\"\r\n let-headerId=\"headerId\"\r\n let-title=\"title\"\r\n>\r\n @if (title) {\r\n <h2 [ptInt]=\"this\" [ptClass]=\"'default-header'\" [id]=\"headerId\">{{ title }}</h2>\r\n } @else {\r\n <div>\r\n <!-- Placeholder for default header content -->\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultFooterTemplate>\r\n <div [ptInt]=\"this\" [ptClass]=\"'default-footer'\">\r\n @for (button of footerButtons(); track $index) {\r\n <ngn-action-button [config]=\"singleButtonTypeFix(button)\" (clicked)=\"buttonClick($event)\" />\r\n }\r\n </div>\r\n</ng-template>\r\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: NgnTemplate, selector: "ng-template[ngnTemplate]", inputs: ["ngnTemplate"] }, { kind: "directive", type: NgnMovable, selector: "[ngnMovable]", inputs: ["ngnMovable", "ngnMovableDragHandle", "ngnMovableChangeCursor", "ngnMovableLimitToViewport"] }, { kind: "component", type: NgnDefer, selector: "ngn-defer", inputs: ["lazyContent", "lazyContentContext", "open", "lazy", "cache", "hiddenOnClosed"] }, { kind: "directive", type: NgnPt, selector: "[ptInt]", inputs: ["ptInt", "ptClass"] }, { kind: "directive", type: NgnButton, selector: "button[ngnButton], a[ngnButton]", inputs: ["inline"] }, { kind: "component", type: NgnActionButton, selector: "ngn-action-button", inputs: ["config"], outputs: ["clicked"] }, { kind: "directive", type: NgComponentOutlet, selector: "[ngComponentOutlet]", inputs: ["ngComponentOutlet", "ngComponentOutletInputs", "ngComponentOutletInjector", "ngComponentOutletEnvironmentInjector", "ngComponentOutletContent", "ngComponentOutletNgModule"], exportAs: ["ngComponentOutlet"] }, { kind: "component", type: NgnIcon, selector: "ngn-icon", inputs: ["defaultIcon", "icon"] }, { kind: "directive", type: NgnResizable, selector: "[ngnResizable]", inputs: ["ngnResizable", "ngnResizableSizeLimits"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
63
290
  }
64
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.0.5", ngImport: i0, type: Dialog, decorators: [{
291
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: NgnDialog, decorators: [{
65
292
  type: Component,
66
- args: [{ selector: 'ngn-dialog', imports: [NgTemplateOutlet, NgnTemplate, LazyCacher], changeDetection: ChangeDetectionStrategy.OnPush, template: "<!-- eslint-disable @angular-eslint/template/no-autofocus -->\n<dialog\n #dialog\n [attr.closedby]=\"closeOnEscape() ? 'closerequest' : 'none'\"\n [autofocus]=\"autofocus()\"\n [attr.aria-labelledby]=\"headerId\"\n (cancel)=\"onCancel()\"\n>\n <header>\n <ng-template\n [ngTemplateOutlet]=\"headerTemplate()\"\n [ngTemplateOutletContext]=\"{ headerId, title: title() }\"\n ></ng-template>\n </header>\n\n <ngn-lazy-cacher [lazyContent]=\"lazyContent()\" [open]=\"open()\" [cache]=\"cache()\">\n <ng-content />\n </ngn-lazy-cacher>\n\n <footer>\n <ng-template [ngTemplateOutlet]=\"footerTemplate()\"></ng-template>\n </footer>\n</dialog>\n\n<ng-template\n #defaultHeaderTemplate\n [ngnTemplate]=\"templateTypes.header\"\n let-headerId=\"headerId\"\n let-title=\"title\"\n>\n @if (title) {\n <h2 [id]=\"headerId\">{{ title }}</h2>\n }\n</ng-template>\n\n<ng-template #defaultFooterTemplate></ng-template>\n" }]
67
- }], ctorParameters: () => [] });
293
+ args: [{ selector: 'ngn-dialog', imports: [
294
+ NgTemplateOutlet,
295
+ NgnTemplate,
296
+ NgnMovable,
297
+ NgnDefer,
298
+ NgnPt,
299
+ NgnButton,
300
+ NgnActionButton,
301
+ NgComponentOutlet,
302
+ NgnIcon,
303
+ NgnResizable,
304
+ ], changeDetection: ChangeDetectionStrategy.OnPush, providers: [provideSelf(NgnDialog)], template: "<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\r\n<dialog\r\n #dialog\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{ root: true, modal: modal() }\"\r\n [attr.closedby]=\"modalClosedBy()\"\r\n [autofocus]=\"autofocus()\"\r\n [attr.aria-labelledby]=\"headerId\"\r\n (cancel)=\"onCancel()\"\r\n (toggle)=\"onCancel($event)\"\r\n (keydown)=\"onCancel($event)\"\r\n [style.minWidth]=\"size().minWidth\"\r\n [style.maxWidth]=\"size().maxWidth\"\r\n [style.width]=\"size().width\"\r\n [style.minHeight]=\"size().minHeight\"\r\n [style.maxHeight]=\"size().maxHeight\"\r\n [ngnMovable]=\"movable()\"\r\n [ngnResizable]=\"resizable()\"\r\n [ngnResizableSizeLimits]=\"{\r\n minWidth: size().minWidth,\r\n minHeight: size().minHeight,\r\n maxWidth: size().maxWidth,\r\n maxHeight: size().maxHeight,\r\n }\"\r\n [ngnMovableDragHandle]=\"header\"\r\n [attr.popover]=\"popoverClosedBy()\"\r\n>\r\n <header #header [ptInt]=\"this\" [ptClass]=\"'header'\">\r\n <ng-template\r\n [ngTemplateOutlet]=\"headerTemplate()\"\r\n [ngTemplateOutletContext]=\"{ headerId, title: title() }\"\r\n ></ng-template>\r\n <button ngnButton [kind]=\"'icon'\" (click)=\"closeWithButton()\" tabindex=\"-1\">\r\n <ngn-icon [defaultIcon]=\"'xmark'\"></ngn-icon>\r\n </button>\r\n </header>\r\n\r\n @if (typedContent().template; as template) {\r\n <ngn-defer\r\n [lazyContent]=\"template\"\r\n [lazy]=\"lazy()\"\r\n [open]=\"open() || !isFullyClosed()\"\r\n [cache]=\"cache()\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'content'\"\r\n />\r\n } @else if (typedContent().string; as string) {\r\n <div [ptInt]=\"this\" [ptClass]=\"'content'\">\r\n {{ string }}\r\n </div>\r\n } @else if (typedContent().component; as component) {\r\n <div [ptInt]=\"this\" [ptClass]=\"'content'\">\r\n <ng-container *ngComponentOutlet=\"component; inputs: contentComponentInputs()\" />\r\n </div>\r\n } @else {\r\n <ng-content />\r\n }\r\n\r\n <footer [ptInt]=\"this\" [ptClass]=\"'footer'\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate()\"></ng-template>\r\n </footer>\r\n</dialog>\r\n\r\n<ng-template\r\n #defaultHeaderTemplate\r\n [ngnTemplate]=\"templateTypes.header\"\r\n let-headerId=\"headerId\"\r\n let-title=\"title\"\r\n>\r\n @if (title) {\r\n <h2 [ptInt]=\"this\" [ptClass]=\"'default-header'\" [id]=\"headerId\">{{ title }}</h2>\r\n } @else {\r\n <div>\r\n <!-- Placeholder for default header content -->\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultFooterTemplate>\r\n <div [ptInt]=\"this\" [ptClass]=\"'default-footer'\">\r\n @for (button of footerButtons(); track $index) {\r\n <ngn-action-button [config]=\"singleButtonTypeFix(button)\" (clicked)=\"buttonClick($event)\" />\r\n }\r\n </div>\r\n</ng-template>\r\n" }]
305
+ }], ctorParameters: () => [], propDecorators: { _dialogElement: [{ type: i0.ViewChild, args: ['dialog', { isSignal: true }] }], open: [{ type: i0.Input, args: [{ isSignal: true, alias: "open", required: false }] }, { type: i0.Output, args: ["openChange"] }], lazy: [{ type: i0.Input, args: [{ isSignal: true, alias: "lazy", required: false }] }], cache: [{ type: i0.Input, args: [{ isSignal: true, alias: "cache", required: false }] }], modal: [{ type: i0.Input, args: [{ isSignal: true, alias: "modal", required: false }] }], autofocus: [{ type: i0.Input, args: [{ isSignal: true, alias: "autofocus", required: false }] }], title: [{ type: i0.Input, args: [{ isSignal: true, alias: "title", required: false }] }], closeBy: [{ type: i0.Input, args: [{ isSignal: true, alias: "closeBy", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], footerButtons: [{ type: i0.Input, args: [{ isSignal: true, alias: "footerButtons", required: false }] }], movable: [{ type: i0.Input, args: [{ isSignal: true, alias: "movable", required: false }] }], resizable: [{ type: i0.Input, args: [{ isSignal: true, alias: "resizable", required: false }] }], buttonClicked: [{ type: i0.Output, args: ["buttonClicked"] }], closed: [{ type: i0.Output, args: ["closed"] }], promptResult: [{ type: i0.Output, args: ["promptResult"] }] } });
306
+
307
+ function applyDialogConfig(dialogRef, config) {
308
+ if (config.title !== undefined) {
309
+ setComponentInput(dialogRef, 'title', config.title);
310
+ }
311
+ if (config.size !== undefined) {
312
+ setComponentInput(dialogRef, 'size', config.size);
313
+ }
314
+ if (config.modal !== undefined) {
315
+ setComponentInput(dialogRef, 'modal', config.modal);
316
+ }
317
+ if (config.footerButtons !== undefined) {
318
+ setComponentInput(dialogRef, 'footerButtons', config.footerButtons);
319
+ }
320
+ if (config.closeBy !== undefined) {
321
+ setComponentInput(dialogRef, 'closeBy', config.closeBy);
322
+ }
323
+ if (config.content !== undefined) {
324
+ setComponentInput(dialogRef, 'content', config.content);
325
+ }
326
+ if (config.movable !== undefined) {
327
+ setComponentInput(dialogRef, 'movable', config.movable);
328
+ }
329
+ if (config.resizable !== undefined) {
330
+ setComponentInput(dialogRef, 'resizable', config.resizable);
331
+ }
332
+ }
333
+ function createDialog(injector, config) {
334
+ const viewContainerRef = injector.get(ViewContainerRef);
335
+ const dialogRef = viewContainerRef.createComponent(NgnDialog, {
336
+ injector,
337
+ });
338
+ applyDialogConfig(dialogRef, config);
339
+ dialogRef.instance.buttonClicked.subscribe(value => {
340
+ buttonClicked.next(value);
341
+ });
342
+ const buttonClicked = new Subject();
343
+ dialogRef.onDestroy(() => {
344
+ buttonClicked.complete();
345
+ });
346
+ if (typeof config.content === 'function' &&
347
+ config.content.prototype instanceof PromptDialogBase) {
348
+ const _result = Promise.withResolvers();
349
+ dialogRef.instance.promptResult.subscribe(result => {
350
+ _result.resolve(result);
351
+ });
352
+ return {
353
+ close: () => dialogRef.destroy(),
354
+ updateConfig: (newConfig) => applyDialogConfig(dialogRef, newConfig),
355
+ result: _result.promise,
356
+ };
357
+ }
358
+ return {
359
+ close: () => dialogRef.destroy(),
360
+ updateConfig: (newConfig) => applyDialogConfig(dialogRef, newConfig),
361
+ buttonClicked: buttonClicked.asObservable(),
362
+ };
363
+ }
68
364
 
69
365
  /**
70
366
  * Generated bundle index. Do not edit.
71
367
  */
72
368
 
73
- export { Dialog };
369
+ export { NgnDialog, PromptDialogBase, createDialog };
74
370
  //# sourceMappingURL=ngneers-controls-dialog.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"ngneers-controls-dialog.mjs","sources":["../../../packages/controls/src/dialog/dialog-templates.ts","../../../packages/controls/src/dialog/dialog.ts","../../../packages/controls/src/dialog/dialog.html","../../../packages/controls/src/dialog/ngneers-controls-dialog.ts"],"sourcesContent":["import { Component, computed, contentChild, input, TemplateRef, viewChild } from '@angular/core';\r\nimport { templateTypesFn } from '@ngneers/controls/api';\r\n\r\n@Component({\r\n template: '',\r\n})\r\nexport abstract class DialogTemplates {\r\n private readonly _defaultHeaderTemplate =\r\n viewChild.required<TemplateRef<unknown>>('defaultHeaderTemplate');\r\n private readonly _userHeaderTemplate = contentChild<TemplateRef<unknown>>('header');\r\n public readonly templateHeader = input<TemplateRef<unknown> | null>(null);\r\n protected readonly headerTemplate = computed(\r\n () => this._userHeaderTemplate() ?? this.templateHeader() ?? this._defaultHeaderTemplate()\r\n );\r\n\r\n private readonly _defaultFooterTemplate =\r\n viewChild.required<TemplateRef<unknown>>('defaultFooterTemplate');\r\n private readonly _userFooterTemplate = contentChild<TemplateRef<unknown>>('footer');\r\n public readonly templateFooter = input<TemplateRef<unknown> | null>(null);\r\n protected readonly footerTemplate = computed(\r\n () => this._userFooterTemplate() ?? this.templateFooter() ?? this._defaultFooterTemplate()\r\n );\r\n\r\n /**\r\n * Types for the dialog templates.\r\n */\r\n public readonly templateTypes = templateTypesFn<{\r\n header: {\r\n headerId: string;\r\n title: string | null;\r\n };\r\n }>();\r\n}\r\n","import { NgTemplateOutlet } from '@angular/common';\nimport {\n afterRenderEffect,\n ChangeDetectionStrategy,\n Component,\n contentChild,\n ElementRef,\n input,\n output,\n TemplateRef,\n untracked,\n viewChild,\n} from '@angular/core';\nimport { NgnTemplate } from '@ngneers/controls/api';\nimport { LazyCacher } from '@ngneers/controls/lazy-cacher';\nimport { generateElementId } from '@ngneers/controls/utils';\n\nimport { DialogTemplates } from './dialog-templates';\n\n@Component({\n selector: 'ngn-dialog',\n imports: [NgTemplateOutlet, NgnTemplate, LazyCacher],\n templateUrl: './dialog.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class Dialog extends DialogTemplates {\n protected readonly headerId = generateElementId();\n\n private readonly _dialogElement = viewChild.required<ElementRef<HTMLDialogElement>>('dialog');\n protected readonly lazyContent = contentChild<TemplateRef<unknown>>('lazy');\n\n public readonly open = input(true);\n public readonly cache = input(false);\n public readonly modal = input(false);\n public readonly autofocus = input(this.modal());\n public readonly title = input<string | null>(null);\n public readonly closeOnEscape = input(true);\n\n public readonly closed = output<void>();\n\n constructor() {\n super();\n afterRenderEffect(() => {\n if (this.open()) {\n if (untracked(this.modal)) {\n this._dialogElement().nativeElement.showModal();\n } else {\n this._dialogElement().nativeElement.show();\n }\n } else {\n this._dialogElement().nativeElement.close();\n }\n });\n }\n\n protected onCancel() {\n this.closed.emit();\n }\n}\n","<!-- eslint-disable @angular-eslint/template/no-autofocus -->\n<dialog\n #dialog\n [attr.closedby]=\"closeOnEscape() ? 'closerequest' : 'none'\"\n [autofocus]=\"autofocus()\"\n [attr.aria-labelledby]=\"headerId\"\n (cancel)=\"onCancel()\"\n>\n <header>\n <ng-template\n [ngTemplateOutlet]=\"headerTemplate()\"\n [ngTemplateOutletContext]=\"{ headerId, title: title() }\"\n ></ng-template>\n </header>\n\n <ngn-lazy-cacher [lazyContent]=\"lazyContent()\" [open]=\"open()\" [cache]=\"cache()\">\n <ng-content />\n </ngn-lazy-cacher>\n\n <footer>\n <ng-template [ngTemplateOutlet]=\"footerTemplate()\"></ng-template>\n </footer>\n</dialog>\n\n<ng-template\n #defaultHeaderTemplate\n [ngnTemplate]=\"templateTypes.header\"\n let-headerId=\"headerId\"\n let-title=\"title\"\n>\n @if (title) {\n <h2 [id]=\"headerId\">{{ title }}</h2>\n }\n</ng-template>\n\n<ng-template #defaultFooterTemplate></ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;MAMsB,eAAe,CAAA;AAClB,IAAA,sBAAsB,GACrC,SAAS,CAAC,QAAQ,CAAuB,uBAAuB,CAAC;AAClD,IAAA,mBAAmB,GAAG,YAAY,CAAuB,QAAQ,CAAC;AACnE,IAAA,cAAc,GAAG,KAAK,CAA8B,IAAI,CAAC;IACtD,cAAc,GAAG,QAAQ,CAC1C,MAAM,IAAI,CAAC,mBAAmB,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,sBAAsB,EAAE,CAC3F;AAEgB,IAAA,sBAAsB,GACrC,SAAS,CAAC,QAAQ,CAAuB,uBAAuB,CAAC;AAClD,IAAA,mBAAmB,GAAG,YAAY,CAAuB,Q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,EAAA,o7BAAA,EAAA;;;AEvBjD;;AAEG;;;;"}
1
+ {"version":3,"file":"ngneers-controls-dialog.mjs","sources":["../../src/dialog/dialog-templates.ts","../../src/dialog/prompt-dialog-base.ts","../../src/dialog/dialog.ts","../../src/dialog/dialog.html","../../src/dialog/create-dialog.ts","../../src/dialog/ngneers-controls-dialog.ts"],"sourcesContent":["import {\r\n computed,\r\n contentChild,\r\n Directive,\r\n input,\r\n TemplateRef,\r\n Type,\r\n viewChild,\r\n} from '@angular/core';\r\nimport { templateTypesFn } from '@ngneers/controls/api/ng';\r\nimport { NgnBase } from '@ngneers/controls/base';\r\n\r\n@Directive()\r\nexport abstract class DialogTemplates<T> extends NgnBase<'dialog'> {\r\n private readonly _userContentTemplate = contentChild<TemplateRef<unknown>>('content');\r\n /**\r\n * The content of the dialog.\r\n * Can be a string, a component type, or a template reference.\r\n * Can also be set using an `<ng-template>` element with `#content` template reference variable.\r\n */\r\n public readonly content = input<TemplateRef<unknown> | null | Type<T> | string>(null);\r\n protected readonly contentTemplate = computed(\r\n () => this._userContentTemplate() ?? this.content()\r\n );\r\n\r\n private readonly _defaultHeaderTemplate =\r\n viewChild.required<TemplateRef<unknown>>('defaultHeaderTemplate');\r\n private readonly _userHeaderTemplate = contentChild<TemplateRef<unknown>>('header');\r\n /**\r\n * Set a custom template for the header of the dialog.\r\n * Can also be set using an `<ng-template>` element with `#header` template reference variable.\r\n */\r\n public readonly templateHeader = input<TemplateRef<unknown> | null>(null);\r\n protected readonly headerTemplate = computed(\r\n () => this._userHeaderTemplate() ?? this.templateHeader() ?? this._defaultHeaderTemplate()\r\n );\r\n\r\n private readonly _defaultFooterTemplate =\r\n viewChild.required<TemplateRef<unknown>>('defaultFooterTemplate');\r\n private readonly _userFooterTemplate = contentChild<TemplateRef<unknown>>('footer');\r\n /**\r\n * Set a custom template for the footer of the dialog.\r\n * Can also be set using an `<ng-template>` element with `#footer` template reference variable.\r\n */\r\n public readonly templateFooter = input<TemplateRef<unknown> | null>(null);\r\n protected readonly footerTemplate = computed(\r\n () => this._userFooterTemplate() ?? this.templateFooter() ?? this._defaultFooterTemplate()\r\n );\r\n\r\n /**\r\n * Types for the dialog templates.\r\n */\r\n public readonly templateTypes = templateTypesFn<{\r\n header: {\r\n headerId: string;\r\n title: string | null;\r\n };\r\n }>();\r\n}\r\n","import { Component, effect, input, ChangeDetectionStrategy } from '@angular/core';\r\n\r\n@Component({\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n template: '',\r\n})\r\nexport abstract class PromptDialogBase<D, ButtonValues> {\r\n public readonly ngnPromptDialogResolveFn = input<{\r\n fn: (value: D | null) => void;\r\n button: ButtonValues;\r\n }>();\r\n\r\n constructor() {\r\n effect(() => {\r\n const fn = this.ngnPromptDialogResolveFn(); // trigger\r\n if (fn) {\r\n this.onDialogButtonClicked(fn.button);\r\n }\r\n });\r\n }\r\n\r\n protected fulfilPrompt(data?: D) {\r\n this.ngnPromptDialogResolveFn()?.fn(data ?? null);\r\n }\r\n\r\n protected abstract onDialogButtonClicked(button: ButtonValues): void;\r\n}\r\n","import { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';\r\nimport {\r\n afterRenderEffect,\r\n booleanAttribute,\r\n ChangeDetectionStrategy,\r\n Component,\r\n computed,\r\n ElementRef,\r\n input,\r\n model,\r\n output,\r\n signal,\r\n TemplateRef,\r\n Type,\r\n untracked,\r\n viewChild,\r\n} from '@angular/core';\r\nimport {\r\n type CloseBy,\r\n toModalCloseBy,\r\n toPopoverCloseBy,\r\n NgnTemplate,\r\n type Openable,\r\n} from '@ngneers/controls/api/ng';\r\nimport { NgnPt, provideSelf } from '@ngneers/controls/base';\r\nimport { NgnActionButton, NgnButton } from '@ngneers/controls/button';\r\nimport { NgnDefer } from '@ngneers/controls/defer';\r\nimport { NgnMovable, NgnResizable } from '@ngneers/controls/directives';\r\nimport { NgnIcon } from '@ngneers/controls/icon';\r\nimport { generateElementId } from '@ngneers/controls/utils-ng';\r\nimport { dialogControlTemplate } from '@ngneers/controls-themes/templates/dialog';\r\n\r\nimport { DialogTemplates } from './dialog-templates';\r\nimport { PromptDialogBase } from './prompt-dialog-base';\r\n\r\nimport type { DialogSize } from './types';\r\nimport type { NgnActionButtonConfig } from '@ngneers/controls/api';\r\n\r\ntype TypedContent = {\r\n template?: TemplateRef<unknown>;\r\n string?: string;\r\n component?: Type<unknown>;\r\n};\r\n\r\n/**\r\n * @category control\r\n */\r\n@Component({\r\n selector: 'ngn-dialog',\r\n imports: [\r\n NgTemplateOutlet,\r\n NgnTemplate,\r\n NgnMovable,\r\n NgnDefer,\r\n NgnPt,\r\n NgnButton,\r\n NgnActionButton,\r\n NgComponentOutlet,\r\n NgnIcon,\r\n NgnResizable,\r\n ],\r\n templateUrl: './dialog.html',\r\n changeDetection: ChangeDetectionStrategy.OnPush,\r\n providers: [provideSelf(NgnDialog)],\r\n})\r\nexport class NgnDialog<\r\n T,\r\n Buttons extends NgnActionButtonConfig<T extends PromptDialogBase<any, infer B> ? B : unknown>[],\r\n>\r\n extends DialogTemplates<T>\r\n implements Openable\r\n{\r\n protected readonly theme = this.injectThemeTemplate(dialogControlTemplate);\r\n protected readonly headerId = generateElementId();\r\n\r\n private readonly _dialogElement = viewChild.required<ElementRef<HTMLDialogElement>>('dialog');\r\n /**\r\n * Shows or hides the dialog.\r\n *\r\n * You probably want to react to openChange events from outside to update your variable accordingly.\r\n */\r\n public readonly open = model(true);\r\n /**\r\n * When `true`, the content will be loaded lazily when the dialog is opened for the first time.\r\n * Only applies when using a template for the content.\r\n */\r\n public readonly lazy = input(false, { transform: booleanAttribute });\r\n /**\r\n * When {@link lazy} is `true`, setting this to `true` will cache the content after the first load.\r\n */\r\n public readonly cache = input(false, { transform: booleanAttribute });\r\n /**\r\n * When `true`, the dialog will be shown as a modal dialog making the background content non-interactable.\r\n * @default false\r\n */\r\n public readonly modal = input(false, { transform: booleanAttribute });\r\n /**\r\n * When `true`, the dialog will automatically receive focus when opened.\r\n * @default modal()\r\n */\r\n public readonly autofocus = input(this.modal());\r\n /**\r\n * The title of the dialog. Displayed in the default header template.\r\n */\r\n public readonly title = input<string | null | undefined>(null);\r\n /**\r\n * Determines how the dialog can be closed by the user.\r\n * - `'any'` - The dialog can be closed by clicking outside the dialog or pressing the Escape key.\r\n * - `'escape'` - The dialog can only be closed by pressing the Escape key.\r\n * - `'none'` - The dialog cannot be closed by user interaction. It can only be closed programmatically.\r\n * @default 'any'\r\n */\r\n public readonly closeBy = input<CloseBy>('any');\r\n /**\r\n * The size of the dialog. You can set any CSS size value (e.g. `300px`, `50%`, `auto`, `min-content`, etc.) for each property.\r\n */\r\n public readonly size = input<DialogSize>({});\r\n /**\r\n * Action buttons to be displayed in the footer of the dialog.\r\n */\r\n public readonly footerButtons = input<Buttons>();\r\n /**\r\n * Whether the dialog is movable by dragging its header.\r\n */\r\n public readonly movable = input<boolean | null | undefined | ''>(false);\r\n /**\r\n * Whether the dialog is resizable.\r\n */\r\n public readonly resizable = input<boolean | null | undefined | ''>(false);\r\n /**\r\n * The result of the dialog, which is the `value` of the button that was clicked to close the dialog or null.\r\n */\r\n public readonly buttonClicked = output<Buttons[number]['value'] | null>();\r\n /**\r\n * Emits when the dialog has fully closed.\r\n */\r\n public readonly closed = output();\r\n\r\n public readonly promptResult = output<{\r\n value: (T extends PromptDialogBase<infer D, Buttons[number]['value']> ? D : never) | null;\r\n button: Buttons[number]['value'] | null;\r\n }>();\r\n\r\n private readonly _latestClickedButtonValue = signal<{ button: Buttons[number]['value'] } | null>(\r\n null\r\n );\r\n\r\n protected readonly contentComponentInputs = computed(() => {\r\n const component = this.typedContent().component;\r\n if (!component || !(component.prototype instanceof PromptDialogBase)) {\r\n return {};\r\n }\r\n const latestButton = this._latestClickedButtonValue();\r\n if (latestButton === null) {\r\n return {};\r\n }\r\n return {\r\n ngnPromptDialogResolveFn: {\r\n button: latestButton.button,\r\n fn: (result: T extends PromptDialogBase<infer D, Buttons[number]['value']> ? D : never) => {\r\n this.promptResult.emit({\r\n value: result,\r\n button: latestButton.button,\r\n });\r\n this._latestClickedButtonValue.set(null);\r\n this.open.set(false);\r\n },\r\n },\r\n };\r\n });\r\n\r\n /**\r\n * How a modal dialog can be closed by the user.\r\n */\r\n protected readonly modalClosedBy = computed(() => toModalCloseBy(this.closeBy()));\r\n /**\r\n * How a popover dialog can be closed by the user.\r\n */\r\n protected readonly popoverClosedBy = computed(() => toPopoverCloseBy(this.closeBy()));\r\n protected readonly isFullyClosed = signal(true);\r\n\r\n protected readonly typedContent = computed<TypedContent>(() => {\r\n const content = this.contentTemplate();\r\n if (!content) {\r\n return {};\r\n }\r\n if (typeof content === 'string') {\r\n return { string: content };\r\n } else if (content instanceof TemplateRef) {\r\n return { template: content };\r\n } else {\r\n return { component: content };\r\n }\r\n });\r\n\r\n constructor() {\r\n super();\r\n afterRenderEffect(() => {\r\n if (this.open()) {\r\n if (untracked(this.modal)) {\r\n this._dialogElement().nativeElement.showModal();\r\n } else {\r\n this._dialogElement().nativeElement.showPopover();\r\n }\r\n } else {\r\n this._dialogElement().nativeElement.close();\r\n this._dialogElement().nativeElement.hidePopover();\r\n }\r\n });\r\n }\r\n\r\n /**\r\n * Different cancel handlers for different event types. Required for modal and popover dialogs.\r\n */\r\n protected onCancel(event?: ToggleEvent | KeyboardEvent): void {\r\n if (event instanceof KeyboardEvent) {\r\n // Modal dialogs handle this on their own\r\n if (this.modal()) {\r\n this.cancelPrompt();\r\n this.setStateToClosed();\r\n return;\r\n }\r\n if (event.key !== 'Escape' || (event.target as HTMLElement).tagName !== 'DIALOG') {\r\n // TODO: limitation: when focus is inside a different element, we cannot know if it is safe to close, so we skip it\r\n return;\r\n }\r\n if (this.closeBy() === 'escape') {\r\n this.setStateToClosed();\r\n }\r\n return;\r\n }\r\n\r\n if (event instanceof ToggleEvent && event.newState !== 'closed') {\r\n // This is also just for popover dialogs\r\n return;\r\n }\r\n /**\r\n * In case the dialog is closed with the same click event that tries to open it again immediately,\r\n * we need to wait for the next animation frame to avoid a stuck state where the outside thinks it's opened\r\n * but inside `open` is set to false.\r\n */\r\n requestAnimationFrame(() => {\r\n this.setStateToClosed();\r\n });\r\n }\r\n\r\n private setStateToClosed() {\r\n this.open.set(false);\r\n this.cancelPrompt();\r\n requestAnimationFrame(() => {\r\n const allAnimationsDone = Promise.all(\r\n this.element.nativeElement.getAnimations().map(x => x.finished)\r\n );\r\n allAnimationsDone\r\n .then(() => {\r\n this.isFullyClosed.set(true);\r\n this.closed.emit();\r\n })\r\n .catch(() => {\r\n // ignore cancelled animation\r\n });\r\n });\r\n }\r\n\r\n private cancelPrompt() {\r\n if (this.contentComponentInputs()) {\r\n this.promptResult.emit({\r\n value: null,\r\n button: null,\r\n });\r\n this._latestClickedButtonValue.set(null);\r\n }\r\n }\r\n\r\n protected closeWithButton() {\r\n this.open.set(false);\r\n this.cancelPrompt();\r\n }\r\n\r\n /**\r\n * Opens the dialog. Alternatively, you can also set the `open` input to `true`.\r\n */\r\n public show(): void {\r\n this.open.set(true);\r\n }\r\n public hide(): void {\r\n this.open.set(false);\r\n }\r\n public toggle(): void {\r\n this.open.update(open => !open);\r\n }\r\n\r\n protected singleButtonTypeFix(button: unknown): Buttons[number] {\r\n return button as Buttons[number];\r\n }\r\n\r\n protected buttonClick(button: Buttons[number]['value']): void {\r\n this.buttonClicked.emit(button);\r\n this._latestClickedButtonValue.set({ button });\r\n }\r\n}\r\n","<!-- eslint-disable-next-line @angular-eslint/template/interactive-supports-focus -->\r\n<dialog\r\n #dialog\r\n [ptInt]=\"this\"\r\n [ptClass]=\"{ root: true, modal: modal() }\"\r\n [attr.closedby]=\"modalClosedBy()\"\r\n [autofocus]=\"autofocus()\"\r\n [attr.aria-labelledby]=\"headerId\"\r\n (cancel)=\"onCancel()\"\r\n (toggle)=\"onCancel($event)\"\r\n (keydown)=\"onCancel($event)\"\r\n [style.minWidth]=\"size().minWidth\"\r\n [style.maxWidth]=\"size().maxWidth\"\r\n [style.width]=\"size().width\"\r\n [style.minHeight]=\"size().minHeight\"\r\n [style.maxHeight]=\"size().maxHeight\"\r\n [ngnMovable]=\"movable()\"\r\n [ngnResizable]=\"resizable()\"\r\n [ngnResizableSizeLimits]=\"{\r\n minWidth: size().minWidth,\r\n minHeight: size().minHeight,\r\n maxWidth: size().maxWidth,\r\n maxHeight: size().maxHeight,\r\n }\"\r\n [ngnMovableDragHandle]=\"header\"\r\n [attr.popover]=\"popoverClosedBy()\"\r\n>\r\n <header #header [ptInt]=\"this\" [ptClass]=\"'header'\">\r\n <ng-template\r\n [ngTemplateOutlet]=\"headerTemplate()\"\r\n [ngTemplateOutletContext]=\"{ headerId, title: title() }\"\r\n ></ng-template>\r\n <button ngnButton [kind]=\"'icon'\" (click)=\"closeWithButton()\" tabindex=\"-1\">\r\n <ngn-icon [defaultIcon]=\"'xmark'\"></ngn-icon>\r\n </button>\r\n </header>\r\n\r\n @if (typedContent().template; as template) {\r\n <ngn-defer\r\n [lazyContent]=\"template\"\r\n [lazy]=\"lazy()\"\r\n [open]=\"open() || !isFullyClosed()\"\r\n [cache]=\"cache()\"\r\n [ptInt]=\"this\"\r\n [ptClass]=\"'content'\"\r\n />\r\n } @else if (typedContent().string; as string) {\r\n <div [ptInt]=\"this\" [ptClass]=\"'content'\">\r\n {{ string }}\r\n </div>\r\n } @else if (typedContent().component; as component) {\r\n <div [ptInt]=\"this\" [ptClass]=\"'content'\">\r\n <ng-container *ngComponentOutlet=\"component; inputs: contentComponentInputs()\" />\r\n </div>\r\n } @else {\r\n <ng-content />\r\n }\r\n\r\n <footer [ptInt]=\"this\" [ptClass]=\"'footer'\">\r\n <ng-template [ngTemplateOutlet]=\"footerTemplate()\"></ng-template>\r\n </footer>\r\n</dialog>\r\n\r\n<ng-template\r\n #defaultHeaderTemplate\r\n [ngnTemplate]=\"templateTypes.header\"\r\n let-headerId=\"headerId\"\r\n let-title=\"title\"\r\n>\r\n @if (title) {\r\n <h2 [ptInt]=\"this\" [ptClass]=\"'default-header'\" [id]=\"headerId\">{{ title }}</h2>\r\n } @else {\r\n <div>\r\n <!-- Placeholder for default header content -->\r\n </div>\r\n }\r\n</ng-template>\r\n\r\n<ng-template #defaultFooterTemplate>\r\n <div [ptInt]=\"this\" [ptClass]=\"'default-footer'\">\r\n @for (button of footerButtons(); track $index) {\r\n <ngn-action-button [config]=\"singleButtonTypeFix(button)\" (clicked)=\"buttonClick($event)\" />\r\n }\r\n </div>\r\n</ng-template>\r\n","import { ComponentRef, Injector, ViewContainerRef } from '@angular/core';\r\nimport { setComponentInput } from '@ngneers/controls/api/ng';\r\nimport { Observable, Subject } from 'rxjs';\r\n\r\nimport { NgnDialog } from './dialog';\r\nimport { PromptDialogBase } from './prompt-dialog-base';\r\n\r\nimport type { DialogConfig } from './types';\r\nimport type { NgnActionButtonConfig } from '@ngneers/controls/api';\r\n\r\nexport type DialogHandle<\r\n T,\r\n Buttons extends NgnActionButtonConfig<T extends PromptDialogBase<any, infer B> ? B : unknown>[],\r\n> = {\r\n close: () => void;\r\n updateConfig: (config: Partial<DialogConfig<T, Buttons>>) => void;\r\n buttonClicked: Observable<Buttons[number]['value'] | null>;\r\n};\r\n\r\nexport type PromptDialogHandle<\r\n T,\r\n Buttons extends NgnActionButtonConfig<T extends PromptDialogBase<any, infer B> ? B : unknown>[],\r\n> = {\r\n close: () => void;\r\n updateConfig: (config: Partial<DialogConfig<T, Buttons>>) => void;\r\n result: Promise<{\r\n value: T extends PromptDialogBase<infer D, Buttons> ? D : never | null;\r\n button: Buttons[number]['value'] | null;\r\n }>;\r\n};\r\n\r\nfunction applyDialogConfig<\r\n T,\r\n Buttons extends NgnActionButtonConfig<T extends PromptDialogBase<any, infer B> ? B : unknown>[],\r\n>(dialogRef: ComponentRef<NgnDialog<T, Buttons>>, config: DialogConfig<T, Buttons>): void {\r\n if (config.title !== undefined) {\r\n setComponentInput(dialogRef, 'title', config.title);\r\n }\r\n if (config.size !== undefined) {\r\n setComponentInput(dialogRef, 'size', config.size);\r\n }\r\n if (config.modal !== undefined) {\r\n setComponentInput(dialogRef, 'modal', config.modal);\r\n }\r\n if (config.footerButtons !== undefined) {\r\n setComponentInput(dialogRef, 'footerButtons', config.footerButtons);\r\n }\r\n if (config.closeBy !== undefined) {\r\n setComponentInput(dialogRef, 'closeBy', config.closeBy);\r\n }\r\n if (config.content !== undefined) {\r\n setComponentInput(dialogRef, 'content', config.content);\r\n }\r\n if (config.movable !== undefined) {\r\n setComponentInput(dialogRef, 'movable', config.movable);\r\n }\r\n if (config.resizable !== undefined) {\r\n setComponentInput(dialogRef, 'resizable', config.resizable);\r\n }\r\n}\r\n\r\nexport function createDialog<\r\n T,\r\n Buttons extends NgnActionButtonConfig<T extends PromptDialogBase<any, infer B> ? B : unknown>[],\r\n>(\r\n injector: Injector,\r\n config: DialogConfig<T, Buttons>\r\n): T extends PromptDialogBase<any, any>\r\n ? PromptDialogHandle<T, Buttons>\r\n : DialogHandle<T, Buttons> {\r\n type ButtonValues = Buttons[number]['value'];\r\n\r\n const viewContainerRef = injector.get(ViewContainerRef);\r\n const dialogRef = viewContainerRef.createComponent(NgnDialog, {\r\n injector,\r\n }) as unknown as ComponentRef<NgnDialog<T, Buttons>>;\r\n\r\n applyDialogConfig(dialogRef, config);\r\n dialogRef.instance.buttonClicked.subscribe(value => {\r\n buttonClicked.next(value);\r\n });\r\n\r\n const buttonClicked = new Subject<ButtonValues | null>();\r\n dialogRef.onDestroy(() => {\r\n buttonClicked.complete();\r\n });\r\n\r\n if (\r\n typeof config.content === 'function' &&\r\n config.content.prototype instanceof PromptDialogBase\r\n ) {\r\n const _result = Promise.withResolvers<{\r\n value: (T extends PromptDialogBase<infer D, ButtonValues> ? D : never) | null;\r\n button: ButtonValues | null;\r\n }>();\r\n\r\n (dialogRef.instance as unknown as NgnDialog<T, Buttons>).promptResult.subscribe(result => {\r\n _result.resolve(result);\r\n });\r\n\r\n return {\r\n close: () => dialogRef.destroy(),\r\n updateConfig: (newConfig: Partial<DialogConfig<T, Buttons>>) =>\r\n applyDialogConfig(dialogRef, newConfig),\r\n result: _result.promise,\r\n } as T extends PromptDialogBase<any, any>\r\n ? PromptDialogHandle<T, Buttons>\r\n : DialogHandle<T, Buttons>;\r\n }\r\n\r\n return {\r\n close: () => dialogRef.destroy(),\r\n updateConfig: (newConfig: Partial<DialogConfig<T, Buttons>>) =>\r\n applyDialogConfig(dialogRef, newConfig),\r\n buttonClicked: buttonClicked.asObservable(),\r\n } as T extends PromptDialogBase<any, any>\r\n ? PromptDialogHandle<T, Buttons>\r\n : DialogHandle<T, Buttons>;\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;AAaM,MAAgB,eAAmB,SAAQ,OAAiB,CAAA;AAC/C,IAAA,oBAAoB,GAAG,YAAY,CAAuB,SAAS,gEAAC;AACrF;;;;AAIG;AACa,IAAA,OAAO,GAAG,KAAK,CAAiD,IAAI,mDAAC;AAClE,IAAA,eAAe,GAAG,QAAQ,CAC3C,MAAM,IAAI,CAAC,oBAAoB,EAAE,IAAI,IAAI,CAAC,OAAO,EAAE,2DACpD;AAEgB,IAAA,sBAAsB,GACrC,SAAS,CAAC,QAAQ,CAAuB,uBAAuB,CAAC;AAClD,IAAA,mBAAmB,GAAG,YAAY,CAAuB,QAAQ,+DAAC;AACnF;;;AAGG;AACa,IAAA,cAAc,GAAG,KAAK,CAA8B,IAAI,0DAAC;IACtD,cAAc,GAAG,QAAQ,CAC1C,MAAM,IAAI,CAAC,mBAAmB,EAAE,IAAI,IAAI,CAAC,cAAc,EAAE,IAAI,IAAI,CAAC,sBAAsB,EAAE,EAAA,IAAA,SAAA,GAAA,CAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,CAAA,GAAA,EAAA,CAAA,CAC3F;AAEgB,IAAA,sBAAsB,GACrC,SAAS,CAAC,QAAQ,CAAuB,uBAAuB,CAAC;AAClD,IAAA,mBAAmB,GAAG,YAAY,CAAuB,QAAQ,+DAAC;AACnF;;;AAGG;AACa,IAAA,cAAc,GAA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