@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.
- package/.eslintrc.js +8 -0
- package/README.md +1 -1
- package/dist/{types/builders → builders}/build-storybook/index.d.ts +3 -3
- package/dist/{types/builders → builders}/build-storybook/index.js +0 -0
- package/dist/builders/build-storybook/index.spec.d.ts +1 -0
- package/dist/builders/build-storybook/index.spec.js +218 -0
- package/dist/{types/builders → builders}/build-storybook/schema.json +0 -0
- package/dist/{types/builders → builders}/builders.json +0 -0
- package/dist/{types/builders → builders}/start-storybook/index.d.ts +3 -3
- package/dist/{types/builders → builders}/start-storybook/index.js +0 -0
- package/dist/builders/start-storybook/index.spec.d.ts +1 -0
- package/dist/builders/start-storybook/index.spec.js +214 -0
- package/dist/{types/builders → builders}/start-storybook/schema.json +0 -0
- package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.d.ts +0 -0
- package/dist/{types/builders → builders}/utils/build-standalone-errors-handler.js +3 -6
- package/dist/{types/builders → builders}/utils/run-compodoc.d.ts +0 -0
- package/dist/{types/builders → builders}/utils/run-compodoc.js +0 -1
- package/dist/builders/utils/run-compodoc.spec.d.ts +1 -0
- package/dist/builders/utils/run-compodoc.spec.js +59 -0
- package/dist/{types/builders → builders}/utils/standalone-options.d.ts +3 -3
- package/dist/{types/builders → builders}/utils/standalone-options.js +0 -0
- package/dist/{types/client → client}/angular/app.component.d.ts +1 -1
- package/dist/{types/client → client}/angular/app.component.js +0 -1
- package/dist/{types/client → client}/angular/app.token.d.ts +0 -0
- package/dist/{types/client → client}/angular/app.token.js +0 -0
- package/dist/{types/client → client}/angular/helpers.d.ts +3 -3
- package/dist/{types/client → client}/angular/helpers.js +1 -2
- package/dist/{types/client → client}/angular-beta/AbstractRenderer.d.ts +1 -1
- package/dist/{types/client → client}/angular-beta/AbstractRenderer.js +13 -13
- package/dist/{types/client → client}/angular-beta/CanvasRenderer.d.ts +0 -0
- package/dist/{types/client → client}/angular-beta/CanvasRenderer.js +0 -0
- package/dist/{types/client → client}/angular-beta/ComputesTemplateFromComponent.d.ts +3 -3
- package/dist/{types/client → client}/angular-beta/ComputesTemplateFromComponent.js +3 -3
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.d.ts +1 -0
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +390 -0
- package/dist/{types/client → client}/angular-beta/DocsRenderer.d.ts +0 -0
- package/dist/{types/client → client}/angular-beta/DocsRenderer.js +5 -8
- package/dist/{types/client → client}/angular-beta/RendererFactory.d.ts +1 -1
- package/dist/{types/client → client}/angular-beta/RendererFactory.js +3 -3
- package/dist/client/angular-beta/RendererFactory.test.d.ts +1 -0
- package/dist/client/angular-beta/RendererFactory.test.js +297 -0
- package/dist/{types/client → client}/angular-beta/StorybookModule.d.ts +2 -2
- package/dist/{types/client → client}/angular-beta/StorybookModule.js +4 -23
- package/dist/client/angular-beta/StorybookModule.test.d.ts +1 -0
- package/dist/client/angular-beta/StorybookModule.test.js +279 -0
- package/dist/{types/client → client}/angular-beta/StorybookProvider.d.ts +1 -1
- package/dist/{types/client → client}/angular-beta/StorybookProvider.js +0 -0
- package/dist/{types/client → client}/angular-beta/StorybookWrapperComponent.d.ts +0 -0
- package/dist/{types/client → client}/angular-beta/StorybookWrapperComponent.js +0 -1
- package/dist/client/angular-beta/__testfixtures__/input.component.d.ts +26 -0
- package/dist/client/angular-beta/__testfixtures__/input.component.js +67 -0
- package/dist/{types/client → client}/angular-beta/utils/NgComponentAnalyzer.d.ts +2 -2
- package/dist/{types/client → client}/angular-beta/utils/NgComponentAnalyzer.js +0 -0
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.d.ts +1 -0
- package/dist/client/angular-beta/utils/NgComponentAnalyzer.test.js +340 -0
- package/dist/{types/client → client}/angular-beta/utils/NgModulesAnalyzer.d.ts +0 -0
- package/dist/{types/client → client}/angular-beta/utils/NgModulesAnalyzer.js +0 -0
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.d.ts +1 -0
- package/dist/client/angular-beta/utils/NgModulesAnalyzer.test.js +23 -0
- package/dist/client/config.d.ts +6 -0
- package/dist/client/config.js +10 -0
- package/dist/client/decorateStory.d.ts +4 -0
- package/dist/{types/client → client}/decorateStory.js +3 -3
- package/dist/client/decorateStory.test.d.ts +1 -0
- package/dist/client/decorateStory.test.js +335 -0
- package/dist/client/decorators.d.ts +5 -0
- package/dist/{types/client → client}/decorators.js +0 -0
- package/dist/client/decorators.test.d.ts +1 -0
- package/dist/client/decorators.test.js +106 -0
- package/dist/client/docs/__testfixtures__/doc-button/input.d.ts +111 -0
- package/dist/client/docs/__testfixtures__/doc-button/input.js +207 -0
- package/dist/client/docs/__testfixtures__/doc-button/tsconfig.json +7 -0
- package/dist/client/docs/angular-properties.test.d.ts +1 -0
- package/dist/client/docs/angular-properties.test.js +56 -0
- package/dist/{types/client → client}/docs/compodoc.d.ts +5 -11
- package/dist/{types/client → client}/docs/compodoc.js +7 -7
- package/dist/client/docs/compodoc.test.d.ts +1 -0
- package/dist/client/docs/compodoc.test.js +131 -0
- package/dist/client/docs/config.d.ts +4 -0
- package/dist/{types/client → client}/docs/config.js +0 -0
- package/dist/{types/client → client}/docs/index.d.ts +0 -0
- package/dist/{types/client → client}/docs/index.js +0 -0
- package/dist/{types/client → client}/docs/sourceDecorator.d.ts +3 -3
- package/dist/{types/client → client}/docs/sourceDecorator.js +3 -3
- package/dist/{types/client → client}/docs/types.d.ts +1 -1
- package/dist/{types/client → client}/docs/types.js +0 -0
- package/dist/{types/client → client}/globals.d.ts +0 -0
- package/dist/{types/client → client}/globals.js +0 -0
- package/dist/{types/client → client}/index.d.ts +0 -0
- package/dist/{types/client → client}/index.js +3 -0
- package/dist/client/public-api.d.ts +15 -0
- package/dist/{types/client → client}/public-api.js +2 -9
- package/dist/client/public-types.d.ts +36 -0
- package/dist/{types/client → client}/public-types.js +0 -0
- package/dist/client/render.d.ts +6 -0
- package/dist/{types/client → client}/render.js +3 -3
- package/dist/{types/client → client}/types.d.ts +9 -13
- package/dist/{types/client → client}/types.js +0 -0
- package/dist/{types/index.d.ts → index.d.ts} +0 -0
- package/dist/{types/index.js → index.js} +0 -0
- package/dist/{types/preset.d.ts → preset.d.ts} +1 -1
- package/dist/{types/preset.js → preset.js} +0 -1
- package/dist/{types/renderer.d.ts → renderer.d.ts} +0 -0
- package/dist/{types/renderer.js → renderer.js} +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/empty-projects-entry/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/main.js +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json +0 -0
- package/dist/{types/server/__mocks-ng-workspace__/some-config → server/__mocks-ng-workspace__/minimal-config}/tsconfig.json +1 -4
- package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/main.js +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/tsconfig.app.json +0 -0
- package/dist/{types/server/__mocks-ng-workspace__/with-angularBrowserTarget → server/__mocks-ng-workspace__/some-config}/tsconfig.json +1 -4
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/tsconfig.app.json +0 -0
- package/dist/{types/server/__mocks-ng-workspace__/minimal-config → server/__mocks-ng-workspace__/with-angularBrowserTarget}/tsconfig.json +1 -4
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/src/main.js +0 -0
- package/dist/{types/server/__mocks-ng-workspace__/without-projects-entry → server/__mocks-ng-workspace__/with-lib}/projects/pattern-lib/tsconfig.lib.json +2 -8
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/tsconfig.json +1 -4
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/nx.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/main.js +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx/src/tsconfig.app.json +0 -0
- package/dist/server/__mocks-ng-workspace__/with-nx/tsconfig.json +14 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/nx.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/main.js +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json +0 -0
- package/dist/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +14 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/workspace.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.js +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/tsconfig.app.json +0 -0
- package/dist/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +13 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build-options/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-compatible-projects/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/src/main.js +0 -0
- package/dist/{types/server/__mocks-ng-workspace__/with-lib → server/__mocks-ng-workspace__/without-projects-entry}/projects/pattern-lib/tsconfig.lib.json +2 -8
- package/dist/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +13 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/angular.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.d.ts +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/main.js +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json +0 -0
- package/dist/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +13 -0
- package/dist/server/__tests__/angular.json +96 -0
- package/dist/{types/server/angular-cli-webpack-12.2.x.d.ts → server/angular-cli-webpack.d.ts} +0 -0
- package/dist/{types/server/angular-cli-webpack-13.x.x.js → server/angular-cli-webpack.js} +6 -1
- package/dist/{types/server → server}/angular-read-workspace.d.ts +0 -0
- package/dist/{types/server → server}/angular-read-workspace.js +1 -1
- package/dist/{types/server → server}/framework-preset-angular-cli.d.ts +1 -1
- package/dist/{types/server → server}/framework-preset-angular-cli.js +5 -24
- package/dist/server/framework-preset-angular-cli.test.d.ts +1 -0
- package/dist/server/framework-preset-angular-cli.test.js +698 -0
- package/dist/{types/server → server}/framework-preset-angular-docs.d.ts +1 -1
- package/dist/{types/server → server}/framework-preset-angular-docs.js +1 -1
- package/dist/{types/server → server}/framework-preset-angular-ivy.d.ts +1 -1
- package/dist/{types/server → server}/framework-preset-angular-ivy.js +4 -2
- package/dist/server/plugins/storybook-normalize-angular-entry-plugin.d.ts +25 -0
- package/dist/server/plugins/storybook-normalize-angular-entry-plugin.js +46 -0
- package/dist/{types/server → server}/preset-options.d.ts +2 -2
- package/dist/{types/server → server}/preset-options.js +0 -0
- package/dist/{types/server → server}/utils/filter-out-styling-rules.d.ts +1 -1
- package/dist/{types/server → server}/utils/filter-out-styling-rules.js +0 -0
- package/dist/{types/server → server}/utils/module-is-available.d.ts +0 -0
- package/dist/{types/server → server}/utils/module-is-available.js +0 -0
- package/dist/{types/server → server}/utils/normalize-asset-patterns.d.ts +1 -1
- package/dist/{types/server → server}/utils/normalize-asset-patterns.js +0 -0
- package/dist/{types/server → server}/utils/normalize-optimization.d.ts +0 -0
- package/dist/{types/server → server}/utils/normalize-optimization.js +0 -0
- package/dist/types.d.ts +29 -0
- package/dist/{types/types.js → types.js} +0 -0
- package/jest.config.js +8 -1
- package/package.json +49 -54
- package/preset.js +1 -1
- package/renderer.d.ts +1 -1
- package/renderer.js +1 -1
- package/template/cli/.eslintrc.json +5 -0
- package/template/cli/Button.stories.ts +51 -0
- package/template/cli/Header.stories.ts +37 -0
- package/template/cli/Page.stories.ts +46 -0
- package/template/cli/User.ts +2 -0
- package/template/cli/button.component.ts +53 -0
- package/template/cli/header.component.ts +75 -0
- package/template/cli/page.component.ts +77 -0
- package/template/components/button.component.ts +54 -0
- package/template/components/button.css +30 -0
- package/template/components/form.component.ts +37 -0
- package/template/components/html.component.ts +22 -0
- package/template/components/index.js +8 -0
- package/template/components/pre.component.ts +29 -0
- package/template/stories/angular-mdx.stories.mdx +25 -0
- package/template/stories/argTypes/doc-button/doc-button.component.html +7 -0
- package/template/stories/argTypes/doc-button/doc-button.component.scss +3 -0
- package/template/stories/argTypes/doc-button/doc-button.component.ts +233 -0
- package/template/stories/argTypes/doc-button/doc-button.stories.ts +24 -0
- package/template/stories/argTypes/doc-directive/doc-directive.directive.ts +24 -0
- package/template/stories/argTypes/doc-directive/doc-directive.stories.ts +14 -0
- package/template/stories/argTypes/doc-injectable/doc-injectable.service.ts +27 -0
- package/template/stories/argTypes/doc-injectable/doc-injectable.stories.ts +17 -0
- package/template/stories/argTypes/doc-pipe/doc-pipe.pipe.ts +18 -0
- package/template/stories/argTypes/doc-pipe/doc-pipe.stories.ts +17 -0
- package/template/stories/basics/README.stories.mdx +7 -0
- package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva-component.stories.ts +27 -0
- package/template/stories/basics/angular-forms/customControlValueAccessor/custom-cva.component.ts +57 -0
- package/template/stories/basics/component-with-complex-selectors/attribute-selector.component.ts +19 -0
- package/template/stories/basics/component-with-complex-selectors/attribute-selectors.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/class-selector.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/class-selector.component.ts +19 -0
- package/template/stories/basics/component-with-complex-selectors/multiple-class-selector.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.stories.ts +8 -0
- package/template/stories/basics/component-with-complex-selectors/multiple-selector.component.ts +37 -0
- package/template/stories/basics/component-with-enums/enums.component.html +8 -0
- package/template/stories/basics/component-with-enums/enums.component.stories.ts +24 -0
- package/template/stories/basics/component-with-enums/enums.component.ts +53 -0
- package/template/stories/basics/component-with-inheritance/base-button.component.ts +10 -0
- package/template/stories/basics/component-with-inheritance/base-button.stories.ts +12 -0
- package/template/stories/basics/component-with-inheritance/icon-button.component.ts +11 -0
- package/template/stories/basics/component-with-inheritance/icon-button.stories.ts +13 -0
- package/template/stories/basics/component-with-ng-content/ng-content-about-parent.stories.ts +58 -0
- package/template/stories/basics/component-with-ng-content/ng-content-simple.stories.ts +29 -0
- package/template/stories/basics/component-with-ng-on-destroy/component-with-on-destroy.stories.ts +42 -0
- package/template/stories/basics/component-with-on-push/on-push-box.component.ts +21 -0
- package/template/stories/basics/component-with-on-push/on-push.stories.ts +21 -0
- package/template/stories/basics/component-with-pipe/custom-pipes.stories.ts +31 -0
- package/template/stories/basics/component-with-pipe/custom.pipe.ts +10 -0
- package/template/stories/basics/component-with-pipe/with-pipe.component.ts +10 -0
- package/template/stories/basics/component-with-provider/di.component.html +7 -0
- package/template/stories/basics/component-with-provider/di.component.stories.ts +26 -0
- package/template/stories/basics/component-with-provider/di.component.ts +28 -0
- package/template/stories/basics/component-with-style/styled.component.css +3 -0
- package/template/stories/basics/component-with-style/styled.component.html +5 -0
- package/template/stories/basics/component-with-style/styled.component.scss +5 -0
- package/template/stories/basics/component-with-style/styled.component.stories.ts +10 -0
- package/template/stories/basics/component-with-style/styled.component.ts +8 -0
- package/template/stories/basics/component-without-selector/without-selector-ng-component-outlet.stories.ts +73 -0
- package/template/stories/basics/component-without-selector/without-selector-ng-factory-resolver.stories.ts +71 -0
- package/template/stories/basics/component-without-selector/without-selector.component.ts +30 -0
- package/template/stories/basics/component-without-selector/without-selector.stories.ts +30 -0
- package/template/stories/basics/ng-module/angular-src/chip-color.token.ts +3 -0
- package/template/stories/basics/ng-module/angular-src/chip-text.pipe.ts +29 -0
- package/template/stories/basics/ng-module/angular-src/chip.component.ts +60 -0
- package/template/stories/basics/ng-module/angular-src/chips-group.component.ts +49 -0
- package/template/stories/basics/ng-module/angular-src/chips.module.ts +31 -0
- package/template/stories/basics/ng-module/import-module-for-root.stories.ts +50 -0
- package/template/stories/basics/ng-module/import-module.stories.ts +46 -0
- package/template/stories/button.component.ts +26 -0
- package/template/stories/core/README.stories.mdx +7 -0
- package/template/stories/core/decorators/componentWrapperDecorator/child.component.ts +20 -0
- package/template/stories/core/decorators/componentWrapperDecorator/decorators.stories.ts +117 -0
- package/template/stories/core/decorators/componentWrapperDecorator/parent.component.ts +18 -0
- package/template/stories/core/decorators/theme-decorator/decorators.stories.ts +20 -0
- package/template/stories/core/moduleMetadata/angular-src/custom.pipe.ts +10 -0
- package/template/stories/core/moduleMetadata/angular-src/dummy.service.ts +14 -0
- package/template/stories/core/moduleMetadata/angular-src/service.component.ts +24 -0
- package/template/stories/core/moduleMetadata/angular-src/token.component.ts +31 -0
- package/template/stories/core/moduleMetadata/in-export-default.stories.ts +38 -0
- package/template/stories/core/moduleMetadata/in-stories.stories.ts +46 -0
- package/template/stories/core/moduleMetadata/merge-default-and-story.stories.ts +35 -0
- package/template/stories/core/parameters/bootstrap-options.stories.ts +22 -0
- package/template/stories/core/styles/story-styles.stories.ts +50 -0
- package/template/stories/others/issues/12009-unknown-component.stories.ts +14 -0
- package/template/stories/others/ngx-translate/README.stories.mdx +58 -0
- package/LICENSE +0 -21
- package/dist/types/client/config.d.ts +0 -6
- package/dist/types/client/config.js +0 -10
- package/dist/types/client/decorateStory.d.ts +0 -4
- package/dist/types/client/decorators.d.ts +0 -5
- package/dist/types/client/docs/config.d.ts +0 -14
- package/dist/types/client/public-api.d.ts +0 -23
- package/dist/types/client/public-types.d.ts +0 -27
- package/dist/types/client/render.d.ts +0 -7
- package/dist/types/server/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -19
- package/dist/types/server/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -19
- package/dist/types/server/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -16
- package/dist/types/server/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -16
- package/dist/types/server/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -16
- package/dist/types/server/angular-cli-webpack-12.2.x.js +0 -66
- package/dist/types/server/angular-cli-webpack-13.x.x.d.ts +0 -1
- package/dist/types/server/angular-cli-webpack-older.d.ts +0 -6
- package/dist/types/server/angular-cli-webpack-older.js +0 -111
- package/dist/types/server/angular-devkit-build-webpack.d.ts +0 -30
- package/dist/types/server/angular-devkit-build-webpack.js +0 -164
- package/dist/types/server/create-fork-ts-checker-plugin.d.ts +0 -3
- package/dist/types/server/create-fork-ts-checker-plugin.js +0 -19
- package/dist/types/server/framework-preset-angular.d.ts +0 -5
- package/dist/types/server/framework-preset-angular.js +0 -103
- package/dist/types/server/ngx-template-loader/index.d.ts +0 -1
- package/dist/types/server/ngx-template-loader/index.js +0 -46
- package/dist/types/server/ts_config.d.ts +0 -2
- package/dist/types/server/ts_config.js +0 -28
- package/dist/types/types.d.ts +0 -28
|
@@ -0,0 +1,335 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
9
|
+
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
10
|
+
};
|
|
11
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
const core_1 = require("@angular/core");
|
|
16
|
+
const decorators_1 = require("./decorators");
|
|
17
|
+
const decorateStory_1 = __importDefault(require("./decorateStory"));
|
|
18
|
+
describe('decorateStory', () => {
|
|
19
|
+
describe('angular behavior', () => {
|
|
20
|
+
it('should use componentWrapperDecorator with args', () => {
|
|
21
|
+
const decorators = [
|
|
22
|
+
(0, decorators_1.componentWrapperDecorator)(ParentComponent, ({ args }) => args),
|
|
23
|
+
(0, decorators_1.componentWrapperDecorator)((story) => `<grandparent [grandparentInput]="grandparentInput">${story}</grandparent>`, ({ args }) => args),
|
|
24
|
+
(0, decorators_1.componentWrapperDecorator)((story) => `<great-grandparent>${story}</great-grandparent>`),
|
|
25
|
+
];
|
|
26
|
+
const decorated = (0, decorateStory_1.default)(() => ({ template: '</child>' }), decorators);
|
|
27
|
+
expect(decorated(makeContext({
|
|
28
|
+
component: FooComponent,
|
|
29
|
+
args: {
|
|
30
|
+
parentInput: 'Parent input',
|
|
31
|
+
grandparentInput: 'grandparent input',
|
|
32
|
+
parentOutput: () => { },
|
|
33
|
+
},
|
|
34
|
+
}))).toEqual({
|
|
35
|
+
props: {
|
|
36
|
+
parentInput: 'Parent input',
|
|
37
|
+
grandparentInput: 'grandparent input',
|
|
38
|
+
parentOutput: expect.any(Function),
|
|
39
|
+
},
|
|
40
|
+
template: '<great-grandparent><grandparent [grandparentInput]="grandparentInput"><parent [parentInput]="parentInput" (parentOutput)="parentOutput($event)"></child></parent></grandparent></great-grandparent>',
|
|
41
|
+
userDefinedTemplate: true,
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
it('should use componentWrapperDecorator with input / output', () => {
|
|
45
|
+
const decorators = [
|
|
46
|
+
(0, decorators_1.componentWrapperDecorator)(ParentComponent, {
|
|
47
|
+
parentInput: 'Parent input',
|
|
48
|
+
parentOutput: () => { },
|
|
49
|
+
}),
|
|
50
|
+
(0, decorators_1.componentWrapperDecorator)((story) => `<grandparent [grandparentInput]="grandparentInput">${story}</grandparent>`, {
|
|
51
|
+
grandparentInput: 'Grandparent input',
|
|
52
|
+
sameInput: 'Should be override by story props',
|
|
53
|
+
}),
|
|
54
|
+
(0, decorators_1.componentWrapperDecorator)((story) => `<great-grandparent>${story}</great-grandparent>`),
|
|
55
|
+
];
|
|
56
|
+
const decorated = (0, decorateStory_1.default)(() => ({ template: '</child>', props: { sameInput: 'Story input' } }), decorators);
|
|
57
|
+
expect(decorated(makeContext({
|
|
58
|
+
component: FooComponent,
|
|
59
|
+
}))).toEqual({
|
|
60
|
+
props: {
|
|
61
|
+
parentInput: 'Parent input',
|
|
62
|
+
parentOutput: expect.any(Function),
|
|
63
|
+
grandparentInput: 'Grandparent input',
|
|
64
|
+
sameInput: 'Story input',
|
|
65
|
+
},
|
|
66
|
+
template: '<great-grandparent><grandparent [grandparentInput]="grandparentInput"><parent [parentInput]="parentInput" (parentOutput)="parentOutput($event)"></child></parent></grandparent></great-grandparent>',
|
|
67
|
+
userDefinedTemplate: true,
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
it('should use componentWrapperDecorator', () => {
|
|
71
|
+
const decorators = [
|
|
72
|
+
(0, decorators_1.componentWrapperDecorator)(ParentComponent),
|
|
73
|
+
(0, decorators_1.componentWrapperDecorator)((story) => `<grandparent>${story}</grandparent>`),
|
|
74
|
+
(0, decorators_1.componentWrapperDecorator)((story) => `<great-grandparent>${story}</great-grandparent>`),
|
|
75
|
+
];
|
|
76
|
+
const decorated = (0, decorateStory_1.default)(() => ({ template: '</child>' }), decorators);
|
|
77
|
+
expect(decorated(makeContext({ component: FooComponent }))).toEqual({
|
|
78
|
+
template: '<great-grandparent><grandparent><parent></child></parent></grandparent></great-grandparent>',
|
|
79
|
+
userDefinedTemplate: true,
|
|
80
|
+
});
|
|
81
|
+
});
|
|
82
|
+
it('should use template in preference to component parameters', () => {
|
|
83
|
+
const decorators = [
|
|
84
|
+
(s) => {
|
|
85
|
+
const story = s();
|
|
86
|
+
return {
|
|
87
|
+
...story,
|
|
88
|
+
template: `<parent>${story.template}</parent>`,
|
|
89
|
+
};
|
|
90
|
+
},
|
|
91
|
+
(s) => {
|
|
92
|
+
const story = s();
|
|
93
|
+
return {
|
|
94
|
+
...story,
|
|
95
|
+
template: `<grandparent>${story.template}</grandparent>`,
|
|
96
|
+
};
|
|
97
|
+
},
|
|
98
|
+
(s) => {
|
|
99
|
+
const story = s();
|
|
100
|
+
return {
|
|
101
|
+
...story,
|
|
102
|
+
template: `<great-grandparent>${story.template}</great-grandparent>`,
|
|
103
|
+
};
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
const decorated = (0, decorateStory_1.default)(() => ({ template: '</child>' }), decorators);
|
|
107
|
+
expect(decorated(makeContext({ component: FooComponent }))).toEqual({
|
|
108
|
+
template: '<great-grandparent><grandparent><parent></child></parent></grandparent></great-grandparent>',
|
|
109
|
+
userDefinedTemplate: true,
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
it('should include story templates in decorators', () => {
|
|
113
|
+
const decorators = [
|
|
114
|
+
(s) => {
|
|
115
|
+
const story = s();
|
|
116
|
+
return {
|
|
117
|
+
...story,
|
|
118
|
+
template: `<parent>${story.template}</parent>`,
|
|
119
|
+
};
|
|
120
|
+
},
|
|
121
|
+
(s) => {
|
|
122
|
+
const story = s();
|
|
123
|
+
return {
|
|
124
|
+
...story,
|
|
125
|
+
template: `<grandparent>${story.template}</grandparent>`,
|
|
126
|
+
};
|
|
127
|
+
},
|
|
128
|
+
(s) => {
|
|
129
|
+
const story = s();
|
|
130
|
+
return {
|
|
131
|
+
...story,
|
|
132
|
+
template: `<great-grandparent>${story.template}</great-grandparent>`,
|
|
133
|
+
};
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
const decorated = (0, decorateStory_1.default)(() => ({ template: '</child>' }), decorators);
|
|
137
|
+
expect(decorated(makeContext({}))).toEqual({
|
|
138
|
+
template: '<great-grandparent><grandparent><parent></child></parent></grandparent></great-grandparent>',
|
|
139
|
+
userDefinedTemplate: true,
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
it('should include story components in decorators', () => {
|
|
143
|
+
const decorators = [
|
|
144
|
+
(s) => {
|
|
145
|
+
const story = s();
|
|
146
|
+
return {
|
|
147
|
+
...story,
|
|
148
|
+
template: `<parent>${story.template}</parent>`,
|
|
149
|
+
};
|
|
150
|
+
},
|
|
151
|
+
(s) => {
|
|
152
|
+
const story = s();
|
|
153
|
+
return {
|
|
154
|
+
...story,
|
|
155
|
+
template: `<grandparent>${story.template}</grandparent>`,
|
|
156
|
+
};
|
|
157
|
+
},
|
|
158
|
+
(s) => {
|
|
159
|
+
const story = s();
|
|
160
|
+
return {
|
|
161
|
+
...story,
|
|
162
|
+
template: `<great-grandparent>${story.template}</great-grandparent>`,
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
];
|
|
166
|
+
const decorated = (0, decorateStory_1.default)(() => ({}), decorators);
|
|
167
|
+
expect(decorated(makeContext({ component: FooComponent }))).toEqual({
|
|
168
|
+
template: '<great-grandparent><grandparent><parent><foo></foo></parent></grandparent></great-grandparent>',
|
|
169
|
+
userDefinedTemplate: false,
|
|
170
|
+
});
|
|
171
|
+
});
|
|
172
|
+
it('should include legacy story components in decorators', () => {
|
|
173
|
+
const decorators = [
|
|
174
|
+
(s) => {
|
|
175
|
+
const story = s();
|
|
176
|
+
return {
|
|
177
|
+
...story,
|
|
178
|
+
template: `<parent>${story.template}</parent>`,
|
|
179
|
+
};
|
|
180
|
+
},
|
|
181
|
+
(s) => {
|
|
182
|
+
const story = s();
|
|
183
|
+
return {
|
|
184
|
+
...story,
|
|
185
|
+
template: `<grandparent>${story.template}</grandparent>`,
|
|
186
|
+
};
|
|
187
|
+
},
|
|
188
|
+
(s) => {
|
|
189
|
+
const story = s();
|
|
190
|
+
return {
|
|
191
|
+
...story,
|
|
192
|
+
template: `<great-grandparent>${story.template}</great-grandparent>`,
|
|
193
|
+
};
|
|
194
|
+
},
|
|
195
|
+
];
|
|
196
|
+
const decorated = (0, decorateStory_1.default)(() => ({ component: FooComponent }), decorators);
|
|
197
|
+
expect(decorated(makeContext({}))).toEqual({
|
|
198
|
+
template: '<great-grandparent><grandparent><parent><foo></foo></parent></grandparent></great-grandparent>',
|
|
199
|
+
component: FooComponent,
|
|
200
|
+
userDefinedTemplate: false,
|
|
201
|
+
});
|
|
202
|
+
});
|
|
203
|
+
it('should keep template with an empty value', () => {
|
|
204
|
+
const decorators = [
|
|
205
|
+
(0, decorators_1.componentWrapperDecorator)(ParentComponent),
|
|
206
|
+
];
|
|
207
|
+
const decorated = (0, decorateStory_1.default)(() => ({ template: '' }), decorators);
|
|
208
|
+
expect(decorated(makeContext({ component: FooComponent }))).toEqual({
|
|
209
|
+
template: '<parent></parent>',
|
|
210
|
+
});
|
|
211
|
+
});
|
|
212
|
+
it('should only keeps args with a control or an action in argTypes', () => {
|
|
213
|
+
const decorated = (0, decorateStory_1.default)((context) => ({
|
|
214
|
+
template: `Args available in the story : ${Object.keys(context.args).join()}`,
|
|
215
|
+
}), []);
|
|
216
|
+
expect(decorated(makeContext({
|
|
217
|
+
component: FooComponent,
|
|
218
|
+
argTypes: {
|
|
219
|
+
withControl: { control: { type: 'object' }, name: 'withControl' },
|
|
220
|
+
withAction: { action: 'onClick', name: 'withAction' },
|
|
221
|
+
toRemove: { name: 'toRemove' },
|
|
222
|
+
},
|
|
223
|
+
args: {
|
|
224
|
+
withControl: 'withControl',
|
|
225
|
+
withAction: () => ({}),
|
|
226
|
+
toRemove: 'toRemove',
|
|
227
|
+
},
|
|
228
|
+
}))).toEqual({
|
|
229
|
+
template: 'Args available in the story : withControl,withAction',
|
|
230
|
+
userDefinedTemplate: true,
|
|
231
|
+
});
|
|
232
|
+
});
|
|
233
|
+
});
|
|
234
|
+
describe('default behavior', () => {
|
|
235
|
+
it('calls decorators in out to in order', () => {
|
|
236
|
+
const decorators = [
|
|
237
|
+
(s) => {
|
|
238
|
+
const story = s();
|
|
239
|
+
return { ...story, props: { a: [...story.props.a, 1] } };
|
|
240
|
+
},
|
|
241
|
+
(s) => {
|
|
242
|
+
const story = s();
|
|
243
|
+
return { ...story, props: { a: [...story.props.a, 2] } };
|
|
244
|
+
},
|
|
245
|
+
(s) => {
|
|
246
|
+
const story = s();
|
|
247
|
+
return { ...story, props: { a: [...story.props.a, 3] } };
|
|
248
|
+
},
|
|
249
|
+
];
|
|
250
|
+
const decorated = (0, decorateStory_1.default)(() => ({ props: { a: [0] } }), decorators);
|
|
251
|
+
expect(decorated(makeContext({}))).toEqual({ props: { a: [0, 1, 2, 3] } });
|
|
252
|
+
});
|
|
253
|
+
it('passes context through to sub decorators', () => {
|
|
254
|
+
const decorators = [
|
|
255
|
+
(s, c) => {
|
|
256
|
+
const story = s({ ...c, k: 1 });
|
|
257
|
+
return { ...story, props: { a: [...story.props.a, c.k] } };
|
|
258
|
+
},
|
|
259
|
+
(s, c) => {
|
|
260
|
+
const story = s({ ...c, k: 2 });
|
|
261
|
+
return { ...story, props: { a: [...story.props.a, c.k] } };
|
|
262
|
+
},
|
|
263
|
+
(s, c) => {
|
|
264
|
+
const story = s({ ...c, k: 3 });
|
|
265
|
+
return { ...story, props: { a: [...story.props.a, c.k] } };
|
|
266
|
+
},
|
|
267
|
+
];
|
|
268
|
+
const decorated = (0, decorateStory_1.default)((c) => ({ props: { a: [c.k] } }), decorators);
|
|
269
|
+
expect(decorated(makeContext({ k: 0 }))).toEqual({ props: { a: [1, 2, 3, 0] } });
|
|
270
|
+
});
|
|
271
|
+
it('DOES NOT merge parameter or pass through parameters key in context', () => {
|
|
272
|
+
const decorators = [
|
|
273
|
+
(s, c) => {
|
|
274
|
+
const story = s({ ...c, k: 1, parameters: { p: 1 } });
|
|
275
|
+
return {
|
|
276
|
+
...story,
|
|
277
|
+
props: { a: [...story.props.a, c.k], p: [...story.props.p, c.parameters.p] },
|
|
278
|
+
};
|
|
279
|
+
},
|
|
280
|
+
(s, c) => {
|
|
281
|
+
const story = s({ ...c, k: 2, parameters: { p: 2 } });
|
|
282
|
+
return {
|
|
283
|
+
...story,
|
|
284
|
+
props: { a: [...story.props.a, c.k], p: [...story.props.p, c.parameters.p] },
|
|
285
|
+
};
|
|
286
|
+
},
|
|
287
|
+
(s, c) => {
|
|
288
|
+
const story = s({ ...c, k: 3, parameters: { p: 3 } });
|
|
289
|
+
return {
|
|
290
|
+
...story,
|
|
291
|
+
props: { a: [...story.props.a, c.k], p: [...story.props.p, c.parameters.p] },
|
|
292
|
+
};
|
|
293
|
+
},
|
|
294
|
+
];
|
|
295
|
+
const decorated = (0, decorateStory_1.default)((c) => ({ props: { a: [c.k], p: [c.parameters.p] } }), decorators);
|
|
296
|
+
expect(decorated(makeContext({ k: 0, parameters: { p: 0 } }))).toEqual({
|
|
297
|
+
props: { a: [1, 2, 3, 0], p: [0, 0, 0, 0] },
|
|
298
|
+
});
|
|
299
|
+
});
|
|
300
|
+
});
|
|
301
|
+
});
|
|
302
|
+
function makeContext(input) {
|
|
303
|
+
return {
|
|
304
|
+
id: 'id',
|
|
305
|
+
kind: 'kind',
|
|
306
|
+
name: 'name',
|
|
307
|
+
viewMode: 'story',
|
|
308
|
+
parameters: {},
|
|
309
|
+
...input,
|
|
310
|
+
};
|
|
311
|
+
}
|
|
312
|
+
let FooComponent = class FooComponent {
|
|
313
|
+
};
|
|
314
|
+
FooComponent = __decorate([
|
|
315
|
+
(0, core_1.Component)({
|
|
316
|
+
selector: 'foo',
|
|
317
|
+
template: `foo`,
|
|
318
|
+
})
|
|
319
|
+
], FooComponent);
|
|
320
|
+
let ParentComponent = class ParentComponent {
|
|
321
|
+
};
|
|
322
|
+
__decorate([
|
|
323
|
+
(0, core_1.Input)(),
|
|
324
|
+
__metadata("design:type", String)
|
|
325
|
+
], ParentComponent.prototype, "parentInput", void 0);
|
|
326
|
+
__decorate([
|
|
327
|
+
(0, core_1.Output)(),
|
|
328
|
+
__metadata("design:type", Object)
|
|
329
|
+
], ParentComponent.prototype, "parentOutput", void 0);
|
|
330
|
+
ParentComponent = __decorate([
|
|
331
|
+
(0, core_1.Component)({
|
|
332
|
+
selector: 'parent',
|
|
333
|
+
template: `<ng-content></ng-content>`,
|
|
334
|
+
})
|
|
335
|
+
], ParentComponent);
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Type } from '@angular/core';
|
|
2
|
+
import { DecoratorFunction, StoryContext } from '@storybook/types';
|
|
3
|
+
import { ICollection, NgModuleMetadata, AngularRenderer } from './types';
|
|
4
|
+
export declare const moduleMetadata: <TArgs = any>(metadata: Partial<NgModuleMetadata>) => DecoratorFunction<AngularRenderer, TArgs>;
|
|
5
|
+
export declare const componentWrapperDecorator: <TArgs = any>(element: Type<unknown> | ((story: string) => string), props?: ICollection | ((storyContext: StoryContext<AngularRenderer, TArgs>) => ICollection)) => DecoratorFunction<AngularRenderer, TArgs>;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
3
|
+
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
4
|
+
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
5
|
+
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
6
|
+
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
7
|
+
};
|
|
8
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
+
const core_1 = require("@angular/core");
|
|
10
|
+
const decorators_1 = require("./decorators");
|
|
11
|
+
const defaultContext = {
|
|
12
|
+
componentId: 'unspecified',
|
|
13
|
+
kind: 'unspecified',
|
|
14
|
+
title: 'unspecified',
|
|
15
|
+
id: 'unspecified',
|
|
16
|
+
name: 'unspecified',
|
|
17
|
+
story: 'unspecified',
|
|
18
|
+
tags: [],
|
|
19
|
+
parameters: {},
|
|
20
|
+
initialArgs: {},
|
|
21
|
+
args: {},
|
|
22
|
+
argTypes: {},
|
|
23
|
+
globals: {},
|
|
24
|
+
hooks: {},
|
|
25
|
+
loaded: {},
|
|
26
|
+
originalStoryFn: jest.fn(),
|
|
27
|
+
viewMode: 'story',
|
|
28
|
+
abortSignal: undefined,
|
|
29
|
+
canvasElement: undefined,
|
|
30
|
+
};
|
|
31
|
+
class MockModule {
|
|
32
|
+
}
|
|
33
|
+
class MockModuleTwo {
|
|
34
|
+
}
|
|
35
|
+
class MockService {
|
|
36
|
+
}
|
|
37
|
+
let MockComponent = class MockComponent {
|
|
38
|
+
};
|
|
39
|
+
MockComponent = __decorate([
|
|
40
|
+
(0, core_1.Component)({})
|
|
41
|
+
], MockComponent);
|
|
42
|
+
describe('moduleMetadata', () => {
|
|
43
|
+
it('should add metadata to a story without it', () => {
|
|
44
|
+
const result = (0, decorators_1.moduleMetadata)({
|
|
45
|
+
imports: [MockModule],
|
|
46
|
+
providers: [MockService],
|
|
47
|
+
})(() => ({
|
|
48
|
+
component: MockComponent,
|
|
49
|
+
}),
|
|
50
|
+
// deepscan-disable-next-line
|
|
51
|
+
defaultContext);
|
|
52
|
+
expect(result).toEqual({
|
|
53
|
+
component: MockComponent,
|
|
54
|
+
moduleMetadata: {
|
|
55
|
+
declarations: [],
|
|
56
|
+
entryComponents: [],
|
|
57
|
+
imports: [MockModule],
|
|
58
|
+
schemas: [],
|
|
59
|
+
providers: [MockService],
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
it('should combine with individual metadata on a story', () => {
|
|
64
|
+
const result = (0, decorators_1.moduleMetadata)({
|
|
65
|
+
imports: [MockModule],
|
|
66
|
+
})(() => ({
|
|
67
|
+
component: MockComponent,
|
|
68
|
+
moduleMetadata: {
|
|
69
|
+
imports: [MockModuleTwo],
|
|
70
|
+
providers: [MockService],
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
// deepscan-disable-next-line
|
|
74
|
+
defaultContext);
|
|
75
|
+
expect(result).toEqual({
|
|
76
|
+
component: MockComponent,
|
|
77
|
+
moduleMetadata: {
|
|
78
|
+
declarations: [],
|
|
79
|
+
entryComponents: [],
|
|
80
|
+
imports: [MockModule, MockModuleTwo],
|
|
81
|
+
schemas: [],
|
|
82
|
+
providers: [MockService],
|
|
83
|
+
},
|
|
84
|
+
});
|
|
85
|
+
});
|
|
86
|
+
it('should return the original metadata if passed null', () => {
|
|
87
|
+
const result = (0, decorators_1.moduleMetadata)(null)(() => ({
|
|
88
|
+
component: MockComponent,
|
|
89
|
+
moduleMetadata: {
|
|
90
|
+
providers: [MockService],
|
|
91
|
+
},
|
|
92
|
+
}),
|
|
93
|
+
// deepscan-disable-next-line
|
|
94
|
+
defaultContext);
|
|
95
|
+
expect(result).toEqual({
|
|
96
|
+
component: MockComponent,
|
|
97
|
+
moduleMetadata: {
|
|
98
|
+
declarations: [],
|
|
99
|
+
entryComponents: [],
|
|
100
|
+
imports: [],
|
|
101
|
+
schemas: [],
|
|
102
|
+
providers: [MockService],
|
|
103
|
+
},
|
|
104
|
+
});
|
|
105
|
+
});
|
|
106
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { EventEmitter, ElementRef } from '@angular/core';
|
|
2
|
+
export declare const exportedConstant = "An exported constant";
|
|
3
|
+
export type ButtonSize = 'small' | 'medium' | 'large' | 'xlarge';
|
|
4
|
+
export declare enum ButtonAccent {
|
|
5
|
+
'Normal' = "Normal",
|
|
6
|
+
'High' = "High"
|
|
7
|
+
}
|
|
8
|
+
export interface ISomeInterface {
|
|
9
|
+
one: string;
|
|
10
|
+
two: boolean;
|
|
11
|
+
three: any[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
|
|
15
|
+
*
|
|
16
|
+
* It supports [markdown](https://en.wikipedia.org/wiki/Markdown), so you can embed formatted text,
|
|
17
|
+
* like **bold**, _italic_, and `inline code`.
|
|
18
|
+
*
|
|
19
|
+
* > How you like dem apples?! It's never been easier to document all your components.
|
|
20
|
+
*
|
|
21
|
+
* @string Hello world
|
|
22
|
+
* @link [Example](http://example.com)
|
|
23
|
+
* @code `ThingThing`
|
|
24
|
+
* @html <span class="badge">aaa</span>
|
|
25
|
+
*/
|
|
26
|
+
export declare class InputComponent<T> {
|
|
27
|
+
buttonRef: ElementRef;
|
|
28
|
+
/** Appearance style of the button. */
|
|
29
|
+
appearance: 'primary' | 'secondary';
|
|
30
|
+
/** Specify the accent-type of the button */
|
|
31
|
+
accent: ButtonAccent;
|
|
32
|
+
/** Sets the button to a disabled state. */
|
|
33
|
+
isDisabled: boolean;
|
|
34
|
+
/**
|
|
35
|
+
* The inner text of the button.
|
|
36
|
+
*
|
|
37
|
+
* @required
|
|
38
|
+
*/
|
|
39
|
+
label: string;
|
|
40
|
+
/** Size of the button. */
|
|
41
|
+
size?: ButtonSize;
|
|
42
|
+
/** Specifies some arbitrary object */
|
|
43
|
+
someDataObject: ISomeInterface;
|
|
44
|
+
/**
|
|
45
|
+
* Some input you shouldn't use.
|
|
46
|
+
*
|
|
47
|
+
* @deprecated
|
|
48
|
+
*/
|
|
49
|
+
somethingYouShouldNotUse: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* Handler to be called when the button is clicked by a user.
|
|
52
|
+
*
|
|
53
|
+
* Will also block the emission of the event if `isDisabled` is true.
|
|
54
|
+
*/
|
|
55
|
+
onClick: EventEmitter<Event>;
|
|
56
|
+
/**
|
|
57
|
+
* This is an internal method that we don't want to document and have added the `ignore` annotation to.
|
|
58
|
+
*
|
|
59
|
+
* @ignore
|
|
60
|
+
*/
|
|
61
|
+
handleClick(event: Event): void;
|
|
62
|
+
private _inputValue;
|
|
63
|
+
/** Setter for `inputValue` that is also an `@Input`. */
|
|
64
|
+
set inputValue(value: string);
|
|
65
|
+
/** Getter for `inputValue`. */
|
|
66
|
+
get inputValue(): string;
|
|
67
|
+
onClickListener(btn: any): void;
|
|
68
|
+
focus: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Returns all the CSS classes for the button.
|
|
71
|
+
*
|
|
72
|
+
* @ignore
|
|
73
|
+
*/
|
|
74
|
+
get classes(): string[];
|
|
75
|
+
/**
|
|
76
|
+
* @ignore
|
|
77
|
+
*/
|
|
78
|
+
ignoredProperty: string;
|
|
79
|
+
/** Public value. */
|
|
80
|
+
internalProperty: string;
|
|
81
|
+
/** Private value. */
|
|
82
|
+
private _value;
|
|
83
|
+
/** Set the private value. */
|
|
84
|
+
set value(value: string | number);
|
|
85
|
+
/** Get the private value. */
|
|
86
|
+
get value(): string | number;
|
|
87
|
+
/**
|
|
88
|
+
* An internal calculation method which adds `x` and `y` together.
|
|
89
|
+
*
|
|
90
|
+
* @param x Some number you'd like to use.
|
|
91
|
+
* @param y Some other number or string you'd like to use, will have `parseInt()` applied before calculation.
|
|
92
|
+
*/
|
|
93
|
+
calc(x: number, y: string | number): number;
|
|
94
|
+
/** A public method using an interface. */
|
|
95
|
+
publicMethod(things: ISomeInterface): void;
|
|
96
|
+
/**
|
|
97
|
+
* A protected method.
|
|
98
|
+
*
|
|
99
|
+
* @param id Some `id`.
|
|
100
|
+
*/
|
|
101
|
+
protected protectedMethod(id?: number): void;
|
|
102
|
+
/**
|
|
103
|
+
* A private method.
|
|
104
|
+
*
|
|
105
|
+
* @param password Some `password`.
|
|
106
|
+
*/
|
|
107
|
+
private privateMethod;
|
|
108
|
+
showKey: keyof T;
|
|
109
|
+
set item(item: T[]);
|
|
110
|
+
processedItem: T[];
|
|
111
|
+
}
|