@storybook/angular 7.0.0-alpha.45 → 7.0.0-alpha.47
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/dist/{types/builders → builders}/build-storybook/index.d.ts +1 -1
- package/dist/{types/builders → builders}/build-storybook/index.js +0 -0
- package/dist/{types/builders → builders}/build-storybook/index.spec.d.ts +0 -0
- package/dist/{types/builders → builders}/build-storybook/index.spec.js +0 -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 +1 -1
- package/dist/{types/builders → builders}/start-storybook/index.js +0 -0
- package/dist/{types/builders → builders}/start-storybook/index.spec.d.ts +0 -0
- package/dist/{types/builders → builders}/start-storybook/index.spec.js +0 -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 +0 -0
- package/dist/{types/builders → builders}/utils/run-compodoc.d.ts +0 -0
- package/dist/{types/builders → builders}/utils/run-compodoc.js +0 -0
- package/dist/{types/builders → builders}/utils/run-compodoc.spec.d.ts +0 -0
- package/dist/{types/builders → builders}/utils/run-compodoc.spec.js +0 -0
- package/dist/{types/builders → builders}/utils/standalone-options.d.ts +2 -2
- 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 -0
- 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 +2 -2
- package/dist/{types/client → client}/angular/helpers.js +0 -0
- package/dist/{types/client → client}/angular-beta/AbstractRenderer.d.ts +0 -0
- package/dist/{types/client → client}/angular-beta/AbstractRenderer.js +0 -0
- 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 +0 -0
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.d.ts +1 -0
- package/dist/client/angular-beta/ComputesTemplateFromComponent.test.js +389 -0
- package/dist/{types/client → client}/angular-beta/DocsRenderer.d.ts +0 -0
- package/dist/{types/client → client}/angular-beta/DocsRenderer.js +0 -0
- package/dist/{types/client → client}/angular-beta/RendererFactory.d.ts +0 -0
- package/dist/{types/client → client}/angular-beta/RendererFactory.js +0 -0
- package/dist/client/angular-beta/RendererFactory.test.d.ts +1 -0
- package/dist/client/angular-beta/RendererFactory.test.js +295 -0
- package/dist/{types/client → client}/angular-beta/StorybookModule.d.ts +1 -1
- package/dist/{types/client → client}/angular-beta/StorybookModule.js +0 -0
- 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 -0
- 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 +1 -1
- 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/{types/client → client}/config.d.ts +0 -0
- package/dist/{types/client → client}/config.js +0 -0
- package/dist/{types/client → client}/decorateStory.d.ts +2 -2
- package/dist/{types/client → client}/decorateStory.js +0 -0
- package/dist/client/decorateStory.test.d.ts +1 -0
- package/dist/client/decorateStory.test.js +335 -0
- package/dist/{types/client → client}/decorators.d.ts +3 -3
- 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 +2 -2
- package/dist/{types/client → client}/docs/compodoc.js +0 -0
- package/dist/client/docs/compodoc.test.d.ts +1 -0
- package/dist/client/docs/compodoc.test.js +131 -0
- package/dist/{types/client → client}/docs/config.d.ts +1 -1
- 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 +1 -1
- package/dist/{types/client → client}/docs/sourceDecorator.js +0 -0
- package/dist/{types/client → client}/docs/types.d.ts +0 -0
- 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 +0 -0
- package/dist/{types/client → client}/public-api.d.ts +2 -2
- package/dist/{types/client → client}/public-api.js +0 -0
- package/dist/{types/client → client}/public-types.d.ts +1 -1
- package/dist/{types/client → client}/public-types.js +0 -0
- package/dist/{types/client → client}/render.d.ts +2 -2
- package/dist/{types/client → client}/render.js +0 -0
- package/dist/{types/client → client}/types.d.ts +1 -1
- 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 -0
- 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 → server}/__mocks-ng-workspace__/minimal-config/tsconfig.json +0 -0
- 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 → server}/__mocks-ng-workspace__/some-config/tsconfig.json +0 -0
- 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 → server}/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json +0 -0
- 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 → server}/__mocks-ng-workspace__/with-lib/projects/pattern-lib/tsconfig.lib.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/with-lib/tsconfig.json +0 -0
- 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/{types/server → server}/__mocks-ng-workspace__/with-nx/tsconfig.json +0 -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/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/tsconfig.json +0 -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/{types/server → server}/__mocks-ng-workspace__/with-options-styles/tsconfig.json +0 -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 → server}/__mocks-ng-workspace__/without-projects-entry/projects/pattern-lib/tsconfig.lib.json +0 -0
- package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/tsconfig.json +0 -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/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/tsconfig.json +0 -0
- package/dist/server/__tests__/angular.json +96 -0
- package/dist/{types/server → server}/angular-cli-webpack-13.x.x.d.ts +0 -0
- package/dist/{types/server → server}/angular-cli-webpack-13.x.x.js +0 -0
- package/dist/{types/server → server}/angular-read-workspace.d.ts +0 -0
- package/dist/{types/server → server}/angular-read-workspace.js +0 -0
- package/dist/{types/server → server}/framework-preset-angular-cli.d.ts +1 -1
- package/dist/{types/server → server}/framework-preset-angular-cli.js +0 -0
- package/dist/server/framework-preset-angular-cli.test.d.ts +1 -0
- package/dist/server/framework-preset-angular-cli.test.js +708 -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 +0 -0
- package/dist/{types/server → server}/preset-options.d.ts +1 -1
- 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/types.d.ts → types.d.ts} +2 -2
- package/dist/{types/types.js → types.js} +0 -0
- package/package.json +23 -21
- 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 +52 -0
- package/template/cli/Header.stories.ts +35 -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
|
@@ -0,0 +1,67 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.InputComponent = exports.ButtonAccent = exports.exportedConstant = void 0;
|
|
13
|
+
const core_1 = require("@angular/core");
|
|
14
|
+
exports.exportedConstant = 'An exported constant';
|
|
15
|
+
var ButtonAccent;
|
|
16
|
+
(function (ButtonAccent) {
|
|
17
|
+
ButtonAccent["Normal"] = "Normal";
|
|
18
|
+
ButtonAccent["High"] = "High";
|
|
19
|
+
})(ButtonAccent = exports.ButtonAccent || (exports.ButtonAccent = {}));
|
|
20
|
+
let InputComponent = class InputComponent {
|
|
21
|
+
constructor() {
|
|
22
|
+
/** Appearance style of the button. */
|
|
23
|
+
this.appearance = 'secondary';
|
|
24
|
+
/** Sets the button to a disabled state. */
|
|
25
|
+
this.isDisabled = false;
|
|
26
|
+
this.onClick = new core_1.EventEmitter();
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
__decorate([
|
|
30
|
+
(0, core_1.Input)(),
|
|
31
|
+
__metadata("design:type", String)
|
|
32
|
+
], InputComponent.prototype, "appearance", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
(0, core_1.Input)(),
|
|
35
|
+
__metadata("design:type", Number)
|
|
36
|
+
], InputComponent.prototype, "counter", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
(0, core_1.Input)(),
|
|
39
|
+
__metadata("design:type", String)
|
|
40
|
+
], InputComponent.prototype, "accent", void 0);
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, core_1.Input)('color'),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], InputComponent.prototype, "foregroundColor", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, core_1.Input)(),
|
|
47
|
+
__metadata("design:type", Object)
|
|
48
|
+
], InputComponent.prototype, "isDisabled", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, core_1.Input)(),
|
|
51
|
+
__metadata("design:type", String)
|
|
52
|
+
], InputComponent.prototype, "label", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Input)(),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], InputComponent.prototype, "someDataObject", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
(0, core_1.Output)(),
|
|
59
|
+
__metadata("design:type", Object)
|
|
60
|
+
], InputComponent.prototype, "onClick", void 0);
|
|
61
|
+
InputComponent = __decorate([
|
|
62
|
+
(0, core_1.Component)({
|
|
63
|
+
selector: 'doc-button',
|
|
64
|
+
template: '<button>{{ label }}</button>',
|
|
65
|
+
})
|
|
66
|
+
], InputComponent);
|
|
67
|
+
exports.InputComponent = InputComponent;
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,340 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
const core_1 = require("@angular/core");
|
|
13
|
+
const testing_1 = require("@angular/core/testing");
|
|
14
|
+
const testing_2 = require("@angular/platform-browser-dynamic/testing");
|
|
15
|
+
const NgComponentAnalyzer_1 = require("./NgComponentAnalyzer");
|
|
16
|
+
describe('getComponentInputsOutputs', () => {
|
|
17
|
+
it('should return empty if no I/O found', () => {
|
|
18
|
+
let FooComponent = class FooComponent {
|
|
19
|
+
};
|
|
20
|
+
FooComponent = __decorate([
|
|
21
|
+
(0, core_1.Component)({})
|
|
22
|
+
], FooComponent);
|
|
23
|
+
expect((0, NgComponentAnalyzer_1.getComponentInputsOutputs)(FooComponent)).toEqual({
|
|
24
|
+
inputs: [],
|
|
25
|
+
outputs: [],
|
|
26
|
+
});
|
|
27
|
+
class BarComponent {
|
|
28
|
+
}
|
|
29
|
+
expect((0, NgComponentAnalyzer_1.getComponentInputsOutputs)(BarComponent)).toEqual({
|
|
30
|
+
inputs: [],
|
|
31
|
+
outputs: [],
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
it('should return I/O', () => {
|
|
35
|
+
let FooComponent = class FooComponent {
|
|
36
|
+
constructor() {
|
|
37
|
+
this.output = new core_1.EventEmitter();
|
|
38
|
+
this.outputWithBindingPropertyName = new core_1.EventEmitter();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
__decorate([
|
|
42
|
+
(0, core_1.Input)(),
|
|
43
|
+
__metadata("design:type", String)
|
|
44
|
+
], FooComponent.prototype, "input", void 0);
|
|
45
|
+
__decorate([
|
|
46
|
+
(0, core_1.Input)('inputPropertyName'),
|
|
47
|
+
__metadata("design:type", String)
|
|
48
|
+
], FooComponent.prototype, "inputWithBindingPropertyName", void 0);
|
|
49
|
+
__decorate([
|
|
50
|
+
(0, core_1.Output)(),
|
|
51
|
+
__metadata("design:type", Object)
|
|
52
|
+
], FooComponent.prototype, "output", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
(0, core_1.Output)('outputPropertyName'),
|
|
55
|
+
__metadata("design:type", Object)
|
|
56
|
+
], FooComponent.prototype, "outputWithBindingPropertyName", void 0);
|
|
57
|
+
FooComponent = __decorate([
|
|
58
|
+
(0, core_1.Component)({
|
|
59
|
+
template: '',
|
|
60
|
+
inputs: ['inputInComponentMetadata'],
|
|
61
|
+
outputs: ['outputInComponentMetadata'],
|
|
62
|
+
})
|
|
63
|
+
], FooComponent);
|
|
64
|
+
const fooComponentFactory = resolveComponentFactory(FooComponent);
|
|
65
|
+
const { inputs, outputs } = (0, NgComponentAnalyzer_1.getComponentInputsOutputs)(FooComponent);
|
|
66
|
+
expect({ inputs, outputs }).toEqual({
|
|
67
|
+
inputs: [
|
|
68
|
+
{ propName: 'inputInComponentMetadata', templateName: 'inputInComponentMetadata' },
|
|
69
|
+
{ propName: 'input', templateName: 'input' },
|
|
70
|
+
{ propName: 'inputWithBindingPropertyName', templateName: 'inputPropertyName' },
|
|
71
|
+
],
|
|
72
|
+
outputs: [
|
|
73
|
+
{ propName: 'outputInComponentMetadata', templateName: 'outputInComponentMetadata' },
|
|
74
|
+
{ propName: 'output', templateName: 'output' },
|
|
75
|
+
{ propName: 'outputWithBindingPropertyName', templateName: 'outputPropertyName' },
|
|
76
|
+
],
|
|
77
|
+
});
|
|
78
|
+
expect(sortByPropName(inputs)).toEqual(sortByPropName(fooComponentFactory.inputs));
|
|
79
|
+
expect(sortByPropName(outputs)).toEqual(sortByPropName(fooComponentFactory.outputs));
|
|
80
|
+
});
|
|
81
|
+
it("should return I/O when some of component metadata has the same name as one of component's properties", () => {
|
|
82
|
+
let FooComponent = class FooComponent {
|
|
83
|
+
constructor() {
|
|
84
|
+
this.output = new core_1.EventEmitter();
|
|
85
|
+
this.outputWithBindingPropertyName = new core_1.EventEmitter();
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
__decorate([
|
|
89
|
+
(0, core_1.Input)(),
|
|
90
|
+
__metadata("design:type", String)
|
|
91
|
+
], FooComponent.prototype, "input", void 0);
|
|
92
|
+
__decorate([
|
|
93
|
+
(0, core_1.Input)('inputPropertyName'),
|
|
94
|
+
__metadata("design:type", String)
|
|
95
|
+
], FooComponent.prototype, "inputWithBindingPropertyName", void 0);
|
|
96
|
+
__decorate([
|
|
97
|
+
(0, core_1.Output)(),
|
|
98
|
+
__metadata("design:type", Object)
|
|
99
|
+
], FooComponent.prototype, "output", void 0);
|
|
100
|
+
__decorate([
|
|
101
|
+
(0, core_1.Output)('outputPropertyName'),
|
|
102
|
+
__metadata("design:type", Object)
|
|
103
|
+
], FooComponent.prototype, "outputWithBindingPropertyName", void 0);
|
|
104
|
+
FooComponent = __decorate([
|
|
105
|
+
(0, core_1.Component)({
|
|
106
|
+
template: '',
|
|
107
|
+
inputs: ['input', 'inputWithBindingPropertyName'],
|
|
108
|
+
outputs: ['outputWithBindingPropertyName'],
|
|
109
|
+
})
|
|
110
|
+
], FooComponent);
|
|
111
|
+
const fooComponentFactory = resolveComponentFactory(FooComponent);
|
|
112
|
+
const { inputs, outputs } = (0, NgComponentAnalyzer_1.getComponentInputsOutputs)(FooComponent);
|
|
113
|
+
expect(sortByPropName(inputs)).toEqual(sortByPropName(fooComponentFactory.inputs));
|
|
114
|
+
expect(sortByPropName(outputs)).toEqual(sortByPropName(fooComponentFactory.outputs));
|
|
115
|
+
});
|
|
116
|
+
it('should return I/O in the presence of multiple decorators', () => {
|
|
117
|
+
let FooComponent = class FooComponent {
|
|
118
|
+
};
|
|
119
|
+
__decorate([
|
|
120
|
+
(0, core_1.Input)(),
|
|
121
|
+
(0, core_1.HostBinding)('class.preceeding-first'),
|
|
122
|
+
__metadata("design:type", String)
|
|
123
|
+
], FooComponent.prototype, "inputPreceedingHostBinding", void 0);
|
|
124
|
+
__decorate([
|
|
125
|
+
(0, core_1.HostBinding)('class.following-binding'),
|
|
126
|
+
(0, core_1.Input)(),
|
|
127
|
+
__metadata("design:type", String)
|
|
128
|
+
], FooComponent.prototype, "inputFollowingHostBinding", void 0);
|
|
129
|
+
FooComponent = __decorate([
|
|
130
|
+
(0, core_1.Component)({
|
|
131
|
+
template: '',
|
|
132
|
+
})
|
|
133
|
+
], FooComponent);
|
|
134
|
+
const fooComponentFactory = resolveComponentFactory(FooComponent);
|
|
135
|
+
const { inputs, outputs } = (0, NgComponentAnalyzer_1.getComponentInputsOutputs)(FooComponent);
|
|
136
|
+
expect({ inputs, outputs }).toEqual({
|
|
137
|
+
inputs: [
|
|
138
|
+
{ propName: 'inputPreceedingHostBinding', templateName: 'inputPreceedingHostBinding' },
|
|
139
|
+
{ propName: 'inputFollowingHostBinding', templateName: 'inputFollowingHostBinding' },
|
|
140
|
+
],
|
|
141
|
+
outputs: [],
|
|
142
|
+
});
|
|
143
|
+
expect(sortByPropName(inputs)).toEqual(sortByPropName(fooComponentFactory.inputs));
|
|
144
|
+
expect(sortByPropName(outputs)).toEqual(sortByPropName(fooComponentFactory.outputs));
|
|
145
|
+
});
|
|
146
|
+
it('should return I/O with extending classes', () => {
|
|
147
|
+
let BarComponent = class BarComponent {
|
|
148
|
+
};
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, core_1.Input)(),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], BarComponent.prototype, "a", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, core_1.Input)(),
|
|
155
|
+
__metadata("design:type", String)
|
|
156
|
+
], BarComponent.prototype, "b", void 0);
|
|
157
|
+
BarComponent = __decorate([
|
|
158
|
+
(0, core_1.Component)({
|
|
159
|
+
template: '',
|
|
160
|
+
})
|
|
161
|
+
], BarComponent);
|
|
162
|
+
let FooComponent = class FooComponent extends BarComponent {
|
|
163
|
+
};
|
|
164
|
+
__decorate([
|
|
165
|
+
(0, core_1.Input)(),
|
|
166
|
+
__metadata("design:type", String)
|
|
167
|
+
], FooComponent.prototype, "b", void 0);
|
|
168
|
+
__decorate([
|
|
169
|
+
(0, core_1.Input)(),
|
|
170
|
+
__metadata("design:type", String)
|
|
171
|
+
], FooComponent.prototype, "c", void 0);
|
|
172
|
+
FooComponent = __decorate([
|
|
173
|
+
(0, core_1.Component)({
|
|
174
|
+
template: '',
|
|
175
|
+
})
|
|
176
|
+
], FooComponent);
|
|
177
|
+
const fooComponentFactory = resolveComponentFactory(FooComponent);
|
|
178
|
+
const { inputs, outputs } = (0, NgComponentAnalyzer_1.getComponentInputsOutputs)(FooComponent);
|
|
179
|
+
expect({ inputs, outputs }).toEqual({
|
|
180
|
+
inputs: [
|
|
181
|
+
{ propName: 'a', templateName: 'a' },
|
|
182
|
+
{ propName: 'b', templateName: 'b' },
|
|
183
|
+
{ propName: 'c', templateName: 'c' },
|
|
184
|
+
],
|
|
185
|
+
outputs: [],
|
|
186
|
+
});
|
|
187
|
+
expect(sortByPropName(inputs)).toEqual(sortByPropName(fooComponentFactory.inputs));
|
|
188
|
+
expect(sortByPropName(outputs)).toEqual(sortByPropName(fooComponentFactory.outputs));
|
|
189
|
+
});
|
|
190
|
+
});
|
|
191
|
+
describe('isDeclarable', () => {
|
|
192
|
+
it('should return true with a Component', () => {
|
|
193
|
+
let FooComponent = class FooComponent {
|
|
194
|
+
};
|
|
195
|
+
FooComponent = __decorate([
|
|
196
|
+
(0, core_1.Component)({})
|
|
197
|
+
], FooComponent);
|
|
198
|
+
expect((0, NgComponentAnalyzer_1.isDeclarable)(FooComponent)).toEqual(true);
|
|
199
|
+
});
|
|
200
|
+
it('should return true with a Directive', () => {
|
|
201
|
+
let FooDirective = class FooDirective {
|
|
202
|
+
};
|
|
203
|
+
FooDirective = __decorate([
|
|
204
|
+
(0, core_1.Directive)({})
|
|
205
|
+
], FooDirective);
|
|
206
|
+
expect((0, NgComponentAnalyzer_1.isDeclarable)(FooDirective)).toEqual(true);
|
|
207
|
+
});
|
|
208
|
+
it('should return true with a Pipe', () => {
|
|
209
|
+
let FooPipe = class FooPipe {
|
|
210
|
+
};
|
|
211
|
+
FooPipe = __decorate([
|
|
212
|
+
(0, core_1.Pipe)({ name: 'pipe' })
|
|
213
|
+
], FooPipe);
|
|
214
|
+
expect((0, NgComponentAnalyzer_1.isDeclarable)(FooPipe)).toEqual(true);
|
|
215
|
+
});
|
|
216
|
+
it('should return false with simple class', () => {
|
|
217
|
+
class FooPipe {
|
|
218
|
+
}
|
|
219
|
+
expect((0, NgComponentAnalyzer_1.isDeclarable)(FooPipe)).toEqual(false);
|
|
220
|
+
});
|
|
221
|
+
it('should return false with Injectable', () => {
|
|
222
|
+
let FooInjectable = class FooInjectable {
|
|
223
|
+
};
|
|
224
|
+
FooInjectable = __decorate([
|
|
225
|
+
(0, core_1.Injectable)()
|
|
226
|
+
], FooInjectable);
|
|
227
|
+
expect((0, NgComponentAnalyzer_1.isDeclarable)(FooInjectable)).toEqual(false);
|
|
228
|
+
});
|
|
229
|
+
});
|
|
230
|
+
describe('isComponent', () => {
|
|
231
|
+
it('should return true with a Component', () => {
|
|
232
|
+
let FooComponent = class FooComponent {
|
|
233
|
+
};
|
|
234
|
+
FooComponent = __decorate([
|
|
235
|
+
(0, core_1.Component)({})
|
|
236
|
+
], FooComponent);
|
|
237
|
+
expect((0, NgComponentAnalyzer_1.isComponent)(FooComponent)).toEqual(true);
|
|
238
|
+
});
|
|
239
|
+
it('should return false with simple class', () => {
|
|
240
|
+
class FooPipe {
|
|
241
|
+
}
|
|
242
|
+
expect((0, NgComponentAnalyzer_1.isComponent)(FooPipe)).toEqual(false);
|
|
243
|
+
});
|
|
244
|
+
it('should return false with Directive', () => {
|
|
245
|
+
let FooDirective = class FooDirective {
|
|
246
|
+
};
|
|
247
|
+
FooDirective = __decorate([
|
|
248
|
+
(0, core_1.Directive)()
|
|
249
|
+
], FooDirective);
|
|
250
|
+
expect((0, NgComponentAnalyzer_1.isComponent)(FooDirective)).toEqual(false);
|
|
251
|
+
});
|
|
252
|
+
});
|
|
253
|
+
describe('isStandaloneComponent', () => {
|
|
254
|
+
it('should return true with a Component with "standalone: true"', () => {
|
|
255
|
+
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
|
|
256
|
+
// Angular deps are updated to v14.x.x.
|
|
257
|
+
let FooComponent = class FooComponent {
|
|
258
|
+
};
|
|
259
|
+
FooComponent = __decorate([
|
|
260
|
+
(0, core_1.Component)({ standalone: true })
|
|
261
|
+
], FooComponent);
|
|
262
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooComponent)).toEqual(true);
|
|
263
|
+
});
|
|
264
|
+
it('should return false with a Component with "standalone: false"', () => {
|
|
265
|
+
// TODO: `standalone` is only available in Angular v14. Remove cast to `any` once
|
|
266
|
+
// Angular deps are updated to v14.x.x.
|
|
267
|
+
let FooComponent = class FooComponent {
|
|
268
|
+
};
|
|
269
|
+
FooComponent = __decorate([
|
|
270
|
+
(0, core_1.Component)({ standalone: false })
|
|
271
|
+
], FooComponent);
|
|
272
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooComponent)).toEqual(false);
|
|
273
|
+
});
|
|
274
|
+
it('should return false with a Component without the "standalone" property', () => {
|
|
275
|
+
let FooComponent = class FooComponent {
|
|
276
|
+
};
|
|
277
|
+
FooComponent = __decorate([
|
|
278
|
+
(0, core_1.Component)({})
|
|
279
|
+
], FooComponent);
|
|
280
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooComponent)).toEqual(false);
|
|
281
|
+
});
|
|
282
|
+
it('should return false with simple class', () => {
|
|
283
|
+
class FooPipe {
|
|
284
|
+
}
|
|
285
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooPipe)).toEqual(false);
|
|
286
|
+
});
|
|
287
|
+
it('should return false with Directive', () => {
|
|
288
|
+
let FooDirective = class FooDirective {
|
|
289
|
+
};
|
|
290
|
+
FooDirective = __decorate([
|
|
291
|
+
(0, core_1.Directive)()
|
|
292
|
+
], FooDirective);
|
|
293
|
+
expect((0, NgComponentAnalyzer_1.isStandaloneComponent)(FooDirective)).toEqual(false);
|
|
294
|
+
});
|
|
295
|
+
});
|
|
296
|
+
describe('getComponentDecoratorMetadata', () => {
|
|
297
|
+
it('should return Component with a Component', () => {
|
|
298
|
+
let FooComponent = class FooComponent {
|
|
299
|
+
};
|
|
300
|
+
FooComponent = __decorate([
|
|
301
|
+
(0, core_1.Component)({ selector: 'foo' })
|
|
302
|
+
], FooComponent);
|
|
303
|
+
expect((0, NgComponentAnalyzer_1.getComponentDecoratorMetadata)(FooComponent)).toBeInstanceOf(core_1.Component);
|
|
304
|
+
expect((0, NgComponentAnalyzer_1.getComponentDecoratorMetadata)(FooComponent)).toEqual({
|
|
305
|
+
changeDetection: 1,
|
|
306
|
+
selector: 'foo',
|
|
307
|
+
});
|
|
308
|
+
});
|
|
309
|
+
it('should return Component with extending classes', () => {
|
|
310
|
+
let BarComponent = class BarComponent {
|
|
311
|
+
};
|
|
312
|
+
BarComponent = __decorate([
|
|
313
|
+
(0, core_1.Component)({ selector: 'bar' })
|
|
314
|
+
], BarComponent);
|
|
315
|
+
let FooComponent = class FooComponent extends BarComponent {
|
|
316
|
+
};
|
|
317
|
+
FooComponent = __decorate([
|
|
318
|
+
(0, core_1.Component)({ selector: 'foo' })
|
|
319
|
+
], FooComponent);
|
|
320
|
+
expect((0, NgComponentAnalyzer_1.getComponentDecoratorMetadata)(FooComponent)).toBeInstanceOf(core_1.Component);
|
|
321
|
+
expect((0, NgComponentAnalyzer_1.getComponentDecoratorMetadata)(FooComponent)).toEqual({
|
|
322
|
+
changeDetection: 1,
|
|
323
|
+
selector: 'foo',
|
|
324
|
+
});
|
|
325
|
+
});
|
|
326
|
+
});
|
|
327
|
+
function sortByPropName(array) {
|
|
328
|
+
return array.sort((a, b) => a.propName.localeCompare(b.propName));
|
|
329
|
+
}
|
|
330
|
+
function resolveComponentFactory(component) {
|
|
331
|
+
testing_1.TestBed.configureTestingModule({
|
|
332
|
+
declarations: [component],
|
|
333
|
+
}).overrideModule(testing_2.BrowserDynamicTestingModule, {
|
|
334
|
+
set: {
|
|
335
|
+
entryComponents: [component],
|
|
336
|
+
},
|
|
337
|
+
});
|
|
338
|
+
const componentFactoryResolver = testing_1.TestBed.inject(core_1.ComponentFactoryResolver);
|
|
339
|
+
return componentFactoryResolver.resolveComponentFactory(component);
|
|
340
|
+
}
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const core_1 = require("@angular/core");
|
|
4
|
+
const NgModulesAnalyzer_1 = require("./NgModulesAnalyzer");
|
|
5
|
+
const FooComponent = (0, core_1.Component)({})(class {
|
|
6
|
+
});
|
|
7
|
+
const BarComponent = (0, core_1.Component)({})(class {
|
|
8
|
+
});
|
|
9
|
+
const BetaModule = (0, core_1.NgModule)({ declarations: [FooComponent] })(class {
|
|
10
|
+
});
|
|
11
|
+
const AlphaModule = (0, core_1.NgModule)({ imports: [BetaModule] })(class {
|
|
12
|
+
});
|
|
13
|
+
describe('isComponentAlreadyDeclaredInModules', () => {
|
|
14
|
+
it('should return true when the component is already declared in one of modules', () => {
|
|
15
|
+
expect((0, NgModulesAnalyzer_1.isComponentAlreadyDeclaredInModules)(FooComponent, [], [AlphaModule])).toEqual(true);
|
|
16
|
+
});
|
|
17
|
+
it('should return true if the component is in moduleDeclarations', () => {
|
|
18
|
+
expect((0, NgModulesAnalyzer_1.isComponentAlreadyDeclaredInModules)(BarComponent, [BarComponent], [AlphaModule])).toEqual(true);
|
|
19
|
+
});
|
|
20
|
+
it('should return false if the component is not declared', () => {
|
|
21
|
+
expect((0, NgModulesAnalyzer_1.isComponentAlreadyDeclaredInModules)(BarComponent, [], [AlphaModule])).toEqual(false);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
File without changes
|
|
File without changes
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { DecoratorFunction, LegacyStoryFn } from '@storybook/types';
|
|
2
|
+
import { AngularFramework } from './types';
|
|
3
3
|
export default function decorateStory(mainStoryFn: LegacyStoryFn<AngularFramework>, decorators: DecoratorFunction<AngularFramework>[]): LegacyStoryFn<AngularFramework>;
|
|
4
4
|
export { decorateStory };
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|