@storybook/angular 7.0.0-alpha.8 → 7.0.0-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (302) hide show
  1. package/.eslintrc.js +8 -0
  2. package/README.md +1 -1
  3. package/dist/{types/builders → builders}/build-storybook/index.d.ts +3 -3
  4. package/dist/{types/builders → builders}/build-storybook/index.js +0 -0
  5. package/dist/builders/build-storybook/index.spec.d.ts +1 -0
  6. package/dist/builders/build-storybook/index.spec.js +218 -0
  7. package/dist/{types/builders → builders}/build-storybook/schema.json +0 -0
  8. package/dist/{types/builders → builders}/builders.json +0 -0
  9. package/dist/{types/builders → builders}/start-storybook/index.d.ts +3 -3
  10. package/dist/{types/builders → builders}/start-storybook/index.js +0 -0
  11. package/dist/builders/start-storybook/index.spec.d.ts +1 -0
  12. package/dist/builders/start-storybook/index.spec.js +214 -0
  13. package/dist/{types/builders → builders}/start-storybook/schema.json +0 -0
  14. package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.d.ts +0 -0
  15. package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.js +3 -6
  16. package/dist/{types/builders → builders}/utils/run-compodoc.d.ts +0 -0
  17. package/dist/{types/builders → builders}/utils/run-compodoc.js +0 -1
  18. package/dist/builders/utils/run-compodoc.spec.d.ts +1 -0
  19. package/dist/builders/utils/run-compodoc.spec.js +59 -0
  20. package/dist/{types/builders → builders}/utils/standalone-options.d.ts +3 -3
  21. package/dist/{types/builders → builders}/utils/standalone-options.js +0 -0
  22. package/dist/{types/client → client}/angular/app.component.d.ts +1 -1
  23. package/dist/{types/client → client}/angular/app.component.js +0 -1
  24. package/dist/{types/client → client}/angular/app.token.d.ts +0 -0
  25. package/dist/{types/client → client}/angular/app.token.js +0 -0
  26. package/dist/{types/client → client}/angular/helpers.d.ts +3 -3
  27. package/dist/{types/client → client}/angular/helpers.js +1 -2
  28. package/dist/{types/client → client}/angular-beta/AbstractRenderer.d.ts +1 -1
  29. package/dist/{types/client → client}/angular-beta/AbstractRenderer.js +13 -13
  30. package/dist/{types/client → client}/angular-beta/CanvasRenderer.d.ts +0 -0
  31. package/dist/{types/client → client}/angular-beta/CanvasRenderer.js +0 -0
  32. package/dist/{types/client → client}/angular-beta/ComputesTemplateFromComponent.d.ts +3 -3
  33. package/dist/{types/client → client}/angular-beta/ComputesTemplateFromComponent.js +3 -3
  34. package/dist/client/angular-beta/ComputesTemplateFromComponent.test.d.ts +1 -0
  35. package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +390 -0
  36. package/dist/{types/client → client}/angular-beta/DocsRenderer.d.ts +0 -0
  37. package/dist/{types/client → client}/angular-beta/DocsRenderer.js +5 -8
  38. package/dist/{types/client → client}/angular-beta/RendererFactory.d.ts +1 -1
  39. package/dist/{types/client → client}/angular-beta/RendererFactory.js +3 -3
  40. package/dist/client/angular-beta/RendererFactory.test.d.ts +1 -0
  41. package/dist/client/angular-beta/RendererFactory.test.js +297 -0
  42. package/dist/{types/client → client}/angular-beta/StorybookModule.d.ts +2 -2
  43. package/dist/{types/client → client}/angular-beta/StorybookModule.js +4 -23
  44. package/dist/client/angular-beta/StorybookModule.test.d.ts +1 -0
  45. package/dist/client/angular-beta/StorybookModule.test.js +279 -0
  46. package/dist/{types/client → client}/angular-beta/StorybookProvider.d.ts +1 -1
  47. package/dist/{types/client → client}/angular-beta/StorybookProvider.js +0 -0
  48. package/dist/{types/client → client}/angular-beta/StorybookWrapperComponent.d.ts +0 -0
  49. package/dist/{types/client → client}/angular-beta/StorybookWrapperComponent.js +0 -1
  50. package/dist/client/angular-beta/__testfixtures__/input.component.d.ts +26 -0
  51. package/dist/client/angular-beta/__testfixtures__/input.component.js +67 -0
  52. package/dist/{types/client → client}/angular-beta/utils/NgComponentAnalyzer.d.ts +2 -2
  53. package/dist/{types/client → client}/angular-beta/utils/NgComponentAnalyzer.js +0 -0
  54. package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.d.ts +1 -0
  55. package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.js +340 -0
  56. package/dist/{types/client → client}/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -0
  57. package/dist/{types/client → client}/angular-beta/utils/NgModulesAnalyzer.js +0 -0
  58. package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.d.ts +1 -0
  59. package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.js +23 -0
  60. package/dist/client/config.d.ts +6 -0
  61. package/dist/client/config.js +10 -0
  62. package/dist/client/decorateStory.d.ts +4 -0
  63. package/dist/{types/client → client}/decorateStory.js +3 -3
  64. package/dist/client/decorateStory.test.d.ts +1 -0
  65. package/dist/client/decorateStory.test.js +335 -0
  66. package/dist/client/decorators.d.ts +5 -0
  67. package/dist/{types/client → client}/decorators.js +0 -0
  68. package/dist/client/decorators.test.d.ts +1 -0
  69. package/dist/client/decorators.test.js +106 -0
  70. package/dist/client/docs/__testfixtures__/doc-button/input.d.ts +111 -0
  71. package/dist/client/docs/__testfixtures__/doc-button/input.js +207 -0
  72. package/dist/client/docs/__testfixtures__/doc-button/tsconfig.json +7 -0
  73. package/dist/client/docs/angular-properties.test.d.ts +1 -0
  74. package/dist/client/docs/angular-properties.test.js +56 -0
  75. package/dist/{types/client → client}/docs/compodoc.d.ts +5 -11
  76. package/dist/{types/client → client}/docs/compodoc.js +7 -7
  77. package/dist/client/docs/compodoc.test.d.ts +1 -0
  78. package/dist/client/docs/compodoc.test.js +131 -0
  79. package/dist/client/docs/config.d.ts +4 -0
  80. package/dist/{types/client → client}/docs/config.js +0 -0
  81. package/dist/{types/client → client}/docs/index.d.ts +0 -0
  82. package/dist/{types/client → client}/docs/index.js +0 -0
  83. package/dist/{types/client → client}/docs/sourceDecorator.d.ts +3 -3
  84. package/dist/{types/client → client}/docs/sourceDecorator.js +3 -3
  85. package/dist/{types/client → client}/docs/types.d.ts +1 -1
  86. package/dist/{types/client → client}/docs/types.js +0 -0
  87. package/dist/{types/client → client}/globals.d.ts +0 -0
  88. package/dist/{types/client → client}/globals.js +0 -0
  89. package/dist/{types/client → client}/index.d.ts +0 -0
  90. package/dist/{types/client → client}/index.js +3 -0
  91. package/dist/client/public-api.d.ts +15 -0
  92. package/dist/{types/client → client}/public-api.js +2 -9
  93. package/dist/client/public-types.d.ts +36 -0
  94. package/dist/{types/client → client}/public-types.js +0 -0
  95. package/dist/client/render.d.ts +6 -0
  96. package/dist/{types/client → client}/render.js +3 -3
  97. package/dist/{types/client → client}/types.d.ts +9 -13
  98. package/dist/{types/client → client}/types.js +0 -0
  99. package/dist/{types/index.d.ts → index.d.ts} +0 -0
  100. package/dist/{types/index.js → index.js} +0 -0
  101. package/dist/{types/preset.d.ts → preset.d.ts} +1 -1
  102. package/dist/{types/preset.js → preset.js} +0 -1
  103. package/dist/{types/renderer.d.ts → renderer.d.ts} +0 -0
  104. package/dist/{types/renderer.js → renderer.js} +0 -0
  105. package/dist/{types/server → server}/__mocks-ng-workspace__/empty-projects-entry/angular.json +0 -0
  106. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/angular.json +0 -0
  107. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -0
  108. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.js +0 -0
  109. package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +0 -0
  110. package/dist/{types/server/__mocks-ng-workspace__/some-config → server/__mocks-ng-workspace__/minimal-config}/tsconfig.json +1 -4
  111. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/angular.json +0 -0
  112. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -0
  113. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.js +0 -0
  114. package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +0 -0
  115. package/dist/{types/server/__mocks-ng-workspace__/with-angularBrowserTarget → server/__mocks-ng-workspace__/some-config}/tsconfig.json +1 -4
  116. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +0 -0
  117. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -0
  118. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +0 -0
  119. package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +0 -0
  120. package/dist/{types/server/__mocks-ng-workspace__/minimal-config → server/__mocks-ng-workspace__/with-angularBrowserTarget}/tsconfig.json +1 -4
  121. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/angular.json +0 -0
  122. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -0
  123. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +0 -0
  124. package/dist/{types/server/__mocks-ng-workspace__/without-projects-entry → server/__mocks-ng-workspace__/with-lib}/projects/pattern-lib/tsconfig.lib.json +2 -8
  125. package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/tsconfig.json +1 -4
  126. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/angular.json +0 -0
  127. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/nx.json +0 -0
  128. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -0
  129. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.js +0 -0
  130. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +0 -0
  131. package/dist/server/__mocks-ng-workspace__/with-nx/tsconfig.json +14 -0
  132. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/nx.json +0 -0
  133. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -0
  134. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.js +0 -0
  135. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +0 -0
  136. package/dist/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +14 -0
  137. package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/workspace.json +0 -0
  138. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/angular.json +0 -0
  139. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -0
  140. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.js +0 -0
  141. package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +0 -0
  142. package/dist/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +13 -0
  143. package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build/angular.json +0 -0
  144. package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build-options/angular.json +0 -0
  145. package/dist/{types/server → server}/__mocks-ng-workspace__/without-compatible-projects/angular.json +0 -0
  146. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/angular.json +0 -0
  147. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -0
  148. package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +0 -0
  149. package/dist/{types/server/__mocks-ng-workspace__/with-lib → server/__mocks-ng-workspace__/without-projects-entry}/projects/pattern-lib/tsconfig.lib.json +2 -8
  150. package/dist/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +13 -0
  151. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/angular.json +0 -0
  152. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -0
  153. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.js +0 -0
  154. package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +0 -0
  155. package/dist/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +13 -0
  156. package/dist/server/__tests__/angular.json +96 -0
  157. package/dist/{types/server/angular-cli-webpack-12.2.x.d.ts → server/angular-cli-webpack.d.ts} +0 -0
  158. package/dist/{types/server/angular-cli-webpack-13.x.x.js → server/angular-cli-webpack.js} +6 -1
  159. package/dist/{types/server → server}/angular-read-workspace.d.ts +0 -0
  160. package/dist/{types/server → server}/angular-read-workspace.js +1 -1
  161. package/dist/{types/server → server}/framework-preset-angular-cli.d.ts +1 -1
  162. package/dist/{types/server → server}/framework-preset-angular-cli.js +5 -24
  163. package/dist/server/framework-preset-angular-cli.test.d.ts +1 -0
  164. package/dist/server/framework-preset-angular-cli.test.js +698 -0
  165. package/dist/{types/server → server}/framework-preset-angular-docs.d.ts +1 -1
  166. package/dist/{types/server → server}/framework-preset-angular-docs.js +1 -1
  167. package/dist/{types/server → server}/framework-preset-angular-ivy.d.ts +1 -1
  168. package/dist/{types/server → server}/framework-preset-angular-ivy.js +4 -2
  169. package/dist/server/plugins/storybook-normalize-angular-entry-plugin.d.ts +25 -0
  170. package/dist/server/plugins/storybook-normalize-angular-entry-plugin.js +46 -0
  171. package/dist/{types/server → server}/preset-options.d.ts +2 -2
  172. package/dist/{types/server → server}/preset-options.js +0 -0
  173. package/dist/{types/server → server}/utils/filter-out-styling-rules.d.ts +1 -1
  174. package/dist/{types/server → server}/utils/filter-out-styling-rules.js +0 -0
  175. package/dist/{types/server → server}/utils/module-is-available.d.ts +0 -0
  176. package/dist/{types/server → server}/utils/module-is-available.js +0 -0
  177. package/dist/{types/server → server}/utils/normalize-asset-patterns.d.ts +1 -1
  178. package/dist/{types/server → server}/utils/normalize-asset-patterns.js +0 -0
  179. package/dist/{types/server → server}/utils/normalize-optimization.d.ts +0 -0
  180. package/dist/{types/server → server}/utils/normalize-optimization.js +0 -0
  181. package/dist/types.d.ts +29 -0
  182. package/dist/{types/types.js → types.js} +0 -0
  183. package/jest.config.js +8 -1
  184. package/package.json +49 -54
  185. package/preset.js +1 -1
  186. package/renderer.d.ts +1 -1
  187. package/renderer.js +1 -1
  188. package/template/cli/.eslintrc.json +5 -0
  189. package/template/cli/Button.stories.ts +51 -0
  190. package/template/cli/Header.stories.ts +37 -0
  191. package/template/cli/Page.stories.ts +46 -0
  192. package/template/cli/User.ts +2 -0
  193. package/template/cli/button.component.ts +53 -0
  194. package/template/cli/header.component.ts +75 -0
  195. package/template/cli/page.component.ts +77 -0
  196. package/template/components/button.component.ts +54 -0
  197. package/template/components/button.css +30 -0
  198. package/template/components/form.component.ts +37 -0
  199. package/template/components/html.component.ts +22 -0
  200. package/template/components/index.js +8 -0
  201. package/template/components/pre.component.ts +29 -0
  202. package/template/stories/angular-mdx.stories.mdx +25 -0
  203. package/template/stories/argTypes/doc-button/doc-button.component.html +7 -0
  204. package/template/stories/argTypes/doc-button/doc-button.component.scss +3 -0
  205. package/template/stories/argTypes/doc-button/doc-button.component.ts +233 -0
  206. package/template/stories/argTypes/doc-button/doc-button.stories.ts +24 -0
  207. package/template/stories/argTypes/doc-directive/doc-directive.directive.ts +24 -0
  208. package/template/stories/argTypes/doc-directive/doc-directive.stories.ts +14 -0
  209. package/template/stories/argTypes/doc-injectable/doc-injectable.service.ts +27 -0
  210. package/template/stories/argTypes/doc-injectable/doc-injectable.stories.ts +17 -0
  211. package/template/stories/argTypes/doc-pipe/doc-pipe.pipe.ts +18 -0
  212. package/template/stories/argTypes/doc-pipe/doc-pipe.stories.ts +17 -0
  213. package/template/stories/basics/README.stories.mdx +7 -0
  214. package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva-component.stories.ts +27 -0
  215. package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva.component.ts +57 -0
  216. package/template/stories/basics/component-with-complex-selectors/attribute-selector.component.ts +19 -0
  217. package/template/stories/basics/component-with-complex-selectors/attribute-selectors.component.stories.ts +8 -0
  218. package/template/stories/basics/component-with-complex-selectors/class-selector.component.stories.ts +8 -0
  219. package/template/stories/basics/component-with-complex-selectors/class-selector.component.ts +19 -0
  220. package/template/stories/basics/component-with-complex-selectors/multiple-class-selector.component.stories.ts +8 -0
  221. package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.stories.ts +8 -0
  222. package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.ts +37 -0
  223. package/template/stories/basics/component-with-enums/enums.component.html +8 -0
  224. package/template/stories/basics/component-with-enums/enums.component.stories.ts +24 -0
  225. package/template/stories/basics/component-with-enums/enums.component.ts +53 -0
  226. package/template/stories/basics/component-with-inheritance/base-button.component.ts +10 -0
  227. package/template/stories/basics/component-with-inheritance/base-button.stories.ts +12 -0
  228. package/template/stories/basics/component-with-inheritance/icon-button.component.ts +11 -0
  229. package/template/stories/basics/component-with-inheritance/icon-button.stories.ts +13 -0
  230. package/template/stories/basics/component-with-ng-content/ng-content-about-parent.stories.ts +58 -0
  231. package/template/stories/basics/component-with-ng-content/ng-content-simple.stories.ts +29 -0
  232. package/template/stories/basics/component-with-ng-on-destroy/component-with-on-destroy.stories.ts +42 -0
  233. package/template/stories/basics/component-with-on-push/on-push-box.component.ts +21 -0
  234. package/template/stories/basics/component-with-on-push/on-push.stories.ts +21 -0
  235. package/template/stories/basics/component-with-pipe/custom-pipes.stories.ts +31 -0
  236. package/template/stories/basics/component-with-pipe/custom.pipe.ts +10 -0
  237. package/template/stories/basics/component-with-pipe/with-pipe.component.ts +10 -0
  238. package/template/stories/basics/component-with-provider/di.component.html +7 -0
  239. package/template/stories/basics/component-with-provider/di.component.stories.ts +26 -0
  240. package/template/stories/basics/component-with-provider/di.component.ts +28 -0
  241. package/template/stories/basics/component-with-style/styled.component.css +3 -0
  242. package/template/stories/basics/component-with-style/styled.component.html +5 -0
  243. package/template/stories/basics/component-with-style/styled.component.scss +5 -0
  244. package/template/stories/basics/component-with-style/styled.component.stories.ts +10 -0
  245. package/template/stories/basics/component-with-style/styled.component.ts +8 -0
  246. package/template/stories/basics/component-without-selector/without-selector-ng-component-outlet.stories.ts +73 -0
  247. package/template/stories/basics/component-without-selector/without-selector-ng-factory-resolver.stories.ts +71 -0
  248. package/template/stories/basics/component-without-selector/without-selector.component.ts +30 -0
  249. package/template/stories/basics/component-without-selector/without-selector.stories.ts +30 -0
  250. package/template/stories/basics/ng-module/angular-src/chip-color.token.ts +3 -0
  251. package/template/stories/basics/ng-module/angular-src/chip-text.pipe.ts +29 -0
  252. package/template/stories/basics/ng-module/angular-src/chip.component.ts +60 -0
  253. package/template/stories/basics/ng-module/angular-src/chips-group.component.ts +49 -0
  254. package/template/stories/basics/ng-module/angular-src/chips.module.ts +31 -0
  255. package/template/stories/basics/ng-module/import-module-for-root.stories.ts +50 -0
  256. package/template/stories/basics/ng-module/import-module.stories.ts +46 -0
  257. package/template/stories/button.component.ts +26 -0
  258. package/template/stories/core/README.stories.mdx +7 -0
  259. package/template/stories/core/decorators/componentWrapperDecorator/child.component.ts +20 -0
  260. package/template/stories/core/decorators/componentWrapperDecorator/decorators.stories.ts +117 -0
  261. package/template/stories/core/decorators/componentWrapperDecorator/parent.component.ts +18 -0
  262. package/template/stories/core/decorators/theme-decorator/decorators.stories.ts +20 -0
  263. package/template/stories/core/moduleMetadata/angular-src/custom.pipe.ts +10 -0
  264. package/template/stories/core/moduleMetadata/angular-src/dummy.service.ts +14 -0
  265. package/template/stories/core/moduleMetadata/angular-src/service.component.ts +24 -0
  266. package/template/stories/core/moduleMetadata/angular-src/token.component.ts +31 -0
  267. package/template/stories/core/moduleMetadata/in-export-default.stories.ts +38 -0
  268. package/template/stories/core/moduleMetadata/in-stories.stories.ts +46 -0
  269. package/template/stories/core/moduleMetadata/merge-default-and-story.stories.ts +35 -0
  270. package/template/stories/core/parameters/bootstrap-options.stories.ts +22 -0
  271. package/template/stories/core/styles/story-styles.stories.ts +50 -0
  272. package/template/stories/others/issues/12009-unknown-component.stories.ts +14 -0
  273. package/template/stories/others/ngx-translate/README.stories.mdx +58 -0
  274. package/LICENSE +0 -21
  275. package/dist/types/client/config.d.ts +0 -6
  276. package/dist/types/client/config.js +0 -10
  277. package/dist/types/client/decorateStory.d.ts +0 -4
  278. package/dist/types/client/decorators.d.ts +0 -5
  279. package/dist/types/client/docs/config.d.ts +0 -14
  280. package/dist/types/client/public-api.d.ts +0 -23
  281. package/dist/types/client/public-types.d.ts +0 -27
  282. package/dist/types/client/render.d.ts +0 -7
  283. package/dist/types/server/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -19
  284. package/dist/types/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -19
  285. package/dist/types/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -16
  286. package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -16
  287. package/dist/types/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -16
  288. package/dist/types/server/angular-cli-webpack-12.2.x.js +0 -66
  289. package/dist/types/server/angular-cli-webpack-13.x.x.d.ts +0 -1
  290. package/dist/types/server/angular-cli-webpack-older.d.ts +0 -6
  291. package/dist/types/server/angular-cli-webpack-older.js +0 -111
  292. package/dist/types/server/angular-devkit-build-webpack.d.ts +0 -30
  293. package/dist/types/server/angular-devkit-build-webpack.js +0 -164
  294. package/dist/types/server/create-fork-ts-checker-plugin.d.ts +0 -3
  295. package/dist/types/server/create-fork-ts-checker-plugin.js +0 -19
  296. package/dist/types/server/framework-preset-angular.d.ts +0 -5
  297. package/dist/types/server/framework-preset-angular.js +0 -103
  298. package/dist/types/server/ngx-template-loader/index.d.ts +0 -1
  299. package/dist/types/server/ngx-template-loader/index.js +0 -46
  300. package/dist/types/server/ts_config.d.ts +0 -2
  301. package/dist/types/server/ts_config.js +0 -28
  302. package/dist/types/types.d.ts +0 -28
@@ -0,0 +1,77 @@
1
+ import { Component } from '@angular/core';
2
+ import type { User } from './User';
3
+
4
+ @Component({
5
+ selector: 'storybook-page',
6
+ template: `<article>
7
+ <storybook-header
8
+ [user]="user"
9
+ (onLogout)="doLogout()"
10
+ (onLogin)="doLogin()"
11
+ (onCreateAccount)="doCreateAccount()"
12
+ ></storybook-header>
13
+ <section>
14
+ <h2>Pages in Storybook</h2>
15
+ <p>
16
+ We recommend building UIs with a
17
+ <a href="https://componentdriven.org" target="_blank" rel="noopener noreferrer">
18
+ <strong>component-driven</strong>
19
+ </a>
20
+ process starting with atomic components and ending with pages.
21
+ </p>
22
+ <p>
23
+ Render pages with mock data. This makes it easy to build and review page states without
24
+ needing to navigate to them in your app. Here are some handy patterns for managing page data
25
+ in Storybook:
26
+ </p>
27
+ <ul>
28
+ <li>
29
+ Use a higher-level connected component. Storybook helps you compose such data from the
30
+ "args" of child component stories
31
+ </li>
32
+ <li>
33
+ Assemble data in the page component from your services. You can mock these services out
34
+ using Storybook.
35
+ </li>
36
+ </ul>
37
+ <p>
38
+ Get a guided tutorial on component-driven development at
39
+ <a href="https://storybook.js.org/tutorials/" target="_blank" rel="noopener noreferrer">
40
+ Storybook tutorials
41
+ </a>
42
+ . Read more in the
43
+ <a href="https://storybook.js.org/docs" target="_blank" rel="noopener noreferrer"> docs </a>
44
+ .
45
+ </p>
46
+ <div class="tip-wrapper">
47
+ <span class="tip">Tip</span> Adjust the width of the canvas with the
48
+ <svg width="10" height="10" viewBox="0 0 12 12" xmlns="http://www.w3.org/2000/svg">
49
+ <g fill="none" fillRule="evenodd">
50
+ <path
51
+ d="M1.5 5.2h4.8c.3 0 .5.2.5.4v5.1c-.1.2-.3.3-.4.3H1.4a.5.5 0 01-.5-.4V5.7c0-.3.2-.5.5-.5zm0-2.1h6.9c.3 0 .5.2.5.4v7a.5.5 0 01-1 0V4H1.5a.5.5 0 010-1zm0-2.1h9c.3 0 .5.2.5.4v9.1a.5.5 0 01-1 0V2H1.5a.5.5 0 010-1zm4.3 5.2H2V10h3.8V6.2z"
52
+ id="a"
53
+ fill="#999"
54
+ />
55
+ </g>
56
+ </svg>
57
+ Viewports addon in the toolbar
58
+ </div>
59
+ </section>
60
+ </article>`,
61
+ styleUrls: ['./page.css'],
62
+ })
63
+ export default class PageComponent {
64
+ user: User | null = null;
65
+
66
+ doLogout() {
67
+ this.user = null;
68
+ }
69
+
70
+ doLogin() {
71
+ this.user = { name: 'Jane Doe' };
72
+ }
73
+
74
+ doCreateAccount() {
75
+ this.user = { name: 'Jane Doe' };
76
+ }
77
+ }
@@ -0,0 +1,54 @@
1
+ import { Component, Input, Output, EventEmitter } from '@angular/core';
2
+
3
+ @Component({
4
+ // Needs to be a different name to the CLI template button
5
+ selector: 'storybook-framework-button',
6
+ template: ` <button
7
+ type="button"
8
+ (click)="onClick.emit($event)"
9
+ [ngClass]="classes"
10
+ [ngStyle]="{ 'background-color': backgroundColor }"
11
+ >
12
+ {{ label }}
13
+ </button>`,
14
+ styleUrls: ['./button.css'],
15
+ })
16
+ export default class FrameworkButtonComponent {
17
+ /**
18
+ * Is this the principal call to action on the page?
19
+ */
20
+ @Input()
21
+ primary = false;
22
+
23
+ /**
24
+ * What background color to use
25
+ */
26
+ @Input()
27
+ backgroundColor?: string;
28
+
29
+ /**
30
+ * How large should the button be?
31
+ */
32
+ @Input()
33
+ size: 'small' | 'medium' | 'large' = 'medium';
34
+
35
+ /**
36
+ * Button contents
37
+ *
38
+ * @required
39
+ */
40
+ @Input()
41
+ label = 'Button';
42
+
43
+ /**
44
+ * Optional click handler
45
+ */
46
+ @Output()
47
+ onClick = new EventEmitter<Event>();
48
+
49
+ public get classes(): string[] {
50
+ const mode = this.primary ? 'storybook-button--primary' : 'storybook-button--secondary';
51
+
52
+ return ['storybook-button', `storybook-button--${this.size}`, mode];
53
+ }
54
+ }
@@ -0,0 +1,30 @@
1
+ .storybook-button {
2
+ font-family: 'Nunito Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
3
+ font-weight: 700;
4
+ border: 0;
5
+ border-radius: 3em;
6
+ cursor: pointer;
7
+ display: inline-block;
8
+ line-height: 1;
9
+ }
10
+ .storybook-button--primary {
11
+ color: white;
12
+ background-color: #1ea7fd;
13
+ }
14
+ .storybook-button--secondary {
15
+ color: #333;
16
+ background-color: transparent;
17
+ box-shadow: rgba(0, 0, 0, 0.15) 0px 0px 0px 1px inset;
18
+ }
19
+ .storybook-button--small {
20
+ font-size: 12px;
21
+ padding: 10px 16px;
22
+ }
23
+ .storybook-button--medium {
24
+ font-size: 14px;
25
+ padding: 11px 20px;
26
+ }
27
+ .storybook-button--large {
28
+ font-size: 16px;
29
+ padding: 12px 24px;
30
+ }
@@ -0,0 +1,37 @@
1
+ import { Component, Output, EventEmitter } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'storybook-form',
5
+ template: `
6
+ <form id="interaction-test-form" (submit)="handleSubmit($event)">
7
+ <label>
8
+ Enter Value
9
+ <input type="text" data-testid="value" [value]="value" required />
10
+ </label>
11
+ <button type="submit">Submit</button>
12
+ <p *ngIf="complete">Completed!!</p>
13
+ </form>
14
+ `,
15
+ })
16
+ export default class FormComponent {
17
+ /**
18
+ * Optional success handler
19
+ */
20
+ @Output()
21
+ onSuccess = new EventEmitter<string>();
22
+
23
+ value = '';
24
+
25
+ complete = false;
26
+
27
+ handleSubmit(event: SubmitEvent) {
28
+ event.preventDefault();
29
+ this.onSuccess.emit(this.value);
30
+ setTimeout(() => {
31
+ this.complete = true;
32
+ }, 500);
33
+ setTimeout(() => {
34
+ this.complete = false;
35
+ }, 1500);
36
+ }
37
+ }
@@ -0,0 +1,22 @@
1
+ import { Component, Input } from '@angular/core';
2
+ import { DomSanitizer } from '@angular/platform-browser';
3
+
4
+ @Component({
5
+ selector: 'storybook-html',
6
+ template: `<div [innerHTML]="safeContent"></div>`,
7
+ })
8
+ export default class HtmlComponent {
9
+ /**
10
+ * The HTML to render
11
+ *
12
+ * @required
13
+ */
14
+ @Input()
15
+ content = '';
16
+
17
+ constructor(private sanitizer: DomSanitizer) {}
18
+
19
+ get safeContent() {
20
+ return this.sanitizer.bypassSecurityTrustHtml(this.content);
21
+ }
22
+ }
@@ -0,0 +1,8 @@
1
+ import globalThis from 'global';
2
+
3
+ import Button from './button.component';
4
+ import Html from './html.component';
5
+ import Pre from './pre.component';
6
+ import Form from './form.component';
7
+
8
+ globalThis.Components = { Button, Html, Pre, Form };
@@ -0,0 +1,29 @@
1
+ import { Component, Input } from '@angular/core';
2
+
3
+ @Component({
4
+ selector: 'storybook-pre',
5
+ template: `<pre data-testid="pre" [ngStyle]="style">{{ finalText }}</pre>`,
6
+ })
7
+ export default class PreComponent {
8
+ /**
9
+ * Styles to apply to the component
10
+ */
11
+ @Input()
12
+ style?: Object;
13
+
14
+ /**
15
+ * An object to render
16
+ */
17
+ @Input()
18
+ object?: Object;
19
+
20
+ /**
21
+ * The code to render
22
+ */
23
+ @Input()
24
+ text?: string;
25
+
26
+ get finalText() {
27
+ return this.object ? JSON.stringify(this.object, null, 2) : this.text;
28
+ }
29
+ }
@@ -0,0 +1,25 @@
1
+ import globalThis from 'global';
2
+ import { moduleMetadata } from '@storybook/angular';
3
+ import { Meta, Story, Canvas } from '@storybook/addon-docs';
4
+
5
+ export const Button = globalThis.Components.Button;
6
+
7
+ <Meta
8
+ title="angular/angular-mdx"
9
+ component={Button}
10
+ decorators={[moduleMetadata({ declarations: [Button] })]}
11
+ />
12
+
13
+ # Angular-specific MDX Stories
14
+
15
+ <Canvas>
16
+ <Story name="Angular Story">
17
+ {{
18
+ template: `<storybook-framework-button [label]="text" (onClick)="onClick($event)"></storybook-framework-button>`,
19
+ props: {
20
+ text: 'hello button',
21
+ onClick: () => {},
22
+ },
23
+ }}
24
+ </Story>
25
+ </Canvas>
@@ -0,0 +1,7 @@
1
+ <button [disabled]="isDisabled" [ngClass]="classes" #buttonRef>
2
+ <img
3
+ width="100"
4
+ src="data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4NCjwhLS0gR2VuZXJhdG9yOiBBZG9iZSBJbGx1c3RyYXRvciAxOS4xLjAsIFNWRyBFeHBvcnQgUGx1Zy1JbiAuIFNWRyBWZXJzaW9uOiA2LjAwIEJ1aWxkIDApICAtLT4NCjxzdmcgdmVyc2lvbj0iMS4xIiBpZD0iTGF5ZXJfMSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB4bWxuczp4bGluaz0iaHR0cDovL3d3dy53My5vcmcvMTk5OS94bGluayIgeD0iMHB4IiB5PSIwcHgiDQoJIHZpZXdCb3g9IjAgMCAyNTAgMjUwIiBzdHlsZT0iZW5hYmxlLWJhY2tncm91bmQ6bmV3IDAgMCAyNTAgMjUwOyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSI+DQo8c3R5bGUgdHlwZT0idGV4dC9jc3MiPg0KCS5zdDB7ZmlsbDojREQwMDMxO30NCgkuc3Qxe2ZpbGw6I0MzMDAyRjt9DQoJLnN0MntmaWxsOiNGRkZGRkY7fQ0KPC9zdHlsZT4NCjxnPg0KCTxwb2x5Z29uIGNsYXNzPSJzdDAiIHBvaW50cz0iMTI1LDMwIDEyNSwzMCAxMjUsMzAgMzEuOSw2My4yIDQ2LjEsMTg2LjMgMTI1LDIzMCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAJIi8+DQoJPHBvbHlnb24gY2xhc3M9InN0MSIgcG9pbnRzPSIxMjUsMzAgMTI1LDUyLjIgMTI1LDUyLjEgMTI1LDE1My40IDEyNSwxNTMuNCAxMjUsMjMwIDEyNSwyMzAgMjAzLjksMTg2LjMgMjE4LjEsNjMuMiAxMjUsMzAgCSIvPg0KCTxwYXRoIGNsYXNzPSJzdDIiIGQ9Ik0xMjUsNTIuMUw2Ni44LDE4Mi42aDBoMjEuN2gwbDExLjctMjkuMmg0OS40bDExLjcsMjkuMmgwaDIxLjdoMEwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMUwxMjUsNTIuMQ0KCQlMMTI1LDUyLjF6IE0xNDIsMTM1LjRIMTA4bDE3LTQwLjlMMTQyLDEzNS40eiIvPg0KPC9nPg0KPC9zdmc+DQo="
5
+ />
6
+ {{ label }}
7
+ </button>
@@ -0,0 +1,3 @@
1
+ .btn-primary {
2
+ background-color: #ff9899;
3
+ }
@@ -0,0 +1,233 @@
1
+ /* eslint-disable no-console */
2
+ /* eslint-disable no-underscore-dangle */
3
+ import {
4
+ Component,
5
+ EventEmitter,
6
+ HostBinding,
7
+ HostListener,
8
+ Input,
9
+ Output,
10
+ ViewChild,
11
+ ElementRef,
12
+ } from '@angular/core';
13
+
14
+ export const exportedConstant = 'An exported constant';
15
+
16
+ export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge';
17
+
18
+ export interface ISomeInterface {
19
+ one: string;
20
+ two: boolean;
21
+ three: any[];
22
+ }
23
+
24
+ export enum ButtonAccent {
25
+ 'Normal' = 'Normal',
26
+ 'High' = 'High',
27
+ }
28
+
29
+ /**
30
+ * This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
31
+ *
32
+ * It supports [markdown](https://en.wikipedia.org/wiki/Markdown), so you can embed formatted text,
33
+ * like **bold**, _italic_, and `inline code`.
34
+ *
35
+ * > How you like dem apples?! It's never been easier to document all your components.
36
+ *
37
+ * @string Hello world
38
+ * @link [Example](http://example.com)
39
+ * @code `ThingThing`
40
+ * @html <span class="badge">aaa</span>
41
+ */
42
+ @Component({
43
+ selector: 'my-button',
44
+ templateUrl: './doc-button.component.html',
45
+ styleUrls: ['./doc-button.component.scss'],
46
+ })
47
+ export class DocButtonComponent<T> {
48
+ @ViewChild('buttonRef', { static: false }) buttonRef!: ElementRef;
49
+
50
+ /** Test default value. */
51
+ @Input()
52
+ public theDefaultValue = 'Default value in component';
53
+
54
+ /**
55
+ * Setting default value here because compodoc won't get the default value for accessors
56
+ * @default Another default value
57
+ * */
58
+ @Input()
59
+ get anotherDefaultValue() {
60
+ return this._anotherDefaultValue;
61
+ }
62
+
63
+ set anotherDefaultValue(v: string) {
64
+ this._anotherDefaultValue = v;
65
+ }
66
+
67
+ _anotherDefaultValue = 'Another default value';
68
+
69
+ /** Test null default value. */
70
+ @Input()
71
+ public aNullValue: string | null = null;
72
+
73
+ /** Test null default value. */
74
+ @Input()
75
+ // @ts-expect-error intentionally undefined
76
+ public anUndefinedValue;
77
+
78
+ /** Test numeric default value. */
79
+ @Input()
80
+ public aNumericValue = 123;
81
+
82
+ /** Appearance style of the button. */
83
+ @Input()
84
+ public appearance: 'primary' | 'secondary' = 'secondary';
85
+
86
+ /** Sets the button to a disabled state. */
87
+ @Input()
88
+ public isDisabled = false;
89
+
90
+ /** Specify the accent-type of the button */
91
+ @Input()
92
+ public accent: ButtonAccent = ButtonAccent.Normal;
93
+
94
+ /** Specifies some arbitrary object. This comment is to test certain chars like apostrophes - it's working */
95
+ @Input() public someDataObject!: ISomeInterface;
96
+
97
+ /**
98
+ * The inner text of the button.
99
+ *
100
+ * @required
101
+ */
102
+ @Input()
103
+ public label!: string;
104
+
105
+ /** Size of the button. */
106
+ @Input()
107
+ public size?: ButtonSize = 'medium';
108
+
109
+ /**
110
+ * Some input you shouldn't use.
111
+ *
112
+ * @deprecated
113
+ */
114
+ @Input()
115
+ public somethingYouShouldNotUse = false;
116
+
117
+ /**
118
+ * Handler to be called when the button is clicked by a user.
119
+ *
120
+ * Will also block the emission of the event if `isDisabled` is true.
121
+ */
122
+ @Output()
123
+ public onClick = new EventEmitter<Event>();
124
+
125
+ /**
126
+ * This is an internal method that we don't want to document and have added the `ignore` annotation to.
127
+ *
128
+ * @ignore
129
+ */
130
+ public handleClick(event: Event) {
131
+ event.stopPropagation();
132
+
133
+ if (!this.isDisabled) {
134
+ this.onClick.emit(event);
135
+ }
136
+ }
137
+
138
+ private _inputValue = 'some value';
139
+
140
+ /** Setter for `inputValue` that is also an `@Input`. */
141
+ @Input()
142
+ public set inputValue(value: string) {
143
+ this._inputValue = value;
144
+ }
145
+
146
+ /** Getter for `inputValue`. */
147
+ public get inputValue() {
148
+ return this._inputValue;
149
+ }
150
+
151
+ @HostListener('click', ['$event'])
152
+ onClickListener(event: Event) {
153
+ console.log('button', event.target);
154
+ this.handleClick(event);
155
+ }
156
+
157
+ @HostBinding('class.focused') focus = false;
158
+
159
+ /**
160
+ * Returns all the CSS classes for the button.
161
+ *
162
+ * @ignore
163
+ */
164
+ public get classes(): string[] {
165
+ return [this.appearance, this.size]
166
+ .filter((_class) => !!_class)
167
+ .map((_class) => `btn-${_class}`);
168
+ }
169
+
170
+ /**
171
+ * @ignore
172
+ */
173
+ public ignoredProperty = 'Ignore me';
174
+
175
+ /** Public value. */
176
+ public internalProperty = 'Public hello';
177
+
178
+ /** Private value. */
179
+ private _value = 'Private hello';
180
+
181
+ /** Set the private value. */
182
+ public set value(value: string | number) {
183
+ this._value = `${value}`;
184
+ }
185
+
186
+ /** Get the private value. */
187
+ public get value(): string | number {
188
+ return this._value;
189
+ }
190
+
191
+ /**
192
+ * An internal calculation method which adds `x` and `y` together.
193
+ *
194
+ * @param x Some number you'd like to use.
195
+ * @param y Some other number or string you'd like to use, will have `parseInt()` applied before calculation.
196
+ */
197
+ public calc(x: number, y: string | number): number {
198
+ return x + parseInt(`${y}`, 10);
199
+ }
200
+
201
+ /** A public method using an interface. */
202
+ public publicMethod(things: ISomeInterface) {
203
+ console.log(things);
204
+ }
205
+
206
+ /**
207
+ * A protected method.
208
+ *
209
+ * @param id Some `id`.
210
+ */
211
+ protected protectedMethod(id?: number) {
212
+ console.log(id);
213
+ }
214
+
215
+ /**
216
+ * A private method.
217
+ *
218
+ * @param password Some `password`.
219
+ */
220
+ private privateMethod(password: string) {
221
+ console.log(password);
222
+ }
223
+
224
+ @Input('showKeyAlias')
225
+ public showKey!: keyof T;
226
+
227
+ @Input()
228
+ public set item(item: T[]) {
229
+ this.processedItem = item;
230
+ }
231
+
232
+ public processedItem!: T[];
233
+ }
@@ -0,0 +1,24 @@
1
+ import { Args } from '@storybook/angular';
2
+ import { DocButtonComponent } from './doc-button.component';
3
+
4
+ export default {
5
+ component: DocButtonComponent,
6
+ };
7
+
8
+ export const Basic = (args: Args) => ({
9
+ props: args,
10
+ });
11
+ Basic.args = { label: 'Args test', isDisabled: false };
12
+ Basic.ArgTypes = {
13
+ theDefaultValue: {
14
+ table: {
15
+ defaultValue: { summary: 'Basic default value' },
16
+ },
17
+ },
18
+ };
19
+
20
+ export const WithTemplate = (args: Args) => ({
21
+ props: args,
22
+ template: '<my-button [label]="label" [appearance]="appearance"></my-button>',
23
+ });
24
+ WithTemplate.args = { label: 'Template test', appearance: 'primary' };
@@ -0,0 +1,24 @@
1
+ import { ElementRef, AfterViewInit, Directive, Input } from '@angular/core';
2
+
3
+ /**
4
+ * This is an Angular Directive
5
+ * example that has a Prop Table.
6
+ */
7
+ @Directive({
8
+ selector: '[docDirective]',
9
+ })
10
+ export class DocDirective implements AfterViewInit {
11
+ constructor(private ref: ElementRef) {}
12
+
13
+ /**
14
+ * Will apply gray background color
15
+ * if set to true.
16
+ */
17
+ @Input() hasGrayBackground = false;
18
+
19
+ ngAfterViewInit(): void {
20
+ if (this.hasGrayBackground) {
21
+ this.ref.nativeElement.style = 'background-color: lightgray';
22
+ }
23
+ }
24
+ }
@@ -0,0 +1,14 @@
1
+ import { DocDirective } from './doc-directive.directive';
2
+
3
+ export default {
4
+ component: DocDirective,
5
+ };
6
+
7
+ const modules = {
8
+ declarations: [DocDirective],
9
+ };
10
+
11
+ export const Basic = () => ({
12
+ moduleMetadata: modules,
13
+ template: '<div docDirective [hasGrayBackground]="true"><h1>DocDirective</h1></div>',
14
+ });
@@ -0,0 +1,27 @@
1
+ import { Injectable } from '@angular/core';
2
+ import { HttpHeaders } from '@angular/common/http';
3
+
4
+ /**
5
+ * This is an Angular Injectable
6
+ * example that has a Prop Table.
7
+ */
8
+ @Injectable({
9
+ providedIn: 'root',
10
+ })
11
+ export class DocInjectableService {
12
+ /**
13
+ * Auth headers to use.
14
+ */
15
+ auth: any;
16
+
17
+ constructor() {
18
+ this.auth = new HttpHeaders({ 'Content-Type': 'application/json' });
19
+ }
20
+
21
+ /**
22
+ * Get posts from Backend.
23
+ */
24
+ getPosts(): unknown[] {
25
+ return [];
26
+ }
27
+ }
@@ -0,0 +1,17 @@
1
+ import { DocInjectableService } from './doc-injectable.service';
2
+
3
+ export default {
4
+ component: DocInjectableService,
5
+ parameters: {
6
+ controls: { hideNoControlsWarning: true },
7
+ },
8
+ };
9
+
10
+ const modules = {
11
+ provider: [DocInjectableService],
12
+ };
13
+
14
+ export const Basic = () => ({
15
+ moduleMetadata: modules,
16
+ template: '<div><h1>DocInjectable</h1></div>',
17
+ });
@@ -0,0 +1,18 @@
1
+ import { PipeTransform, Pipe } from '@angular/core';
2
+
3
+ /**
4
+ * This is an Angular Pipe
5
+ * example that has a Prop Table.
6
+ */
7
+ @Pipe({
8
+ name: 'docPipe',
9
+ })
10
+ export class DocPipe implements PipeTransform {
11
+ /**
12
+ * Transforms a string into uppercase.
13
+ * @param value string
14
+ */
15
+ transform(value: string): string {
16
+ return value?.toUpperCase();
17
+ }
18
+ }
@@ -0,0 +1,17 @@
1
+ import { DocPipe } from './doc-pipe.pipe';
2
+
3
+ export default {
4
+ component: DocPipe,
5
+ parameters: {
6
+ controls: { hideNoControlsWarning: true },
7
+ },
8
+ };
9
+
10
+ const modules = {
11
+ declarations: [DocPipe],
12
+ };
13
+
14
+ export const Basic = () => ({
15
+ moduleMetadata: modules,
16
+ template: `<div><h1>{{ 'DocPipe' | docPipe }}</h1></div>`,
17
+ });
@@ -0,0 +1,7 @@
1
+ import { Meta } from '@storybook/addon-docs';
2
+
3
+ <Meta title="stories / frameworks / angular / basics / README" />
4
+
5
+ # Examples for Angular features
6
+
7
+ These examples serve to highlight the right Storybook operation for basics Angular features