;
15 | }
16 | }
17 |
--------------------------------------------------------------------------------
/projects/examples/e2e/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../../out-tsc/e2e",
5 | "module": "commonjs",
6 | "target": "es5",
7 | "types": ["jasmine", "jasminewd2", "node"]
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/projects/examples/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 | const generateKarmaConf = require('../../karma.conf.base');
4 |
5 | module.exports = generateKarmaConf('examples');
6 |
--------------------------------------------------------------------------------
/projects/examples/src/app/app-routing.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { NgModule } from '@angular/core';
7 | import { RouterModule } from '@angular/router';
8 |
9 | @NgModule({
10 | imports: [RouterModule.forRoot([])],
11 | exports: [RouterModule],
12 | })
13 | export class AppRoutingModule {}
14 |
--------------------------------------------------------------------------------
/projects/examples/src/app/app.component.scss:
--------------------------------------------------------------------------------
1 | .github {
2 | display: flex;
3 | flex: 1 0 auto;
4 | justify-content: flex-end;
5 | align-items: center;
6 | }
7 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/contextual-actions/action-menu-contextual-actions-example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-action-menu ::ng-deep .inline-actions-container {
2 | & .inline-action-dropdown ::ng-deep .nested-dropdown > .first-dropdown-toggle {
3 | margin-top: 0 !important;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/contextual-actions/action-menu-contextual-actions-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuContextualActionsExampleComponent } from './action-menu-contextual-actions-example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuContextualActionsExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule],
16 | exports: [ActionMenuContextualActionsExampleComponent],
17 | })
18 | export class ActionMenuContextualActionsExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/data-ui-attribute/action-menu-data-ui-example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | The textKeys of following actions are added as data-ui attributes on their HTML button elements. Inspect the
4 | action button HTML elements to notice the data-ui attributes on them
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/data-ui-attribute/action-menu-data-ui-example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-action-menu ::ng-deep .inline-actions-container {
2 | & .inline-action-dropdown ::ng-deep .nested-dropdown > .first-dropdown-toggle {
3 | margin-top: 0 !important;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/data-ui-attribute/action-menu-data-ui-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuDataUiExampleComponent } from './action-menu-data-ui-example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuDataUiExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule],
16 | exports: [ActionMenuDataUiExampleComponent],
17 | })
18 | export class ActionMenuDataUiExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/hide-disable/action-menu-hide-disable-example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-action-menu ::ng-deep .inline-actions-container {
2 | & .inline-action-dropdown ::ng-deep .nested-dropdown > .first-dropdown-toggle {
3 | margin-top: 0 !important;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/hide-disable/action-menu-hide-disable.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuHideDisableExampleComponent } from './action-menu-hide-disable-example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuHideDisableExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule],
16 | exports: [ActionMenuHideDisableExampleComponent],
17 | })
18 | export class ActionMenuHideDisableExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/search-debounce/action-menu-search-debounce.example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Press to toggle Quick Search and search through the actions
4 |
5 |
6 | Notice that there is a spinner displayed initially for 300ms before displaying the action items. This is because
7 | the action search provider is created to debounce the search using 2nd argument(boolean) passed to its
8 | constructor.
9 |
10 |
16 |
17 |
18 |
19 |
20 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/search-debounce/action-menu-search-debounce.example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-action-menu ::ng-deep .inline-actions-container {
2 | & .inline-action-dropdown {
3 | & ::ng-deep .nested-dropdown > .first-dropdown-toggle {
4 | margin-top: 0 !important;
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/search-debounce/action-menu-search-debounce.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { VcdComponentsModule } from '@vcd/ui-components';
9 | import { ActionMenuSearchDebounceExampleComponent } from './action-menu-search-debounce.example.component';
10 |
11 | @NgModule({
12 | declarations: [ActionMenuSearchDebounceExampleComponent],
13 | imports: [CommonModule, VcdComponentsModule],
14 | exports: [ActionMenuSearchDebounceExampleComponent],
15 | })
16 | export class ActionMenuSearchDebounceExampleModule {}
17 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/search-pause-unpause/action-menu-search-pause-and-unpause.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { QuickSearchModule, VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuSearchPauseUnpauseExampleComponent } from './action-menu-search-pause-and-unpause.example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuSearchPauseUnpauseExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule, QuickSearchModule],
16 | exports: [ActionMenuSearchPauseUnpauseExampleComponent],
17 | })
18 | export class ActionMenuSearchPauseAndUnpauseExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/search/action-menu-search-example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
Press to show Quick Search
3 |
4 | If there is an action with no children, it is not displayed in the search results. Try searching for `No
5 | children action` being passed in the list of actions and notice that it is not going to be a search result.
6 |
7 |
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/search/action-menu-search-example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-action-menu ::ng-deep .inline-actions-container {
2 | & .inline-action-dropdown {
3 | & ::ng-deep .nested-dropdown > .first-dropdown-toggle {
4 | margin-top: 0 !important;
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/search/action-menu-search-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { QuickSearchModule, VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuSearchExampleComponent } from './action-menu-search-example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuSearchExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule, QuickSearchModule],
16 | exports: [ActionMenuSearchExampleComponent],
17 | })
18 | export class ActionMenuSearchExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/static-actions/action-menu-static-actions-example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Static actions don't depend on selected entities. Static actions marked as featured are shown towards the left
4 | side and the static actions that are not marked as featured are shown next to the right edge of inline action
5 | bar
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/static-actions/action-menu-static-actions-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuStaticActionsExampleComponent } from './action-menu-static-actions-example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuStaticActionsExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule],
16 | exports: [ActionMenuStaticActionsExampleComponent],
17 | })
18 | export class ActionMenuStaticActionsExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/static-and-contextual-actions/action-menu-static-and-contextual-actions-example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | When static and contextual actions are displayed together, featured static actions are displayed first from
4 | left, followed by featured contextual actions, followed by all contextual actions dropdown and non featured
5 | static actions are displayed to the right most
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/static-and-contextual-actions/action-menu-static-and-contextual-actions-example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-action-menu ::ng-deep .inline-actions-container {
2 | & .inline-action-dropdown ::ng-deep .nested-dropdown > .first-dropdown-toggle {
3 | margin-top: 0 !important;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/static-and-contextual-actions/action-menu-static-and-contextual-actions-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuStaticAndContextualActionsExampleComponent } from './action-menu-static-and-contextual-actions-example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuStaticAndContextualActionsExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule],
16 | exports: [ActionMenuStaticAndContextualActionsExampleComponent],
17 | })
18 | export class ActionMenuStaticAndContextualActionsExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/with-separators/action-menu-with-separators.example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
Use action items as separators to add a separator between action items in a dropdown
3 |
4 | As each item decides its own availability, some groups may become empty and multiple separators can become
5 | contiguous and we collapse the separators if they are contiguous
6 |
7 |
8 | In the following example, Separator at index 3 is collapsed. Please take a look in the TS at dropdown list items
9 | at indices 3 and 4
10 |
11 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/action-menu/with-separators/action-menu-with-separators.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule } from '@vcd/ui-components';
11 | import { ActionMenuWithSeparatorsExampleComponent } from './action-menu-with-separators.example.component';
12 |
13 | @NgModule({
14 | declarations: [ActionMenuWithSeparatorsExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdActionMenuModule],
16 | exports: [ActionMenuWithSeparatorsExampleComponent],
17 | })
18 | export class ActionMenuWithSeparatorsExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/sharing-modal/directive/users-groups-orgs-sharing-modal.example.html:
--------------------------------------------------------------------------------
1 |
2 | This is an example of how to configure the sharing modal using the `vcdUsersGroupsOrgsSharingModal` directive. This
3 | directive gives convenience inputs for the users, groups, and organizations tabs. It also gives convenience inputs
4 | for predefined checkboxes. In each tab config, we also give a default for `makeSearch` that uses the @vcd/sdk to
5 | search for entities on the current environment. If you wish to use our default, just don't supply your own
6 | implementation of `makeSearch`. You can also override the default `entityRenderer` if you wish to have custom
7 | behavior.
8 |
9 | Open
10 |
23 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/sharing-modal/directive/users-groups-orgs-sharing-modal.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { VcdComponentsModule } from '@vcd/ui-components';
9 | import { UsersGroupsOrgsSharingModalExampleComponent } from './users-groups-orgs-sharing-modal.example';
10 |
11 | @NgModule({
12 | declarations: [UsersGroupsOrgsSharingModalExampleComponent],
13 | imports: [CommonModule, VcdComponentsModule],
14 | exports: [UsersGroupsOrgsSharingModalExampleComponent],
15 | })
16 | export class UsersGroupsOrgsSharingModalExampleModule {}
17 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/sharing-modal/directive/users-groups-orgs-sharing-modal.example.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/app/components/sharing-modal/directive/users-groups-orgs-sharing-modal.example.scss
--------------------------------------------------------------------------------
/projects/examples/src/app/components/sharing-modal/sharing-modal-example.component.html:
--------------------------------------------------------------------------------
1 |
2 | This is an example of how to configure the sharing modal on its own. You can customize the title, the tabs, and the
3 | checkboxes. Opening the modal must be done by a trigger coming outside through the two-way binding of `isOpened`.
4 | The form value is also a two way binding. Supply the currently shared with entities, and it will emit the new value
5 | when the user clicks submit.
6 |
7 | Open
8 |
17 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/sharing-modal/sharing-modal-example.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/app/components/sharing-modal/sharing-modal-example.component.scss
--------------------------------------------------------------------------------
/projects/examples/src/app/components/sharing-modal/sharing-modal-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { VcdComponentsModule } from '@vcd/ui-components';
9 | import { SharingModalExampleComponent, SharingModalRendererComponent } from './sharing-modal-example.component';
10 |
11 | @NgModule({
12 | declarations: [SharingModalExampleComponent, SharingModalRendererComponent],
13 | imports: [CommonModule, VcdComponentsModule],
14 | exports: [SharingModalExampleComponent],
15 | })
16 | export class SharingModalExampleModule {}
17 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/focusing/focusing-clipped-text-example.component.scss:
--------------------------------------------------------------------------------
1 | .example-el {
2 | border: 1px solid black;
3 | display: inline-block;
4 | min-height: 1rem;
5 | margin-top: 0.5rem;
6 | min-width: 100px;
7 | }
8 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/focusing/focusing-clipped-text-example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 | import { Component } from '@angular/core';
6 | import { CommonModule } from '@angular/common';
7 | import { TooltipSize, VcdComponentsModule } from '@vcd/ui-components';
8 | import { ClarityModule } from '@clr/angular';
9 | import { FormsModule } from '@angular/forms';
10 |
11 | @Component({
12 | standalone: true,
13 | selector: 'vcd-focusing-clipped-text-example',
14 | templateUrl: 'focusing-clipped-text-example.component.html',
15 | styleUrls: ['focusing-clipped-text-example.component.scss'],
16 | imports: [CommonModule, VcdComponentsModule, ClarityModule, FormsModule],
17 | })
18 | export class FocusingClippedTextExampleComponent {
19 | protected readonly TooltipSize = TooltipSize;
20 | }
21 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/hide/hide-clipped-text-example.component.html:
--------------------------------------------------------------------------------
1 |
11 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/hide/hide-clipped-text-example.component.scss:
--------------------------------------------------------------------------------
1 | .scroll-container {
2 | position: relative;
3 | width: 100%;
4 | height: 500px;
5 | overflow: auto;
6 | }
7 | .clipped-container {
8 | width: 300px;
9 | padding: 10px;
10 | margin-top: 30px;
11 | cursor: pointer;
12 | }
13 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/hide/hide-clipped-text-example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 |
8 | @Component({
9 | selector: 'vcd-hide-clipped-text-example',
10 | templateUrl: './hide-clipped-text-example.component.html',
11 | styleUrls: ['./hide-clipped-text-example.component.scss'],
12 | })
13 | export class HideClippedTextPositioningExampleComponent {
14 | public isClippedContainerVisible: boolean = true;
15 |
16 | toggleContainer(): void {
17 | this.isClippedContainerVisible = !this.isClippedContainerVisible;
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/hide/hide-clipped-text-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { HideClippedTextPositioningExampleComponent } from './hide-clipped-text-example.component';
11 |
12 | @NgModule({
13 | declarations: [HideClippedTextPositioningExampleComponent],
14 | imports: [CommonModule, VcdComponentsModule, ClarityModule],
15 | exports: [HideClippedTextPositioningExampleComponent],
16 | })
17 | export class HideClippedTextPositioningExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/positioning/show-clipped-text-positioning-example.component.html:
--------------------------------------------------------------------------------
1 |
7 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/positioning/show-clipped-text-positioning-example.component.scss:
--------------------------------------------------------------------------------
1 | .scroll-container {
2 | position: relative;
3 | width: 100%;
4 | height: 500px;
5 | }
6 |
7 | .clipped-left {
8 | position: absolute;
9 | width: 100px;
10 | }
11 |
12 | .clipped-right {
13 | position: absolute;
14 | right: 10px;
15 | width: 100px;
16 | }
17 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/positioning/show-clipped-text-positioning-example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 |
8 | @Component({
9 | selector: 'vcd-show-clipped-text-positioning-example',
10 | templateUrl: './show-clipped-text-positioning-example.component.html',
11 | styleUrls: ['./show-clipped-text-positioning-example.component.scss'],
12 | })
13 | export class ShowClippedTextPositioningExampleComponent {}
14 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/positioning/show-clipped-text-positioning-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { VcdComponentsModule } from '@vcd/ui-components';
9 | import { ShowClippedTextPositioningExampleComponent } from './show-clipped-text-positioning-example.component';
10 |
11 | @NgModule({
12 | declarations: [ShowClippedTextPositioningExampleComponent],
13 | imports: [CommonModule, VcdComponentsModule],
14 | exports: [ShowClippedTextPositioningExampleComponent],
15 | })
16 | export class ShowClippedTextPositioningExampleModule {}
17 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/sizing/show-clipped-text-sizing-example.component.html:
--------------------------------------------------------------------------------
1 | Using fixed width and small tooltip
2 | Text for div below:
3 | {{ text }}
4 |
5 | Using Max width using medium tooltip
6 | Text for div below:
7 | {{ text2 }}
8 |
9 | This div is a standard block using large tooltip
10 | Text for div below:
11 | {{ text3 }}
12 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/sizing/show-clipped-text-sizing-example.component.scss:
--------------------------------------------------------------------------------
1 | div {
2 | border: 1px solid black;
3 | }
4 |
5 | .fixed-width {
6 | width: 200px;
7 | }
8 |
9 | /** To use max-width, element must be inline-block */
10 | .max-width {
11 | display: inline-block;
12 | max-width: 200px;
13 | }
14 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/sizing/show-clipped-text-sizing-example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 | import { TooltipSize } from '@vcd/ui-components';
8 |
9 | @Component({
10 | selector: 'vcd-show-clipped-text-sizing-example',
11 | templateUrl: './show-clipped-text-sizing-example.component.html',
12 | styleUrls: ['./show-clipped-text-sizing-example.component.scss'],
13 | })
14 | export class ShowClippedTextSizingExampleComponent {
15 | TooltipSize = TooltipSize;
16 |
17 | text =
18 | 'Something really long that will require clipping in most cases so we add random text' +
19 | ' to make sure that clipping happens on initially';
20 | text2 =
21 | 'Something else for 2... really long that will require clipping in most cases so we add random text' +
22 | ' to make sure that clipping happens on initially';
23 |
24 | text3 =
25 | 'Something else for 3... long that will require clipping in most cases so we add random text' +
26 | ' to make sure that clipping happens on initially';
27 | }
28 |
--------------------------------------------------------------------------------
/projects/examples/src/app/components/show-clipped-text/sizing/show-clipped-text-sizing-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { FormsModule } from '@angular/forms';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { ShowClippedTextSizingExampleComponent } from './show-clipped-text-sizing-example.component';
11 |
12 | @NgModule({
13 | declarations: [ShowClippedTextSizingExampleComponent],
14 | imports: [CommonModule, FormsModule, VcdComponentsModule],
15 | exports: [ShowClippedTextSizingExampleComponent],
16 | })
17 | export class ShowClippedTextSizingExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/app/home/home.component.spec.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { ComponentFixture, TestBed, waitForAsync } from '@angular/core/testing';
7 |
8 | import { HomeComponent } from './home.component';
9 |
10 | describe('HomeComponent', () => {
11 | let component: HomeComponent;
12 | let fixture: ComponentFixture;
13 |
14 | beforeEach(
15 | waitForAsync(() => {
16 | TestBed.configureTestingModule({
17 | declarations: [HomeComponent],
18 | }).compileComponents();
19 | })
20 | );
21 |
22 | beforeEach(() => {
23 | fixture = TestBed.createComponent(HomeComponent);
24 | component = fixture.componentInstance;
25 | fixture.detectChanges();
26 | });
27 |
28 | it('should create', () => {
29 | expect(component).toBeTruthy();
30 | });
31 | });
32 |
--------------------------------------------------------------------------------
/projects/examples/src/app/home/home.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 |
8 | @Component({
9 | selector: 'vcd-home',
10 | templateUrl: './home.component.html',
11 | })
12 | export class HomeComponent {
13 | ghReadMeUrl =
14 | 'https://github.com/vmware/vmware-cloud-director-ui-components/blob/master/projects/components/README.md#Components';
15 | vcdUrl = 'https://www.vmware.com/products/cloud-director.html';
16 | }
17 |
--------------------------------------------------------------------------------
/projects/examples/src/assets/.gitkeep:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/assets/.gitkeep
--------------------------------------------------------------------------------
/projects/examples/src/components/activity-reporter/banner-activity-reporter.example.component.html:
--------------------------------------------------------------------------------
1 | Start Activity Reporter
2 | Throw Error
3 | Report Success
4 |
5 |
--------------------------------------------------------------------------------
/projects/examples/src/components/activity-reporter/banner-activity-reporter.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { BannerActivityReporterExampleComponent } from './banner-activity-reporter.example.component';
12 |
13 | @NgModule({
14 | declarations: [BannerActivityReporterExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [BannerActivityReporterExampleComponent],
17 | })
18 | export class BannerActivityReporterExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/activity-reporter/spinner-activity-reporter.example.component.html:
--------------------------------------------------------------------------------
1 | Start Activity Reporter
2 | Throw Error
3 | Report Success
4 |
5 |
--------------------------------------------------------------------------------
/projects/examples/src/components/activity-reporter/spinner-activity-reporter.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { SpinnerActivityReporterExampleComponent } from './spinner-activity-reporter.example.component';
12 |
13 | @NgModule({
14 | declarations: [SpinnerActivityReporterExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [SpinnerActivityReporterExampleComponent],
17 | })
18 | export class SpinnerActivityReporterExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/data-exporter/data-exporter.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DataExporterExampleComponent } from './data-exporter.example.component';
12 |
13 | @NgModule({
14 | declarations: [DataExporterExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DataExporterExampleComponent],
17 | })
18 | export class DataExporterExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/data-exporter/data-exporter.examples.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { NgModule } from '@angular/core';
7 |
8 | import { DataExporterComponent } from '@vcd/ui-components';
9 | import { Documentation } from '@vmw/ng-live-docs';
10 | import { DataExporterExampleComponent } from './data-exporter.example.component';
11 | import { DataExporterExampleModule } from './data-exporter.example.module';
12 |
13 | Documentation.registerDocumentationEntry({
14 | component: DataExporterComponent,
15 | displayName: 'Data Exporter',
16 | urlSegment: 'dataExporter',
17 | examples: [
18 | {
19 | component: DataExporterExampleComponent,
20 | title: 'Data Exporter example',
21 | urlSegment: 'data-exporter',
22 | },
23 | ],
24 | });
25 |
26 | @NgModule({
27 | imports: [DataExporterExampleModule],
28 | })
29 | export class DataExporterExamplesModule {}
30 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-action-display-config.example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-datagrid ::ng-deep .inline-actions-container {
2 | & .first-dropdown-toggle {
3 | margin-top: 0 !important;
4 | }
5 | }
6 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-action-display-config.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridActionDisplayConfigExampleComponent } from './datagrid-action-display-config.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridActionDisplayConfigExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridActionDisplayConfigExampleComponent],
17 | })
18 | export class DatagridActionDisplayConfigExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-action-menu-tracking-example.component.scss:
--------------------------------------------------------------------------------
1 | ::ng-deep {
2 | .clr-form-compact .clr-subtext {
3 | display: none;
4 | }
5 |
6 | clr-dg-action-bar.top-action-bar {
7 | margin-top: 0;
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-action-menu-tracking.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule, VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridActionMenuTrackingExampleComponent } from './datagrid-action-menu-tracking-example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridActionMenuTrackingExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule, VcdActionMenuModule],
16 | exports: [DatagridActionMenuTrackingExampleComponent],
17 | })
18 | export class DatagridActionMenuTrackerExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-activity-reporter.example.component.html:
--------------------------------------------------------------------------------
1 |
8 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-activity-reporter.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { DatagridActivityReporterExampleComponent } from './datagrid-activity-reporter.example.component';
11 |
12 | @NgModule({
13 | declarations: [DatagridActivityReporterExampleComponent],
14 | imports: [CommonModule, ClarityModule, VcdComponentsModule],
15 | exports: [DatagridActivityReporterExampleComponent],
16 | })
17 | export class DatagridActivityReporterExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-cliptext.example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-cliptext.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { DatagridCliptextExampleComponent } from './datagrid-cliptext.example.component';
11 |
12 | @NgModule({
13 | declarations: [DatagridCliptextExampleComponent],
14 | imports: [CommonModule, ClarityModule, VcdComponentsModule],
15 | exports: [DatagridCliptextExampleComponent],
16 | })
17 | export class DatagridCliptextExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-column-width.example.component.html:
--------------------------------------------------------------------------------
1 |
2 | This is an example that shows that you can set the CSS class on each column to change things like the starting
3 | width. Each column has a different class that corresponds to a different width set with a different unit. The only
4 | units that are supported are
5 |
absolute length units . Relative lengths do not seem well supported by Clarity.
8 |
9 |
10 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-column-width.example.component.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | ::ng-deep .col-1 {
7 | width: 2in;
8 | }
9 |
10 | ::ng-deep .col-2 {
11 | width: 200px;
12 | }
13 |
14 | ::ng-deep .col-3 {
15 | width: 4em;
16 | }
17 |
18 | ::ng-deep .col-4 {
19 | width: 50pt;
20 | }
21 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-column-width.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { DatagridColumnWidthExampleComponent } from './datagrid-column-width.example.component';
11 |
12 | @NgModule({
13 | declarations: [DatagridColumnWidthExampleComponent],
14 | imports: [CommonModule, ClarityModule, VcdComponentsModule],
15 | exports: [DatagridColumnWidthExampleComponent],
16 | })
17 | export class DatagridColumnWidthExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-css-classes.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { DatagridCssClassesExampleComponent } from './datagrid-css-classes.example.component';
11 |
12 | @NgModule({
13 | declarations: [DatagridCssClassesExampleComponent],
14 | imports: [CommonModule, ClarityModule, VcdComponentsModule],
15 | exports: [DatagridCssClassesExampleComponent],
16 | })
17 | export class DatagridCssClassesExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-detail-pane.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import {
12 | DatagridDetailPaneExampleComponent,
13 | DatagridDetailPaneSubComponent,
14 | } from './datagrid-detail-pane.example.component';
15 |
16 | @NgModule({
17 | declarations: [DatagridDetailPaneExampleComponent, DatagridDetailPaneSubComponent],
18 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
19 | exports: [DatagridDetailPaneExampleComponent],
20 | })
21 | export class DatagridDetailPaneExampleModule {}
22 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-detail-row.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import {
12 | DatagridDetailRowExampleComponent,
13 | DatagridDetailRowSubComponent,
14 | DatagridDetailRowSubNoLazyComponent,
15 | } from './datagrid-detail-row.example.component';
16 |
17 | @NgModule({
18 | declarations: [
19 | DatagridDetailRowExampleComponent,
20 | DatagridDetailRowSubComponent,
21 | DatagridDetailRowSubNoLazyComponent,
22 | ],
23 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
24 | exports: [DatagridDetailRowExampleComponent],
25 | })
26 | export class DatagridDetailRowExampleModule {}
27 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-filter.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { DatagridFilterExampleComponent } from './datagrid-filter.example.component';
11 |
12 | @NgModule({
13 | declarations: [DatagridFilterExampleComponent],
14 | imports: [CommonModule, ClarityModule, VcdComponentsModule],
15 | exports: [DatagridFilterExampleComponent],
16 | })
17 | export class DatagridFilterExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-header.example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-header.example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 | import { GridColumn, GridDataFetchResult, GridState } from '@vcd/ui-components';
8 |
9 | interface Data {
10 | value: string;
11 | }
12 |
13 | /**
14 | * Shows the capability of the datagrid to put a header on the top.
15 | */
16 | @Component({
17 | selector: 'vcd-datagrid-header-example',
18 | templateUrl: './datagrid-header.example.component.html',
19 | })
20 | export class DatagridHeaderExampleComponent {
21 | gridData: GridDataFetchResult = {
22 | items: [],
23 | };
24 |
25 | columns: GridColumn[] = [
26 | {
27 | displayName: 'Column',
28 | renderer: 'value',
29 | },
30 | ];
31 |
32 | header = 'Some Header!';
33 |
34 | refresh(eventData: GridState): void {
35 | this.gridData = {
36 | items: [{ value: 'a' }, { value: 'b' }],
37 | totalItems: 2,
38 | };
39 | }
40 | }
41 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-header.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridHeaderExampleComponent } from './datagrid-header.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridHeaderExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridHeaderExampleComponent],
17 | })
18 | export class DatagridHeaderExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-height.example.component.html:
--------------------------------------------------------------------------------
1 |
2 |
9 |
10 |
11 |
12 |
19 |
20 |
Ends Here!
21 |
22 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-height.example.component.scss:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | .fixed-height {
7 | height: 500px;
8 | flex-direction: column;
9 | display: flex;
10 | }
11 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-height.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridHeightExampleComponent } from './datagrid-height.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridHeightExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridHeightExampleComponent],
17 | })
18 | export class DatagridHeightExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-is-row-selectable-example.component.html:
--------------------------------------------------------------------------------
1 | Single Select
2 | Multi Select Select
3 |
10 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-is-row-selectable-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2022 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridIsRowSelectableExampleComponent } from './datagrid-is-row-selectable-example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridIsRowSelectableExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridIsRowSelectableExampleComponent],
17 | })
18 | export class DatagridIsRowSelectableExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-link.example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-datagrid ::ng-deep .inline-actions-container {
2 | & .inline-action-dropdown {
3 | & ::ng-deep .nested-dropdown > .first-dropdown-toggle {
4 | margin-top: 0 !important;
5 | }
6 | }
7 | }
8 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-link.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdActionMenuModule, VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridLinkExampleComponent } from './datagrid-link.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridLinkExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule, VcdActionMenuModule],
16 | exports: [DatagridLinkExampleComponent],
17 | })
18 | export class DatagridLinkExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-loading-placeholder.example.component.html:
--------------------------------------------------------------------------------
1 | Stop Loading
2 |
3 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-loading-placeholder.example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 | import { GridColumn, GridDataFetchResult, GridState } from '@vcd/ui-components';
8 |
9 | interface Data {
10 | value: string;
11 | }
12 |
13 | /**
14 | * Press the first button to stop loading and show the placeholder.
15 | */
16 | @Component({
17 | selector: 'vcd-datagrid-loading-placeholder-example',
18 | templateUrl: './datagrid-loading-placeholder.example.component.html',
19 | })
20 | export class DatagridLoadingPlaceholderExampleComponent {
21 | gridData: GridDataFetchResult = {
22 | items: [],
23 | };
24 |
25 | columns: GridColumn[] = [
26 | {
27 | displayName: 'Column',
28 | renderer: 'value',
29 | },
30 | ];
31 |
32 | setData(): void {
33 | this.gridData = {
34 | items: [],
35 | totalItems: 0,
36 | };
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-loading-placeholder.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridLoadingPlaceholderExampleComponent } from './datagrid-loading-placeholder.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridLoadingPlaceholderExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridLoadingPlaceholderExampleComponent],
17 | })
18 | export class DatagridLoadingPlaceholderExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-pagination-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridPaginationExampleComponent } from './datagrid-pagination-example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridPaginationExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridPaginationExampleComponent],
17 | })
18 | export class DatagridPagionationExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-preserve-selection.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2023 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridPreserveSelectionExampleComponent } from './datagrid-preserve-selection.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridPreserveSelectionExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridPreserveSelectionExampleComponent],
17 | })
18 | export class DatagridPreserveSelectionExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-row-icon.example.component.html:
--------------------------------------------------------------------------------
1 |
2 | Shows that when the data within the grid is reloaded but the trackBy value stays the same, the DOM is not
3 | re-rendered. Thus, any row within the datagrid maintains its state. If the DOM was re-rendered, the modal would not
4 | open when you clicked the button because the state of the row would be cleared.
5 |
6 |
7 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-row-icon.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { DatagridRowIconExampleComponent, RowIconRendererComponent } from './datagrid-row-icon.example.component';
11 |
12 | @NgModule({
13 | declarations: [DatagridRowIconExampleComponent, RowIconRendererComponent],
14 | imports: [CommonModule, ClarityModule, VcdComponentsModule],
15 | exports: [DatagridRowIconExampleComponent],
16 | })
17 | export class DatagridRowIconExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-row-select.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridRowSelectExampleComponent } from './datagrid-row-select.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridRowSelectExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridRowSelectExampleComponent],
17 | })
18 | export class DatagridRowSelectExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-show-hide.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridShowHideExampleComponent } from './datagrid-show-hide.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridShowHideExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridShowHideExampleComponent],
17 | })
18 | export class DatagridShowHideExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-sort.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { DatagridSortExampleComponent } from './datagrid-sort.example.component';
12 |
13 | @NgModule({
14 | declarations: [DatagridSortExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [DatagridSortExampleComponent],
17 | })
18 | export class DatagridSortExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/datagrid/datagrid-three-renderers.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { VcdComponentsModule } from '@vcd/ui-components';
10 | import { DatagridThreeRenderersExampleComponent } from './datagrid-three-renderers.example.component';
11 |
12 | @NgModule({
13 | declarations: [DatagridThreeRenderersExampleComponent],
14 | imports: [CommonModule, ClarityModule, VcdComponentsModule],
15 | exports: [DatagridThreeRenderersExampleComponent],
16 | })
17 | export class DatagridThreeRenderersExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/error/error-banner.example.component.html:
--------------------------------------------------------------------------------
1 | Show/Hide Error
2 |
3 |
--------------------------------------------------------------------------------
/projects/examples/src/components/error/error-banner.example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020-2023 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 |
8 | /**
9 | * Press the button to show/hide the error banner.
10 | */
11 | @Component({
12 | selector: 'vcd-error-banner-example',
13 | templateUrl: './error-banner.example.component.html',
14 | })
15 | export class ErrorBannerExampleComponent {
16 | errorMessage: string;
17 | }
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/error/error-banner.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { ErrorBannerExampleComponent } from './error-banner.example.component';
12 |
13 | @NgModule({
14 | declarations: [ErrorBannerExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [ErrorBannerExampleComponent],
17 | })
18 | export class ErrorBannerExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/error/error-banner.examples.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { NgModule } from '@angular/core';
7 | import { ErrorBannerComponent } from '@vcd/ui-components';
8 | import { Documentation } from '@vmw/ng-live-docs';
9 | import { ErrorBannerExampleComponent } from './error-banner.example.component';
10 | import { ErrorBannerExampleModule } from './error-banner.example.module';
11 |
12 | Documentation.registerDocumentationEntry({
13 | component: ErrorBannerComponent,
14 | displayName: 'Error Banner',
15 | urlSegment: 'errorBanner',
16 | examples: [
17 | {
18 | component: ErrorBannerExampleComponent,
19 | title: 'Error banner when the button is pressed',
20 | urlSegment: 'error-banner',
21 | },
22 | ],
23 | });
24 |
25 | /**
26 | * A module that imports all error banner examples.
27 | */
28 | @NgModule({
29 | imports: [ErrorBannerExampleModule],
30 | })
31 | export class ErrorBannerExamplesModule {}
32 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/form-checkbox.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { NgModule } from '@angular/core';
7 | import { ReactiveFormsModule } from '@angular/forms';
8 | import { VcdFormModule } from '@vcd/ui-components';
9 | import { FormCheckboxExampleComponent } from './form-checkbox.example.component';
10 |
11 | @NgModule({
12 | declarations: [FormCheckboxExampleComponent],
13 | imports: [VcdFormModule, ReactiveFormsModule],
14 | exports: [FormCheckboxExampleComponent],
15 | })
16 | export class FormCheckboxExampleModule {}
17 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/form-input.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { NgModule } from '@angular/core';
7 | import { ReactiveFormsModule } from '@angular/forms';
8 | import { VcdFormModule } from '@vcd/ui-components';
9 | import { FormInputExampleComponent } from './form-input.example.component';
10 |
11 | @NgModule({
12 | declarations: [FormInputExampleComponent],
13 | imports: [VcdFormModule, ReactiveFormsModule],
14 | exports: [FormInputExampleComponent],
15 | })
16 | export class FormInputExampleModule {}
17 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/form-select-disabled-options.example.component.html:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/form-select-disabled.example.component.html:
--------------------------------------------------------------------------------
1 |
21 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/form-select-validation.example.component.html:
--------------------------------------------------------------------------------
1 |
10 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/form-select.example.component.html:
--------------------------------------------------------------------------------
1 |
25 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/form-select.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2022 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { NgModule } from '@angular/core';
7 | import { ReactiveFormsModule } from '@angular/forms';
8 | import { VcdFormModule } from '@vcd/ui-components';
9 | import { FormSelectDisabledOptionsExampleComponent } from './form-select-disabled-options.example.component';
10 | import { FormSelectExampleComponent } from './form-select.example.component';
11 | import { FormSelectValidationExampleComponent } from './form-select-validation.example.component';
12 | import { FormSelectDisabledExampleComponent } from './form-select-disabled.example.component';
13 |
14 | @NgModule({
15 | declarations: [
16 | FormSelectExampleComponent,
17 | FormSelectDisabledExampleComponent,
18 | FormSelectDisabledOptionsExampleComponent,
19 | FormSelectValidationExampleComponent,
20 | ],
21 | imports: [VcdFormModule, ReactiveFormsModule],
22 | exports: [FormSelectExampleComponent],
23 | })
24 | export class FormSelectExampleModule {}
25 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/number-with-unit-form-input-unitless.example.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/components/form-input/number-with-unit-form-input-unitless.example.component.scss
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/number-with-unit-form-input-unitless.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { I18nModule } from '@vcd/i18n';
10 | import { VcdFormModule } from '@vcd/ui-components';
11 | import { NumberWithUnitFormInputUnitlessExampleComponent } from './number-with-unit-form-input-unitless.example.component';
12 |
13 | @NgModule({
14 | declarations: [NumberWithUnitFormInputUnitlessExampleComponent],
15 | imports: [CommonModule, VcdFormModule, ReactiveFormsModule, I18nModule],
16 | exports: [NumberWithUnitFormInputUnitlessExampleComponent],
17 | })
18 | export class NumberWithUnitFormInputUnitlessExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/number-with-unit-form-input.example.component.scss:
--------------------------------------------------------------------------------
1 | .form-value-display {
2 | margin-top: 0.5rem;
3 | }
4 |
5 | .form-valid {
6 | margin-top: 1.5rem;
7 | }
8 |
--------------------------------------------------------------------------------
/projects/examples/src/components/form-input/number-with-unit-form-input.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { I18nModule } from '@vcd/i18n';
10 | import { VcdFormModule } from '@vcd/ui-components';
11 | import { NumberWithUnitFormInputExampleComponent } from './number-with-unit-form-input.example.component';
12 |
13 | @NgModule({
14 | declarations: [NumberWithUnitFormInputExampleComponent],
15 | imports: [CommonModule, VcdFormModule, ReactiveFormsModule, I18nModule],
16 | exports: [NumberWithUnitFormInputExampleComponent],
17 | })
18 | export class NumberWithUnitFormInputExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/formly/input/formly-input-example-wrapper.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component, ViewChild, ViewContainerRef } from '@angular/core';
7 | import { FieldWrapper } from '@ngx-formly/core';
8 |
9 | @Component({
10 | selector: 'vcd-formly-input-example-wrapper',
11 | template: `
12 |
13 |
14 |
{{ to.cardTitle }}
15 |
16 |
17 |
18 |
19 |
20 | `,
21 | })
22 | export class FormlyInputExampleWrapperComponent extends FieldWrapper {
23 | @ViewChild('fieldComponent', { static: true, read: ViewContainerRef })
24 | fieldComponent: ViewContainerRef;
25 | }
26 |
--------------------------------------------------------------------------------
/projects/examples/src/components/loading/loading-indicator.example.component.html:
--------------------------------------------------------------------------------
1 | Start/Stop Loading
2 |
3 |
--------------------------------------------------------------------------------
/projects/examples/src/components/loading/loading-indicator.example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 |
8 | /**
9 | * Press the button to start/stop the loading indicator.
10 | */
11 | @Component({
12 | selector: 'vcd-loading-indicator-example',
13 | templateUrl: './loading-indicator.example.component.html',
14 | })
15 | export class LoadingIndicatorExampleComponent {
16 | isLoading = false;
17 | }
18 |
--------------------------------------------------------------------------------
/projects/examples/src/components/loading/loading-indicator.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import { LoadingIndicatorExampleComponent } from './loading-indicator.example.component';
12 |
13 | @NgModule({
14 | declarations: [LoadingIndicatorExampleComponent],
15 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
16 | exports: [LoadingIndicatorExampleComponent],
17 | })
18 | export class LoadingIndicatorExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/loading/loading-indicator.examples.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { NgModule } from '@angular/core';
7 | import { LoadingIndicatorComponent } from '@vcd/ui-components';
8 | import { Documentation } from '@vmw/ng-live-docs';
9 | import { LoadingIndicatorExampleComponent } from './loading-indicator.example.component';
10 | import { LoadingIndicatorExampleModule } from './loading-indicator.example.module';
11 |
12 | Documentation.registerDocumentationEntry({
13 | component: LoadingIndicatorComponent,
14 | displayName: 'Loading Indicator',
15 | urlSegment: 'loadingIndicator',
16 | examples: [
17 | {
18 | component: LoadingIndicatorExampleComponent,
19 | title: 'Shows a loading indicator when set to loading',
20 | urlSegment: 'loading-indicator',
21 | },
22 | ],
23 | });
24 |
25 | /**
26 | * A module that imports all loading indicator examples.
27 | */
28 | @NgModule({
29 | imports: [LoadingIndicatorExampleModule],
30 | })
31 | export class LoadingIndicatorExamplesModule {}
32 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/filters/quick-search-filters.example.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/components/quick-search/filters/quick-search-filters.example.component.scss
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/filters/quick-search-filters.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { QuickSearchModule, VcdFormModule } from '@vcd/ui-components';
11 | import { ActionsSearchProvider, QuickSearchFiltersExampleComponent } from './quick-search-filters.example.component';
12 |
13 | @NgModule({
14 | imports: [CommonModule, ClarityModule, QuickSearchModule, VcdFormModule, ReactiveFormsModule],
15 | declarations: [QuickSearchFiltersExampleComponent],
16 | exports: [QuickSearchFiltersExampleComponent],
17 | })
18 | export class QuickSearchFiltersExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/nested-providers/quick-search-nested-providers.example.component.html:
--------------------------------------------------------------------------------
1 | Press to show Quick Search
2 |
3 |
4 | Quick search gives the client to register nested sections on-top-of normal sections. A nested section is a simple
5 | group of quick search providers that has a section name.
6 |
7 |
8 | These sections can be ordered amongst each-other, but will always display below normal quick search providers.
9 |
10 |
11 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/nested-providers/quick-search-nested-providers.example.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/components/quick-search/nested-providers/quick-search-nested-providers.example.component.scss
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/nested-providers/quick-search-nested-providers.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { QuickSearchModule, VcdFormModule } from '@vcd/ui-components';
11 | import {
12 | ActionsSearchProvider,
13 | QuickSearchNestedProvidersExampleComponent,
14 | } from './quick-search-nested-providers.example.component';
15 |
16 | @NgModule({
17 | imports: [CommonModule, ClarityModule, QuickSearchModule, VcdFormModule, ReactiveFormsModule],
18 | declarations: [QuickSearchNestedProvidersExampleComponent],
19 | exports: [QuickSearchNestedProvidersExampleComponent],
20 | })
21 | export class QuickSearchNestedProvidersExampleModule {}
22 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/quick-search-content-projection.example.component.scss:
--------------------------------------------------------------------------------
1 | .info {
2 | display: flex;
3 | font-style: italic;
4 | justify-content: center;
5 | background-color: var(--clr-color-neutral-200);
6 | border-radius: 0.2em;
7 | }
8 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/quick-search-content-projection.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { QuickSearchModule, VcdFormModule } from '@vcd/ui-components';
11 | import { QuickSearchContentProjectionExampleComponent } from './quick-search-content-projection.example.component';
12 |
13 | @NgModule({
14 | imports: [CommonModule, ClarityModule, QuickSearchModule, VcdFormModule, ReactiveFormsModule],
15 | declarations: [QuickSearchContentProjectionExampleComponent],
16 | exports: [QuickSearchContentProjectionExampleComponent],
17 | })
18 | export class QuickSearchContentProjectionExampleModule {}
19 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/quick-search-hide-empty-section-example.component.html:
--------------------------------------------------------------------------------
1 | Press to show Quick Search
2 | This example shows how to configure whether a provider section should be hidden if there are no results.
3 |
4 | Use the form below to configure the Quick Search
5 |
6 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/quick-search-hide-empty-section-example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { QuickSearchModule, VcdFormModule } from '@vcd/ui-components';
11 | import {
12 | ActionsSearchProvider,
13 | QuickSearchHideEmptySectionExampleComponent,
14 | } from './quick-search-hide-empty-section-example.component';
15 |
16 | @NgModule({
17 | imports: [CommonModule, ClarityModule, QuickSearchModule, VcdFormModule, ReactiveFormsModule],
18 | declarations: [QuickSearchHideEmptySectionExampleComponent],
19 | exports: [QuickSearchHideEmptySectionExampleComponent],
20 | providers: [
21 | {
22 | provide: ActionsSearchProvider,
23 | useValue: new ActionsSearchProvider(false),
24 | },
25 | ],
26 | })
27 | export class QuickSearchHideEmptySectionExampleModule {}
28 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/quick-search-sync-async.example.component.html:
--------------------------------------------------------------------------------
1 | Press to show Quick Search
2 |
3 | There several sections - some that do the search asynchronously while the other synchronously.
4 |
5 | Use the keyboard arrow keys to move through the search result. You can do this even while the results are still
6 | loading.
7 |
8 | Press 'Enter' to invoke the selected action. You can also use the mouse to click on an item
9 | Use the form below to configure the Quick Search
10 |
11 |
20 |
21 |
26 |
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/quick-search-sync-async.example.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/components/quick-search/quick-search-sync-async.example.component.scss
--------------------------------------------------------------------------------
/projects/examples/src/components/quick-search/quick-search-sync-async.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { QuickSearchModule, VcdFormModule } from '@vcd/ui-components';
11 | import {
12 | ActionsSearchProvider,
13 | QuickSearchSyncAsyncExampleComponent,
14 | } from './quick-search-sync-async.example.component';
15 |
16 | @NgModule({
17 | imports: [CommonModule, ClarityModule, QuickSearchModule, VcdFormModule, ReactiveFormsModule],
18 | declarations: [QuickSearchSyncAsyncExampleComponent],
19 | exports: [QuickSearchSyncAsyncExampleComponent],
20 | providers: [
21 | {
22 | provide: ActionsSearchProvider,
23 | useValue: new ActionsSearchProvider(false),
24 | },
25 | ],
26 | })
27 | export class QuickSearchSyncAsyncExampleModule {}
28 |
--------------------------------------------------------------------------------
/projects/examples/src/components/subscription/subscription-tracker.example.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ReactiveFormsModule } from '@angular/forms';
9 | import { ClarityModule } from '@clr/angular';
10 | import { VcdComponentsModule } from '@vcd/ui-components';
11 | import {
12 | SubscriptionTrackerExampleComponent,
13 | SubscriptionTrackerExampleSubComponent,
14 | } from './subscription-tracker.example.component';
15 |
16 | @NgModule({
17 | declarations: [SubscriptionTrackerExampleComponent, SubscriptionTrackerExampleSubComponent],
18 | imports: [CommonModule, ClarityModule, ReactiveFormsModule, VcdComponentsModule],
19 | exports: [SubscriptionTrackerExampleComponent],
20 | })
21 | export class SubscriptionTrackerExampleModule {}
22 |
--------------------------------------------------------------------------------
/projects/examples/src/environments/environment.prod.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export const environment = {
7 | production: true,
8 | };
9 |
--------------------------------------------------------------------------------
/projects/examples/src/environments/environment.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | // This file can be replaced during build by using the `fileReplacements` array.
7 | // `ng build --prod` replaces `environment.ts` with `environment.prod.ts`.
8 | // The list of file replacements can be found in `angular.json`.
9 |
10 | export const environment = {
11 | production: false,
12 | };
13 |
14 | /*
15 | * For easier debugging in development mode, you can import the following file
16 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`.
17 | *
18 | * This import should be commented out in production mode because it will have a negative impact
19 | * on performance if an error is thrown.
20 | */
21 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI.
22 |
--------------------------------------------------------------------------------
/projects/examples/src/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/examples/src/favicon.ico
--------------------------------------------------------------------------------
/projects/examples/src/index.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | Examples
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/projects/examples/src/main.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { enableProdMode, LOCALE_ID } from '@angular/core';
7 | import { platformBrowserDynamic } from '@angular/platform-browser-dynamic';
8 |
9 | import { AppModule } from './app/app.module';
10 | import { environment } from './environments/environment';
11 |
12 | if (environment.production) {
13 | enableProdMode();
14 | }
15 |
16 | platformBrowserDynamic([
17 | {
18 | provide: LOCALE_ID,
19 | useValue: navigator.language,
20 | },
21 | ])
22 | .bootstrapModule(AppModule)
23 | .catch((err) => console.error(err));
24 |
--------------------------------------------------------------------------------
/projects/examples/src/mock-vcd-common.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export const EMPTY = {};
7 |
--------------------------------------------------------------------------------
/projects/examples/src/styles.scss:
--------------------------------------------------------------------------------
1 | /* You can add global styles to this file, and also import other style files */
2 | // TODO: Provide the users with option to select the prismjs CSS based on the theme they want
3 | @import '../../../node_modules/prismjs/themes/prism';
4 | @import '~@cds/core/global.min.css';
5 |
--------------------------------------------------------------------------------
/projects/examples/src/test.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2019 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
7 |
8 | import 'zone.js/testing';
9 | // eslint-disable-next-line sort-imports
10 | import { getTestBed } from '@angular/core/testing';
11 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
12 |
13 | // First, initialize the Angular testing environment.
14 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
15 | teardown: { destroyAfterEach: false },
16 | });
17 |
--------------------------------------------------------------------------------
/projects/examples/tsconfig.app.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/app",
5 | "types": []
6 | },
7 | // TODO: Removed the 'files' property because files added to the property are being excluded by Compodoc parser
8 | // https://github.com/compodoc/compodoc/issues/831
9 | "include": ["src/main.ts", "src/polyfills.ts", "src/**/*.ts"],
10 | "exclude": ["src/test.ts", "src/**/*.spec.ts"]
11 | }
12 |
--------------------------------------------------------------------------------
/projects/examples/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/spec",
5 | "types": ["jasmine", "node"]
6 | },
7 | "files": ["src/test.ts", "src/polyfills.ts"],
8 | "include": ["src/**/*.spec.ts", "src/**/*.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/projects/i18n/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../.eslintrc.json",
3 | "ignorePatterns": [
4 | "!**/*"
5 | ],
6 | "overrides": [
7 | {
8 | "files": [
9 | "*.ts"
10 | ],
11 | "parserOptions": {
12 | "project": [
13 | "projects/i18n/tsconfig.lib.json",
14 | "projects/i18n/tsconfig.spec.json"
15 | ],
16 | "createDefaultProgram": true
17 | }
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/projects/i18n/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 | const generateKarmaConf = require('../../karma.conf.base');
4 |
5 | module.exports = generateKarmaConf('i18n');
6 |
--------------------------------------------------------------------------------
/projects/i18n/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/i18n",
4 | "lib": {
5 | "entryFile": "src/public-api.ts"
6 | },
7 | "allowedNonPeerDependencies": ["messageformat"]
8 | }
9 |
--------------------------------------------------------------------------------
/projects/i18n/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@vcd/i18n",
3 | "version": "15.0.1",
4 | "peerDependencies": {
5 | "@angular/common": ">=15.2.3",
6 | "@angular/core": ">=15.2.3"
7 | },
8 | "dependencies": {
9 | "@messageformat/core": "^3"
10 | }
11 | }
12 |
--------------------------------------------------------------------------------
/projects/i18n/src/lib/service/mock-translation-service.spec.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { MockTranslationService } from './mock-translation-service';
7 |
8 | describe('MockTranslationService', () => {
9 | const service = new MockTranslationService();
10 |
11 | it('uses the perferred local set', () => {
12 | service.preferredLocale = 'en';
13 | expect(service.getActiveLocale()).toEqual('en');
14 | });
15 |
16 | it('formats dates using the default formatter', () => {
17 | expect(service.formatDate(new Date('1/1/1999'))).toEqual('1/1/1999, 12:00:00 AM');
18 | expect(service.formatTime(new Date('1/1/1999'))).toEqual('1/1/1999, 12:00:00 AM');
19 | expect(service.formatDateTime(new Date('1/1/1999'))).toEqual('1/1/1999, 12:00:00 AM');
20 | });
21 | });
22 |
--------------------------------------------------------------------------------
/projects/i18n/src/lib/utils/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export * from './platform-util';
7 |
--------------------------------------------------------------------------------
/projects/i18n/src/public-api.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export * from './lib/i18n.module';
7 | export * from './lib/service/translation-service';
8 | export * from './lib/pipe/translation-pipe';
9 | export * from './lib/pipe/format-date-time-pipe';
10 | export * from './lib/pipe/lazy-string.pipe';
11 | export * from './lib/service/message-format-translation-service';
12 | export * from './lib/service/mock-translation-service';
13 | export * from './lib/loader/translation-loader';
14 | export * from './lib/utils/index';
15 |
--------------------------------------------------------------------------------
/projects/i18n/src/test.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
7 |
8 | import 'zone.js';
9 | import 'zone.js/testing';
10 | import { getTestBed } from '@angular/core/testing';
11 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
12 |
13 | // First, initialize the Angular testing environment.
14 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
15 | teardown: { destroyAfterEach: false },
16 | });
17 |
--------------------------------------------------------------------------------
/projects/i18n/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/lib",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "annotateForClosureCompiler": true,
13 | "compilationMode": "partial",
14 | "skipTemplateCodegen": true,
15 | "strictMetadataEmit": true,
16 | "fullTemplateTypeCheck": true,
17 | "strictInjectionParameters": true,
18 | "enableResourceInlining": true
19 | },
20 | "include": ["**/*.ts"],
21 | "exclude": ["src/test.ts", "**/*.spec.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/projects/i18n/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.lib.json",
3 | "compilerOptions": {
4 | "declarationMap": false
5 | },
6 | "angularCompilerOptions": {
7 | "compilationMode": "partial"
8 | }
9 | }
10 |
--------------------------------------------------------------------------------
/projects/i18n/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/spec",
5 | "types": ["jasmine", "node"]
6 | },
7 | "files": ["src/test.ts"],
8 | "include": ["**/*.spec.ts", "**/*.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../.eslintrc.json",
3 | "ignorePatterns": [
4 | "!**/*"
5 | ],
6 | "overrides": [
7 | {
8 | "files": [
9 | "*.ts"
10 | ],
11 | "parserOptions": {
12 | "project": [
13 | "projects/ng-live-docs/tsconfig.lib.json",
14 | "projects/ng-live-docs/tsconfig.spec.json"
15 | ],
16 | "createDefaultProgram": true
17 | },
18 | "rules": {
19 | "@angular-eslint/component-selector": [
20 | "error",
21 | {
22 | "type": "element",
23 | "prefix": "vmw",
24 | "style": "kebab-case"
25 | }
26 | ],
27 | "@angular-eslint/directive-selector": [
28 | "error",
29 | {
30 | "type": "attribute",
31 | "prefix": "vmw",
32 | "style": "camelCase"
33 | }
34 | ]
35 | }
36 | }
37 | ]
38 | }
39 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
6 |
7 | ## [Unreleased]
8 |
9 | ## [0.0.15]
10 |
11 | Upgraded to Angular/Clarity 12
12 |
13 | ## [0.0.14]
14 |
15 | ### Fixed
16 |
17 | Make @vmw/ng-live-docs/index.js work on Windows
18 |
19 | ## [0.0.13]
20 |
21 | The first good version after problems with the pipeline. Version to be used for
22 | Angular 11 / Clarity 5
23 |
24 | ### Changed
25 |
26 | Updated to require @vmw/plain-js-livedocs@0.0.4 which has more liberal peer dependencies
27 |
28 | ## [0.0.10]
29 |
30 | ### Changed
31 |
32 | - Upgraded to Angular 11 / Clarity 5
33 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 | const generateKarmaConf = require('../../karma.conf.base');
4 |
5 | module.exports = generateKarmaConf('ng-live-docs');
6 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/ng-live-docs",
4 | "lib": {
5 | "entryFile": "src/public-api.ts"
6 | },
7 | "allowedNonPeerDependencies": [
8 | "rbradford-compodoc",
9 | "@stackblitz/sdk",
10 | "schematics-utilities",
11 | "cross-spawn"
12 | ]
13 | }
14 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@vmw/ng-live-docs",
3 | "version": "0.0.16",
4 | "peerDependencies": {
5 | "@angular/common": "~13.3.11",
6 | "@angular/core": "~13.3.11",
7 | "@angular/platform-browser": "^13.3.11",
8 | "@clr/ui": "^13.5.0",
9 | "@clr/icons": "^13.0.2",
10 | "@clr/angular": "^13.5.0",
11 | "@cds/core": "^6.1.0",
12 | "prismjs": "^1"
13 | },
14 | "dependencies": {
15 | "rbradford-compodoc": "1.1.11",
16 | "@stackblitz/sdk": "^1.3",
17 | "schematics-utilities": "^2",
18 | "cross-spawn": "^7.0.3"
19 | },
20 | "schematics": "./schematics/collection.json"
21 | }
22 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/add-example/files/example-component/__name@dasherize__.example.component.html.template:
--------------------------------------------------------------------------------
1 | <%= name %>
2 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/add-example/files/example-component/__name@dasherize__.example.component.scss.template:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/vmware-archive/vmware-cloud-director-ui-components/c0d4bee9936324c6232ddad1a6f8b56cd431abc2/projects/ng-live-docs/schematics/add-example/files/example-component/__name@dasherize__.example.component.scss.template
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/add-example/files/example-component/__name@dasherize__.example.component.ts.template:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component, OnInit } from '@angular/core';
7 |
8 | @Component({
9 | selector: 'vcd-<%= dasherize(name) %>-example',
10 | templateUrl: './<%= dasherize(name) %>.example.component.html',
11 | styleUrls: ['./<%= dasherize(name) %>.example.component.scss'],
12 | })
13 | export class <%= name %>ExampleComponent implements OnInit {
14 | constructor() {}
15 |
16 | ngOnInit(): void {}
17 | }
18 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/add-example/files/example-component/__name@dasherize__.example.module.ts.template:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { <%= classify(moduleName) %> } from '<%= packageName %>';
9 | import { <%= name %>ExampleComponent } from './<%= dasherize(name) %>.example.component';
10 |
11 | @NgModule({
12 | declarations: [<%= name %>ExampleComponent],
13 | imports: [CommonModule, <%= classify(moduleName) %> ],
14 | exports: [<%= name %>ExampleComponent],
15 | entryComponents: [<%= name %>ExampleComponent],
16 | })
17 | export class <%= name %>ExampleModule {}
18 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/add-example/files/root-module/examples.module.ts.template:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { <%= name %>ExamplesModule } from './<%= componentType %>s/<%= dasherize(name) %>/<%= dasherize(name) %>.examples.module';
9 |
10 | @NgModule({
11 | imports: [
12 | CommonModule,
13 | <%= name %>ExamplesModule
14 | ]
15 | })
16 | export class ExamplesModule {}
17 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/add-example/schema.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "http://json-schema.org/schema",
3 | "id": "SchematicsMyService",
4 | "title": "My Service Schema",
5 | "type": "object",
6 | "properties": {
7 | "packageName": {
8 | "description": "Package name",
9 | "type": "string"
10 | },
11 | "moduleName": {
12 | "description": "Module name",
13 | "type": "string"
14 | },
15 | "componentName": {
16 | "description": "The component to add example",
17 | "type": "string"
18 | },
19 | "exampleName": {
20 | "description": "Example name",
21 | "type": "string"
22 | },
23 | "displayName": {
24 | "description": "Title of example",
25 | "type": "string"
26 | }
27 | },
28 | "required": [
29 | "packageName", "moduleName", "componentName", "exampleName", "displayName"
30 | ]
31 | }
32 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/add-example/schema.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export interface Schema {
7 | packageName: string;
8 | moduleName: string;
9 | componentName: string;
10 | exampleName: string;
11 | displayName: string;
12 | }
13 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/schematics/collection.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../../node_modules/@angular-devkit/schematics/collection-schema.json",
3 | "schematics": {
4 | "add-example": {
5 | "description": "Add example",
6 | "factory": "./add-example/index#addExample",
7 | "schema": "./add-example/schema.json"
8 | }
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/scripts/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "moduleResolution": "node",
4 | "module": "commonjs",
5 | "noImplicitAny": true,
6 | "removeComments": true,
7 | "preserveConstEnums": true,
8 | "sourceMap": true,
9 | "target": "es2016",
10 | "outDir": "../../../dist/ng-live-docs",
11 | "types": ["jasmine", "node"],
12 | "lib": [
13 | "es2015",
14 | "dom"
15 | ],
16 | "allowJs": true
17 | },
18 | "files": [
19 | "create-module-data.ts",
20 | "index.js"
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/api-viewer/api-viewer.component.scss:
--------------------------------------------------------------------------------
1 | ::ng-deep body p {
2 | margin-top: 0;
3 | }
4 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/api-viewer/api-viewer.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { ApiViewerComponent } from './api-viewer.component';
10 |
11 | const declarations = [ApiViewerComponent];
12 |
13 | @NgModule({
14 | imports: [ClarityModule, CommonModule],
15 | declarations: [...declarations],
16 | exports: [...declarations],
17 | })
18 | export class ApiViewerModule {}
19 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/api-viewer/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export * from './api-viewer.component';
7 | export * from './api-viewer.module';
8 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/documentation-container-api.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component, OnInit } from '@angular/core';
7 | import { ActivatedRoute, Data } from '@angular/router';
8 |
9 | @Component({
10 | selector: 'vmw-documentation-container-api',
11 | template: ` `,
12 | })
13 | export class DocumentationContainerApiComponent implements OnInit {
14 | component: Component;
15 |
16 | constructor(private route: ActivatedRoute) {}
17 |
18 | ngOnInit(): void {
19 | this.route.data.subscribe((data: Data) => {
20 | if (data.component) {
21 | this.component = data.component;
22 | }
23 | });
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/documentation-container-documentation.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component, OnInit } from '@angular/core';
7 | import { ActivatedRoute, Data } from '@angular/router';
8 |
9 | @Component({
10 | selector: 'vmw-documentation-container-documentation',
11 | template: ` `,
12 | })
13 | export class DocumentationContainerDocumentationComponent implements OnInit {
14 | component: Component;
15 |
16 | constructor(private route: ActivatedRoute) {}
17 |
18 | ngOnInit(): void {
19 | this.route.data.subscribe((data: Data) => {
20 | if (data.component) {
21 | this.component = data.component;
22 | }
23 | });
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/documentation-container-example.component.html:
--------------------------------------------------------------------------------
1 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/documentation-container-example.component.scss:
--------------------------------------------------------------------------------
1 | vcd-example-viewer {
2 | margin-top: 1rem;
3 | display: block;
4 | }
5 |
6 | ul.example-list {
7 | columns: auto 3;
8 | }
9 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/documentation-container-example.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component, OnInit } from '@angular/core';
7 | import { ActivatedRoute, Data } from '@angular/router';
8 |
9 | @Component({
10 | selector: 'vmw-documentation-container-example',
11 | templateUrl: './documentation-container-example.component.html',
12 | styleUrls: ['./documentation-container-example.component.scss'],
13 | })
14 | export class DocumentationContainerExampleComponent implements OnInit {
15 | examples = [];
16 |
17 | constructor(private route: ActivatedRoute) {}
18 |
19 | ngOnInit(): void {
20 | this.route.data.subscribe((data: Data) => {
21 | if (data.examples) {
22 | this.examples = data.examples;
23 | }
24 | });
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/documentation-container.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | Documentation
4 |
5 |
6 |
7 | API
8 |
9 |
10 |
11 | Examples
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/documentation-container.component.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { Component } from '@angular/core';
7 | import { ActivatedRoute } from '@angular/router';
8 | import { DocumentationEntry } from '../interfaces';
9 |
10 | @Component({
11 | selector: 'vmw-documentation-container',
12 | templateUrl: './documentation-container.component.html',
13 | })
14 | export class DocumentationContainerComponent {
15 | /**
16 | * The documentation entry registered for a component is obtained here using the route data
17 | * {@link Documentation.getRoutes} registered for that component using {@link Documentation.registerDocumentationEntry}
18 | */
19 | documentationEntry: DocumentationEntry;
20 |
21 | constructor(private route: ActivatedRoute) {}
22 | }
23 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/documentation-container/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export * from './documentation-container.component';
7 | export * from './documentation-container.module';
8 | export * from './documentation-container-api.component';
9 | export * from './documentation-container-documentation.component';
10 | export * from './documentation-container-example.component';
11 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/example-viewer/example-viewer.component.scss:
--------------------------------------------------------------------------------
1 | $radius: 3px;
2 | $margin: 0.5rem;
3 | $bg-clr: #d8e3e9;
4 |
5 | .card-header-main {
6 | display: flex;
7 |
8 | .card-header {
9 | flex: 1;
10 | }
11 |
12 | .example-button-container {
13 | display: flex;
14 | margin: 0.4rem $margin 0 0;
15 | padding: 0 4px;
16 |
17 | &.example-shown {
18 | border-radius: $radius $radius 0 0;
19 | background-color: $bg-clr;
20 | }
21 | clr-icon {
22 | margin: 0 2px;
23 | cursor: pointer;
24 | align-self: center;
25 | }
26 | }
27 | }
28 | .source-code-container {
29 | border-radius: $radius 0 $radius $radius;
30 | margin: 0 $margin;
31 | background-color: $bg-clr;
32 | }
33 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/example-viewer/example-viewer.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { OverviewViewerModule } from '../overview-viewer/overview-viewer.module';
10 | import { SourceCodeViewerModule } from '../source-code-viewer/source-code-viewer.module';
11 | import { ExampleViewerComponent } from './example-viewer.component';
12 |
13 | const declarations = [ExampleViewerComponent];
14 |
15 | @NgModule({
16 | imports: [ClarityModule, CommonModule, SourceCodeViewerModule, OverviewViewerModule],
17 | declarations: [...declarations],
18 | exports: [...declarations],
19 | })
20 | export class ExampleViewerModule {}
21 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/example-viewer/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export * from './example-viewer.component';
7 | export * from './example-viewer.module';
8 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/injection-tokens.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { InjectionToken } from '@angular/core';
7 | import { CompodocSchema } from './compodoc/compodoc-schema';
8 | import { StackBlitzInfo } from './interfaces';
9 |
10 | /**
11 | * NOTE: The following two has to be exported otherwise the AoT compiler won't see it.
12 | */
13 |
14 | /**
15 | * Token that makes the documentation JSONs available to the following factory function.
16 | */
17 | export const DOCUMENTATION_DATA = new InjectionToken(
18 | 'NgLiveDocsModule.forRoot() CompoDocRetrieverService doc jsons.'
19 | );
20 |
21 | /**
22 | * A token that is used to provide the url where the raw compodoc output is located.
23 | */
24 | export const COMPODOC_URL = new InjectionToken('COMPODOC_URL');
25 |
26 | /**
27 | * Token that makes Stqckblitz JSON data available to factory functions
28 | */
29 | export const STACKBLITZ_DATA = new InjectionToken(
30 | 'NgLiveDocsModule.forRoot() StackBlitz template JSON data'
31 | );
32 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/overview-viewer/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export * from './overview-viewer.component';
7 | export * from './overview-viewer.module';
8 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/overview-viewer/overview-viewer.component.html:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/overview-viewer/overview-viewer.component.scss:
--------------------------------------------------------------------------------
1 | :host > div {
2 | padding-top: 10px;
3 | }
4 |
5 | :host ::ng-deep p {
6 | margin-bottom: 10px;
7 | }
8 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/overview-viewer/overview-viewer.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { OverviewViewerComponent } from './overview-viewer.component';
10 |
11 | const declarations = [OverviewViewerComponent];
12 |
13 | @NgModule({
14 | imports: [ClarityModule, CommonModule],
15 | declarations: [...declarations],
16 | exports: [...declarations],
17 | })
18 | export class OverviewViewerModule {}
19 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/public-api.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | /*
7 | * Public API Surface of doc-lib
8 | */
9 |
10 | export * from './documentation-retriever.service';
11 | export * from './documentation';
12 | export * from './compodoc/compodoc-schema';
13 | export * from './ng-live-docs.module';
14 | export * from './api-viewer/index';
15 | export * from './documentation-container/index';
16 | export * from './example-viewer/index';
17 | export * from './overview-viewer/index';
18 | export * from './source-code-viewer/index';
19 | export * from './stack-blitz-writer.service';
20 | export * from './interfaces';
21 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/source-code-viewer/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export * from './source-code-viewer.component';
7 | export * from './source-code-viewer.module';
8 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/source-code-viewer/source-code-viewer.component.html:
--------------------------------------------------------------------------------
1 |
2 |
3 | HTML
4 |
5 |
6 |
7 |
8 |
9 | Typescript
10 |
11 |
12 |
13 |
14 |
15 | CSS
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/source-code-viewer/source-code-viewer.component.scss:
--------------------------------------------------------------------------------
1 | pre {
2 | height: 15rem;
3 | max-height: 15rem;
4 | border-radius: 3px;
5 | }
6 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/source-code-viewer/source-code-viewer.module.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { CommonModule } from '@angular/common';
7 | import { NgModule } from '@angular/core';
8 | import { ClarityModule } from '@clr/angular';
9 | import { SourceCodeViewerComponent } from './source-code-viewer.component';
10 |
11 | const declarations = [SourceCodeViewerComponent];
12 |
13 | @NgModule({
14 | imports: [ClarityModule, CommonModule],
15 | declarations: [...declarations],
16 | exports: [...declarations],
17 | })
18 | export class SourceCodeViewerModule {}
19 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/src/test.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files
7 | // The two zone.js imports below must be loaded before anything else
8 | import 'zone.js';
9 | import 'zone.js/testing';
10 | import { getTestBed } from '@angular/core/testing';
11 | import { BrowserDynamicTestingModule, platformBrowserDynamicTesting } from '@angular/platform-browser-dynamic/testing';
12 |
13 | // First, initialize the Angular testing environment.
14 | getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting(), {
15 | teardown: { destroyAfterEach: false },
16 | });
17 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/lib",
5 | "target": "es2015",
6 | "declaration": true,
7 | "inlineSources": true,
8 | "types": [],
9 | "lib": ["dom", "es2018"]
10 | },
11 | "angularCompilerOptions": {
12 | "annotateForClosureCompiler": true,
13 | "compilationMode": "partial",
14 | "skipTemplateCodegen": true,
15 | "strictMetadataEmit": true,
16 | "fullTemplateTypeCheck": true,
17 | "strictInjectionParameters": true,
18 | "enableResourceInlining": true
19 | },
20 | "include": ["**/*.ts"],
21 | "exclude": ["src/test.ts", "**/*.spec.ts"]
22 | }
23 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/tsconfig.lib.prod.json:
--------------------------------------------------------------------------------
1 | /* To learn more about this file see: https://angular.io/config/tsconfig. */
2 | {
3 | "extends": "./tsconfig.lib.json",
4 | "compilerOptions": {
5 | "declarationMap": false
6 | },
7 | "angularCompilerOptions": {
8 | "compilationMode": "partial"
9 | }
10 | }
11 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/tsconfig.schematics.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "baseUrl": ".",
4 | "lib": [
5 | "es2018",
6 | "dom"
7 | ],
8 | "declaration": true,
9 | "module": "commonjs",
10 | "moduleResolution": "node",
11 | "noEmitOnError": true,
12 | "noFallthroughCasesInSwitch": true,
13 | "noImplicitAny": true,
14 | "noImplicitThis": true,
15 | "noUnusedParameters": true,
16 | "noUnusedLocals": true,
17 | "rootDir": "schematics",
18 | "outDir": "../../dist/ng-live-docs/schematics",
19 | "skipDefaultLibCheck": true,
20 | "skipLibCheck": true,
21 | "sourceMap": true,
22 | "strictNullChecks": true,
23 | "target": "es6",
24 | "types": [
25 | "jasmine",
26 | "node"
27 | ]
28 | },
29 | "include": [
30 | "schematics/**/*"
31 | ],
32 | "exclude": [
33 | "schematics/*/files/**/*"
34 | ]
35 | }
36 |
--------------------------------------------------------------------------------
/projects/ng-live-docs/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/spec",
5 | "types": [
6 | "jasmine",
7 | "node"
8 | ]
9 | },
10 | "files": [
11 | "src/test.ts"
12 | ],
13 | "include": [
14 | "**/*.spec.ts",
15 | "**/*.d.ts"
16 | ]
17 | }
18 |
--------------------------------------------------------------------------------
/projects/route-analyzer/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../.eslintrc.json",
3 | "ignorePatterns": [
4 | "!**/*"
5 | ],
6 | "overrides": [
7 | {
8 | "files": [
9 | "*.ts"
10 | ],
11 | "parserOptions": {
12 | "project": [
13 | "projects/route-analyzer/tsconfig.lib.json",
14 | "projects/route-analyzer/tsconfig.spec.json"
15 | ],
16 | "createDefaultProgram": true
17 | }
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/projects/route-analyzer/jest.config.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | export default {
3 | displayName: 'route-analyzer',
4 | preset: '../../jest.preset.js',
5 | globals: {
6 | 'ts-jest': {
7 | tsconfig: '/tsconfig.spec.json',
8 | },
9 | },
10 | transform: {
11 | '^.+\\.[tj]sx?$': 'ts-jest',
12 | },
13 | moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
14 | coverageDirectory: '../../coverage/route-analyzer',
15 | };
16 |
--------------------------------------------------------------------------------
/projects/route-analyzer/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 | const generateKarmaConf = require('../../karma.conf.base');
4 |
5 | module.exports = generateKarmaConf('route-analyzer');
6 |
--------------------------------------------------------------------------------
/projects/route-analyzer/ng-package.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3 | "dest": "../../dist/route-analyzer",
4 | "lib": {
5 | "entryFile": "src/public-api.ts"
6 | },
7 | "allowedNonPeerDependencies": ["ts-evaluator", "yargs", "@angular-devkit/core"]
8 | }
9 |
--------------------------------------------------------------------------------
/projects/route-analyzer/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@vcd/route-analyzer",
3 | "version": "0.0.13",
4 | "bin": "cli.js",
5 | "dependencies": {
6 | "ts-evaluator": "1.1.0",
7 | "yargs": "17.2.1",
8 | "@angular-devkit/core": "^15"
9 | },
10 | "peerDependencies": {
11 | "typescript": "^4.x"
12 | },
13 | "devDependencies": {
14 | "ts-node": "^10.8.2",
15 | "@types/node": "^12.11.1"
16 | }
17 | }
18 |
--------------------------------------------------------------------------------
/projects/route-analyzer/src/lib/constants.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 | export const ANGULAR_CORE = {
6 | ANGULAR_ROUTER: '@angular/router',
7 | FOR_CHILD: 'forChild',
8 | FOR_ROOT: 'forRoot',
9 | ROUTER_MODULE: 'RouterModule',
10 | };
11 |
12 | export const ROUTE_PROP = {
13 | PATH: 'path',
14 | REDIRECT_TO: 'redirectTo',
15 | CHILDREN: 'children',
16 | LOAD_CHILDREN: 'loadChildren',
17 | COMPONENT: 'component',
18 | DATA: 'data',
19 | };
20 |
--------------------------------------------------------------------------------
/projects/route-analyzer/src/lib/route-info.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 | export interface RouteInfo {
6 | /**
7 | * Calls this to create a route
8 | * @param args replacement IDs for each replaceable part of the URL
9 | */
10 | route(...args: string[]): string;
11 |
12 | /**
13 | * Regex that can be used to see if this route matches an existing URL
14 | */
15 | regex: RegExp;
16 |
17 | /**
18 | * The tag name that will be rendered by Angular's router for this route.
19 | */
20 | tagName?: string;
21 | }
22 |
--------------------------------------------------------------------------------
/projects/route-analyzer/src/public-api.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | /*
7 | * Public API Surface of route-analyzer
8 | */
9 |
10 | export * from './lib/app-route';
11 | export * from './lib/route-info';
12 |
--------------------------------------------------------------------------------
/projects/route-analyzer/tsconfig.cli.json:
--------------------------------------------------------------------------------
1 | {
2 | "compilerOptions": {
3 | "moduleResolution": "node",
4 | "module": "commonjs",
5 | "esModuleInterop": true,
6 | "target": "es2016",
7 | "sourceMap": true,
8 | "outDir": "../../dist/route-analyzer",
9 | "removeComments": true,
10 | "noImplicitAny": true,
11 | "noImplicitThis": true,
12 | "skipLibCheck": true,
13 | "forceConsistentCasingInFileNames": true,
14 | "lib": ["dom", "es2018", "es2020.string"]
15 | },
16 | "files": ["./src/cli.ts"]
17 | }
18 |
--------------------------------------------------------------------------------
/projects/route-analyzer/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/lib",
5 | "declaration": true,
6 | "inlineSources": true,
7 | "types": [],
8 | "lib": ["dom", "es2018", "es2020.string"]
9 | },
10 | "angularCompilerOptions": {
11 | "annotateForClosureCompiler": true,
12 | "compilationMode": "partial",
13 | "skipTemplateCodegen": true,
14 | "strictMetadataEmit": true,
15 | "fullTemplateTypeCheck": true,
16 | "strictInjectionParameters": true,
17 | "enableResourceInlining": true
18 | },
19 | "exclude": ["**/*.spec.ts"]
20 | }
21 |
--------------------------------------------------------------------------------
/projects/route-analyzer/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../out-tsc/spec",
5 | "types": ["jasmine", "node"]
6 | },
7 | "include": ["jest.config.ts", "**/*.spec.ts", "**/*.d.ts"]
8 | }
9 |
--------------------------------------------------------------------------------
/projects/widget-object/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": ["../../.eslintrc.json"],
3 | "ignorePatterns": ["!**/*"],
4 | "overrides": [
5 | {
6 | "files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
7 | "rules": {}
8 | },
9 | {
10 | "files": ["*.ts", "*.tsx"],
11 | "rules": {}
12 | },
13 | {
14 | "files": ["*.js", "*.jsx"],
15 | "rules": {}
16 | }
17 | ]
18 | }
19 |
--------------------------------------------------------------------------------
/projects/widget-object/CHANGELOG.MD:
--------------------------------------------------------------------------------
1 | # Changelog
2 |
3 | All notable changes to this project will be documented in this file.
4 |
5 | The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6 | and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7 |
8 | ## [0.0.2]
9 | * Restore behavior of SelectorUtils that was broken when splitting out WidgetObject
10 |
--------------------------------------------------------------------------------
/projects/widget-object/README.md:
--------------------------------------------------------------------------------
1 | # widget-object
2 |
3 | This library was generated with [Nx](https://nx.dev).
4 |
5 | ## Building
6 |
7 | Run `nx build widget-object` to build the library.
8 |
9 | ## Running unit tests
10 |
11 | Run `nx test widget-object` to execute the unit tests via [Jest](https://jestjs.io).
12 |
--------------------------------------------------------------------------------
/projects/widget-object/jest.config.ts:
--------------------------------------------------------------------------------
1 | /* eslint-disable */
2 | export default {
3 | displayName: 'widget-object',
4 | preset: 'jest-preset-angular',
5 | setupFilesAfterEnv: ['/setup-jest.ts'],
6 | globalSetup: 'jest-preset-angular/global-setup',
7 | globals: {
8 | 'ts-jest': {
9 | tsconfig: '/tsconfig.spec.json',
10 | },
11 | },
12 | transform: {
13 | '^.+\\.(ts|js|html)$': 'jest-preset-angular',
14 | },
15 | restoreMocks: true,
16 | moduleFileExtensions: ['ts', 'js', 'html'],
17 | coverageDirectory: '../../coverage/projects/widget-object',
18 | };
19 |
--------------------------------------------------------------------------------
/projects/widget-object/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "@vcd/widget-object",
3 | "version": "0.0.2",
4 | "type": "commonjs"
5 | }
6 |
--------------------------------------------------------------------------------
/projects/widget-object/setup-jest.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 | import 'jest-preset-angular/setup-jest';
6 |
--------------------------------------------------------------------------------
/projects/widget-object/src/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 | export * from './lib/';
6 |
--------------------------------------------------------------------------------
/projects/widget-object/src/lib/datagrid/vcd-datagrid.wo.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | import { BaseWidgetObject } from '../';
7 | import { ClrDatagridWidgetObject } from './datagrid.wo';
8 |
9 | /**
10 | * Widget Object for our VCD DataGrid
11 | */
12 | export class VcdDatagridWidgetObject extends BaseWidgetObject {
13 | static tagName = `vcd-datagrid`;
14 |
15 | /**
16 | * Gives the header above the grid.
17 | */
18 | getHeader = this.factory.css('h3');
19 |
20 | /**
21 | * Gives the widget object for this `clr-datagrid`.
22 | */
23 | get clrDatagrid(): ClrDatagridWidgetObject {
24 | return this.el.findWidget>(ClrDatagridWidgetObject);
25 | }
26 |
27 | /**
28 | * Unwraps the `vcd-datagrid`
29 | *
30 | * @deprecated Please use {@link VcdDatagridWidgetObject.self()}.
31 | */
32 | get vcdDatagrid(): T {
33 | return this.self();
34 | }
35 | }
36 |
--------------------------------------------------------------------------------
/projects/widget-object/src/lib/index.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2020 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 |
6 | export { CypressWidgetObjectFinder, FindCypressWidgetOptions } from './cypress/cypress-widget-finder';
7 | export { AngularWidgetObjectFinder } from './angular/angular-widget-finder';
8 | export { TestElement } from './angular/angular-widget-object-element';
9 | export { FindElementOptions, BaseWidgetObject, FindableWidget, WidgetObjectElement } from './widget-object';
10 | export { ClrDatagridWidgetObject } from './datagrid/datagrid.wo';
11 | export { VcdDatagridWidgetObject } from './datagrid/vcd-datagrid.wo';
12 |
--------------------------------------------------------------------------------
/projects/widget-object/src/lib/selector-util.ts:
--------------------------------------------------------------------------------
1 | /*!
2 | * Copyright 2021 VMware, Inc.
3 | * SPDX-License-Identifier: BSD-2-Clause
4 | */
5 | import { FindElementOptions } from './widget-object';
6 |
7 | export class SelectorUtil {
8 | /**
9 | * Extracts the selector from the parameter passed. It is possible that selector is a `FindElementOptions` but
10 | * does not contain dataUiSelector or cssSelector. That would
11 | *
12 | * @return a CSS selector string to be used or undefined if no CSS selector can be found
13 | */
14 | static extractSelector(selector: string | FindElementOptions): string | undefined {
15 | if (typeof selector === 'string') {
16 | return selector;
17 | } else {
18 | if (selector.dataUiSelector) {
19 | return `[data-ui="${selector.dataUiSelector}"]`;
20 | }
21 |
22 | return selector.cssSelector;
23 | }
24 | }
25 | }
26 |
--------------------------------------------------------------------------------
/projects/widget-object/tsconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "../../tsconfig.json",
3 | "compilerOptions": {
4 | "module": "commonjs",
5 | "forceConsistentCasingInFileNames": true,
6 | "strict": true,
7 | "noImplicitOverride": true,
8 | "noPropertyAccessFromIndexSignature": true,
9 | "noImplicitReturns": true,
10 | "noFallthroughCasesInSwitch": true
11 | },
12 | "files": [],
13 | "include": [],
14 | "references": [
15 | {
16 | "path": "./tsconfig.lib.json"
17 | },
18 | {
19 | "path": "./tsconfig.spec.json"
20 | }
21 | ]
22 | }
23 |
--------------------------------------------------------------------------------
/projects/widget-object/tsconfig.lib.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "declaration": true,
6 | "types": ["node"]
7 | },
8 | "include": ["src/**/*.ts"],
9 | "exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
10 | }
11 |
--------------------------------------------------------------------------------
/projects/widget-object/tsconfig.spec.json:
--------------------------------------------------------------------------------
1 | {
2 | "extends": "./tsconfig.json",
3 | "compilerOptions": {
4 | "outDir": "../../dist/out-tsc",
5 | "module": "commonjs",
6 | "types": ["jest", "node"]
7 | },
8 | "include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
9 | }
10 |
--------------------------------------------------------------------------------
/vcdh5cc.l10n:
--------------------------------------------------------------------------------
1 | #
2 | # This file lists all files that should be localized for a release.
3 | # These localizations are maintained internally by VMware.
4 | #
5 |
6 |
7 | # For VCD-CC, all files including *.properties are UTF-8 encoded.
8 | # Override default value ('java_escape') for java-resource (*.properties) files.
9 | Encodingrule: java-resource => utf_8_sig
10 | Encodingrule: text-file => utf_8_sig
11 |
12 | #################################
13 | # HTML5 UI
14 | [projects/components/src/assets/resources]
15 | %M.properties
16 |
--------------------------------------------------------------------------------