@ng-doc/app 15.1.1 → 15.3.1

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 (201) hide show
  1. package/classes/index.d.ts +0 -1
  2. package/classes/root-page/root-page.d.ts +20 -5
  3. package/components/api-list/api-list.component.d.ts +0 -3
  4. package/components/demo/demo.component.d.ts +2 -2
  5. package/components/demo-displayer/demo-displayer.module.d.ts +2 -1
  6. package/components/index.d.ts +1 -0
  7. package/components/navbar/navbar.component.d.ts +18 -0
  8. package/components/navbar/navbar.module.d.ts +1 -1
  9. package/components/page/page.module.d.ts +2 -1
  10. package/components/playground/base-playground.d.ts +15 -0
  11. package/components/playground/index.d.ts +5 -0
  12. package/components/playground/playground-demo/playground-demo.component.d.ts +33 -0
  13. package/components/playground/playground-form.d.ts +6 -0
  14. package/components/playground/playground-properties/playground-properties.component.d.ts +22 -0
  15. package/components/{playground-property → playground/playground-property}/playground-property.component.d.ts +2 -2
  16. package/components/playground/playground.component.d.ts +5 -4
  17. package/components/playground/playground.module.d.ts +9 -6
  18. package/components/root/root.component.d.ts +35 -1
  19. package/components/root/root.module.d.ts +1 -1
  20. package/components/sidebar/sidebar-category/sidebar-category.component.d.ts +2 -2
  21. package/esm2020/classes/index.mjs +1 -2
  22. package/esm2020/classes/root-page/root-page.mjs +4 -1
  23. package/esm2020/components/api-list/api-list.component.mjs +2 -2
  24. package/esm2020/components/code/code.component.mjs +2 -2
  25. package/esm2020/components/demo/demo.component.mjs +2 -2
  26. package/esm2020/components/demo-displayer/demo-displayer.component.mjs +4 -3
  27. package/esm2020/components/demo-displayer/demo-displayer.module.mjs +7 -3
  28. package/esm2020/components/index.mjs +2 -1
  29. package/esm2020/components/navbar/navbar.component.mjs +21 -3
  30. package/esm2020/components/navbar/navbar.module.mjs +2 -5
  31. package/esm2020/components/page/page.component.mjs +3 -3
  32. package/esm2020/components/page/page.module.mjs +23 -4
  33. package/esm2020/components/playground/base-playground.mjs +18 -0
  34. package/esm2020/components/playground/index.mjs +6 -1
  35. package/esm2020/components/playground/playground-demo/playground-demo.component.mjs +116 -0
  36. package/esm2020/components/playground/playground-form.mjs +2 -0
  37. package/esm2020/components/playground/playground-properties/playground-properties.component.mjs +42 -0
  38. package/esm2020/components/playground/playground-property/playground-property.component.mjs +89 -0
  39. package/esm2020/components/playground/playground.component.mjs +13 -11
  40. package/esm2020/components/playground/playground.module.mjs +41 -14
  41. package/esm2020/components/root/root.component.mjs +50 -4
  42. package/esm2020/components/root/root.module.mjs +5 -5
  43. package/esm2020/components/sidebar/sidebar-category/sidebar-category.component.mjs +3 -3
  44. package/esm2020/components/sidebar/sidebar.component.mjs +2 -2
  45. package/esm2020/components/toc/toc.component.mjs +2 -2
  46. package/esm2020/helpers/format-html/format-html.mjs +12 -10
  47. package/esm2020/helpers/generate-toc/generate-toc.mjs +2 -10
  48. package/esm2020/helpers/index.mjs +2 -2
  49. package/esm2020/helpers/provide-playground-demo/index.mjs +2 -0
  50. package/esm2020/helpers/provide-playground-demo/ng-doc-app-helpers-provide-playground-demo.mjs +5 -0
  51. package/esm2020/helpers/provide-playground-demo/provide-playground-demo.mjs +30 -0
  52. package/esm2020/index.mjs +2 -1
  53. package/esm2020/interfaces/context.mjs +1 -1
  54. package/esm2020/interfaces/index.mjs +1 -2
  55. package/esm2020/interfaces/navigation.mjs +1 -1
  56. package/esm2020/interfaces/type-control-provider-options.mjs +1 -1
  57. package/esm2020/processors/tooltip-processor/tooltip-wrapper.component.mjs +3 -3
  58. package/esm2020/services/sidebar/sidebar.service.mjs +49 -8
  59. package/fesm2015/ng-doc-app-classes-root-page.mjs +3 -0
  60. package/fesm2015/ng-doc-app-classes-root-page.mjs.map +1 -1
  61. package/fesm2015/ng-doc-app-classes.mjs +0 -1
  62. package/fesm2015/ng-doc-app-classes.mjs.map +1 -1
  63. package/fesm2015/ng-doc-app-components-api-list.mjs +1 -1
  64. package/fesm2015/ng-doc-app-components-api-list.mjs.map +1 -1
  65. package/fesm2015/ng-doc-app-components-code.mjs +1 -1
  66. package/fesm2015/ng-doc-app-components-code.mjs.map +1 -1
  67. package/fesm2015/ng-doc-app-components-demo-displayer.mjs +9 -4
  68. package/fesm2015/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  69. package/fesm2015/ng-doc-app-components-demo.mjs +2 -1
  70. package/fesm2015/ng-doc-app-components-demo.mjs.map +1 -1
  71. package/fesm2015/ng-doc-app-components-navbar.mjs +21 -6
  72. package/fesm2015/ng-doc-app-components-navbar.mjs.map +1 -1
  73. package/fesm2015/ng-doc-app-components-page.mjs +24 -5
  74. package/fesm2015/ng-doc-app-components-page.mjs.map +1 -1
  75. package/fesm2015/ng-doc-app-components-playground.mjs +306 -30
  76. package/fesm2015/ng-doc-app-components-playground.mjs.map +1 -1
  77. package/fesm2015/ng-doc-app-components-root.mjs +53 -7
  78. package/fesm2015/ng-doc-app-components-root.mjs.map +1 -1
  79. package/fesm2015/ng-doc-app-components-sidebar.mjs +4 -4
  80. package/fesm2015/ng-doc-app-components-sidebar.mjs.map +1 -1
  81. package/fesm2015/ng-doc-app-components-toc.mjs +2 -2
  82. package/fesm2015/ng-doc-app-components-toc.mjs.map +1 -1
  83. package/fesm2015/ng-doc-app-components.mjs +1 -0
  84. package/fesm2015/ng-doc-app-components.mjs.map +1 -1
  85. package/fesm2015/ng-doc-app-helpers-format-html.mjs +12 -9
  86. package/fesm2015/ng-doc-app-helpers-format-html.mjs.map +1 -1
  87. package/fesm2015/ng-doc-app-helpers-generate-toc.mjs +1 -9
  88. package/fesm2015/ng-doc-app-helpers-generate-toc.mjs.map +1 -1
  89. package/fesm2015/ng-doc-app-helpers-provide-playground-demo.mjs +37 -0
  90. package/fesm2015/ng-doc-app-helpers-provide-playground-demo.mjs.map +1 -0
  91. package/fesm2015/ng-doc-app-helpers.mjs +1 -1
  92. package/fesm2015/ng-doc-app-processors-tooltip-processor.mjs +2 -2
  93. package/fesm2015/ng-doc-app-processors-tooltip-processor.mjs.map +1 -1
  94. package/fesm2015/ng-doc-app-services-sidebar.mjs +50 -7
  95. package/fesm2015/ng-doc-app-services-sidebar.mjs.map +1 -1
  96. package/fesm2015/ng-doc-app.mjs +1 -0
  97. package/fesm2015/ng-doc-app.mjs.map +1 -1
  98. package/fesm2020/ng-doc-app-classes-root-page.mjs +3 -0
  99. package/fesm2020/ng-doc-app-classes-root-page.mjs.map +1 -1
  100. package/fesm2020/ng-doc-app-classes.mjs +0 -1
  101. package/fesm2020/ng-doc-app-classes.mjs.map +1 -1
  102. package/fesm2020/ng-doc-app-components-api-list.mjs +1 -1
  103. package/fesm2020/ng-doc-app-components-api-list.mjs.map +1 -1
  104. package/fesm2020/ng-doc-app-components-code.mjs +1 -1
  105. package/fesm2020/ng-doc-app-components-code.mjs.map +1 -1
  106. package/fesm2020/ng-doc-app-components-demo-displayer.mjs +9 -4
  107. package/fesm2020/ng-doc-app-components-demo-displayer.mjs.map +1 -1
  108. package/fesm2020/ng-doc-app-components-demo.mjs +1 -1
  109. package/fesm2020/ng-doc-app-components-demo.mjs.map +1 -1
  110. package/fesm2020/ng-doc-app-components-navbar.mjs +21 -6
  111. package/fesm2020/ng-doc-app-components-navbar.mjs.map +1 -1
  112. package/fesm2020/ng-doc-app-components-page.mjs +24 -5
  113. package/fesm2020/ng-doc-app-components-page.mjs.map +1 -1
  114. package/fesm2020/ng-doc-app-components-playground.mjs +297 -30
  115. package/fesm2020/ng-doc-app-components-playground.mjs.map +1 -1
  116. package/fesm2020/ng-doc-app-components-root.mjs +53 -7
  117. package/fesm2020/ng-doc-app-components-root.mjs.map +1 -1
  118. package/fesm2020/ng-doc-app-components-sidebar.mjs +4 -4
  119. package/fesm2020/ng-doc-app-components-sidebar.mjs.map +1 -1
  120. package/fesm2020/ng-doc-app-components-toc.mjs +2 -2
  121. package/fesm2020/ng-doc-app-components-toc.mjs.map +1 -1
  122. package/fesm2020/ng-doc-app-components.mjs +1 -0
  123. package/fesm2020/ng-doc-app-components.mjs.map +1 -1
  124. package/fesm2020/ng-doc-app-helpers-format-html.mjs +12 -9
  125. package/fesm2020/ng-doc-app-helpers-format-html.mjs.map +1 -1
  126. package/fesm2020/ng-doc-app-helpers-generate-toc.mjs +1 -9
  127. package/fesm2020/ng-doc-app-helpers-generate-toc.mjs.map +1 -1
  128. package/fesm2020/ng-doc-app-helpers-provide-playground-demo.mjs +37 -0
  129. package/fesm2020/ng-doc-app-helpers-provide-playground-demo.mjs.map +1 -0
  130. package/fesm2020/ng-doc-app-helpers.mjs +1 -1
  131. package/fesm2020/ng-doc-app-processors-tooltip-processor.mjs +2 -2
  132. package/fesm2020/ng-doc-app-processors-tooltip-processor.mjs.map +1 -1
  133. package/fesm2020/ng-doc-app-services-sidebar.mjs +48 -7
  134. package/fesm2020/ng-doc-app-services-sidebar.mjs.map +1 -1
  135. package/fesm2020/ng-doc-app.mjs +1 -0
  136. package/fesm2020/ng-doc-app.mjs.map +1 -1
  137. package/helpers/format-html/format-html.d.ts +2 -1
  138. package/helpers/index.d.ts +1 -1
  139. package/helpers/provide-playground-demo/index.d.ts +1 -0
  140. package/helpers/provide-playground-demo/provide-playground-demo.d.ts +18 -0
  141. package/index.d.ts +1 -0
  142. package/interfaces/context.d.ts +6 -0
  143. package/interfaces/index.d.ts +0 -1
  144. package/interfaces/navigation.d.ts +3 -0
  145. package/interfaces/type-control-provider-options.d.ts +7 -0
  146. package/package.json +11 -43
  147. package/services/sidebar/sidebar.service.d.ts +28 -1
  148. package/styles/global.css +1 -0
  149. package/styles/main.css +1 -0
  150. package/classes/html-parser/index.d.ts +0 -1
  151. package/components/playground-demo/demo/base-demo.component.d.ts +0 -7
  152. package/components/playground-demo/index.d.ts +0 -2
  153. package/components/playground-demo/playground-demo.component.d.ts +0 -29
  154. package/components/playground-demo/playground-demo.module.d.ts +0 -9
  155. package/components/playground-properties/index.d.ts +0 -2
  156. package/components/playground-properties/playground-properties.component.d.ts +0 -16
  157. package/components/playground-properties/playground-properties.module.d.ts +0 -11
  158. package/components/playground-property/index.d.ts +0 -2
  159. package/components/playground-property/playground-property.module.d.ts +0 -11
  160. package/esm2020/classes/html-parser/index.mjs +0 -2
  161. package/esm2020/classes/html-parser/ng-doc-app-classes-html-parser.mjs +0 -5
  162. package/esm2020/components/playground-demo/demo/base-demo.component.mjs +0 -3
  163. package/esm2020/components/playground-demo/index.mjs +0 -3
  164. package/esm2020/components/playground-demo/ng-doc-app-components-playground-demo.mjs +0 -5
  165. package/esm2020/components/playground-demo/playground-demo.component.mjs +0 -101
  166. package/esm2020/components/playground-demo/playground-demo.module.mjs +0 -19
  167. package/esm2020/components/playground-properties/index.mjs +0 -3
  168. package/esm2020/components/playground-properties/ng-doc-app-components-playground-properties.mjs +0 -5
  169. package/esm2020/components/playground-properties/playground-properties.component.mjs +0 -36
  170. package/esm2020/components/playground-properties/playground-properties.module.mjs +0 -50
  171. package/esm2020/components/playground-property/index.mjs +0 -3
  172. package/esm2020/components/playground-property/ng-doc-app-components-playground-property.mjs +0 -5
  173. package/esm2020/components/playground-property/playground-property.component.mjs +0 -88
  174. package/esm2020/components/playground-property/playground-property.module.mjs +0 -21
  175. package/esm2020/helpers/compile-template/compile-template.mjs +0 -116
  176. package/esm2020/helpers/compile-template/index.mjs +0 -2
  177. package/esm2020/helpers/compile-template/ng-doc-app-helpers-compile-template.mjs +0 -5
  178. package/esm2020/interfaces/playground-form.mjs +0 -2
  179. package/fesm2015/ng-doc-app-classes-html-parser.mjs +0 -8
  180. package/fesm2015/ng-doc-app-classes-html-parser.mjs.map +0 -1
  181. package/fesm2015/ng-doc-app-components-playground-demo.mjs +0 -123
  182. package/fesm2015/ng-doc-app-components-playground-demo.mjs.map +0 -1
  183. package/fesm2015/ng-doc-app-components-playground-properties.mjs +0 -90
  184. package/fesm2015/ng-doc-app-components-playground-properties.mjs.map +0 -1
  185. package/fesm2015/ng-doc-app-components-playground-property.mjs +0 -113
  186. package/fesm2015/ng-doc-app-components-playground-property.mjs.map +0 -1
  187. package/fesm2015/ng-doc-app-helpers-compile-template.mjs +0 -122
  188. package/fesm2015/ng-doc-app-helpers-compile-template.mjs.map +0 -1
  189. package/fesm2020/ng-doc-app-classes-html-parser.mjs +0 -8
  190. package/fesm2020/ng-doc-app-classes-html-parser.mjs.map +0 -1
  191. package/fesm2020/ng-doc-app-components-playground-demo.mjs +0 -123
  192. package/fesm2020/ng-doc-app-components-playground-demo.mjs.map +0 -1
  193. package/fesm2020/ng-doc-app-components-playground-properties.mjs +0 -89
  194. package/fesm2020/ng-doc-app-components-playground-properties.mjs.map +0 -1
  195. package/fesm2020/ng-doc-app-components-playground-property.mjs +0 -112
  196. package/fesm2020/ng-doc-app-components-playground-property.mjs.map +0 -1
  197. package/fesm2020/ng-doc-app-helpers-compile-template.mjs +0 -122
  198. package/fesm2020/ng-doc-app-helpers-compile-template.mjs.map +0 -1
  199. package/helpers/compile-template/compile-template.d.ts +0 -18
  200. package/helpers/compile-template/index.d.ts +0 -1
  201. package/interfaces/playground-form.d.ts +0 -5
@@ -1,24 +1,274 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Component, ChangeDetectionStrategy, NgModule } from '@angular/core';
3
- import { objectKeys, extractValue } from '@ng-doc/core';
4
- import * as i1 from '@ng-doc/app/classes';
5
- import * as i2 from '@angular/forms';
6
- import { ReactiveFormsModule } from '@angular/forms';
7
- import * as i3 from '@angular/common';
2
+ import { Directive, isDevMode, ViewContainerRef, Component, ChangeDetectionStrategy, Input, ViewChild, HostBinding, EventEmitter, Output, ChangeDetectorRef, Injector, NgModule } from '@angular/core';
3
+ import { extractValueOrThrow, buildPlaygroundDemoTemplate, objectKeys, extractValue } from '@ng-doc/core';
4
+ import * as i1$1 from '@ng-doc/app/classes/root-page';
5
+ import { NgDocRootPage } from '@ng-doc/app/classes/root-page';
6
+ import * as i3 from '@angular/forms';
7
+ import { ReactiveFormsModule, FormsModule } from '@angular/forms';
8
+ import * as i2 from '@angular/common';
8
9
  import { CommonModule } from '@angular/common';
9
- import * as i4 from '@ng-doc/app/components/playground-demo';
10
- import { NgDocPlaygroundDemoModule } from '@ng-doc/app/components/playground-demo';
11
- import * as i5 from '@ng-doc/app/components/playground-properties';
12
- import { NgDocPlaygroundPropertiesModule } from '@ng-doc/app/components/playground-properties';
13
- import * as i6 from '@ng-doc/ui-kit';
14
- import { NgDocAsArrayModule } from '@ng-doc/ui-kit';
10
+ import * as i1 from '@angular/cdk/layout';
11
+ import { Breakpoints } from '@angular/cdk/layout';
12
+ import { pluck, takeUntil } from 'rxjs/operators';
13
+ import * as i4 from '@ng-doc/ui-kit';
14
+ import { NgDocLabelModule, NgDocTooltipModule, NgDocAsArrayModule, NgDocButtonIconModule, NgDocIconModule, NgDocTextModule, NgDocCheckboxModule, NgDocButtonModule } from '@ng-doc/ui-kit';
15
+ import { isPlaygroundProperty } from '@ng-doc/app/helpers/is-playground-property';
16
+ import { getTokenForType } from '@ng-doc/app/helpers/provide-type-control';
17
+ import { __decorate, __metadata } from 'tslib';
18
+ import { formatHtml } from '@ng-doc/app/helpers/format-html';
19
+ import { getPlaygroundDemoToken } from '@ng-doc/app/helpers/provide-playground-demo';
20
+ import { untilDestroyed, UntilDestroy } from '@ngneat/until-destroy';
21
+ import { of, Subject } from 'rxjs';
22
+ import * as i2$1 from '@ng-doc/app/components/demo-displayer';
23
+ import { NgDocDemoDisplayerModule } from '@ng-doc/app/components/demo-displayer';
24
+ import { PolymorpheusModule } from '@tinkoff/ng-polymorpheus';
25
+
26
+ /**
27
+ * Base class for playgrounds components.
28
+ */
29
+ class NgDocBasePlayground {
30
+ constructor() {
31
+ this.data = {};
32
+ this.content = {};
33
+ }
34
+ }
35
+ NgDocBasePlayground.selector = 'unknown';
36
+ NgDocBasePlayground.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocBasePlayground, deps: [], target: i0.ɵɵFactoryTarget.Directive });
37
+ NgDocBasePlayground.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.0.3", type: NgDocBasePlayground, ngImport: i0 });
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocBasePlayground, decorators: [{
39
+ type: Directive
40
+ }] });
41
+
42
+ class NgDocPlaygroundPropertyComponent {
43
+ constructor(injector) {
44
+ this.injector = injector;
45
+ this.name = '';
46
+ }
47
+ ngOnChanges({ property, control }) {
48
+ var _a, _b, _c, _d, _e, _f;
49
+ if (property && this.property) {
50
+ (_a = this.propertyControl) === null || _a === void 0 ? void 0 : _a.destroy();
51
+ this.propertyControl = undefined;
52
+ const type = isPlaygroundProperty(this.property) ? this.property.type : 'boolean';
53
+ const typeControl = (_b = this.getControlForType(type)) !== null && _b !== void 0 ? _b : this.getControlForTypeAlias(isPlaygroundProperty(this.property) ? this.property.options : undefined);
54
+ if (typeControl && this.propertyOutlet) {
55
+ this.propertyControl = this.propertyOutlet.createComponent(typeControl.control);
56
+ this.propertyControl.instance.name = this.name;
57
+ this.propertyControl.instance.description = this.tooltipContent;
58
+ this.propertyControl.instance.options = isPlaygroundProperty(this.property)
59
+ ? this.property.options
60
+ : undefined;
61
+ this.propertyControl.instance.default = isPlaygroundProperty(this.property)
62
+ ? this.property.default
63
+ : undefined;
64
+ this.propertyControl.instance.writeValue((_c = this.control) === null || _c === void 0 ? void 0 : _c.value);
65
+ this.option = typeControl.options;
66
+ }
67
+ else if (isDevMode()) {
68
+ console.warn(`NgDocPlayground didn't find the control for the @Input "${this.name}", the type "${type}" was not recognized'`);
69
+ }
70
+ }
71
+ if (control) {
72
+ (_d = this.control) === null || _d === void 0 ? void 0 : _d.registerOnChange((value) => { var _a, _b; return (_b = (_a = this.propertyControl) === null || _a === void 0 ? void 0 : _a.instance) === null || _b === void 0 ? void 0 : _b.writeValue(value); });
73
+ (_e = this.propertyControl) === null || _e === void 0 ? void 0 : _e.instance.registerOnChange((value) => { var _a; return (_a = this.control) === null || _a === void 0 ? void 0 : _a.setValue(value); });
74
+ (_f = this.propertyControl) === null || _f === void 0 ? void 0 : _f.instance.registerOnTouched(() => { var _a; return (_a = this.control) === null || _a === void 0 ? void 0 : _a.markAsTouched(); });
75
+ }
76
+ }
77
+ get hasPropertyControl() {
78
+ return !!this.propertyControl;
79
+ }
80
+ get tooltipContent() {
81
+ var _a;
82
+ return this.property && isPlaygroundProperty(this.property) ? (_a = this.property.description) !== null && _a !== void 0 ? _a : '' : '';
83
+ }
84
+ getControlForType(type) {
85
+ const token = getTokenForType(type);
86
+ return token ? this.injector.get(token) : undefined;
87
+ }
88
+ getControlForTypeAlias(options) {
89
+ if (options && options.length) {
90
+ let optionsIsValid = true;
91
+ try {
92
+ // checking that all values are extractable
93
+ options.forEach((item) => extractValueOrThrow(item));
94
+ }
95
+ catch (_a) {
96
+ optionsIsValid = false;
97
+ }
98
+ if (optionsIsValid) {
99
+ const token = getTokenForType('NgDocTypeAlias');
100
+ return token ? this.injector.get(token) : undefined;
101
+ }
102
+ }
103
+ return undefined;
104
+ }
105
+ }
106
+ NgDocPlaygroundPropertyComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertyComponent, deps: [{ token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
107
+ NgDocPlaygroundPropertyComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundPropertyComponent, selector: "ng-doc-playground-property", inputs: { name: "name", property: "property", control: "control" }, host: { properties: { "attr.data-has-property-control": "this.hasPropertyControl" } }, viewQueries: [{ propertyName: "propertyOutlet", first: true, predicate: ["propertyOutlet"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<label [ng-doc-label]=\"option?.hideLabel ? '' : labelContent\">\n\t<ng-template #labelContent>\n\t\t<span [ngDocTooltip]=\"tooltipContent\" [canOpen]=\"!!tooltipContent\"\n\t\t\t [positions]=\"['left-center', 'top-right', 'bottom-right']\">{{name}}</span>\n\t</ng-template>\n\t<ng-container #propertyOutlet></ng-container>\n</label>\n", styles: [":host{display:block}:host[data-has-property-control=false]{display:none}\n"], dependencies: [{ kind: "component", type: i4.NgDocLabelComponent, selector: "label[ng-doc-label]", inputs: ["ng-doc-label", "align"] }, { kind: "directive", type: i4.NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
108
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertyComponent, decorators: [{
109
+ type: Component,
110
+ args: [{ selector: 'ng-doc-playground-property', changeDetection: ChangeDetectionStrategy.OnPush, template: "<label [ng-doc-label]=\"option?.hideLabel ? '' : labelContent\">\n\t<ng-template #labelContent>\n\t\t<span [ngDocTooltip]=\"tooltipContent\" [canOpen]=\"!!tooltipContent\"\n\t\t\t [positions]=\"['left-center', 'top-right', 'bottom-right']\">{{name}}</span>\n\t</ng-template>\n\t<ng-container #propertyOutlet></ng-container>\n</label>\n", styles: [":host{display:block}:host[data-has-property-control=false]{display:none}\n"] }]
111
+ }], ctorParameters: function () { return [{ type: i0.Injector }]; }, propDecorators: { name: [{
112
+ type: Input
113
+ }], property: [{
114
+ type: Input
115
+ }], control: [{
116
+ type: Input
117
+ }], propertyOutlet: [{
118
+ type: ViewChild,
119
+ args: ['propertyOutlet', { read: ViewContainerRef, static: true }]
120
+ }], hasPropertyControl: [{
121
+ type: HostBinding,
122
+ args: ['attr.data-has-property-control']
123
+ }] } });
124
+
125
+ class NgDocPlaygroundPropertiesComponent {
126
+ constructor(breakpointObserver) {
127
+ this.breakpointObserver = breakpointObserver;
128
+ this.recreateDemo = false;
129
+ this.recreateDemoChange = new EventEmitter();
130
+ this.resetForm = new EventEmitter();
131
+ this.breakpoints = [Breakpoints.XSmall];
132
+ this.observer = this.breakpointObserver.observe(this.breakpoints).pipe(pluck('matches'));
133
+ }
134
+ getFormControl(controlType, key) {
135
+ var _a;
136
+ return (_a = this.form.get(controlType)) === null || _a === void 0 ? void 0 : _a.get(key);
137
+ }
138
+ }
139
+ NgDocPlaygroundPropertiesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertiesComponent, deps: [{ token: i1.BreakpointObserver }], target: i0.ɵɵFactoryTarget.Component });
140
+ NgDocPlaygroundPropertiesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundPropertiesComponent, selector: "ng-doc-playground-properties", inputs: { form: "form", properties: "properties", dynamicContent: "dynamicContent", recreateDemo: "recreateDemo" }, outputs: { recreateDemoChange: "recreateDemoChange", resetForm: "resetForm" }, ngImport: i0, template: "<div class=\"ng-doc-playground-properties-wrapper\" [class.vertical]=\"observer | async\">\n\t<div class=\"ng-doc-playground-demos\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"ng-doc-playground-properties\">\n\t\t<div class=\"ng-doc-playground-header\">\n\t\t\t<h4 ng-doc-text>Playground</h4>\n\t\t\t<button ng-doc-button color=\"red\" (click)=\"resetForm.emit()\">Reset</button>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-setting\">\n\t\t\t<ng-doc-checkbox [(ngModel)]=\"recreateDemo\" (ngModelChange)=\"recreateDemoChange.emit($event)\">\n\t\t\t\t<span\n\t\t\t\t\tng-doc-text\n\t\t\t\t\t[ngDocTooltip]=\"'Recreates demo everytime\\none of the input has changed'\"\n\t\t\t\t\t[positions]=\"['bottom-right', 'left-center']\"\n\t\t\t\t>\n\t\t\t\t\tRecreate\n\t\t\t\t\t<ng-doc-icon icon=\"info\" ngDocTextRight></ng-doc-icon>\n\t\t\t\t</span>\n\t\t\t</ng-doc-checkbox>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-divider\"></div>\n\t\t<ng-container *ngIf=\"(properties | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Settings</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let property of properties | keyvalue\"\n\t\t\t\t[name]=\"property.value.name\"\n\t\t\t\t[property]=\"property.value\"\n\t\t\t\t[control]=\"getFormControl('properties', property.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\n\t\t<ng-container *ngIf=\"(dynamicContent | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Content</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let content of dynamicContent | keyvalue\"\n\t\t\t\t[name]=\"content.value.label\"\n\t\t\t\t[property]=\"content.value\"\n\t\t\t\t[control]=\"getFormControl('content', content.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\t</div>\n</div>\n", styles: [":host .ng-doc-playground-properties-wrapper{position:relative;display:flex}:host .ng-doc-playground-properties-wrapper.vertical{flex-direction:column}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-demos{margin-right:0;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-properties{width:100%}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-demos{display:flex;flex-direction:column;width:100%;overflow:hidden;margin-right:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties{flex-shrink:0;width:300px;padding:calc(var(--ng-doc-base-gutter) * 2) calc(var(--ng-doc-base-gutter) * 3);background-color:var(--ng-doc-base-1);border-radius:var(--ng-doc-base-gutter)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties ng-doc-playground-property:not(:last-child){margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-controls{display:flex;justify-content:flex-end}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header{display:flex;align-items:center;justify-content:space-between;height:40px;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header h4{margin:0}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-setting{display:flex;flex-direction:column}:host .ng-doc-playground-properties-wrapper .ng-doc-title{margin-top:0;margin-bottom:calc(var(--ng-doc-base-gutter) + var(--ng-doc-base-gutter) / 2)}:host .ng-doc-playground-divider{margin:calc(var(--ng-doc-base-gutter) * 2) 0;height:1px;background-color:var(--ng-doc-base-2)}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgDocTooltipDirective, selector: "[ngDocTooltip]", inputs: ["ngDocTooltip", "delay", "displayOrigin", "pointerOrigin", "positions", "canOpen", "panelClass", "minHeight", "maxHeight", "height", "minWidth", "maxWidth", "width"], outputs: ["beforeOpen", "afterOpen", "beforeClose", "afterClose"], exportAs: ["ngDocTooltip"] }, { kind: "component", type: i4.NgDocIconComponent, selector: "ng-doc-icon", inputs: ["icon", "size"] }, { kind: "component", type: i4.NgDocTextComponent, selector: "[ng-doc-text]", inputs: ["size", "color", "align", "absoluteContent"] }, { kind: "directive", type: i4.NgDocTextRightDirective, selector: "[ngDocTextRight]" }, { kind: "component", type: i4.NgDocCheckboxComponent, selector: "ng-doc-checkbox", inputs: ["color"] }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i4.NgDocButtonComponent, selector: "button[ng-doc-button], a[ng-doc-button]", inputs: ["size", "color"] }, { kind: "component", type: NgDocPlaygroundPropertyComponent, selector: "ng-doc-playground-property", inputs: ["name", "property", "control"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }, { kind: "pipe", type: i2.KeyValuePipe, name: "keyvalue" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
141
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundPropertiesComponent, decorators: [{
142
+ type: Component,
143
+ args: [{ selector: 'ng-doc-playground-properties', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"ng-doc-playground-properties-wrapper\" [class.vertical]=\"observer | async\">\n\t<div class=\"ng-doc-playground-demos\">\n\t\t<ng-content></ng-content>\n\t</div>\n\t<div class=\"ng-doc-playground-properties\">\n\t\t<div class=\"ng-doc-playground-header\">\n\t\t\t<h4 ng-doc-text>Playground</h4>\n\t\t\t<button ng-doc-button color=\"red\" (click)=\"resetForm.emit()\">Reset</button>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-setting\">\n\t\t\t<ng-doc-checkbox [(ngModel)]=\"recreateDemo\" (ngModelChange)=\"recreateDemoChange.emit($event)\">\n\t\t\t\t<span\n\t\t\t\t\tng-doc-text\n\t\t\t\t\t[ngDocTooltip]=\"'Recreates demo everytime\\none of the input has changed'\"\n\t\t\t\t\t[positions]=\"['bottom-right', 'left-center']\"\n\t\t\t\t>\n\t\t\t\t\tRecreate\n\t\t\t\t\t<ng-doc-icon icon=\"info\" ngDocTextRight></ng-doc-icon>\n\t\t\t\t</span>\n\t\t\t</ng-doc-checkbox>\n\t\t</div>\n\t\t<div class=\"ng-doc-playground-divider\"></div>\n\t\t<ng-container *ngIf=\"(properties | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Settings</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let property of properties | keyvalue\"\n\t\t\t\t[name]=\"property.value.name\"\n\t\t\t\t[property]=\"property.value\"\n\t\t\t\t[control]=\"getFormControl('properties', property.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\n\t\t<ng-container *ngIf=\"(dynamicContent | keyvalue)?.length\">\n\t\t\t<h5 class=\"ng-doc-title\" ng-doc-text>Content</h5>\n\t\t\t<ng-doc-playground-property\n\t\t\t\t*ngFor=\"let content of dynamicContent | keyvalue\"\n\t\t\t\t[name]=\"content.value.label\"\n\t\t\t\t[property]=\"content.value\"\n\t\t\t\t[control]=\"getFormControl('content', content.key)\"\n\t\t\t>\n\t\t\t</ng-doc-playground-property>\n\t\t</ng-container>\n\t</div>\n</div>\n", styles: [":host .ng-doc-playground-properties-wrapper{position:relative;display:flex}:host .ng-doc-playground-properties-wrapper.vertical{flex-direction:column}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-demos{margin-right:0;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper.vertical .ng-doc-playground-properties{width:100%}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-demos{display:flex;flex-direction:column;width:100%;overflow:hidden;margin-right:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties{flex-shrink:0;width:300px;padding:calc(var(--ng-doc-base-gutter) * 2) calc(var(--ng-doc-base-gutter) * 3);background-color:var(--ng-doc-base-1);border-radius:var(--ng-doc-base-gutter)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties ng-doc-playground-property:not(:last-child){margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-controls{display:flex;justify-content:flex-end}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header{display:flex;align-items:center;justify-content:space-between;height:40px;margin-bottom:calc(var(--ng-doc-base-gutter) * 2)}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-header h4{margin:0}:host .ng-doc-playground-properties-wrapper .ng-doc-playground-properties .ng-doc-playground-setting{display:flex;flex-direction:column}:host .ng-doc-playground-properties-wrapper .ng-doc-title{margin-top:0;margin-bottom:calc(var(--ng-doc-base-gutter) + var(--ng-doc-base-gutter) / 2)}:host .ng-doc-playground-divider{margin:calc(var(--ng-doc-base-gutter) * 2) 0;height:1px;background-color:var(--ng-doc-base-2)}\n"] }]
144
+ }], ctorParameters: function () { return [{ type: i1.BreakpointObserver }]; }, propDecorators: { form: [{
145
+ type: Input
146
+ }], properties: [{
147
+ type: Input
148
+ }], dynamicContent: [{
149
+ type: Input
150
+ }], recreateDemo: [{
151
+ type: Input
152
+ }], recreateDemoChange: [{
153
+ type: Output
154
+ }], resetForm: [{
155
+ type: Output
156
+ }] } });
157
+
158
+ let NgDocPlaygroundDemoComponent = class NgDocPlaygroundDemoComponent {
159
+ constructor(rootPage, injector) {
160
+ this.rootPage = rootPage;
161
+ this.injector = injector;
162
+ this.id = '';
163
+ this.selector = '';
164
+ this.recreateDemo = false;
165
+ this.code = of('');
166
+ this.unsubscribe$ = new Subject();
167
+ }
168
+ ngOnChanges({ form, id }) {
169
+ var _a;
170
+ if (form && id) {
171
+ this.unsubscribe$.next();
172
+ const demoInjector = getPlaygroundDemoToken(this.id);
173
+ if (demoInjector) {
174
+ const demos = this.injector.get(demoInjector, []);
175
+ this.playgroundDemo = demos.find((demo) => demo.selector === this.selector);
176
+ }
177
+ this.updateDemo();
178
+ (_a = this.form) === null || _a === void 0 ? void 0 : _a.valueChanges.pipe(takeUntil(this.unsubscribe$), untilDestroyed(this)).subscribe((data) => this.updateDemo(data));
179
+ }
180
+ }
181
+ updateDemo(data) {
182
+ var _a, _b, _c, _d, _e, _f, _g, _h;
183
+ if (this.recreateDemo || !this.demoRef) {
184
+ this.renderDemo();
185
+ }
186
+ if (data) {
187
+ Object.assign((_b = (_a = this.demoRef) === null || _a === void 0 ? void 0 : _a.instance.playground) !== null && _b !== void 0 ? _b : {}, data.properties);
188
+ Object.assign((_d = (_c = this.demoRef) === null || _c === void 0 ? void 0 : _c.instance.content) !== null && _d !== void 0 ? _d : {}, data.content);
189
+ (_h = (_g = (_f = (_e = this.demoRef) === null || _e === void 0 ? void 0 : _e.instance) === null || _f === void 0 ? void 0 : _f.viewContainerRef) === null || _g === void 0 ? void 0 : _g.injector.get(ChangeDetectorRef)) === null || _h === void 0 ? void 0 : _h.markForCheck();
190
+ }
191
+ this.updateCodeView();
192
+ }
193
+ renderDemo() {
194
+ var _a, _b, _c;
195
+ if (this.playgroundDemo) {
196
+ (_a = this.demoRef) === null || _a === void 0 ? void 0 : _a.destroy();
197
+ if (this.playgroundDemo) {
198
+ this.demoRef = (_b = this.demoOutlet) === null || _b === void 0 ? void 0 : _b.createComponent(this.playgroundDemo);
199
+ }
200
+ (_c = this.demoRef) === null || _c === void 0 ? void 0 : _c.changeDetectorRef.markForCheck();
201
+ }
202
+ }
203
+ updateCodeView() {
204
+ var _a, _b;
205
+ const template = buildPlaygroundDemoTemplate((_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.template) !== null && _b !== void 0 ? _b : '', this.selector, this.getActiveContent(), this.getActiveInputs());
206
+ this.code = formatHtml(template);
207
+ }
208
+ getActiveContent() {
209
+ var _a, _b;
210
+ const formData = (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.controls.content.value) !== null && _b !== void 0 ? _b : {};
211
+ return objectKeys(formData).reduce((result, key) => {
212
+ var _a, _b, _c;
213
+ result[key] = formData[key] ? (_c = (_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b[key].template) !== null && _c !== void 0 ? _c : '' : '';
214
+ return result;
215
+ }, {});
216
+ }
217
+ getActiveInputs() {
218
+ var _a, _b;
219
+ const formData = (_b = (_a = this.form) === null || _a === void 0 ? void 0 : _a.controls.properties.value) !== null && _b !== void 0 ? _b : {};
220
+ return objectKeys(formData).reduce((result, key) => {
221
+ var _a, _b;
222
+ const property = (_a = this.properties) === null || _a === void 0 ? void 0 : _a[key];
223
+ if (property) {
224
+ const value = formData[key];
225
+ const isString = typeof value === 'string';
226
+ const inputValue = isString ? `'${value}'` : `${JSON.stringify(value)}`;
227
+ if (((_b = property.default) !== null && _b !== void 0 ? _b : '') !== inputValue) {
228
+ result[property.name] = inputValue;
229
+ }
230
+ }
231
+ return result;
232
+ }, {});
233
+ }
234
+ ngOnDestroy() {
235
+ this.unsubscribe$.next();
236
+ this.unsubscribe$.complete();
237
+ }
238
+ };
239
+ NgDocPlaygroundDemoComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundDemoComponent, deps: [{ token: i1$1.NgDocRootPage }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component });
240
+ NgDocPlaygroundDemoComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundDemoComponent, selector: "ng-doc-playground-demo", inputs: { id: "id", selector: "selector", configuration: "configuration", properties: "properties", recreateDemo: "recreateDemo", form: "form" }, viewQueries: [{ propertyName: "demoOutlet", first: true, predicate: ["demoOutlet"], descendants: true, read: ViewContainerRef, static: true }], usesOnChanges: true, ngImport: i0, template: "<ng-doc-demo-displayer [code]=\"(code | async) ?? ''\" [border]=\"false\" language=\"html\">\n\t<ng-container #demoOutlet></ng-container>\n</ng-doc-demo-displayer>\n", styles: [":host{display:block;border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);overflow:hidden}:host:not(:last-child){border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}:host:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}\n"], dependencies: [{ kind: "component", type: i2$1.NgDocDemoDisplayerComponent, selector: "ng-doc-demo-displayer", inputs: ["codeContent", "code", "language", "container", "border"] }, { kind: "pipe", type: i2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
241
+ NgDocPlaygroundDemoComponent = __decorate([
242
+ UntilDestroy(),
243
+ __metadata("design:paramtypes", [NgDocRootPage, Injector])
244
+ ], NgDocPlaygroundDemoComponent);
245
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundDemoComponent, decorators: [{
246
+ type: Component,
247
+ args: [{ selector: 'ng-doc-playground-demo', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-doc-demo-displayer [code]=\"(code | async) ?? ''\" [border]=\"false\" language=\"html\">\n\t<ng-container #demoOutlet></ng-container>\n</ng-doc-demo-displayer>\n", styles: [":host{display:block;border:var(--ng-doc-demo-displayer-border);border-radius:var(--ng-doc-demo-displayer-border-radius);overflow:hidden}:host:not(:last-child){border-bottom:0;border-bottom-left-radius:0;border-bottom-right-radius:0}:host:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}\n"] }]
248
+ }], ctorParameters: function () { return [{ type: i1$1.NgDocRootPage }, { type: i0.Injector }]; }, propDecorators: { id: [{
249
+ type: Input
250
+ }], selector: [{
251
+ type: Input
252
+ }], configuration: [{
253
+ type: Input
254
+ }], properties: [{
255
+ type: Input
256
+ }], recreateDemo: [{
257
+ type: Input
258
+ }], form: [{
259
+ type: Input
260
+ }], demoOutlet: [{
261
+ type: ViewChild,
262
+ args: ['demoOutlet', { static: true, read: ViewContainerRef }]
263
+ }] } });
15
264
 
16
265
  class NgDocPlaygroundComponent {
17
266
  constructor(rootPage, formBuilder) {
18
267
  this.rootPage = rootPage;
19
268
  this.formBuilder = formBuilder;
269
+ this.id = '';
20
270
  this.selectors = [];
21
- this.reinitializeDemo = false;
271
+ this.recreateDemo = false;
22
272
  }
23
273
  ngOnInit() {
24
274
  const propertiesForm = this.formBuilder.group(this.getPropertiesFormValues());
@@ -29,7 +279,8 @@ class NgDocPlaygroundComponent {
29
279
  });
30
280
  }
31
281
  get configuration() {
32
- return this.id && this.rootPage.playground ? this.rootPage.playground[this.id] : undefined;
282
+ var _a, _b;
283
+ return (_b = (_a = this.rootPage.dependencies) === null || _a === void 0 ? void 0 : _a.playgrounds) === null || _b === void 0 ? void 0 : _b[this.id];
33
284
  }
34
285
  getPropertiesFormValues() {
35
286
  var _a;
@@ -43,13 +294,14 @@ class NgDocPlaygroundComponent {
43
294
  }
44
295
  getContentFormValues() {
45
296
  var _a, _b;
46
- return objectKeys((_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.dynamicContent) !== null && _b !== void 0 ? _b : {}).reduce((controls, key) => {
297
+ return objectKeys((_b = (_a = this.configuration) === null || _a === void 0 ? void 0 : _a.content) !== null && _b !== void 0 ? _b : {}).reduce((controls, key) => {
47
298
  var _a;
48
- if ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.dynamicContent) {
299
+ if ((_a = this.configuration) === null || _a === void 0 ? void 0 : _a.content) {
49
300
  controls[key] = false;
50
301
  }
51
302
  return controls;
52
303
  }, {});
304
+ return {};
53
305
  }
54
306
  resetForm() {
55
307
  var _a;
@@ -59,38 +311,62 @@ class NgDocPlaygroundComponent {
59
311
  });
60
312
  }
61
313
  }
62
- NgDocPlaygroundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundComponent, deps: [{ token: i1.NgDocRootPage }, { token: i2.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
63
- NgDocPlaygroundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundComponent, selector: "ng-doc-playground", ngImport: i0, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties [form]=\"formGroup\" [properties]=\"properties\"\n\t\t\t\t\t\t\t\t [dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t [(reinitializeDemo)]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t (resetForm)=\"resetForm()\">\n\t\t<ng-doc-playground-demo *ngFor=\"let selector of (configuration.selectors ?? selectors) | asArray\"\n\t\t\t\t\t\t\t\t[target]=\"configuration.target\"\n\t\t\t\t\t\t\t\t[selector]=\"selector\"\n\t\t\t\t\t\t\t\t[template]=\"configuration.template\"\n\t\t\t\t\t\t\t\t[properties]=\"properties\"\n\t\t\t\t\t\t\t\t[data]=\"configuration.data\"\n\t\t\t\t\t\t\t\t[dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t[reinitializeDemo]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t[form]=\"formGroup\">\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i4.NgDocPlaygroundDemoComponent, selector: "ng-doc-playground-demo", inputs: ["target", "selector", "template", "properties", "dynamicContent", "data", "reinitializeDemo", "form"] }, { kind: "component", type: i5.NgDocPlaygroundPropertiesComponent, selector: "ng-doc-playground-properties", inputs: ["form", "properties", "dynamicContent", "reinitializeDemo"], outputs: ["reinitializeDemoChange", "resetForm"] }, { kind: "pipe", type: i6.NgDocAsArrayPipe, name: "asArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
314
+ NgDocPlaygroundComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundComponent, deps: [{ token: i1$1.NgDocRootPage }, { token: i3.FormBuilder }], target: i0.ɵɵFactoryTarget.Component });
315
+ NgDocPlaygroundComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.0.3", type: NgDocPlaygroundComponent, selector: "ng-doc-playground", ngImport: i0, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties\n\t\t[form]=\"formGroup\"\n\t\t[properties]=\"properties\"\n\t\t[dynamicContent]=\"configuration.content\"\n\t\t[(recreateDemo)]=\"recreateDemo\"\n\t\t(resetForm)=\"resetForm()\"\n\t>\n\t\t<ng-doc-playground-demo\n\t\t\t*ngFor=\"let selector of configuration.selectors ?? selectors | asArray\"\n\t\t\t[id]=\"id\"\n\t\t\t[selector]=\"selector\"\n\t\t\t[properties]=\"properties\"\n\t\t\t[configuration]=\"configuration\"\n\t\t\t[recreateDemo]=\"recreateDemo\"\n\t\t\t[form]=\"formGroup\"\n\t\t>\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"], dependencies: [{ kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: NgDocPlaygroundPropertiesComponent, selector: "ng-doc-playground-properties", inputs: ["form", "properties", "dynamicContent", "recreateDemo"], outputs: ["recreateDemoChange", "resetForm"] }, { kind: "component", type: NgDocPlaygroundDemoComponent, selector: "ng-doc-playground-demo", inputs: ["id", "selector", "configuration", "properties", "recreateDemo", "form"] }, { kind: "pipe", type: i4.NgDocAsArrayPipe, name: "asArray" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
64
316
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundComponent, decorators: [{
65
317
  type: Component,
66
- args: [{ selector: 'ng-doc-playground', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties [form]=\"formGroup\" [properties]=\"properties\"\n\t\t\t\t\t\t\t\t [dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t [(reinitializeDemo)]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t (resetForm)=\"resetForm()\">\n\t\t<ng-doc-playground-demo *ngFor=\"let selector of (configuration.selectors ?? selectors) | asArray\"\n\t\t\t\t\t\t\t\t[target]=\"configuration.target\"\n\t\t\t\t\t\t\t\t[selector]=\"selector\"\n\t\t\t\t\t\t\t\t[template]=\"configuration.template\"\n\t\t\t\t\t\t\t\t[properties]=\"properties\"\n\t\t\t\t\t\t\t\t[data]=\"configuration.data\"\n\t\t\t\t\t\t\t\t[dynamicContent]=\"configuration.dynamicContent\"\n\t\t\t\t\t\t\t\t[reinitializeDemo]=\"reinitializeDemo\"\n\t\t\t\t\t\t\t\t[form]=\"formGroup\">\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"] }]
67
- }], ctorParameters: function () { return [{ type: i1.NgDocRootPage }, { type: i2.FormBuilder }]; } });
318
+ args: [{ selector: 'ng-doc-playground', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"configuration\">\n\t<ng-doc-playground-properties\n\t\t[form]=\"formGroup\"\n\t\t[properties]=\"properties\"\n\t\t[dynamicContent]=\"configuration.content\"\n\t\t[(recreateDemo)]=\"recreateDemo\"\n\t\t(resetForm)=\"resetForm()\"\n\t>\n\t\t<ng-doc-playground-demo\n\t\t\t*ngFor=\"let selector of configuration.selectors ?? selectors | asArray\"\n\t\t\t[id]=\"id\"\n\t\t\t[selector]=\"selector\"\n\t\t\t[properties]=\"properties\"\n\t\t\t[configuration]=\"configuration\"\n\t\t\t[recreateDemo]=\"recreateDemo\"\n\t\t\t[form]=\"formGroup\"\n\t\t>\n\t\t</ng-doc-playground-demo>\n\t</ng-doc-playground-properties>\n</ng-container>\n", styles: [":host{display:block}\n"] }]
319
+ }], ctorParameters: function () { return [{ type: i1$1.NgDocRootPage }, { type: i3.FormBuilder }]; } });
68
320
 
69
321
  class NgDocPlaygroundModule {
70
322
  }
71
323
  NgDocPlaygroundModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
72
- NgDocPlaygroundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, declarations: [NgDocPlaygroundComponent], imports: [CommonModule,
324
+ NgDocPlaygroundModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, declarations: [NgDocPlaygroundComponent, NgDocPlaygroundPropertyComponent, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundDemoComponent], imports: [CommonModule,
73
325
  ReactiveFormsModule,
326
+ NgDocLabelModule,
327
+ NgDocTooltipModule,
328
+ PolymorpheusModule,
74
329
  NgDocAsArrayModule,
75
- NgDocPlaygroundDemoModule,
76
- NgDocPlaygroundPropertiesModule], exports: [NgDocPlaygroundComponent] });
330
+ NgDocButtonIconModule,
331
+ NgDocIconModule,
332
+ NgDocTextModule,
333
+ NgDocCheckboxModule,
334
+ FormsModule,
335
+ NgDocButtonModule,
336
+ NgDocDemoDisplayerModule], exports: [NgDocPlaygroundComponent, NgDocPlaygroundPropertyComponent, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundDemoComponent] });
77
337
  NgDocPlaygroundModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, imports: [CommonModule,
78
338
  ReactiveFormsModule,
339
+ NgDocLabelModule,
340
+ NgDocTooltipModule,
341
+ PolymorpheusModule,
79
342
  NgDocAsArrayModule,
80
- NgDocPlaygroundDemoModule,
81
- NgDocPlaygroundPropertiesModule] });
343
+ NgDocButtonIconModule,
344
+ NgDocIconModule,
345
+ NgDocTextModule,
346
+ NgDocCheckboxModule,
347
+ FormsModule,
348
+ NgDocButtonModule,
349
+ NgDocDemoDisplayerModule] });
82
350
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImport: i0, type: NgDocPlaygroundModule, decorators: [{
83
351
  type: NgModule,
84
352
  args: [{
85
- declarations: [NgDocPlaygroundComponent],
353
+ declarations: [NgDocPlaygroundComponent, NgDocPlaygroundPropertyComponent, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundDemoComponent],
86
354
  imports: [
87
355
  CommonModule,
88
356
  ReactiveFormsModule,
357
+ NgDocLabelModule,
358
+ NgDocTooltipModule,
359
+ PolymorpheusModule,
89
360
  NgDocAsArrayModule,
90
- NgDocPlaygroundDemoModule,
91
- NgDocPlaygroundPropertiesModule,
361
+ NgDocButtonIconModule,
362
+ NgDocIconModule,
363
+ NgDocTextModule,
364
+ NgDocCheckboxModule,
365
+ FormsModule,
366
+ NgDocButtonModule,
367
+ NgDocDemoDisplayerModule,
92
368
  ],
93
- exports: [NgDocPlaygroundComponent],
369
+ exports: [NgDocPlaygroundComponent, NgDocPlaygroundPropertyComponent, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundDemoComponent],
94
370
  }]
95
371
  }] });
96
372
 
@@ -98,5 +374,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.0.3", ngImpor
98
374
  * Generated bundle index. Do not edit.
99
375
  */
100
376
 
101
- export { NgDocPlaygroundComponent, NgDocPlaygroundModule };
377
+ export { NgDocBasePlayground, NgDocPlaygroundComponent, NgDocPlaygroundDemoComponent, NgDocPlaygroundModule, NgDocPlaygroundPropertiesComponent, NgDocPlaygroundPropertyComponent };
102
378
  //# sourceMappingURL=ng-doc-app-components-playground.mjs.map