@storybook/angular 7.0.0-alpha.46 → 7.0.0-alpha.48
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/dist/{types/builders → builders}/build-storybook/index.d.ts +0 -0
- 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 +0 -0
- 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 +0 -0
- package/dist/{types/builders → builders}/utils/standalone-options.js +0 -0
- package/dist/{types/client → client}/angular/app.component.d.ts +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- package/dist/{types/client → client}/angular-beta/StorybookModule.js +9 -1
- 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 +0 -0
- 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 +0 -0
- 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 +0 -0
- 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 +0 -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 +0 -0
- 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 +0 -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 +0 -0
- 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 +0 -0
- package/dist/{types/client → client}/public-api.js +0 -0
- package/dist/{types/client → client}/public-types.d.ts +0 -0
- package/dist/{types/client → client}/public-types.js +0 -0
- package/dist/{types/client → client}/render.d.ts +0 -0
- package/dist/{types/client → client}/render.js +0 -0
- package/dist/{types/client → client}/types.d.ts +0 -0
- 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} +0 -0
- 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 +0 -0
- 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 +0 -0
- package/dist/{types/server → server}/framework-preset-angular-docs.js +1 -1
- package/dist/{types/server → server}/framework-preset-angular-ivy.d.ts +0 -0
- package/dist/{types/server → server}/framework-preset-angular-ivy.js +0 -0
- package/dist/{types/server → server}/preset-options.d.ts +0 -0
- package/dist/{types/server → server}/preset-options.js +0 -0
- package/dist/{types/server → server}/utils/filter-out-styling-rules.d.ts +0 -0
- 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 +0 -0
- 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} +0 -0
- 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 +54 -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
|
@@ -0,0 +1,207 @@
|
|
|
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
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
14
|
+
// @ts-nocheck
|
|
15
|
+
/* eslint-disable no-console */
|
|
16
|
+
/* eslint-disable no-underscore-dangle */
|
|
17
|
+
const core_1 = require("@angular/core");
|
|
18
|
+
exports.exportedConstant = 'An exported constant';
|
|
19
|
+
var ButtonAccent;
|
|
20
|
+
(function (ButtonAccent) {
|
|
21
|
+
ButtonAccent["Normal"] = "Normal";
|
|
22
|
+
ButtonAccent["High"] = "High";
|
|
23
|
+
})(ButtonAccent = exports.ButtonAccent || (exports.ButtonAccent = {}));
|
|
24
|
+
/**
|
|
25
|
+
* This is a simple button that demonstrates various JSDoc handling in Storybook Docs for Angular.
|
|
26
|
+
*
|
|
27
|
+
* It supports [markdown](https://en.wikipedia.org/wiki/Markdown), so you can embed formatted text,
|
|
28
|
+
* like **bold**, _italic_, and `inline code`.
|
|
29
|
+
*
|
|
30
|
+
* > How you like dem apples?! It's never been easier to document all your components.
|
|
31
|
+
*
|
|
32
|
+
* @string Hello world
|
|
33
|
+
* @link [Example](http://example.com)
|
|
34
|
+
* @code `ThingThing`
|
|
35
|
+
* @html <span class="badge">aaa</span>
|
|
36
|
+
*/
|
|
37
|
+
let InputComponent = class InputComponent {
|
|
38
|
+
constructor() {
|
|
39
|
+
/** Appearance style of the button. */
|
|
40
|
+
this.appearance = 'secondary';
|
|
41
|
+
/** Sets the button to a disabled state. */
|
|
42
|
+
this.isDisabled = false;
|
|
43
|
+
/** Size of the button. */
|
|
44
|
+
this.size = 'medium';
|
|
45
|
+
/**
|
|
46
|
+
* Some input you shouldn't use.
|
|
47
|
+
*
|
|
48
|
+
* @deprecated
|
|
49
|
+
*/
|
|
50
|
+
this.somethingYouShouldNotUse = false;
|
|
51
|
+
/**
|
|
52
|
+
* Handler to be called when the button is clicked by a user.
|
|
53
|
+
*
|
|
54
|
+
* Will also block the emission of the event if `isDisabled` is true.
|
|
55
|
+
*/
|
|
56
|
+
this.onClick = new core_1.EventEmitter();
|
|
57
|
+
this._inputValue = 'some value';
|
|
58
|
+
this.focus = false;
|
|
59
|
+
/**
|
|
60
|
+
* @ignore
|
|
61
|
+
*/
|
|
62
|
+
this.ignoredProperty = 'Ignore me';
|
|
63
|
+
/** Public value. */
|
|
64
|
+
this.internalProperty = 'Public hello';
|
|
65
|
+
/** Private value. */
|
|
66
|
+
this._value = 'Private hello';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* This is an internal method that we don't want to document and have added the `ignore` annotation to.
|
|
70
|
+
*
|
|
71
|
+
* @ignore
|
|
72
|
+
*/
|
|
73
|
+
handleClick(event) {
|
|
74
|
+
event.stopPropagation();
|
|
75
|
+
if (!this.isDisabled) {
|
|
76
|
+
this.onClick.emit(event);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/** Setter for `inputValue` that is also an `@Input`. */
|
|
80
|
+
set inputValue(value) {
|
|
81
|
+
this._inputValue = value;
|
|
82
|
+
}
|
|
83
|
+
/** Getter for `inputValue`. */
|
|
84
|
+
get inputValue() {
|
|
85
|
+
return this._inputValue;
|
|
86
|
+
}
|
|
87
|
+
onClickListener(btn) {
|
|
88
|
+
console.log('button', btn);
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Returns all the CSS classes for the button.
|
|
92
|
+
*
|
|
93
|
+
* @ignore
|
|
94
|
+
*/
|
|
95
|
+
get classes() {
|
|
96
|
+
return [this.appearance, this.size]
|
|
97
|
+
.filter((_class) => !!_class)
|
|
98
|
+
.map((_class) => `btn-${_class}`);
|
|
99
|
+
}
|
|
100
|
+
/** Set the private value. */
|
|
101
|
+
set value(value) {
|
|
102
|
+
this._value = `${value}`;
|
|
103
|
+
}
|
|
104
|
+
/** Get the private value. */
|
|
105
|
+
get value() {
|
|
106
|
+
return this._value;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* An internal calculation method which adds `x` and `y` together.
|
|
110
|
+
*
|
|
111
|
+
* @param x Some number you'd like to use.
|
|
112
|
+
* @param y Some other number or string you'd like to use, will have `parseInt()` applied before calculation.
|
|
113
|
+
*/
|
|
114
|
+
calc(x, y) {
|
|
115
|
+
return x + parseInt(`${y}`, 10);
|
|
116
|
+
}
|
|
117
|
+
/** A public method using an interface. */
|
|
118
|
+
publicMethod(things) {
|
|
119
|
+
console.log(things);
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* A protected method.
|
|
123
|
+
*
|
|
124
|
+
* @param id Some `id`.
|
|
125
|
+
*/
|
|
126
|
+
protectedMethod(id) {
|
|
127
|
+
console.log(id);
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* A private method.
|
|
131
|
+
*
|
|
132
|
+
* @param password Some `password`.
|
|
133
|
+
*/
|
|
134
|
+
privateMethod(password) {
|
|
135
|
+
console.log(password);
|
|
136
|
+
}
|
|
137
|
+
set item(item) {
|
|
138
|
+
this.processedItem = item;
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
__decorate([
|
|
142
|
+
(0, core_1.ViewChild)('buttonRef', { static: false }),
|
|
143
|
+
__metadata("design:type", core_1.ElementRef)
|
|
144
|
+
], InputComponent.prototype, "buttonRef", void 0);
|
|
145
|
+
__decorate([
|
|
146
|
+
(0, core_1.Input)(),
|
|
147
|
+
__metadata("design:type", String)
|
|
148
|
+
], InputComponent.prototype, "appearance", void 0);
|
|
149
|
+
__decorate([
|
|
150
|
+
(0, core_1.Input)(),
|
|
151
|
+
__metadata("design:type", String)
|
|
152
|
+
], InputComponent.prototype, "accent", void 0);
|
|
153
|
+
__decorate([
|
|
154
|
+
(0, core_1.Input)(),
|
|
155
|
+
__metadata("design:type", Object)
|
|
156
|
+
], InputComponent.prototype, "isDisabled", void 0);
|
|
157
|
+
__decorate([
|
|
158
|
+
(0, core_1.Input)(),
|
|
159
|
+
__metadata("design:type", String)
|
|
160
|
+
], InputComponent.prototype, "label", void 0);
|
|
161
|
+
__decorate([
|
|
162
|
+
(0, core_1.Input)(),
|
|
163
|
+
__metadata("design:type", String)
|
|
164
|
+
], InputComponent.prototype, "size", void 0);
|
|
165
|
+
__decorate([
|
|
166
|
+
(0, core_1.Input)(),
|
|
167
|
+
__metadata("design:type", Object)
|
|
168
|
+
], InputComponent.prototype, "someDataObject", void 0);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, core_1.Input)(),
|
|
171
|
+
__metadata("design:type", Object)
|
|
172
|
+
], InputComponent.prototype, "somethingYouShouldNotUse", void 0);
|
|
173
|
+
__decorate([
|
|
174
|
+
(0, core_1.Output)(),
|
|
175
|
+
__metadata("design:type", Object)
|
|
176
|
+
], InputComponent.prototype, "onClick", void 0);
|
|
177
|
+
__decorate([
|
|
178
|
+
(0, core_1.Input)(),
|
|
179
|
+
__metadata("design:type", String),
|
|
180
|
+
__metadata("design:paramtypes", [String])
|
|
181
|
+
], InputComponent.prototype, "inputValue", null);
|
|
182
|
+
__decorate([
|
|
183
|
+
(0, core_1.HostListener)('click', ['$event.target']),
|
|
184
|
+
__metadata("design:type", Function),
|
|
185
|
+
__metadata("design:paramtypes", [Object]),
|
|
186
|
+
__metadata("design:returntype", void 0)
|
|
187
|
+
], InputComponent.prototype, "onClickListener", null);
|
|
188
|
+
__decorate([
|
|
189
|
+
(0, core_1.HostBinding)('class.focused'),
|
|
190
|
+
__metadata("design:type", Object)
|
|
191
|
+
], InputComponent.prototype, "focus", void 0);
|
|
192
|
+
__decorate([
|
|
193
|
+
(0, core_1.Input)('showKeyAlias'),
|
|
194
|
+
__metadata("design:type", Object)
|
|
195
|
+
], InputComponent.prototype, "showKey", void 0);
|
|
196
|
+
__decorate([
|
|
197
|
+
(0, core_1.Input)(),
|
|
198
|
+
__metadata("design:type", Array),
|
|
199
|
+
__metadata("design:paramtypes", [Array])
|
|
200
|
+
], InputComponent.prototype, "item", null);
|
|
201
|
+
InputComponent = __decorate([
|
|
202
|
+
(0, core_1.Component)({
|
|
203
|
+
selector: 'doc-button',
|
|
204
|
+
template: '<button>{{ label }}</button>',
|
|
205
|
+
})
|
|
206
|
+
], InputComponent);
|
|
207
|
+
exports.InputComponent = InputComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import 'jest-specific-snapshot';
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
require("jest-specific-snapshot");
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const tmp_1 = __importDefault(require("tmp"));
|
|
10
|
+
const cross_spawn_1 = require("cross-spawn");
|
|
11
|
+
const compodoc_1 = require("./compodoc");
|
|
12
|
+
// @ts-expect-error (Converted from ts-ignore)
|
|
13
|
+
const { SNAPSHOT_OS } = global;
|
|
14
|
+
// File hierarchy: __testfixtures__ / some-test-case / input.*
|
|
15
|
+
const inputRegExp = /^input\..*$/;
|
|
16
|
+
const runCompodoc = (inputPath) => {
|
|
17
|
+
const testDir = path_1.default.dirname(inputPath);
|
|
18
|
+
const { name: tmpDir, removeCallback } = tmp_1.default.dirSync();
|
|
19
|
+
// FIXME: for now, this requires a tsconfig.json for each test case. Tried generating
|
|
20
|
+
// one dynamically in tmpDir, but compodoc doesn't handle absolute paths properly
|
|
21
|
+
// (and screwed around with relative paths as well, but couldn't get it working)
|
|
22
|
+
(0, cross_spawn_1.sync)('yarn', ['compodoc', '-p', `${testDir}/tsconfig.json`, '-e', 'json', '-d', tmpDir], {
|
|
23
|
+
stdio: 'inherit',
|
|
24
|
+
shell: true,
|
|
25
|
+
});
|
|
26
|
+
const output = fs_1.default.readFileSync(`${tmpDir}/documentation.json`, 'utf8');
|
|
27
|
+
try {
|
|
28
|
+
removeCallback();
|
|
29
|
+
}
|
|
30
|
+
catch (e) {
|
|
31
|
+
//
|
|
32
|
+
}
|
|
33
|
+
return output;
|
|
34
|
+
};
|
|
35
|
+
describe('angular component properties', () => {
|
|
36
|
+
const fixturesDir = path_1.default.join(__dirname, '__testfixtures__');
|
|
37
|
+
fs_1.default.readdirSync(fixturesDir, { withFileTypes: true }).forEach((testEntry) => {
|
|
38
|
+
if (testEntry.isDirectory()) {
|
|
39
|
+
const testDir = path_1.default.join(fixturesDir, testEntry.name);
|
|
40
|
+
const testFile = fs_1.default.readdirSync(testDir).find((fileName) => inputRegExp.test(fileName));
|
|
41
|
+
if (testFile) {
|
|
42
|
+
it(`${testEntry.name}`, () => {
|
|
43
|
+
const inputPath = path_1.default.join(testDir, testFile);
|
|
44
|
+
// snapshot the output of compodoc
|
|
45
|
+
const compodocOutput = runCompodoc(inputPath);
|
|
46
|
+
const compodocJson = JSON.parse(compodocOutput);
|
|
47
|
+
expect(compodocJson).toMatchSpecificSnapshot(path_1.default.join(testDir, `compodoc-${SNAPSHOT_OS}.snapshot`));
|
|
48
|
+
// snapshot the output of addon-docs angular-properties
|
|
49
|
+
const componentData = (0, compodoc_1.findComponentByName)('InputComponent', compodocJson);
|
|
50
|
+
const argTypes = (0, compodoc_1.extractArgTypesFromData)(componentData);
|
|
51
|
+
expect(argTypes).toMatchSpecificSnapshot(path_1.default.join(testDir, 'argtypes.snapshot'));
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
});
|
|
File without changes
|
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const compodoc_1 = require("./compodoc");
|
|
4
|
+
const makeProperty = (compodocType) => ({
|
|
5
|
+
type: compodocType,
|
|
6
|
+
name: 'dummy',
|
|
7
|
+
decorators: [],
|
|
8
|
+
optional: true,
|
|
9
|
+
});
|
|
10
|
+
const getDummyCompodocJson = () => {
|
|
11
|
+
return {
|
|
12
|
+
miscellaneous: {
|
|
13
|
+
typealiases: [
|
|
14
|
+
{
|
|
15
|
+
name: 'EnumAlias',
|
|
16
|
+
ctype: 'miscellaneous',
|
|
17
|
+
subtype: 'typealias',
|
|
18
|
+
rawtype: 'EnumNumeric',
|
|
19
|
+
file: 'src/stories/component-with-enums/enums.component.ts',
|
|
20
|
+
description: '',
|
|
21
|
+
kind: 161,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: 'TypeAlias',
|
|
25
|
+
ctype: 'miscellaneous',
|
|
26
|
+
subtype: 'typealias',
|
|
27
|
+
rawtype: '"Type Alias 1" | "Type Alias 2" | "Type Alias 3"',
|
|
28
|
+
file: 'src/stories/component-with-enums/enums.component.ts',
|
|
29
|
+
description: '',
|
|
30
|
+
kind: 168,
|
|
31
|
+
},
|
|
32
|
+
],
|
|
33
|
+
enumerations: [
|
|
34
|
+
{
|
|
35
|
+
name: 'EnumNumeric',
|
|
36
|
+
childs: [
|
|
37
|
+
{
|
|
38
|
+
name: 'FIRST',
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'SECOND',
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
name: 'THIRD',
|
|
45
|
+
},
|
|
46
|
+
],
|
|
47
|
+
ctype: 'miscellaneous',
|
|
48
|
+
subtype: 'enum',
|
|
49
|
+
description: '<p>Button Priority</p>\n',
|
|
50
|
+
file: 'src/stories/component-with-enums/enums.component.ts',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
name: 'EnumNumericInitial',
|
|
54
|
+
childs: [
|
|
55
|
+
{
|
|
56
|
+
name: 'UNO',
|
|
57
|
+
value: '1',
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
name: 'DOS',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'TRES',
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
ctype: 'miscellaneous',
|
|
67
|
+
subtype: 'enum',
|
|
68
|
+
description: '',
|
|
69
|
+
file: 'src/stories/component-with-enums/enums.component.ts',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'EnumStringValues',
|
|
73
|
+
childs: [
|
|
74
|
+
{
|
|
75
|
+
name: 'PRIMARY',
|
|
76
|
+
value: 'PRIMARY',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'SECONDARY',
|
|
80
|
+
value: 'SECONDARY',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'TERTIARY',
|
|
84
|
+
value: 'TERTIARY',
|
|
85
|
+
},
|
|
86
|
+
],
|
|
87
|
+
ctype: 'miscellaneous',
|
|
88
|
+
subtype: 'enum',
|
|
89
|
+
description: '',
|
|
90
|
+
file: 'src/stories/component-with-enums/enums.component.ts',
|
|
91
|
+
},
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
describe('extractType', () => {
|
|
97
|
+
describe('with compodoc type', () => {
|
|
98
|
+
(0, compodoc_1.setCompodocJson)(getDummyCompodocJson());
|
|
99
|
+
it.each([
|
|
100
|
+
['string', { name: 'string' }],
|
|
101
|
+
['boolean', { name: 'boolean' }],
|
|
102
|
+
['number', { name: 'number' }],
|
|
103
|
+
['object', { name: 'object' }],
|
|
104
|
+
['foo', { name: 'object' }],
|
|
105
|
+
[null, { name: 'void' }],
|
|
106
|
+
[undefined, { name: 'void' }],
|
|
107
|
+
['T[]', { name: 'object' }],
|
|
108
|
+
['[]', { name: 'object' }],
|
|
109
|
+
['"primary" | "secondary"', { name: 'enum', value: ['primary', 'secondary'] }],
|
|
110
|
+
['TypeAlias', { name: 'enum', value: ['Type Alias 1', 'Type Alias 2', 'Type Alias 3'] }],
|
|
111
|
+
['EnumNumeric', { name: 'object' }],
|
|
112
|
+
['EnumNumericInitial', { name: 'object' }],
|
|
113
|
+
['EnumStringValues', { name: 'enum', value: ['PRIMARY', 'SECONDARY', 'TERTIARY'] }],
|
|
114
|
+
])('%s', (compodocType, expected) => {
|
|
115
|
+
expect((0, compodoc_1.extractType)(makeProperty(compodocType), null)).toEqual(expected);
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
describe('without compodoc type', () => {
|
|
119
|
+
it.each([
|
|
120
|
+
['string', { name: 'string' }],
|
|
121
|
+
['', { name: 'string' }],
|
|
122
|
+
[false, { name: 'boolean' }],
|
|
123
|
+
[10, { name: 'number' }],
|
|
124
|
+
[['abc'], { name: 'object' }],
|
|
125
|
+
[{ foo: 1 }, { name: 'object' }],
|
|
126
|
+
[undefined, { name: 'void' }],
|
|
127
|
+
])('%s', (defaultValue, expected) => {
|
|
128
|
+
expect((0, compodoc_1.extractType)(makeProperty(null), defaultValue)).toEqual(expected);
|
|
129
|
+
});
|
|
130
|
+
});
|
|
131
|
+
});
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/empty-projects-entry/angular.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/minimal-config/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/some-config/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/angular.json
RENAMED
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.d.ts
RENAMED
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/src/main.js
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-angularBrowserTarget/tsconfig.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-nx-workspace/workspace.json
RENAMED
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/angular.json
RENAMED
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/src/main.d.ts
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/with-options-styles/tsconfig.json
RENAMED
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/without-architect-build/angular.json
RENAMED
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/without-compatible-projects/angular.json
RENAMED
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/angular.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/without-projects-entry/tsconfig.json
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
package/dist/{types/server → server}/__mocks-ng-workspace__/without-tsConfig/src/tsconfig.app.json
RENAMED
|
File without changes
|
|
File without changes
|