├── tools ├── schematics │ └── .gitkeep └── tsconfig.tools.json ├── apps ├── flight-app │ ├── src │ │ ├── assets │ │ │ ├── .gitkeep │ │ │ ├── stats-1.json │ │ │ ├── stats-2.json │ │ │ ├── stats-3.json │ │ │ ├── img │ │ │ │ ├── angular.png │ │ │ │ ├── favicon.png │ │ │ │ ├── new_logo.png │ │ │ │ ├── apple-icon.png │ │ │ │ ├── background.jpg │ │ │ │ ├── tim_80x80.png │ │ │ │ ├── angular2-logo.png │ │ │ │ ├── faces │ │ │ │ │ ├── face-0.jpg │ │ │ │ │ ├── face-1.jpg │ │ │ │ │ ├── face-2.jpg │ │ │ │ │ └── face-3.jpg │ │ │ │ └── angular2-logo-white.png │ │ │ ├── sass │ │ │ │ ├── paper │ │ │ │ │ ├── mixins │ │ │ │ │ │ ├── _tabs.scss │ │ │ │ │ │ ├── _cards.scss │ │ │ │ │ │ ├── _navbars.scss │ │ │ │ │ │ ├── _icons.scss │ │ │ │ │ │ ├── _inputs.scss │ │ │ │ │ │ ├── _transparency.scss │ │ │ │ │ │ ├── _labels.scss │ │ │ │ │ │ ├── _sidebar.scss │ │ │ │ │ │ ├── _buttons.scss │ │ │ │ │ │ └── _chartist.scss │ │ │ │ │ ├── _mixins.scss │ │ │ │ │ ├── _footers.scss │ │ │ │ │ ├── _alerts.scss │ │ │ │ │ ├── _tables.scss │ │ │ │ │ ├── _misc.scss │ │ │ │ │ ├── _dropdown.scss │ │ │ │ │ ├── _typography.scss │ │ │ │ │ ├── _buttons.scss │ │ │ │ │ ├── _navbars.scss │ │ │ │ │ ├── _animate.scss │ │ │ │ │ └── _inputs.scss │ │ │ │ └── paper-dashboard.scss │ │ │ ├── fonts │ │ │ │ ├── themify.eot │ │ │ │ ├── themify.ttf │ │ │ │ └── themify.woff │ │ │ ├── sea-1993791_1920.jpg │ │ │ ├── custom-elements │ │ │ │ ├── src │ │ │ │ │ ├── CustomElementState.js │ │ │ │ │ ├── AlreadyConstructedMarker.js │ │ │ │ │ ├── Patch │ │ │ │ │ │ ├── DocumentFragment.js │ │ │ │ │ │ ├── Native.js │ │ │ │ │ │ ├── Interface │ │ │ │ │ │ │ ├── ParentNode.js │ │ │ │ │ │ │ └── ChildNode.js │ │ │ │ │ │ ├── HTMLElement.js │ │ │ │ │ │ └── Document.js │ │ │ │ │ ├── Deferred.js │ │ │ │ │ ├── custom-elements.js │ │ │ │ │ ├── DocumentConstructionObserver.js │ │ │ │ │ └── Utilities.js │ │ │ │ ├── tests │ │ │ │ │ ├── chromium │ │ │ │ │ │ ├── resources │ │ │ │ │ │ │ ├── plugin.js │ │ │ │ │ │ │ ├── gc.js │ │ │ │ │ │ │ ├── accessibility-helper.js │ │ │ │ │ │ │ ├── run-after-layout-and-paint.js │ │ │ │ │ │ │ ├── mojo-helpers.js │ │ │ │ │ │ │ ├── intersection-observer-helper-functions.js │ │ │ │ │ │ │ └── vendor-prefix.js │ │ │ │ │ │ └── custom-elements │ │ │ │ │ │ │ └── spec │ │ │ │ │ │ │ └── resources │ │ │ │ │ │ │ └── custom-elements-helpers.js │ │ │ │ │ └── js │ │ │ │ │ │ ├── closure.js │ │ │ │ │ │ ├── upgrade.js │ │ │ │ │ │ ├── shadow-dom.js │ │ │ │ │ │ ├── typescript.js │ │ │ │ │ │ ├── instanceof.js │ │ │ │ │ │ ├── babel.js │ │ │ │ │ │ └── registry.js │ │ │ │ ├── externs │ │ │ │ │ └── custom-elements.js │ │ │ │ └── gulpfile.js │ │ │ ├── data │ │ │ │ └── data.json │ │ │ ├── webcomponentsjs │ │ │ │ ├── entrypoints │ │ │ │ │ ├── custom-elements-es5-adapter-index.js │ │ │ │ │ ├── webcomponents-ce-index.js │ │ │ │ │ ├── webcomponents-sd-index.js │ │ │ │ │ ├── webcomponents-sd-ce-index.js │ │ │ │ │ ├── webcomponents-sd-ce-pf-index.js │ │ │ │ │ └── webcomponents-bundle-index.js │ │ │ │ └── custom-elements-es5-adapter.js │ │ │ └── css │ │ │ │ └── demo.css │ │ ├── app │ │ │ ├── home │ │ │ │ ├── home.component.css │ │ │ │ ├── home.component.html │ │ │ │ └── home.component.ts │ │ │ ├── sidebar │ │ │ │ ├── sidebar.component.ts │ │ │ │ └── sidebar.component.html │ │ │ ├── app.component.ts │ │ │ ├── basket │ │ │ │ ├── basket.component.ts │ │ │ │ ├── basket.component.css │ │ │ │ └── basket.component.html │ │ │ ├── app.component.html │ │ │ ├── app.routes.ts │ │ │ ├── navbar │ │ │ │ ├── navbar.component.ts │ │ │ │ └── navbar.component.html │ │ │ ├── shared │ │ │ │ ├── shared.module.ts │ │ │ │ └── pipes │ │ │ │ │ └── city.pipe.ts │ │ │ ├── app.component.spec.ts │ │ │ ├── app.component.css │ │ │ └── app.module.ts │ │ ├── test-setup.ts │ │ ├── environments │ │ │ ├── environment.prod.ts │ │ │ └── environment.ts │ │ ├── favicon.ico │ │ ├── typings.d.ts │ │ ├── main.ts │ │ ├── index.html │ │ ├── styles.css │ │ ├── test.ts │ │ └── polyfills.ts │ ├── tsconfig.json │ ├── tslint.json │ ├── tsconfig.app.json │ ├── tsconfig.spec.json │ ├── jest.config.js │ └── browserslist └── flight-app-e2e │ ├── tslint.json │ ├── src │ ├── support │ │ ├── app.po.ts │ │ ├── index.ts │ │ └── commands.ts │ ├── fixtures │ │ └── example.json │ ├── integration │ │ └── app.spec.ts │ └── plugins │ │ └── index.js │ ├── tsconfig.json │ ├── tsconfig.e2e.json │ └── cypress.json ├── .prettierrc ├── libs ├── booking │ ├── api │ │ ├── src │ │ │ ├── test-setup.ts │ │ │ ├── index.ts │ │ │ └── lib │ │ │ │ ├── booking-api.module.ts │ │ │ │ └── booking-api.module.spec.ts │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── tslint.json │ │ ├── tsconfig.spec.json │ │ ├── jest.config.js │ │ └── tsconfig.lib.json │ ├── feature │ │ ├── src │ │ │ ├── lib │ │ │ │ ├── flight-card │ │ │ │ │ ├── flight-card.component.css │ │ │ │ │ ├── flight-card.component.html │ │ │ │ │ └── flight-card.component.ts │ │ │ │ ├── flight-edit │ │ │ │ │ ├── flight-edit.component.css │ │ │ │ │ ├── flight-edit.component.ts │ │ │ │ │ └── flight-edit.component.html │ │ │ │ ├── flight-search │ │ │ │ │ ├── flight-search.component.css │ │ │ │ │ ├── flight-search.component.ts │ │ │ │ │ └── flight-search.component.html │ │ │ │ ├── passenger-search │ │ │ │ │ ├── passenger-search.component.css │ │ │ │ │ ├── passenger-search.component.html │ │ │ │ │ ├── passenger-search.component.ts │ │ │ │ │ └── passenger-search.component.spec.ts │ │ │ │ ├── flight-booking.component.html │ │ │ │ ├── flight-booking.component.ts │ │ │ │ ├── common │ │ │ │ │ └── city.pipe.ts │ │ │ │ ├── flight-booking.routes.ts │ │ │ │ └── booking-feature.module.ts │ │ │ ├── test-setup.ts │ │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── tslint.json │ │ ├── tsconfig.spec.json │ │ ├── jest.config.js │ │ └── tsconfig.lib.json │ └── domain │ │ ├── src │ │ ├── test-setup.ts │ │ ├── lib │ │ │ ├── domain │ │ │ │ ├── flight.ts │ │ │ │ ├── passenger.ts │ │ │ │ └── get-official-airport-name.ts │ │ │ ├── booking-domain.module.ts │ │ │ ├── application-services │ │ │ │ └── flight.facade.ts │ │ │ └── infrastructure │ │ │ │ └── flight.service.ts │ │ └── index.ts │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── tslint.json │ │ ├── tsconfig.spec.json │ │ ├── jest.config.js │ │ └── tsconfig.lib.json ├── boarding │ ├── domain │ │ ├── src │ │ │ ├── test-setup.ts │ │ │ ├── index.ts │ │ │ └── lib │ │ │ │ ├── boarding-domain.module.ts │ │ │ │ └── domain │ │ │ │ ├── boarding-list.ts │ │ │ │ └── update-boarding-status.ts │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── tslint.json │ │ ├── tsconfig.spec.json │ │ ├── jest.config.js │ │ └── tsconfig.lib.json │ └── feature │ │ ├── src │ │ ├── test-setup.ts │ │ ├── index.ts │ │ └── lib │ │ │ └── boarding-feature.module.ts │ │ ├── tsconfig.json │ │ ├── README.md │ │ ├── tslint.json │ │ ├── tsconfig.spec.json │ │ ├── jest.config.js │ │ └── tsconfig.lib.json └── shared │ ├── ui-common │ ├── src │ │ ├── test-setup.ts │ │ ├── index.ts │ │ └── lib │ │ │ ├── shared-ui-common.module.ts │ │ │ └── shared-ui-common.module.spec.ts │ ├── tsconfig.json │ ├── README.md │ ├── tslint.json │ ├── tsconfig.spec.json │ ├── jest.config.js │ └── tsconfig.lib.json │ └── util-auth │ ├── src │ ├── test-setup.ts │ ├── index.ts │ └── lib │ │ ├── shared-util-auth.module.ts │ │ └── shared-util-auth.module.spec.ts │ ├── tsconfig.json │ ├── README.md │ ├── tslint.json │ ├── tsconfig.spec.json │ ├── jest.config.js │ └── tsconfig.lib.json ├── .prettierignore ├── .vscode └── extensions.json ├── .editorconfig ├── jest.config.js ├── .gitignore ├── nx.json ├── tsconfig.json ├── package.json ├── tslint.json └── README.md /tools/schematics/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/.gitkeep: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/home/home.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /.prettierrc: -------------------------------------------------------------------------------- 1 | { 2 | "singleQuote": true 3 | } 4 | -------------------------------------------------------------------------------- /apps/flight-app/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/booking/api/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-card/flight-card.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-edit/flight-edit.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libs/boarding/domain/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/boarding/feature/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/booking/domain/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-search/flight-search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /libs/booking/feature/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/shared/ui-common/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /libs/shared/util-auth/src/test-setup.ts: -------------------------------------------------------------------------------- 1 | import 'jest-preset-angular'; 2 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | # Add files here to ignore them from prettier formatting 2 | -------------------------------------------------------------------------------- /libs/booking/api/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/booking-api.module'; 2 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/passenger-search/passenger-search.component.css: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/tslint.json: -------------------------------------------------------------------------------- 1 | { "extends": "../../tslint.json", "rules": [] } 2 | -------------------------------------------------------------------------------- /libs/boarding/domain/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/boarding-domain.module'; 2 | -------------------------------------------------------------------------------- /libs/booking/feature/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/booking-feature.module'; 2 | -------------------------------------------------------------------------------- /libs/boarding/feature/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/boarding-feature.module'; 2 | -------------------------------------------------------------------------------- /libs/shared/ui-common/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/shared-ui-common.module'; 2 | -------------------------------------------------------------------------------- /libs/shared/util-auth/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/shared-util-auth.module'; 2 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/src/support/app.po.ts: -------------------------------------------------------------------------------- 1 | export const getGreeting = () => cy.get('h1'); 2 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/stats-1.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 17, 3 | "b": 23, 4 | "c": 64 5 | } -------------------------------------------------------------------------------- /apps/flight-app/src/assets/stats-2.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 66, 3 | "b": 55, 4 | "c": 22 5 | } -------------------------------------------------------------------------------- /apps/flight-app/src/assets/stats-3.json: -------------------------------------------------------------------------------- 1 | { 2 | "a": 35, 3 | "b": 24, 4 | "c": 74 5 | } -------------------------------------------------------------------------------- /apps/flight-app/src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /apps/flight-app/src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/favicon.ico -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/passenger-search/passenger-search.component.html: -------------------------------------------------------------------------------- 1 |

2 | passenger-search works! 3 |

4 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/src/fixtures/example.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Using fixtures to represent data", 3 | "email": "hello@cypress.io" 4 | } 5 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/angular.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/angular.png -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/favicon.png -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/new_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/new_logo.png -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_tabs.scss: -------------------------------------------------------------------------------- 1 | @mixin pill-style($color) { 2 | border: 1px solid $color; 3 | color: $color; 4 | } 5 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/fonts/themify.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/fonts/themify.eot -------------------------------------------------------------------------------- /apps/flight-app/src/assets/fonts/themify.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/fonts/themify.ttf -------------------------------------------------------------------------------- /apps/flight-app/src/assets/fonts/themify.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/fonts/themify.woff -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/apple-icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/apple-icon.png -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/background.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/background.jpg -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/tim_80x80.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/tim_80x80.png -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/angular2-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/angular2-logo.png -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/faces/face-0.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/faces/face-0.jpg -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/faces/face-1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/faces/face-1.jpg -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/faces/face-2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/faces/face-2.jpg -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/faces/face-3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/faces/face-3.jpg -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sea-1993791_1920.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/sea-1993791_1920.jpg -------------------------------------------------------------------------------- /apps/flight-app/src/typings.d.ts: -------------------------------------------------------------------------------- 1 | /* SystemJS module definition */ 2 | declare var module: NodeModule; 3 | interface NodeModule { 4 | id: string; 5 | } 6 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/img/angular2-logo-white.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/manfredsteyer/angular-ddd/HEAD/apps/flight-app/src/assets/img/angular2-logo-white.png -------------------------------------------------------------------------------- /apps/flight-app/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["cypress", "node"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/boarding/domain/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/booking/api/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/booking/domain/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/booking/feature/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/boarding/feature/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/shared/ui-common/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/shared/util-auth/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tsconfig.json", 3 | "compilerOptions": { 4 | "types": ["node", "jest"] 5 | }, 6 | "include": ["**/*.ts"] 7 | } 8 | -------------------------------------------------------------------------------- /libs/booking/api/README.md: -------------------------------------------------------------------------------- 1 | # booking-api 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test booking-api` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/shared/ui-common/README.md: -------------------------------------------------------------------------------- 1 | # shared-ui-common 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test shared-ui-common` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/shared/util-auth/README.md: -------------------------------------------------------------------------------- 1 | # shared-util-auth 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test shared-util-auth` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /.vscode/extensions.json: -------------------------------------------------------------------------------- 1 | { 2 | "recommendations": [ 3 | "nrwl.angular-console", 4 | "angular.ng-template", 5 | "ms-vscode.vscode-typescript-tslint-plugin", 6 | "esbenp.prettier-vscode" 7 | ] 8 | } 9 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/tsconfig.e2e.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "sourceMap": false, 5 | "outDir": "../../dist/out-tsc" 6 | }, 7 | "include": ["src/**/*.ts"] 8 | } 9 | -------------------------------------------------------------------------------- /libs/booking/domain/README.md: -------------------------------------------------------------------------------- 1 | # booking-domain-flights 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test booking-domain-flights` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/booking/feature/README.md: -------------------------------------------------------------------------------- 1 | # booking-feature-flights 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test booking-feature-flights` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/boarding/domain/README.md: -------------------------------------------------------------------------------- 1 | # boarding-domain-boarding 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test boarding-domain-boarding` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /libs/boarding/feature/README.md: -------------------------------------------------------------------------------- 1 | # boarding-feature-boarding 2 | 3 | This library was generated with [Nx](https://nx.dev). 4 | 5 | ## Running unit tests 6 | 7 | Run `nx test boarding-feature-boarding` to execute the unit tests. 8 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/CustomElementState.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @enum {number} 3 | */ 4 | const CustomElementState = { 5 | custom: 1, 6 | failed: 2, 7 | }; 8 | 9 | export default CustomElementState; 10 | -------------------------------------------------------------------------------- /libs/booking/domain/src/lib/domain/flight.ts: -------------------------------------------------------------------------------- 1 | 2 | export interface Flight { 3 | readonly id: number; 4 | readonly from: string; 5 | readonly to: string; 6 | readonly date: string; 7 | readonly delayed: boolean; 8 | } 9 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_cards.scss: -------------------------------------------------------------------------------- 1 | @mixin filter($color) { 2 | @if $color == #FFFFFF { 3 | background-color: rgba($color, .91); 4 | } @else { 5 | background-color: rgba($color, .69); 6 | } 7 | } 8 | 9 | -------------------------------------------------------------------------------- /libs/booking/api/src/lib/booking-api.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule] 6 | }) 7 | export class BookingApiModule {} 8 | -------------------------------------------------------------------------------- /libs/boarding/domain/src/lib/boarding-domain.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule] 6 | }) 7 | export class BoardingDomainModule {} 8 | -------------------------------------------------------------------------------- /libs/shared/ui-common/src/lib/shared-ui-common.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule] 6 | }) 7 | export class SharedUiCommonModule {} 8 | -------------------------------------------------------------------------------- /libs/shared/util-auth/src/lib/shared-util-auth.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule] 6 | }) 7 | export class SharedUtilAuthModule {} 8 | -------------------------------------------------------------------------------- /apps/flight-app/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/boarding/feature/src/lib/boarding-feature.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | 4 | @NgModule({ 5 | imports: [CommonModule] 6 | }) 7 | export class BoardingFeatureModule {} 8 | -------------------------------------------------------------------------------- /libs/boarding/domain/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/booking/api/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/booking/domain/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/booking/feature/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/sidebar/sidebar.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | 3 | 4 | @Component({ 5 | selector: 'sidebar-cmp', 6 | templateUrl: 'sidebar.component.html', 7 | }) 8 | 9 | export class SidebarComponent { 10 | } 11 | -------------------------------------------------------------------------------- /libs/boarding/feature/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/shared/ui-common/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /libs/shared/util-auth/tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../../../tslint.json", 3 | "rules": { 4 | "directive-selector": [true, "attribute", "nxFlights", "camelCase"], 5 | "component-selector": [true, "element", "nx-flights", "kebab-case"] 6 | } 7 | } 8 | -------------------------------------------------------------------------------- /apps/flight-app/tsconfig.app.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "types": [] 6 | }, 7 | "include": ["**/*.ts"], 8 | "exclude": ["src/test-setup.ts", "**/*.spec.ts"] 9 | } 10 | -------------------------------------------------------------------------------- /libs/booking/domain/src/index.ts: -------------------------------------------------------------------------------- 1 | export * from './lib/booking-domain.module'; 2 | export {Flight} from './lib/domain/flight'; 3 | export {FlightService} from './lib/infrastructure/flight.service'; 4 | export { FlightFacade } from './lib/application-services/flight.facade'; -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_navbars.scss: -------------------------------------------------------------------------------- 1 | @mixin navbar-color($color) { 2 | background-color: $color; 3 | } 4 | 5 | @mixin center-item() { 6 | left: 0; 7 | right: 0; 8 | margin-right: auto; 9 | margin-left: auto; 10 | position: absolute; 11 | } 12 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-booking.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 | Flight Search | 4 | Passenger Search 5 |
6 |
7 | 8 | 9 | -------------------------------------------------------------------------------- /tools/tsconfig.tools.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "../tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../dist/out-tsc/tools", 5 | "rootDir": ".", 6 | "module": "commonjs", 7 | "target": "es5", 8 | "types": ["node"] 9 | }, 10 | "include": ["**/*.ts"] 11 | } 12 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/app.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'flight-app', 5 | templateUrl: './app.component.html', 6 | styleUrls: ['./app.component.css'] 7 | }) 8 | export class AppComponent { 9 | constructor() { 10 | } 11 | } 12 | 13 | -------------------------------------------------------------------------------- /apps/flight-app/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/src/integration/app.spec.ts: -------------------------------------------------------------------------------- 1 | import { getGreeting } from '../support/app.po'; 2 | 3 | describe('flight-app', () => { 4 | beforeEach(() => cy.visit('/')); 5 | 6 | it('should display welcome message', () => { 7 | getGreeting().contains('Welcome to flight-app!'); 8 | }); 9 | }); 10 | -------------------------------------------------------------------------------- /libs/booking/api/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | # Editor configuration, see http://editorconfig.org 2 | root = true 3 | 4 | [*] 5 | charset = utf-8 6 | indent_style = space 7 | indent_size = 2 8 | insert_final_newline = true 9 | trim_trailing_whitespace = true 10 | 11 | [*.md] 12 | max_line_length = off 13 | trim_trailing_whitespace = false 14 | -------------------------------------------------------------------------------- /libs/boarding/domain/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/boarding/feature/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/booking/domain/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/booking/feature/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/shared/ui-common/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /libs/shared/util-auth/tsconfig.spec.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "module": "commonjs", 6 | "types": ["jest", "node"] 7 | }, 8 | "files": ["src/test-setup.ts"], 9 | "include": ["**/*.spec.ts", "**/*.d.ts"] 10 | } 11 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/basket/basket.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'basket', 5 | templateUrl: './basket.component.html', 6 | styleUrls: ['./basket.component.css'] 7 | }) 8 | export class BasketComponent { 9 | 10 | constructor() { 11 | } 12 | 13 | 14 | } 15 | -------------------------------------------------------------------------------- /jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], 3 | transform: { 4 | '^.+\\.(ts|js|html)$': 'ts-jest' 5 | }, 6 | resolver: '@nrwl/jest/plugins/resolver', 7 | moduleFileExtensions: ['ts', 'js', 'html'], 8 | coverageReporters: ['html'], 9 | passWithNoTests: true 10 | }; 11 | -------------------------------------------------------------------------------- /apps/flight-app/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'flight-app', 3 | preset: '../../jest.config.js', 4 | coverageDirectory: '../../coverage/apps/flight-app', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/booking/api/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'booking-api', 3 | preset: '../../../jest.config.js', 4 | coverageDirectory: '../../../coverage/libs/booking/api', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_icons.scss: -------------------------------------------------------------------------------- 1 | @mixin icon-background($icon-url) { 2 | background-image: url($icon-url); 3 | 4 | } 5 | 6 | @mixin icon-shape($size, $padding, $border-radius) { 7 | height: $size; 8 | width: $size; 9 | padding: $padding; 10 | border-radius: $border-radius; 11 | display: inline-table; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-booking.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'flight-booking', 5 | templateUrl: './flight-booking.component.html' 6 | }) 7 | export class FlightBookingComponent implements OnInit { 8 | constructor() { 9 | } 10 | 11 | ngOnInit() { 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /libs/shared/ui-common/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'shared-ui-common', 3 | preset: '../../../jest.config.js', 4 | coverageDirectory: '../../../coverage/libs/shared/ui-common', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/shared/util-auth/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'shared-util-auth', 3 | preset: '../../../jest.config.js', 4 | coverageDirectory: '../../../coverage/libs/shared/util-auth', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/booking/domain/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'booking-domain-flights', 3 | preset: '../../../jest.config.js', 4 | coverageDirectory: '../../../coverage/libs/booking/domain-flights', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/booking/feature/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'booking-feature-flights', 3 | preset: '../../../jest.config.js', 4 | coverageDirectory: '../../../coverage/libs/booking/feature-flights', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/boarding/domain/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'boarding-domain-boarding', 3 | preset: '../../../jest.config.js', 4 | coverageDirectory: '../../../coverage/libs/boarding/domain-boarding', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /libs/boarding/feature/jest.config.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | name: 'boarding-feature-boarding', 3 | preset: '../../../jest.config.js', 4 | coverageDirectory: '../../../coverage/libs/boarding/feature-boarding', 5 | snapshotSerializers: [ 6 | 'jest-preset-angular/AngularSnapshotSerializer.js', 7 | 'jest-preset-angular/HTMLCommentSerializer.js' 8 | ] 9 | }; 10 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_mixins.scss: -------------------------------------------------------------------------------- 1 | //Utilities 2 | @import "mixins/transparency"; 3 | @import "mixins/vendor-prefixes"; 4 | //Components 5 | @import "mixins/buttons"; 6 | @import "mixins/inputs"; 7 | @import "mixins/labels"; 8 | @import "mixins/tabs"; 9 | @import "mixins/navbars"; 10 | @import "mixins/icons"; 11 | @import "mixins/cards"; 12 | @import "mixins/chartist"; 13 | @import "mixins/sidebar"; 14 | -------------------------------------------------------------------------------- /apps/flight-app/src/main.ts: -------------------------------------------------------------------------------- 1 | import {enableProdMode} from '@angular/core'; 2 | import {platformBrowserDynamic} from '@angular/platform-browser-dynamic'; 3 | 4 | import {AppModule} from './app/app.module'; 5 | import {environment} from './environments/environment'; 6 | 7 | if (environment.production) { 8 | enableProdMode(); 9 | } 10 | 11 | platformBrowserDynamic().bootstrapModule(AppModule); 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/cypress.json: -------------------------------------------------------------------------------- 1 | { 2 | "fileServerFolder": ".", 3 | "fixturesFolder": "./src/fixtures", 4 | "integrationFolder": "./src/integration", 5 | "pluginsFile": "./src/plugins/index", 6 | "supportFile": false, 7 | "video": true, 8 | "videosFolder": "../../dist/cypress/apps/flight-app-e2e/videos", 9 | "screenshotsFolder": "../../dist/cypress/apps/flight-app-e2e/screenshots", 10 | "chromeWebSecurity": false 11 | } 12 | -------------------------------------------------------------------------------- /apps/flight-app/src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // The file contents for the current environment will overwrite these during build. 2 | // The build system defaults to the dev environment which uses `environment.ts`, but if you do 3 | // `ng build --env=prod` then `environment.prod.ts` will be used instead. 4 | // The list of which env maps to which file can be found in `.angular-cli.json`. 5 | 6 | export const environment = { 7 | production: false 8 | }; 9 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/passenger-search/passenger-search.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'nx-flights-passenger-search', 5 | templateUrl: './passenger-search.component.html', 6 | styleUrls: ['./passenger-search.component.css'] 7 | }) 8 | export class PassengerSearchComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit() { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/AlreadyConstructedMarker.js: -------------------------------------------------------------------------------- 1 | /** 2 | * This class exists only to work around Closure's lack of a way to describe 3 | * singletons. It represents the 'already constructed marker' used in custom 4 | * element construction stacks. 5 | * 6 | * https://html.spec.whatwg.org/#concept-already-constructed-marker 7 | */ 8 | class AlreadyConstructedMarker {} 9 | 10 | export default new AlreadyConstructedMarker(); 11 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_inputs.scss: -------------------------------------------------------------------------------- 1 | @mixin input-size($padding-vertical, $padding-horizontal, $height) { 2 | padding: $padding-vertical $padding-horizontal; 3 | height: $height; 4 | } 5 | 6 | @mixin placeholder($color, $opacity) { 7 | color: $color; 8 | @include opacity(1); 9 | } 10 | 11 | @mixin light-form() { 12 | border-radius: 0; 13 | border: 0; 14 | padding: 0; 15 | background-color: transparent; 16 | 17 | } 18 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/app.component.html: -------------------------------------------------------------------------------- 1 |
2 | 5 |
6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 |
17 |
18 | 19 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/basket/basket.component.css: -------------------------------------------------------------------------------- 1 | .gray-bg { 2 | opacity: 0.4; 3 | background-color: black; 4 | left: 0px; 5 | top: 0px; 6 | width: 100%; 7 | height: 100%; 8 | position: fixed; 9 | } 10 | 11 | .flight-history { 12 | left: 0px; 13 | top: 0px; 14 | width: 100%; 15 | height: 100%; 16 | position: fixed; 17 | } 18 | 19 | .flight-history-inside { 20 | background-color: white; 21 | margin: 100px auto; 22 | width: 400px; 23 | } 24 | -------------------------------------------------------------------------------- /libs/booking/api/src/lib/booking-api.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { BookingApiModule } from './booking-api.module'; 3 | 4 | describe('BookingApiModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [BookingApiModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(BookingApiModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /apps/flight-app/browserslist: -------------------------------------------------------------------------------- 1 | # This file is used by the build system to adjust CSS and JS output to support the specified browsers below. 2 | # For additional information regarding the format and rule options, please see: 3 | # https://github.com/browserslist/browserslist#queries 4 | 5 | # You can see what browsers were selected by your queries by running: 6 | # npx browserslist 7 | 8 | > 0.5% 9 | last 2 versions 10 | Firefox ESR 11 | not dead 12 | not IE 9-11 # For IE 9-11 support, remove 'not'. -------------------------------------------------------------------------------- /libs/boarding/domain/src/lib/domain/boarding-list.ts: -------------------------------------------------------------------------------- 1 | 2 | export type BoardingStatus = 'NOT_CHECKEDIN' | 'CHECKEDIN' | 'BOARDED' | 'UNBOARDED'; 3 | 4 | export interface BoardingList { 5 | readonly id: number; 6 | readonly flightId: number; 7 | readonly passengers: BoardingPassenger[]; 8 | } 9 | 10 | export interface BoardingPassenger { 11 | readonly passengerId: number; 12 | readonly name: string; 13 | readonly firstName: string; 14 | readonly status: BoardingStatus; 15 | } -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_transparency.scss: -------------------------------------------------------------------------------- 1 | // Opacity 2 | 3 | @mixin opacity($opacity) { 4 | opacity: $opacity; 5 | // IE8 filter 6 | $opacity-ie: ($opacity * 100); 7 | filter: #{alpha(opacity=$opacity-ie)}; 8 | } 9 | 10 | @mixin black-filter($opacity) { 11 | top: 0; 12 | left: 0; 13 | height: 100%; 14 | width: 100%; 15 | position: absolute; 16 | background-color: rgba(17, 17, 17, $opacity); 17 | display: block; 18 | content: ""; 19 | z-index: 1; 20 | } 21 | -------------------------------------------------------------------------------- /libs/shared/ui-common/src/lib/shared-ui-common.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { SharedUiCommonModule } from './shared-ui-common.module'; 3 | 4 | describe('SharedUiCommonModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [SharedUiCommonModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(SharedUiCommonModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /libs/shared/util-auth/src/lib/shared-util-auth.module.spec.ts: -------------------------------------------------------------------------------- 1 | import { async, TestBed } from '@angular/core/testing'; 2 | import { SharedUtilAuthModule } from './shared-util-auth.module'; 3 | 4 | describe('SharedUtilAuthModule', () => { 5 | beforeEach(async(() => { 6 | TestBed.configureTestingModule({ 7 | imports: [SharedUtilAuthModule] 8 | }).compileComponents(); 9 | })); 10 | 11 | it('should create', () => { 12 | expect(SharedUtilAuthModule).toBeDefined(); 13 | }); 14 | }); 15 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Patch/DocumentFragment.js: -------------------------------------------------------------------------------- 1 | import CustomElementInternals from '../CustomElementInternals.js'; 2 | import Native from './Native.js'; 3 | import PatchParentNode from './Interface/ParentNode.js'; 4 | 5 | /** 6 | * @param {!CustomElementInternals} internals 7 | */ 8 | export default function(internals) { 9 | PatchParentNode(internals, DocumentFragment.prototype, { 10 | prepend: Native.DocumentFragment_prepend, 11 | append: Native.DocumentFragment_append, 12 | }); 13 | }; 14 | -------------------------------------------------------------------------------- /libs/booking/domain/src/lib/booking-domain.module.ts: -------------------------------------------------------------------------------- 1 | import { NgModule, ModuleWithProviders } from '@angular/core'; 2 | import { CommonModule } from '@angular/common'; 3 | import { FlightService } from './infrastructure/flight.service'; 4 | 5 | @NgModule({ 6 | imports: [ 7 | CommonModule 8 | ] 9 | }) 10 | export class BookingDomainModule { 11 | static forRoot(): ModuleWithProviders { 12 | return { 13 | ngModule: BookingDomainModule, 14 | providers: [ 15 | FlightService 16 | ] 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /apps/flight-app/src/assets/data/data.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": 3, 4 | "from": "Hamburg", 5 | "to": "Graz", 6 | "date": "2018-01-31T08:20:27.6859644+00:00", 7 | "delayed": false 8 | }, 9 | { 10 | "id": 4, 11 | "from": "Hamburg", 12 | "to": "Graz", 13 | "date": "2018-01-31T10:20:27.6859644+00:00", 14 | "delayed": false 15 | }, 16 | { 17 | "id": 5, 18 | "from": "Hamburg", 19 | "to": "Graz", 20 | "date": "2018-01-31T13:20:27.6859644+00:00", 21 | "delayed": false 22 | } 23 | ] 24 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/resources/plugin.js: -------------------------------------------------------------------------------- 1 | // Ensure plugin load, run the speicified function, then finish the test. 2 | function startAfterLoadAndFinish(f, node) { 3 | if (window.testRunner) 4 | testRunner.waitUntilDone(); 5 | window.addEventListener('load', function() { 6 | if (window.internals) 7 | internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks(node); 8 | if (f) 9 | f(); 10 | testRunner.notifyDone(); 11 | }, false); 12 | } 13 | -------------------------------------------------------------------------------- /libs/booking/domain/src/lib/domain/passenger.ts: -------------------------------------------------------------------------------- 1 | // import { Flight } from './flight'; 2 | 3 | export interface Passenger { 4 | readonly id: number; 5 | readonly firstName: string; 6 | readonly name: string; 7 | readonly bonusMiles: number; 8 | readonly passengerStatus: string; 9 | } 10 | 11 | export interface Booking { 12 | readonly passengerId: number; 13 | readonly flightId: number; 14 | } 15 | 16 | // Alternative 17 | // export interface Booking { 18 | // readonly passenger: Passenger; 19 | // readonly flight: Flight; 20 | // } -------------------------------------------------------------------------------- /apps/flight-app/src/app/basket/basket.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 | 5 |
6 | 7 |

Your Basket [x]

8 | 9 | 19 |
20 |
21 | -------------------------------------------------------------------------------- /libs/boarding/domain/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/booking/api/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/booking/domain/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/booking/feature/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/boarding/feature/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/shared/ui-common/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/shared/util-auth/tsconfig.lib.json: -------------------------------------------------------------------------------- 1 | { 2 | "extends": "./tsconfig.json", 3 | "compilerOptions": { 4 | "outDir": "../../../dist/out-tsc", 5 | "target": "es2015", 6 | "declaration": true, 7 | "inlineSources": true, 8 | "types": [], 9 | "lib": ["dom", "es2018"] 10 | }, 11 | "angularCompilerOptions": { 12 | "annotateForClosureCompiler": true, 13 | "skipTemplateCodegen": true, 14 | "strictMetadataEmit": true, 15 | "fullTemplateTypeCheck": true, 16 | "strictInjectionParameters": true, 17 | "enableResourceInlining": true 18 | }, 19 | "exclude": ["src/test.ts", "**/*.spec.ts"] 20 | } 21 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-edit/flight-edit.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from '@angular/core'; 2 | import {ActivatedRoute} from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-flight-edit', 6 | templateUrl: './flight-edit.component.html' 7 | }) 8 | export class FlightEditComponent implements OnInit { 9 | id: string; 10 | showDetails: string; 11 | showWarning = false; 12 | 13 | constructor(private route: ActivatedRoute) { 14 | } 15 | 16 | ngOnInit() { 17 | this.route.params.subscribe(p => { 18 | this.id = p['id']; 19 | this.showDetails = p['showDetails']; 20 | }); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/app.routes.ts: -------------------------------------------------------------------------------- 1 | import {ExtraOptions, Routes} from '@angular/router'; 2 | import {BasketComponent} from './basket/basket.component'; 3 | import {HomeComponent} from './home/home.component'; 4 | 5 | export const APP_ROUTES: Routes = [ 6 | { 7 | path: '', 8 | redirectTo: 'home', 9 | pathMatch: 'full' 10 | }, 11 | { 12 | path: 'home', 13 | component: HomeComponent 14 | }, 15 | { 16 | path: 'basket', 17 | component: BasketComponent, 18 | outlet: 'aux' 19 | }, 20 | { 21 | path: '**', 22 | redirectTo: 'home' 23 | } 24 | ] 25 | 26 | export const APP_EXTRA_OPTIONS: ExtraOptions = { 27 | 28 | } 29 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_labels.scss: -------------------------------------------------------------------------------- 1 | @mixin label-style() { 2 | padding: $padding-label-vertical $padding-label-horizontal; 3 | border: 1px solid $default-color; 4 | border-radius: $border-radius-small; 5 | color: $default-color; 6 | font-weight: $font-weight-semi; 7 | font-size: $font-size-small; 8 | text-transform: uppercase; 9 | display: inline-block; 10 | vertical-align: middle; 11 | } 12 | 13 | @mixin label-color($color) { 14 | border-color: $color; 15 | color: $color; 16 | } 17 | 18 | @mixin label-color-fill($color) { 19 | border-color: $color; 20 | color: $white-color; 21 | background-color: $color; 22 | } 23 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/navbar/navbar.component.ts: -------------------------------------------------------------------------------- 1 | import {Component} from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'navbar-cmp', 5 | templateUrl: 'navbar.component.html' 6 | }) 7 | export class NavbarComponent { 8 | 9 | private sidebarVisible: boolean = false; 10 | 11 | constructor() { 12 | } 13 | 14 | sidebarToggle() { 15 | var body = document.getElementsByTagName('body')[0]; 16 | 17 | if (this.sidebarVisible == false) { 18 | body.classList.add('nav-open'); 19 | this.sidebarVisible = true; 20 | } else { 21 | this.sidebarVisible = false; 22 | body.classList.remove('nav-open'); 23 | } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-edit/flight-edit.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Flight Edit

4 |
5 | 6 | 7 |
8 | 9 |

10 | You haven't saved your modifications. Do you really want to leave me? 11 |

12 | 13 | 14 |
15 | 16 |
17 |

Id: {{id}}

18 |

ShowDetails: {{showDetails}}

19 |
20 |
21 | 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # See http://help.github.com/ignore-files/ for more about ignoring files. 2 | 3 | # compiled output 4 | /dist 5 | /tmp 6 | /out-tsc 7 | 8 | # dependencies 9 | /node_modules 10 | 11 | # IDEs and editors 12 | /.idea 13 | .project 14 | .classpath 15 | .c9/ 16 | *.launch 17 | .settings/ 18 | *.sublime-workspace 19 | 20 | # IDE - VSCode 21 | .vscode/* 22 | !.vscode/settings.json 23 | !.vscode/tasks.json 24 | !.vscode/launch.json 25 | !.vscode/extensions.json 26 | 27 | # misc 28 | /.sass-cache 29 | /connect.lock 30 | /coverage 31 | /libpeerconnection.log 32 | npm-debug.log 33 | yarn-error.log 34 | testem.log 35 | /typings 36 | 37 | # System Files 38 | .DS_Store 39 | Thumbs.db 40 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/src/support/index.ts: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example support/index.js is processed and 3 | // loaded automatically before your test files. 4 | // 5 | // This is a great place to put global configuration and 6 | // behavior that modifies Cypress. 7 | // 8 | // You can change the location of this file or turn off 9 | // automatically serving support files with the 10 | // 'supportFile' configuration option. 11 | // 12 | // You can read more here: 13 | // https://on.cypress.io/configuration 14 | // *********************************************************** 15 | 16 | // Import commands.js using ES2015 syntax: 17 | import './commands'; 18 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/resources/gc.js: -------------------------------------------------------------------------------- 1 | // If there is no window.gc() already defined, define one using the best 2 | // method we can find. 3 | // The slow fallback should not hit in the actual test environment. 4 | if (!window.gc) 5 | { 6 | window.gc = function() 7 | { 8 | if (window.GCController) 9 | return GCController.collectAll(); 10 | function gcRec(n) { 11 | if (n < 1) 12 | return {}; 13 | var temp = {i: "ab" + i + (i / 100000)}; 14 | temp += "foo"; 15 | gcRec(n-1); 16 | } 17 | for (var i = 0; i < 10000; i++) 18 | gcRec(10); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /libs/boarding/domain/src/lib/domain/update-boarding-status.ts: -------------------------------------------------------------------------------- 1 | import { BoardingList, BoardingStatus } from './boarding-list'; 2 | 3 | export function updateBoardingStatus( 4 | boardingList: BoardingList, passengerId: number, status: BoardingStatus): Promise { 5 | 6 | // TODO: Send to server 7 | 8 | const passenger = boardingList.passengers.find(p => p.passengerId === passengerId); 9 | const newPassenger = {...passenger, status}; 10 | const passengers = boardingList.passengers.map(p => p.passengerId === passengerId ? newPassenger : p); 11 | const newBoardingList = {...boardingList, passengers}; 12 | 13 | return Promise.resolve(newBoardingList); 14 | } -------------------------------------------------------------------------------- /apps/flight-app/src/app/shared/shared.module.ts: -------------------------------------------------------------------------------- 1 | import {CommonModule} from '@angular/common'; 2 | import {NgModule} from '@angular/core'; 3 | import {ModuleWithProviders} from '@angular/core'; 4 | import {CityPipe} from './pipes/city.pipe'; 5 | 6 | @NgModule({ 7 | imports: [ 8 | CommonModule 9 | ], 10 | declarations: [ 11 | CityPipe, 12 | ], 13 | exports: [ 14 | CityPipe 15 | ] 16 | }) 17 | export class SharedModule { 18 | static forRoot(): ModuleWithProviders { 19 | return { 20 | ngModule: SharedModule, 21 | providers: [] 22 | } 23 | } 24 | 25 | static forChild(): ModuleWithProviders { 26 | return { 27 | ngModule: SharedModule, 28 | providers: [] 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/shared/pipes/city.pipe.ts: -------------------------------------------------------------------------------- 1 | import {Pipe, PipeTransform} from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'city', 5 | pure: true 6 | }) 7 | export class CityPipe implements PipeTransform { 8 | 9 | transform(value: string, fmt: string): string { 10 | 11 | let short, long; 12 | 13 | switch (value) { 14 | case 'Hamburg': 15 | short = 'HAM'; 16 | long = 'Airport Hamburg Fulsbüttel Helmut Schmidt'; 17 | break; 18 | case 'Graz': 19 | short = 'GRZ'; 20 | long = 'Flughafen Graz Thalerhof'; 21 | break; 22 | default: 23 | short = long = value; //'ROM'; 24 | } 25 | 26 | if (fmt == 'short') return short; 27 | return long; 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/common/city.pipe.ts: -------------------------------------------------------------------------------- 1 | import {Pipe, PipeTransform} from '@angular/core'; 2 | 3 | @Pipe({ 4 | name: 'city', 5 | pure: true 6 | }) 7 | export class CityPipe implements PipeTransform { 8 | 9 | transform(value: string, fmt: string): string { 10 | 11 | let short, long; 12 | 13 | switch (value) { 14 | case 'Hamburg': 15 | short = 'HAM'; 16 | long = 'Airport Hamburg Fulsbüttel Helmut Schmidt'; 17 | break; 18 | case 'Graz': 19 | short = 'GRZ'; 20 | long = 'Flughafen Graz Thalerhof'; 21 | break; 22 | default: 23 | short = long = value; //'ROM'; 24 | } 25 | 26 | if (fmt == 'short') return short; 27 | return long; 28 | 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /apps/flight-app/src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Starter 6 | 7 | 8 | 11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 |
24 |
25 |
26 | 27 | 28 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/webcomponentsjs/entrypoints/custom-elements-es5-adapter-index.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license 3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 'use strict'; 11 | 12 | /* 13 | * Polyfills loaded: Custom Elements ES5 Shim 14 | */ 15 | 16 | import '../node_modules/@webcomponents/custom-elements/src/native-shim.js'; 17 | -------------------------------------------------------------------------------- /libs/booking/domain/src/lib/domain/get-official-airport-name.ts: -------------------------------------------------------------------------------- 1 | export type CityFormat = 'short' | 'long'; 2 | 3 | export function getOfficialAirportName(city: string, format: CityFormat) { 4 | 5 | let short, long; 6 | 7 | switch (city) { 8 | case 'Frankfurt': 9 | short = 'FRA'; 10 | long = 'Airport Frankfurt'; 11 | break; 12 | case 'Hamburg': 13 | short = 'HAM'; 14 | long = 'Airport Hamburg Helmut Schmidt'; 15 | break; 16 | case 'Graz': 17 | short = 'GRZ'; 18 | long = 'Flughafen Graz Thalerhof'; 19 | break; 20 | default: 21 | short = long = city; 22 | } 23 | 24 | if (format === 'long') return long; 25 | return short; 26 | 27 | } 28 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/webcomponentsjs/entrypoints/webcomponents-ce-index.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license 3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 'use strict'; 11 | 12 | /* 13 | * Polyfills loaded: Custom Elements 14 | * Used in: Safari 10 15 | */ 16 | 17 | import '../node_modules/@webcomponents/custom-elements/src/custom-elements.js'; -------------------------------------------------------------------------------- /nx.json: -------------------------------------------------------------------------------- 1 | { 2 | "npmScope": "nx-flights", 3 | "implicitDependencies": { 4 | "angular.json": "*", 5 | "package.json": "*", 6 | "tsconfig.json": "*", 7 | "tslint.json": "*", 8 | "nx.json": "*" 9 | }, 10 | "projects": { 11 | "flight-app-e2e": { 12 | "tags": [] 13 | }, 14 | "flight-app": { 15 | "tags": [] 16 | }, 17 | "booking-feature": { 18 | "tags": [] 19 | }, 20 | "booking-domain": { 21 | "tags": [] 22 | }, 23 | "boarding-feature": { 24 | "tags": [] 25 | }, 26 | "boarding-domain": { 27 | "tags": [] 28 | }, 29 | "shared-util-auth": { 30 | "tags": [] 31 | }, 32 | "shared-ui-common": { 33 | "tags": [] 34 | }, 35 | "booking-api": { 36 | "tags": [] 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/home/home.component.html: -------------------------------------------------------------------------------- 1 |
2 |
3 |

Welcome {{userName}}

4 |
5 |
6 | 7 |
8 | You have been redirected to this page because you don't have the necessary 9 | rights for the reqeusted action. Login with a respective user account! 10 |
11 | 12 | 13 | 14 | 15 |
16 | 17 |
18 | 19 |
20 |   21 |
22 | 23 |
24 | 26 |
27 | 28 | 29 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_sidebar.scss: -------------------------------------------------------------------------------- 1 | @mixin sidebar-background-color($background-color, $font-color) { 2 | &:after, 3 | &:before { 4 | background-color: $background-color; 5 | } 6 | 7 | .logo { 8 | border-bottom: 1px solid rgba($font-color, .3); 9 | 10 | p { 11 | color: $font-color; 12 | } 13 | 14 | .simple-text { 15 | color: $font-color; 16 | } 17 | } 18 | 19 | .nav { 20 | li:not(.active) { 21 | > a { 22 | color: $font-color; 23 | } 24 | } 25 | .divider { 26 | background-color: rgba($font-color, .2); 27 | } 28 | 29 | } 30 | 31 | } 32 | 33 | @mixin sidebar-active-color($font-color) { 34 | .nav { 35 | li { 36 | &.active > a { 37 | color: $font-color; 38 | opacity: 1; 39 | } 40 | } 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/webcomponentsjs/entrypoints/webcomponents-sd-index.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license 3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 'use strict'; 11 | 12 | /* 13 | * Polyfills loaded: Shady DOM/Shady CSS 14 | * Used in: Firefox when CE is implemented 15 | */ 16 | 17 | import '../node_modules/@webcomponents/shadydom/src/shadydom.js'; 18 | import '../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js'; -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-booking.routes.ts: -------------------------------------------------------------------------------- 1 | import {Routes} from '@angular/router'; 2 | import {FlightBookingComponent} from './flight-booking.component'; 3 | import {FlightEditComponent} from './flight-edit/flight-edit.component'; 4 | import {FlightSearchComponent} from './flight-search/flight-search.component'; 5 | import {PassengerSearchComponent} from './passenger-search/passenger-search.component'; 6 | 7 | export const FLIGHT_BOOKING_ROUTES: Routes = [ 8 | { 9 | path: 'flight-booking', 10 | component: FlightBookingComponent, 11 | children: [ 12 | { 13 | path: 'flight-search', 14 | component: FlightSearchComponent 15 | }, 16 | { 17 | path: 'passenger-search', 18 | component: PassengerSearchComponent 19 | }, 20 | { 21 | path: 'flight-edit/:id', 22 | component: FlightEditComponent 23 | } 24 | ] 25 | } 26 | 27 | ] 28 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/src/plugins/index.js: -------------------------------------------------------------------------------- 1 | // *********************************************************** 2 | // This example plugins/index.js can be used to load plugins 3 | // 4 | // You can change the location of this file or turn off loading 5 | // the plugins file with the 'pluginsFile' configuration option. 6 | // 7 | // You can read more here: 8 | // https://on.cypress.io/plugins-guide 9 | // *********************************************************** 10 | 11 | // This function is called when a project is opened or re-opened (e.g. due to 12 | // the project's config changing) 13 | 14 | const { preprocessTypescript } = require('@nrwl/cypress/plugins/preprocessor'); 15 | 16 | module.exports = (on, config) => { 17 | // `on` is used to hook into various events Cypress emits 18 | // `config` is the resolved Cypress config 19 | 20 | // Preprocess Typescript 21 | on('file:preprocessor', preprocessTypescript(config)); 22 | }; 23 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-card/flight-card.component.html: -------------------------------------------------------------------------------- 1 |
4 | 5 |
6 |

{{item.from}} - {{item.to}}

7 |
8 |
9 |

Flight-No.: #{{item.id}}

10 |

Date: {{item.date | date:'long'}}

11 | 12 |

13 | 19 | 25 | 26 | 28 | Edit 29 | 30 | 31 |

32 | 33 |
34 |
35 | -------------------------------------------------------------------------------- /apps/flight-app-e2e/src/support/commands.ts: -------------------------------------------------------------------------------- 1 | // *********************************************** 2 | // This example commands.js shows you how to 3 | // create various custom commands and overwrite 4 | // existing commands. 5 | // 6 | // For more comprehensive examples of custom 7 | // commands please read more here: 8 | // https://on.cypress.io/custom-commands 9 | // *********************************************** 10 | // 11 | // 12 | // -- This is a parent command -- 13 | // Cypress.Commands.add("login", (email, password) => { ... }) 14 | // 15 | // 16 | // -- This is a child command -- 17 | // Cypress.Commands.add("drag", { prevSubject: 'element'}, (subject, options) => { ... }) 18 | // 19 | // 20 | // -- This is a dual command -- 21 | // Cypress.Commands.add("dismiss", { prevSubject: 'optional'}, (subject, options) => { ... }) 22 | // 23 | // 24 | // -- This will overwrite an existing command -- 25 | // Cypress.Commands.overwrite("visit", (originalFn, url, options) => { ... }) 26 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/webcomponentsjs/entrypoints/webcomponents-sd-ce-index.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license 3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 'use strict'; 11 | 12 | /* 13 | * Polyfills loaded: Custom Elements, Shady DOM/Shady CSS 14 | * Used in: Safari 9, Firefox, Edge 15 | */ 16 | 17 | import '../node_modules/@webcomponents/shadydom/src/shadydom.js'; 18 | import '../node_modules/@webcomponents/custom-elements/src/custom-elements.js'; 19 | import '../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js'; -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_footers.scss: -------------------------------------------------------------------------------- 1 | .footer { 2 | background-attachment: fixed; 3 | position: relative; 4 | line-height: 20px; 5 | nav { 6 | ul { 7 | list-style: none; 8 | margin: 0; 9 | padding: 0; 10 | font-weight: normal; 11 | li { 12 | display: inline-block; 13 | padding: 10px 15px; 14 | margin: 15px 3px; 15 | line-height: 20px; 16 | text-align: center; 17 | } 18 | a:not(.btn) { 19 | color: $font-color; 20 | display: block; 21 | margin-bottom: 3px; 22 | 23 | &:focus, 24 | &:hover { 25 | color: $default-states-color; 26 | } 27 | } 28 | } 29 | } 30 | .copyright { 31 | color: $font-color; 32 | padding: 10px 15px; 33 | font-size: 14px; 34 | white-space: nowrap; 35 | margin: 15px 3px; 36 | line-height: 20px; 37 | text-align: center; 38 | } 39 | .heart { 40 | color: $danger-color; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/passenger-search/passenger-search.component.spec.ts: -------------------------------------------------------------------------------- 1 | /* tslint:disable:no-unused-variable */ 2 | import { async, ComponentFixture, TestBed } from '@angular/core/testing'; 3 | import { By } from '@angular/platform-browser'; 4 | import { DebugElement } from '@angular/core'; 5 | 6 | import { PassengerSearchComponent } from './passenger-search.component'; 7 | 8 | describe('PassengerSearchComponent', () => { 9 | let component: PassengerSearchComponent; 10 | let fixture: ComponentFixture; 11 | 12 | beforeEach(async(() => { 13 | TestBed.configureTestingModule({ 14 | declarations: [ PassengerSearchComponent ] 15 | }) 16 | .compileComponents(); 17 | })); 18 | 19 | beforeEach(() => { 20 | fixture = TestBed.createComponent(PassengerSearchComponent); 21 | component = fixture.componentInstance; 22 | fixture.detectChanges(); 23 | }); 24 | 25 | it('should create', () => { 26 | expect(component).toBeTruthy(); 27 | }); 28 | }); 29 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/webcomponentsjs/custom-elements-es5-adapter.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license @nocompile 3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | (function () { 11 | 'use strict'; 12 | 13 | (function(){if(void 0===window.Reflect||void 0===window.customElements||window.customElements.hasOwnProperty('polyfillWrapFlushCallback'))return;const a=HTMLElement;window.HTMLElement=function HTMLElement(){return Reflect.construct(a,[],this.constructor)},HTMLElement.prototype=a.prototype,HTMLElement.prototype.constructor=HTMLElement,Object.setPrototypeOf(HTMLElement,a);})(); 14 | 15 | }()); 16 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Deferred.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @template T 3 | */ 4 | export default class Deferred { 5 | constructor() { 6 | /** 7 | * @private 8 | * @type {T|undefined} 9 | */ 10 | this._value = undefined; 11 | 12 | /** 13 | * @private 14 | * @type {Function|undefined} 15 | */ 16 | this._resolve = undefined; 17 | 18 | /** 19 | * @private 20 | * @type {!Promise} 21 | */ 22 | this._promise = new Promise(resolve => { 23 | this._resolve = resolve; 24 | 25 | if (this._value) { 26 | resolve(this._value); 27 | } 28 | }); 29 | } 30 | 31 | /** 32 | * @param {T} value 33 | */ 34 | resolve(value) { 35 | if (this._value) { 36 | throw new Error('Already resolved.'); 37 | } 38 | 39 | this._value = value; 40 | 41 | if (this._resolve) { 42 | this._resolve(value); 43 | } 44 | } 45 | 46 | /** 47 | * @return {!Promise} 48 | */ 49 | toPromise() { 50 | return this._promise; 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-search/flight-search.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit} from '@angular/core'; 2 | import { FlightService, FlightFacade } from '@nx-flights/booking/domain'; 3 | 4 | @Component({ 5 | selector: 'flight-search', 6 | templateUrl: './flight-search.component.html', 7 | styleUrls: ['./flight-search.component.css'] 8 | }) 9 | export class FlightSearchComponent implements OnInit { 10 | 11 | from = 'Hamburg'; // in Germany 12 | to = 'Graz'; // in Austria 13 | urgent = false; 14 | 15 | flights$ = this.flightFacade.flights$; 16 | 17 | // "shopping basket" with selected flights 18 | basket: object = { 19 | "3": true, 20 | "5": true 21 | }; 22 | 23 | constructor( 24 | private flightFacade: FlightFacade) { 25 | } 26 | 27 | ngOnInit() { 28 | } 29 | 30 | search(): void { 31 | if (!this.from || !this.to) return; 32 | 33 | this.flightFacade.search(this.from, this.to, this.urgent); 34 | 35 | } 36 | 37 | delay(): void { 38 | this.flightFacade.delay(); 39 | } 40 | 41 | } 42 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/home/home.component.ts: -------------------------------------------------------------------------------- 1 | import {Component, OnInit, ViewEncapsulation} from '@angular/core'; 2 | import {ActivatedRoute} from '@angular/router'; 3 | 4 | @Component({ 5 | selector: 'app-home', 6 | templateUrl: './home.component.html', 7 | styleUrls: ['./home.component.css'], 8 | encapsulation: ViewEncapsulation.None 9 | }) 10 | export class HomeComponent implements OnInit { 11 | 12 | expertMode: boolean = false; 13 | 14 | constructor(private route: ActivatedRoute) { 15 | } 16 | 17 | changed($event): void { 18 | console.debug('$event.detail ', $event.target.detail); 19 | 20 | this.expertMode = $event.detail 21 | } 22 | 23 | needsLogin: boolean; 24 | _userName: string = ''; 25 | 26 | ngOnInit() { 27 | this.needsLogin = !!this.route.snapshot.params['needsLogin']; 28 | } 29 | 30 | get userName(): string { 31 | return this._userName; 32 | } 33 | 34 | login(): void { 35 | this._userName = 'Login will be implemented in another exercise!' 36 | } 37 | 38 | logout(): void { 39 | this._userName = ''; 40 | } 41 | 42 | 43 | } 44 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/app.component.spec.ts: -------------------------------------------------------------------------------- 1 | import { TestBed, async } from '@angular/core/testing'; 2 | import { AppComponent } from './app.component'; 3 | describe('AppComponent', () => { 4 | beforeEach(async(() => { 5 | TestBed.configureTestingModule({ 6 | declarations: [ 7 | AppComponent 8 | ], 9 | }).compileComponents(); 10 | })); 11 | it('should create the app', async(() => { 12 | const fixture = TestBed.createComponent(AppComponent); 13 | const app = fixture.debugElement.componentInstance; 14 | expect(app).toBeTruthy(); 15 | })); 16 | it(`should have as title 'app'`, async(() => { 17 | const fixture = TestBed.createComponent(AppComponent); 18 | const app = fixture.debugElement.componentInstance; 19 | expect(app.title).toEqual('app'); 20 | })); 21 | it('should render title in a h1 tag', async(() => { 22 | const fixture = TestBed.createComponent(AppComponent); 23 | fixture.detectChanges(); 24 | const compiled = fixture.debugElement.nativeElement; 25 | expect(compiled.querySelector('h1').textContent).toContain('Welcome to app!'); 26 | })); 27 | }); 28 | -------------------------------------------------------------------------------- /apps/flight-app/src/styles.css: -------------------------------------------------------------------------------- 1 | /* 2 | html { 3 | overflow-y: scroll; 4 | } 5 | 6 | body::before { 7 | background-size: cover; 8 | background-attachment: fixed; 9 | background-image: url('assets/sea-1993791_1920.jpg'); 10 | content: ''; 11 | will-change: transform; 12 | z-index: -1; 13 | left: 0; 14 | right: 0; 15 | bottom: 0; 16 | top: 0; 17 | position: fixed; 18 | } 19 | 20 | h1 { 21 | color: white!important; 22 | } 23 | 24 | card h1 { 25 | color: black!important; 26 | } 27 | 28 | 29 | .container { 30 | margin-top:200px; 31 | } 32 | 33 | .card { 34 | background-color: white; 35 | padding: 30px; 36 | border-radius: 5px; 37 | margin-top: 20px; 38 | margin-right: 20px; 39 | 40 | } 41 | 42 | .col { 43 | padding: 0px!important; 44 | } 45 | 46 | .navbar-default { 47 | background-color:inherit!important; 48 | border-style: none!important; 49 | } 50 | 51 | .navbar li a { 52 | color:white!important; 53 | font-size:16px!important; 54 | } 55 | 56 | .navbar-brand { 57 | color:white!important; 58 | } 59 | 60 | .active { 61 | color: orange !important; 62 | } 63 | 64 | */ -------------------------------------------------------------------------------- /tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compileOnSave": false, 3 | "compilerOptions": { 4 | "rootDir": ".", 5 | "sourceMap": true, 6 | "declaration": false, 7 | "moduleResolution": "node", 8 | "emitDecoratorMetadata": true, 9 | "experimentalDecorators": true, 10 | "importHelpers": true, 11 | "target": "es2015", 12 | "module": "esnext", 13 | "typeRoots": ["node_modules/@types"], 14 | "lib": ["es2017", "dom"], 15 | "skipLibCheck": true, 16 | "skipDefaultLibCheck": true, 17 | "baseUrl": ".", 18 | "paths": { 19 | "@nx-flights/booking/feature": ["libs/booking/feature/src/index.ts"], 20 | "@nx-flights/booking/domain": ["libs/booking/domain/src/index.ts"], 21 | "@nx-flights/boarding/feature": ["libs/boarding/feature/src/index.ts"], 22 | "@nx-flights/boarding/domain": ["libs/boarding/domain/src/index.ts"], 23 | "@nx-flights/shared/util-auth": ["libs/shared/util-auth/src/index.ts"], 24 | "@nx-flights/shared/ui-common": ["libs/shared/ui-common/src/index.ts"], 25 | "@nx-flights/booking/api": ["libs/booking/api/src/index.ts"] 26 | } 27 | }, 28 | "exclude": ["node_modules", "tmp"] 29 | } 30 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/app.component.css: -------------------------------------------------------------------------------- 1 | .loading-indicator { 2 | position: fixed; 3 | left: 0px; 4 | top: 0px; 5 | width: 100%; 6 | height: 100%; 7 | background-color: black; 8 | opacity: 0.3; 9 | } 10 | 11 | .spinner { 12 | width: 40px; 13 | height: 40px; 14 | 15 | position: relative; 16 | margin: 100px auto; 17 | } 18 | 19 | .double-bounce1, .double-bounce2 { 20 | width: 100%; 21 | height: 100%; 22 | border-radius: 50%; 23 | background-color: #FFF; 24 | opacity: 0.6; 25 | position: absolute; 26 | top: 0; 27 | left: 0; 28 | 29 | -webkit-animation: sk-bounce 2.0s infinite ease-in-out; 30 | animation: sk-bounce 2.0s infinite ease-in-out; 31 | } 32 | 33 | .double-bounce2 { 34 | -webkit-animation-delay: -1.0s; 35 | animation-delay: -1.0s; 36 | } 37 | 38 | @-webkit-keyframes sk-bounce { 39 | 0%, 100% { 40 | -webkit-transform: scale(0.0) 41 | } 42 | 50% { 43 | -webkit-transform: scale(1.0) 44 | } 45 | } 46 | 47 | @keyframes sk-bounce { 48 | 0%, 100% { 49 | transform: scale(0.0); 50 | -webkit-transform: scale(0.0); 51 | } 52 | 50% { 53 | transform: scale(1.0); 54 | -webkit-transform: scale(1.0); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /apps/flight-app/src/test.ts: -------------------------------------------------------------------------------- 1 | // This file is required by karma.conf.js and loads recursively all the .spec and framework files 2 | 3 | import {getTestBed} from '@angular/core/testing'; 4 | import { 5 | BrowserDynamicTestingModule, 6 | platformBrowserDynamicTesting 7 | } from '@angular/platform-browser-dynamic/testing'; 8 | import 'zone.js/dist/async-test'; 9 | import 'zone.js/dist/fake-async-test'; 10 | import 'zone.js/dist/jasmine-patch'; 11 | import 'zone.js/dist/long-stack-trace-zone'; 12 | import 'zone.js/dist/proxy.js'; 13 | import 'zone.js/dist/sync-test'; 14 | 15 | // Unfortunately there's no typing for the `__karma__` variable. Just declare it as any. 16 | declare const __karma__: any; 17 | declare const require: any; 18 | 19 | // Prevent Karma from running prematurely. 20 | __karma__.loaded = function () { 21 | }; 22 | 23 | // First, initialize the Angular testing environment. 24 | getTestBed().initTestEnvironment( 25 | BrowserDynamicTestingModule, 26 | platformBrowserDynamicTesting() 27 | ); 28 | // Then we find all the tests. 29 | const context = require.context('./', true, /\.spec\.ts$/); 30 | // And load the modules. 31 | context.keys().map(context); 32 | // Finally, start Karma to run the tests. 33 | __karma__.start(); 34 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/sidebar/sidebar.component.html: -------------------------------------------------------------------------------- 1 | 52 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper-dashboard.scss: -------------------------------------------------------------------------------- 1 | /*! 2 | 3 | ========================================================= 4 | * Paper Dashboard Angular - V1.0.0 5 | ========================================================= 6 | 7 | * Product Page: https://www.creative-tim.com/product/paper-dashboard-angular 8 | * Copyright 2017 Creative Tim (https://www.creative-tim.com) 9 | * Licensed under MIT (https://github.com/creativetimofficial/paper-dashboard-angular/blob/master/LICENSE.md) 10 | 11 | ========================================================= 12 | 13 | * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 14 | 15 | */ 16 | @import "paper/variables"; 17 | @import "paper/mixins"; 18 | @import "paper/typography"; 19 | // Core CSS 20 | @import "paper/misc"; 21 | @import "paper/sidebar-and-main-panel"; 22 | @import "paper/buttons"; 23 | @import "paper/inputs"; 24 | @import "paper/alerts"; 25 | @import "paper/tables"; 26 | @import "paper/checkbox-radio"; 27 | @import "paper/navbars"; 28 | @import "paper/footers"; 29 | // Fancy Stuff 30 | @import "paper/animate"; 31 | @import "paper/dropdown"; 32 | @import "paper/cards"; 33 | @import "paper/chartist"; 34 | @import "paper/responsive"; 35 | @import "paper/plugins/fixed-plugin"; 36 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/booking-feature.module.ts: -------------------------------------------------------------------------------- 1 | import {CommonModule} from '@angular/common'; 2 | import {NgModule} from '@angular/core'; 3 | import {FormsModule} from '@angular/forms'; 4 | import {RouterModule} from '@angular/router'; 5 | import {FlightBookingComponent} from './flight-booking.component'; 6 | import {FLIGHT_BOOKING_ROUTES} from './flight-booking.routes'; 7 | import {FlightCardComponent} from './flight-card/flight-card.component'; 8 | import {FlightEditComponent} from './flight-edit/flight-edit.component'; 9 | import {FlightSearchComponent} from './flight-search/flight-search.component'; 10 | import {PassengerSearchComponent} from './passenger-search/passenger-search.component'; 11 | import { CityPipe } from './common/city.pipe'; 12 | import { BookingDomainModule } from '@nx-flights/booking/domain'; 13 | 14 | @NgModule({ 15 | imports: [ 16 | CommonModule, 17 | FormsModule, 18 | RouterModule.forChild(FLIGHT_BOOKING_ROUTES), 19 | BookingDomainModule.forRoot(), 20 | ], 21 | declarations: [ 22 | FlightSearchComponent, 23 | FlightCardComponent, 24 | PassengerSearchComponent, 25 | FlightEditComponent, 26 | FlightBookingComponent, 27 | CityPipe 28 | ], 29 | providers: [], 30 | exports: [ 31 | FlightSearchComponent 32 | ] 33 | }) 34 | export class BookingFeatureModule { 35 | } 36 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/app.module.ts: -------------------------------------------------------------------------------- 1 | import { HttpClientModule } from "@angular/common/http"; 2 | import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; 3 | import { NgModule } from "@angular/core"; 4 | import { BrowserModule } from "@angular/platform-browser"; 5 | import { RouterModule } from "@angular/router"; 6 | 7 | import { AppComponent } from "./app.component"; 8 | import { APP_EXTRA_OPTIONS, APP_ROUTES } from "./app.routes"; 9 | import { BasketComponent } from "./basket/basket.component"; 10 | import { HomeComponent } from "./home/home.component"; 11 | import { NavbarComponent } from "./navbar/navbar.component"; 12 | import { SharedModule } from "./shared/shared.module"; 13 | import { SidebarComponent } from "./sidebar/sidebar.component"; 14 | import { BookingFeatureModule } from '@nx-flights/booking/feature'; 15 | 16 | @NgModule({ 17 | imports: [ 18 | BrowserModule, 19 | HttpClientModule, 20 | BookingFeatureModule, 21 | BrowserAnimationsModule, 22 | SharedModule.forRoot(), 23 | RouterModule.forRoot([...APP_ROUTES], { ...APP_EXTRA_OPTIONS }), 24 | ], 25 | declarations: [ 26 | AppComponent, 27 | SidebarComponent, 28 | NavbarComponent, 29 | HomeComponent, 30 | BasketComponent 31 | ], 32 | providers: [], 33 | bootstrap: [AppComponent] 34 | }) 35 | export class AppModule {} 36 | -------------------------------------------------------------------------------- /libs/booking/domain/src/lib/application-services/flight.facade.ts: -------------------------------------------------------------------------------- 1 | import { Injectable } from '@angular/core'; 2 | import { BehaviorSubject } from 'rxjs'; 3 | import { first } from 'rxjs/operators'; 4 | import { Flight } from '../domain/flight'; 5 | import { FlightService } from '../infrastructure/flight.service'; 6 | 7 | @Injectable({ providedIn: 'root' }) 8 | export class FlightFacade { 9 | 10 | private flightsSubject = new BehaviorSubject([]); 11 | public flights$ = this.flightsSubject.asObservable(); 12 | 13 | constructor(private flightService: FlightService) { 14 | } 15 | 16 | search(from: string, to: string, urgent: boolean): void { 17 | this.flightService.find(from, to, urgent).subscribe( 18 | flights => { 19 | this.flightsSubject.next(flights) 20 | }, 21 | err => { 22 | console.error('err', err); 23 | } 24 | ); 25 | } 26 | 27 | delay() { 28 | this.flights$.pipe(first()).subscribe( 29 | flights => { 30 | const oldFlight = flights[0]; 31 | const flight = { ...oldFlight, date: (new Date()).toISOString() }; 32 | const newFlights = [flight, ...flights.slice(1)]; 33 | 34 | this.flightsSubject.next(newFlights) 35 | } 36 | ) 37 | } 38 | 39 | } -------------------------------------------------------------------------------- /apps/flight-app/src/assets/webcomponentsjs/entrypoints/webcomponents-sd-ce-pf-index.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license 3 | Copyright (c) 2017 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 'use strict'; 11 | 12 | /* 13 | * Polyfills loaded: HTML Imports, Custom Elements, Shady DOM/Shady CSS, platform polyfills, template 14 | * Used in: IE 11 15 | */ 16 | 17 | import '../node_modules/@webcomponents/webcomponents-platform/webcomponents-platform.js'; 18 | import '../node_modules/@webcomponents/template/template.js'; 19 | import '../src/promise.js'; 20 | import '../src/symbol.js'; 21 | import '../src/flag-parser.js'; 22 | import '../node_modules/@webcomponents/shadydom/src/shadydom.js'; 23 | import '../node_modules/@webcomponents/custom-elements/src/custom-elements.js'; 24 | import '../node_modules/@webcomponents/shadycss/entrypoints/scoping-shim.js'; 25 | import '../node_modules/@webcomponents/url/url.js'; 26 | import '../src/baseuri.js'; 27 | import '../src/unresolved.js'; -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_alerts.scss: -------------------------------------------------------------------------------- 1 | .alert { 2 | border: 0; 3 | border-radius: 0; 4 | color: #FFFFFF; 5 | padding: 10px 15px; 6 | font-size: 14px; 7 | 8 | .container & { 9 | border-radius: 4px; 10 | 11 | } 12 | .navbar & { 13 | border-radius: 0; 14 | left: 0; 15 | position: absolute; 16 | right: 0; 17 | top: 85px; 18 | width: 100%; 19 | z-index: 3; 20 | } 21 | .navbar:not(.navbar-transparent) & { 22 | top: 70px; 23 | } 24 | 25 | span[data-notify="icon"] { 26 | font-size: 30px; 27 | display: block; 28 | left: 15px; 29 | position: absolute; 30 | top: 50%; 31 | margin-top: -20px; 32 | } 33 | 34 | .close ~ span { 35 | display: block; 36 | max-width: 89%; 37 | } 38 | 39 | &[data-notify="container"] { 40 | padding: 10px 10px 10px 20px; 41 | border-radius: $border-radius-base; 42 | } 43 | 44 | [data-notify="icon"][class*="ti-"] ~ [data-notify="message"] { 45 | padding-left: 50px; 46 | } 47 | } 48 | 49 | .alert-info { 50 | background-color: $bg-info; 51 | color: $info-states-color; 52 | } 53 | 54 | .alert-success { 55 | background-color: $bg-success; 56 | color: $success-states-color; 57 | } 58 | 59 | .alert-warning { 60 | background-color: $bg-warning; 61 | color: $warning-states-color; 62 | } 63 | 64 | .alert-danger { 65 | background-color: $bg-danger; 66 | color: $danger-states-color; 67 | } 68 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/resources/accessibility-helper.js: -------------------------------------------------------------------------------- 1 | function buildAccessibilityTree(accessibilityObject, indent, allAttributesRequired, rolesToIgnore, targetObject, targetString) { 2 | if (rolesToIgnore) { 3 | for (var i = 0; i < rolesToIgnore.length; i++) { 4 | if (accessibilityObject.role == 'AXRole: ' + rolesToIgnore[i]) 5 | return true; 6 | } 7 | } 8 | 9 | var str = ""; 10 | for (var i = 0; i < indent; i++) 11 | str += " "; 12 | str += accessibilityObject.role; 13 | if (accessibilityObject.value) 14 | str += " AXValue: " + accessibilityObject.value; 15 | else if (accessibilityObject.name) 16 | str += " \"" + accessibilityObject.name + "\""; 17 | str += allAttributesRequired && accessibilityObject.role == '' ? accessibilityObject.allAttributes() : ''; 18 | str += targetObject && accessibilityObject.isEqual(targetObject) ? " " + targetString : ''; 19 | str += "\n"; 20 | 21 | document.getElementById("console").innerText += str; 22 | 23 | if (accessibilityObject.name.indexOf('End of test') >= 0) 24 | return false; 25 | 26 | var count = accessibilityObject.childrenCount; 27 | for (var i = 0; i < count; i++) { 28 | if (!buildAccessibilityTree(accessibilityObject.childAtIndex(i), indent + 1, allAttributesRequired, rolesToIgnore, targetObject, targetString)) 29 | return false; 30 | } 31 | 32 | return true; 33 | } 34 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/css/demo.css: -------------------------------------------------------------------------------- 1 | @media (min-width: 992px) { 2 | .typo-line { 3 | padding-left: 140px; 4 | margin-bottom: 40px; 5 | position: relative; 6 | } 7 | 8 | .typo-line .category { 9 | transform: translateY(-50%); 10 | top: 50%; 11 | left: 0px; 12 | position: absolute; 13 | } 14 | } 15 | 16 | .icon-section { 17 | margin: 0 0 3em; 18 | clear: both; 19 | overflow: hidden; 20 | } 21 | 22 | .icon-container { 23 | width: 240px; 24 | padding: .7em 0; 25 | float: left; 26 | position: relative; 27 | text-align: left; 28 | } 29 | 30 | .icon-container [class^="ti-"], 31 | .icon-container [class*=" ti-"] { 32 | color: #000; 33 | position: absolute; 34 | margin-top: 3px; 35 | transition: .3s; 36 | font-size: 1.2em; 37 | } 38 | 39 | .icon-container:hover [class^="ti-"], 40 | .icon-container:hover [class*=" ti-"] { 41 | font-size: 2.2em; 42 | margin-top: -5px; 43 | } 44 | 45 | .icon-container:hover .icon-name { 46 | color: #000; 47 | } 48 | 49 | .icon-name { 50 | color: #aaa; 51 | margin-left: 35px; 52 | font-size: .8em; 53 | transition: .3s; 54 | } 55 | 56 | .icon-container:hover .icon-name { 57 | margin-left: 45px; 58 | } 59 | 60 | .places-buttons .btn { 61 | margin-bottom: 30px 62 | } 63 | 64 | .sidebar .nav > li.active-pro { 65 | position: absolute; 66 | width: 100%; 67 | bottom: 10px; 68 | } 69 | 70 | .sidebar .nav > li.active-pro a { 71 | background: rgba(255, 255, 255, 0.14); 72 | opacity: 1; 73 | color: #FFFFFF; 74 | } 75 | 76 | .table-upgrade td:nth-child(2), 77 | .table-upgrade td:nth-child(3) { 78 | text-align: center; 79 | } 80 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/externs/custom-elements.js: -------------------------------------------------------------------------------- 1 | /** @type {boolean|undefined} */ 2 | CustomElementRegistry.prototype.forcePolyfill; 3 | 4 | class AlreadyConstructedMarker {} 5 | 6 | /** 7 | * @enum {number} 8 | */ 9 | const CustomElementState = { 10 | custom: 1, 11 | failed: 2, 12 | }; 13 | 14 | /** 15 | * @typedef {{ 16 | * localName: string, 17 | * constructor: !Function, 18 | * connectedCallback: Function, 19 | * disconnectedCallback: Function, 20 | * adoptedCallback: Function, 21 | * attributeChangedCallback: Function, 22 | * observedAttributes: !Array, 23 | * constructionStack: !Array, 24 | * }} 25 | */ 26 | let CustomElementDefinition; 27 | 28 | 29 | // These properties are defined in the closure externs so that they will not be 30 | // renamed during minification. 31 | 32 | // Used for both Documents and Nodes which represent documents in the HTML 33 | // Imports polyfill. 34 | 35 | /** @type {boolean|undefined} */ 36 | Node.prototype.__CE_hasRegistry; 37 | 38 | /** @type {boolean|undefined} */ 39 | Node.prototype.__CE_isImportDocument; 40 | 41 | /** @type {boolean|undefined} */ 42 | Node.prototype.__CE_documentLoadHandled; 43 | 44 | // Apply generally to Node. 45 | 46 | /** @type {boolean|undefined} */ 47 | Node.prototype.__CE_patched; 48 | 49 | // Apply generally to Element. 50 | 51 | /** @type {!CustomElementState|undefined} */ 52 | Element.prototype.__CE_state; 53 | 54 | /** @type {!CustomElementDefinition|undefined} */ 55 | Element.prototype.__CE_definition; 56 | 57 | /** @type {!DocumentFragment|undefined} */ 58 | Element.prototype.__CE_shadowRoot; 59 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_tables.scss: -------------------------------------------------------------------------------- 1 | .table { 2 | thead, 3 | tbody, 4 | tfoot { 5 | tr > th, 6 | tr > td { 7 | border-top: 1px solid $table-line-color; 8 | } 9 | } 10 | > thead > tr > th { 11 | border-bottom-width: 0; 12 | font-size: $font-size-h5; 13 | font-weight: $font-weight-light; 14 | } 15 | 16 | .radio, 17 | .checkbox { 18 | margin-top: 0; 19 | margin-bottom: 22px; 20 | padding: 0; 21 | width: 15px; 22 | } 23 | > thead > tr > th, 24 | > tbody > tr > th, 25 | > tfoot > tr > th, 26 | > thead > tr > td, 27 | > tbody > tr > td, 28 | > tfoot > tr > td { 29 | padding: 12px; 30 | vertical-align: middle; 31 | } 32 | 33 | .th-description { 34 | max-width: 150px; 35 | } 36 | .td-price { 37 | font-size: 26px; 38 | font-weight: $font-weight-light; 39 | margin-top: 5px; 40 | text-align: right; 41 | } 42 | .td-total { 43 | font-weight: $font-weight-bold; 44 | font-size: $font-size-h5; 45 | padding-top: 20px; 46 | text-align: right; 47 | } 48 | 49 | .td-actions .btn { 50 | 51 | &.btn-sm, 52 | &.btn-xs { 53 | padding-left: 3px; 54 | padding-right: 3px; 55 | } 56 | } 57 | 58 | > tbody > tr { 59 | position: relative; 60 | } 61 | } 62 | 63 | .table-striped { 64 | tbody > tr:nth-of-type(2n+1) { 65 | background-color: #fff; 66 | } 67 | tbody > tr:nth-of-type(2n) { 68 | background-color: $pale-bg; 69 | } 70 | > thead > tr > th, 71 | > tbody > tr > th, 72 | > tfoot > tr > th, 73 | > thead > tr > td, 74 | > tbody > tr > td, 75 | > tfoot > tr > td { 76 | padding: 15px 8px; 77 | } 78 | } 79 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-card/flight-card.component.ts: -------------------------------------------------------------------------------- 1 | import { 2 | Component, 3 | ElementRef, 4 | EventEmitter, 5 | Input, 6 | NgZone, 7 | OnChanges, 8 | OnDestroy, 9 | OnInit, 10 | Output, 11 | SimpleChanges 12 | } from '@angular/core'; 13 | import { Flight } from '@nx-flights/booking/domain'; 14 | 15 | @Component({ 16 | selector: 'flight-card', 17 | templateUrl: './flight-card.component.html', 18 | // changeDetection: ChangeDetectionStrategy.OnPush 19 | }) 20 | export class FlightCardComponent implements OnInit, OnChanges, OnDestroy { 21 | 22 | @Input() item: Flight; 23 | @Input() selected: boolean; 24 | @Output() selectedChange = new EventEmitter(); 25 | 26 | constructor(private element: ElementRef, private zone: NgZone) { 27 | } 28 | 29 | ngOnInit() { 30 | } 31 | 32 | ngOnChanges(changes: SimpleChanges): void { 33 | } 34 | 35 | ngOnDestroy(): void { 36 | } 37 | 38 | select() { 39 | this.selected = true; 40 | this.selectedChange.next(true); 41 | } 42 | 43 | deselect() { 44 | this.selected = false; 45 | this.selectedChange.next(false); 46 | } 47 | 48 | blink() { 49 | // Dirty Hack used to visualize the change detector 50 | // let originalColor = this.element.nativeElement.firstChild.style.backgroundColor; 51 | this.element.nativeElement.firstChild.style.backgroundColor = 'crimson'; 52 | // ^----- DOM-Element 53 | 54 | this.zone.runOutsideAngular(() => { 55 | setTimeout(() => { 56 | this.element.nativeElement.firstChild.style.backgroundColor = 'white'; 57 | }, 1000); 58 | }); 59 | 60 | return null; 61 | } 62 | 63 | 64 | } 65 | -------------------------------------------------------------------------------- /apps/flight-app/src/app/navbar/navbar.component.html: -------------------------------------------------------------------------------- 1 | 46 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/resources/run-after-layout-and-paint.js: -------------------------------------------------------------------------------- 1 | // Run a callback after layout and paint of all pending document changes. 2 | // 3 | // It has two modes: 4 | // - traditional mode, for existing tests, and tests needing customized notifyDone timing: 5 | // Usage: 6 | // if (window.testRunner) 7 | // testRunner.waitUntilDone(); 8 | // runAfterLayoutAndPaint(function() { 9 | // ... // some code which modifies style/layout 10 | // if (window.testRunner) 11 | // testRunner.notifyDone(); 12 | // // Or to ensure the next paint is executed before the test finishes: 13 | // // if (window.testRunner) 14 | // // runAfterAfterLayoutAndPaint(function() { testRunner.notifyDone() }); 15 | // // Or notifyDone any time later if needed. 16 | // }); 17 | // 18 | // - autoNotifyDone mode, for new tests which just need to change style/layout and finish: 19 | // Usage: 20 | // runAfterLayoutAndPaint(function() { 21 | // ... // some code which modifies style/layout 22 | // }, true); 23 | 24 | if (window.internals) 25 | internals.runtimeFlags.paintUnderInvalidationCheckingEnabled = true; 26 | 27 | function runAfterLayoutAndPaint(callback, autoNotifyDone) { 28 | if (!window.testRunner) { 29 | // For manual test. Delay 500ms to allow us to see the visual change 30 | // caused by the callback. 31 | setTimeout(callback, 500); 32 | return; 33 | } 34 | 35 | if (autoNotifyDone) 36 | testRunner.waitUntilDone(); 37 | 38 | testRunner.layoutAndPaintAsyncThen(function() { 39 | callback(); 40 | if (autoNotifyDone) 41 | testRunner.notifyDone(); 42 | }); 43 | } 44 | -------------------------------------------------------------------------------- /libs/booking/feature/src/lib/flight-search/flight-search.component.html: -------------------------------------------------------------------------------- 1 |
2 | 3 |
4 |

Flight Search

5 |
6 |
7 | 8 |
9 | 10 |
11 | 12 | 13 |
14 |
15 | 16 | 17 |
18 |
19 | 24 |
25 | 26 |
27 | 31 | 32 | 33 | 37 | 38 |
39 | {{flights.length}} flights found! 40 |
41 |
42 | 43 |
44 |
45 | 46 |
47 |
48 | 49 |
50 |
51 | 52 |
53 | 56 | 57 |
58 |
59 |
60 | 61 |
62 |
63 |
{{ basket | json }}
64 |
65 |
66 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_buttons.scss: -------------------------------------------------------------------------------- 1 | // Mixin for generating new styles 2 | @mixin btn-styles($btn-color, $btn-states-color) { 3 | border-color: $btn-color; 4 | color: $btn-color; 5 | 6 | &:hover, 7 | &:focus, 8 | &:active, 9 | &.active, 10 | .open > &.dropdown-toggle { 11 | background-color: $btn-color; 12 | color: $fill-font-color; 13 | border-color: $btn-color; 14 | .caret { 15 | border-top-color: $fill-font-color; 16 | } 17 | } 18 | 19 | &.disabled, 20 | &:disabled, 21 | &[disabled], 22 | fieldset[disabled] & { 23 | &, 24 | &:hover, 25 | &:focus, 26 | &.focus, 27 | &:active, 28 | &.active { 29 | background-color: $transparent-bg; 30 | border-color: $btn-color; 31 | } 32 | } 33 | 34 | &.btn-fill { 35 | color: $white-color; 36 | background-color: $btn-color; 37 | @include opacity(1); 38 | 39 | &:hover, 40 | &:focus, 41 | &:active, 42 | &.active, 43 | .open > &.dropdown-toggle { 44 | background-color: $btn-states-color; 45 | color: $white-color; 46 | border-color: $btn-states-color; 47 | } 48 | 49 | .caret { 50 | border-top-color: $white-color; 51 | } 52 | } 53 | 54 | &.btn-simple { 55 | &:hover, 56 | &:focus, 57 | &:active, 58 | &.active, 59 | .open > &.dropdown-toggle { 60 | background-color: $transparent-bg; 61 | color: $btn-states-color; 62 | } 63 | 64 | .caret { 65 | border-top-color: $white-color; 66 | } 67 | } 68 | 69 | .caret { 70 | border-top-color: $btn-color; 71 | } 72 | } 73 | 74 | @mixin btn-size($padding-vertical, $padding-horizontal, $font-size, $border, $line-height) { 75 | font-size: $font-size; 76 | border-radius: $border; 77 | padding: $padding-vertical $padding-horizontal; 78 | 79 | &.btn-simple { 80 | padding: $padding-vertical + 2 $padding-horizontal; 81 | } 82 | 83 | } 84 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/custom-elements.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | import CustomElementInternals from './CustomElementInternals.js'; 12 | import CustomElementRegistry from './CustomElementRegistry.js'; 13 | 14 | import PatchHTMLElement from './Patch/HTMLElement.js'; 15 | import PatchDocument from './Patch/Document.js'; 16 | import PatchDocumentFragment from './Patch/DocumentFragment.js'; 17 | import PatchNode from './Patch/Node.js'; 18 | import PatchElement from './Patch/Element.js'; 19 | 20 | const priorCustomElements = window['customElements']; 21 | 22 | if (!priorCustomElements || 23 | priorCustomElements['forcePolyfill'] || 24 | (typeof priorCustomElements['define'] != 'function') || 25 | (typeof priorCustomElements['get'] != 'function')) { 26 | /** @type {!CustomElementInternals} */ 27 | const internals = new CustomElementInternals(); 28 | 29 | PatchHTMLElement(internals); 30 | PatchDocument(internals); 31 | PatchDocumentFragment(internals); 32 | PatchNode(internals); 33 | PatchElement(internals); 34 | 35 | // The main document is always associated with the registry. 36 | document.__CE_hasRegistry = true; 37 | 38 | /** @type {!CustomElementRegistry} */ 39 | const customElements = new CustomElementRegistry(internals); 40 | 41 | Object.defineProperty(window, 'customElements', { 42 | configurable: true, 43 | enumerable: true, 44 | value: customElements, 45 | }); 46 | } 47 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/webcomponentsjs/entrypoints/webcomponents-bundle-index.js: -------------------------------------------------------------------------------- 1 | /** 2 | @license 3 | Copyright (c) 2018 The Polymer Project Authors. All rights reserved. 4 | This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | Code distributed by Google as part of the polymer project is also 8 | subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 'use strict'; 11 | 12 | /* 13 | * Polyfills loaded: HTML Imports, Custom Elements, Shady DOM/Shady CSS, platform polyfills, template 14 | * Used in: webcomponents bundle to load ALL the things 15 | */ 16 | 17 | import './webcomponents-sd-ce-pf-index.js'; 18 | 19 | const customElements = window.customElements; 20 | 21 | let shouldFlush = false; 22 | /** @type {?function()} */ 23 | let flusher = null; 24 | 25 | if (customElements['polyfillWrapFlushCallback']) { 26 | customElements['polyfillWrapFlushCallback']((flush) => { 27 | flusher = flush; 28 | if (shouldFlush) { 29 | flush(); 30 | } 31 | }); 32 | } 33 | 34 | function flushAndFire() { 35 | if (window.HTMLTemplateElement.bootstrap) { 36 | window.HTMLTemplateElement.bootstrap(window.document); 37 | } 38 | flusher && flusher(); 39 | shouldFlush = true; 40 | window.WebComponents.ready = true; 41 | document.dispatchEvent(new CustomEvent('WebComponentsReady', { bubbles: true })); 42 | } 43 | 44 | if (document.readyState !== 'complete') { 45 | // this script may come between DCL and load, so listen for both, and cancel load listener if DCL fires 46 | window.addEventListener('load', flushAndFire) 47 | window.addEventListener('DOMContentLoaded', () => { 48 | window.removeEventListener('load', flushAndFire); 49 | flushAndFire(); 50 | }); 51 | } else { 52 | flushAndFire(); 53 | } -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/gulpfile.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | 'use strict'; 12 | 13 | const compilerPackage = require('google-closure-compiler'); 14 | const gulp = require('gulp'); 15 | const sourcemaps = require('gulp-sourcemaps'); 16 | const rollup = require('rollup-stream'); 17 | const source = require('vinyl-source-stream'); 18 | 19 | const closureCompiler = compilerPackage.gulp(); 20 | 21 | gulp.task('default', () => { 22 | return gulp.src('./src/**/*.js', {base: './'}) 23 | .pipe(sourcemaps.init()) 24 | .pipe(closureCompiler({ 25 | compilation_level: 'ADVANCED', 26 | warning_level: 'VERBOSE', 27 | language_in: 'ECMASCRIPT6_STRICT', 28 | language_out: 'ECMASCRIPT5_STRICT', 29 | externs: ['externs/custom-elements.js'], 30 | dependency_mode: 'STRICT', 31 | entry_point: ['/src/custom-elements'], 32 | js_output_file: 'custom-elements.min.js', 33 | output_wrapper: '(function(){\n%output%\n}).call(self);', 34 | assume_function_wrapper: true, 35 | new_type_inf: true, 36 | rewrite_polyfills: false, 37 | })) 38 | .pipe(sourcemaps.write('/')) 39 | .pipe(gulp.dest('./')); 40 | }); 41 | 42 | gulp.task('debug', () => { 43 | return rollup({ 44 | entry: './src/custom-elements.js', 45 | format: 'iife', 46 | sourceMap: false, 47 | indent: true, 48 | }) 49 | .pipe(source('custom-elements.min.js')) 50 | .pipe(gulp.dest('./')); 51 | }); 52 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/js/closure.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | suite('Closure ES5 Output', function() { 12 | 13 | customElements.enableFlush = true; 14 | 15 | // Fails at a.prototype.constructor = a; 16 | // Closure needs to use Object.defineProperty? 17 | test.skip('Closure generated ES5 works', function() { 18 | 'use strict'; 19 | 20 | // Closure standard library code 21 | var $jscomp = {scope:{}, getGlobal:function(a) { 22 | return "undefined" != typeof window && window === a ? a : "undefined" != typeof global ? global : a; 23 | }}; 24 | $jscomp.global = $jscomp.getGlobal(this); 25 | $jscomp.inherits = function(a, b) { 26 | function c() { 27 | } 28 | c.prototype = b.prototype; 29 | a.prototype = new c; 30 | a.prototype.constructor = a; 31 | for (var d in b) { 32 | if ($jscomp.global.Object.defineProperties) { 33 | var e = $jscomp.global.Object.getOwnPropertyDescriptor(b, d); 34 | e && $jscomp.global.Object.defineProperty(a, d, e); 35 | } else { 36 | a[d] = b[d]; 37 | } 38 | } 39 | }; 40 | 41 | // Compiled test 42 | var XFoo = function(a) { 43 | HTMLElement.apply(this, arguments); 44 | }; 45 | $jscomp.inherits(XFoo, HTMLElement); 46 | customElements.define("x-foo", XFoo); 47 | var xfoo = new XFoo; 48 | assert.equal(xfoo.localName, "x-foo"); 49 | assert.instanceOf(xfoo, XFoo); 50 | }); 51 | 52 | }); 53 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/js/upgrade.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | suite('Upgrades', function() { 12 | var work; 13 | var assert = chai.assert; 14 | 15 | setup(function() { 16 | work = document.createElement('div'); 17 | document.body.appendChild(work); 18 | }); 19 | 20 | teardown(function() { 21 | document.body.removeChild(work); 22 | }); 23 | 24 | test('connected elements upgrade when defined', function() { 25 | work.innerHTML = ''; 26 | var e1 = work.firstChild; 27 | var e2 = e1.firstChild; 28 | 29 | class X1 extends HTMLElement {} 30 | class X2 extends HTMLElement {} 31 | customElements.define('x-markup-1', X1); 32 | customElements.define('x-markup-2', X2); 33 | 34 | assert.instanceOf(e1, X1); 35 | assert.instanceOf(e2, X2); 36 | }); 37 | 38 | test('defined disconnected elements upgrade when connected', function() { 39 | var e1 = document.createElement('x-disconnected-1'); 40 | var e2 = document.createElement('x-disconnected-2'); 41 | e1.appendChild(e2); 42 | 43 | class X1 extends HTMLElement {} 44 | class X2 extends HTMLElement {} 45 | customElements.define('x-disconnected-1', X1); 46 | customElements.define('x-disconnected-2', X2); 47 | 48 | // disconnected elements should not be upgraded 49 | assert.notInstanceOf(e1, X1); 50 | assert.notInstanceOf(e2, X2); 51 | 52 | // they should upgrade when connected 53 | work.appendChild(e1); 54 | assert.instanceOf(e1, X1); 55 | assert.instanceOf(e2, X2); 56 | }); 57 | 58 | }); 59 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/DocumentConstructionObserver.js: -------------------------------------------------------------------------------- 1 | import CustomElementInternals from './CustomElementInternals.js'; 2 | 3 | export default class DocumentConstructionObserver { 4 | constructor(internals, doc) { 5 | /** 6 | * @type {!CustomElementInternals} 7 | */ 8 | this._internals = internals; 9 | 10 | /** 11 | * @type {!Document} 12 | */ 13 | this._document = doc; 14 | 15 | /** 16 | * @type {MutationObserver|undefined} 17 | */ 18 | this._observer = undefined; 19 | 20 | 21 | // Simulate tree construction for all currently accessible nodes in the 22 | // document. 23 | this._internals.patchAndUpgradeTree(this._document); 24 | 25 | if (this._document.readyState === 'loading') { 26 | this._observer = new MutationObserver(this._handleMutations.bind(this)); 27 | 28 | // Nodes created by the parser are given to the observer *before* the next 29 | // task runs. Inline scripts are run in a new task. This means that the 30 | // observer will be able to handle the newly parsed nodes before the inline 31 | // script is run. 32 | this._observer.observe(this._document, { 33 | childList: true, 34 | subtree: true, 35 | }); 36 | } 37 | } 38 | 39 | disconnect() { 40 | if (this._observer) { 41 | this._observer.disconnect(); 42 | } 43 | } 44 | 45 | /** 46 | * @param {!Array} mutations 47 | */ 48 | _handleMutations(mutations) { 49 | // Once the document's `readyState` is 'interactive' or 'complete', all new 50 | // nodes created within that document will be the result of script and 51 | // should be handled by patching. 52 | const readyState = this._document.readyState; 53 | if (readyState === 'interactive' || readyState === 'complete') { 54 | this.disconnect(); 55 | } 56 | 57 | for (let i = 0; i < mutations.length; i++) { 58 | const addedNodes = mutations[i].addedNodes; 59 | for (let j = 0; j < addedNodes.length; j++) { 60 | const node = addedNodes[j]; 61 | this._internals.patchAndUpgradeTree(node); 62 | } 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/custom-elements/spec/resources/custom-elements-helpers.js: -------------------------------------------------------------------------------- 1 | function create_window_in_test(t, srcdoc) { 2 | let p = new Promise((resolve) => { 3 | let f = document.createElement('iframe'); 4 | srcdoc = srcdoc || ''; 5 | // srcdoc = `\n` + 6 | srcdoc = `\n` + 7 | `\n` + srcdoc; 8 | f.srcdoc = srcdoc; 9 | f.onload = (event) => { 10 | let w = f.contentWindow; 11 | t.add_cleanup(() => f.parentNode && f.remove()); 12 | resolve(w); 13 | }; 14 | document.body.appendChild(f); 15 | }); 16 | return p; 17 | } 18 | 19 | function test_with_window(f, name, srcdoc) { 20 | promise_test((t) => { 21 | return create_window_in_test(t, srcdoc) 22 | .then((w) => { 23 | f(w); 24 | }); 25 | }, name); 26 | } 27 | 28 | function assert_throws_dom_exception(global_context, code, func, description) { 29 | let exception; 30 | assert_throws(code, () => { 31 | try { 32 | func.call(this); 33 | } catch(e) { 34 | exception = e; 35 | throw e; 36 | } 37 | }, description); 38 | assert_true(exception instanceof global_context.DOMException, 'DOMException on the appropriate window'); 39 | } 40 | 41 | function assert_array_equals_callback_invocations(actual, expected, description) { 42 | assert_equals(actual.length, expected.length); 43 | for (let len=actual.length, i=0; i { 22 | this.flights = flights; 23 | }, 24 | err => console.error('Error loading flights', err) 25 | ); 26 | } 27 | 28 | find(from: string, to: string, urgent: boolean = false): Observable { 29 | 30 | // For offline access 31 | // let url = '/assets/data/data.json'; 32 | 33 | // For online access 34 | let url = [this.baseUrl, 'flight'].join('/'); 35 | 36 | if (urgent) { 37 | url = [this.baseUrl,'error?code=403'].join('/'); 38 | } 39 | 40 | let params = new HttpParams() 41 | .set('from', from) 42 | .set('to', to); 43 | 44 | let headers = new HttpHeaders() 45 | .set('Accept', 'application/json'); 46 | 47 | const reqObj = {params, headers}; 48 | return this.http.get(url, reqObj); 49 | // return of(flights).pipe(delay(this.reqDelay)) 50 | 51 | } 52 | 53 | findById(id: string): Observable { 54 | const reqObj = { params: null }; 55 | reqObj.params = new HttpParams().set('id', id); 56 | const url = [this.baseUrl, 'flight'].join('/'); 57 | return this.http.get(url, reqObj); 58 | // return of(flights[0]).pipe(delay(this.reqDelay)) 59 | } 60 | 61 | save(flight: Flight): Observable { 62 | const url = [this.baseUrl, 'flight'].join('/'); 63 | return this.http.post(url, flight); 64 | } 65 | 66 | delay() { 67 | const ONE_MINUTE = 1000 * 60; 68 | 69 | let oldFlights = this.flights; 70 | let oldFlight = oldFlights[0]; 71 | let oldDate = new Date(oldFlight.date); 72 | 73 | // Mutable 74 | // oldDate.setTime(oldDate.getTime() + 15 * ONE_MINUTE); 75 | // oldFlight.date = oldDate.toISOString(); 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Patch/Native.js: -------------------------------------------------------------------------------- 1 | export default { 2 | Document_createElement: window.Document.prototype.createElement, 3 | Document_createElementNS: window.Document.prototype.createElementNS, 4 | Document_importNode: window.Document.prototype.importNode, 5 | Document_prepend: window.Document.prototype['prepend'], 6 | Document_append: window.Document.prototype['append'], 7 | DocumentFragment_prepend: window.DocumentFragment.prototype['prepend'], 8 | DocumentFragment_append: window.DocumentFragment.prototype['append'], 9 | Node_cloneNode: window.Node.prototype.cloneNode, 10 | Node_appendChild: window.Node.prototype.appendChild, 11 | Node_insertBefore: window.Node.prototype.insertBefore, 12 | Node_removeChild: window.Node.prototype.removeChild, 13 | Node_replaceChild: window.Node.prototype.replaceChild, 14 | Node_textContent: Object.getOwnPropertyDescriptor(window.Node.prototype, 'textContent'), 15 | Element_attachShadow: window.Element.prototype['attachShadow'], 16 | Element_innerHTML: Object.getOwnPropertyDescriptor(window.Element.prototype, 'innerHTML'), 17 | Element_getAttribute: window.Element.prototype.getAttribute, 18 | Element_setAttribute: window.Element.prototype.setAttribute, 19 | Element_removeAttribute: window.Element.prototype.removeAttribute, 20 | Element_getAttributeNS: window.Element.prototype.getAttributeNS, 21 | Element_setAttributeNS: window.Element.prototype.setAttributeNS, 22 | Element_removeAttributeNS: window.Element.prototype.removeAttributeNS, 23 | Element_insertAdjacentElement: window.Element.prototype['insertAdjacentElement'], 24 | Element_insertAdjacentHTML: window.Element.prototype['insertAdjacentHTML'], 25 | Element_prepend: window.Element.prototype['prepend'], 26 | Element_append: window.Element.prototype['append'], 27 | Element_before: window.Element.prototype['before'], 28 | Element_after: window.Element.prototype['after'], 29 | Element_replaceWith: window.Element.prototype['replaceWith'], 30 | Element_remove: window.Element.prototype['remove'], 31 | HTMLElement: window.HTMLElement, 32 | HTMLElement_innerHTML: Object.getOwnPropertyDescriptor(window.HTMLElement.prototype, 'innerHTML'), 33 | HTMLElement_insertAdjacentElement: window.HTMLElement.prototype['insertAdjacentElement'], 34 | HTMLElement_insertAdjacentHTML: window.HTMLElement.prototype['insertAdjacentHTML'], 35 | }; 36 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Patch/Interface/ParentNode.js: -------------------------------------------------------------------------------- 1 | import CustomElementInternals from '../../CustomElementInternals.js'; 2 | import * as Utilities from '../../Utilities.js'; 3 | 4 | /** 5 | * @typedef {{ 6 | * prepend: !function(...(!Node|string)), 7 | * append: !function(...(!Node|string)), 8 | * }} 9 | */ 10 | let ParentNodeNativeMethods; 11 | 12 | /** 13 | * @param {!CustomElementInternals} internals 14 | * @param {!Object} destination 15 | * @param {!ParentNodeNativeMethods} builtIn 16 | */ 17 | export default function(internals, destination, builtIn) { 18 | /** 19 | * @param {!function(...(!Node|string))} builtInMethod 20 | * @return {!function(...(!Node|string))} 21 | */ 22 | function appendPrependPatch(builtInMethod) { 23 | return function(...nodes) { 24 | /** 25 | * A copy of `nodes`, with any DocumentFragment replaced by its children. 26 | * @type {!Array} 27 | */ 28 | const flattenedNodes = []; 29 | 30 | /** 31 | * Elements in `nodes` that were connected before this call. 32 | * @type {!Array} 33 | */ 34 | const connectedElements = []; 35 | 36 | for (var i = 0; i < nodes.length; i++) { 37 | const node = nodes[i]; 38 | 39 | if (node instanceof Element && Utilities.isConnected(node)) { 40 | connectedElements.push(node); 41 | } 42 | 43 | if (node instanceof DocumentFragment) { 44 | for (let child = node.firstChild; child; child = child.nextSibling) { 45 | flattenedNodes.push(child); 46 | } 47 | } else { 48 | flattenedNodes.push(node); 49 | } 50 | } 51 | 52 | builtInMethod.apply(this, nodes); 53 | 54 | for (let i = 0; i < connectedElements.length; i++) { 55 | internals.disconnectTree(connectedElements[i]); 56 | } 57 | 58 | if (Utilities.isConnected(this)) { 59 | for (let i = 0; i < flattenedNodes.length; i++) { 60 | const node = flattenedNodes[i]; 61 | if (node instanceof Element) { 62 | internals.connectTree(node); 63 | } 64 | } 65 | } 66 | }; 67 | } 68 | 69 | if (builtIn.prepend !== undefined) { 70 | Utilities.setPropertyUnchecked(destination, 'prepend', appendPrependPatch(builtIn.prepend)); 71 | } 72 | 73 | if (builtIn.append !== undefined) { 74 | Utilities.setPropertyUnchecked(destination, 'append', appendPrependPatch(builtIn.append)); 75 | } 76 | }; 77 | -------------------------------------------------------------------------------- /tslint.json: -------------------------------------------------------------------------------- 1 | { 2 | "rulesDirectory": [ 3 | "node_modules/@nrwl/workspace/src/tslint", 4 | "node_modules/codelyzer" 5 | ], 6 | "rules": { 7 | "arrow-return-shorthand": true, 8 | "callable-types": true, 9 | "class-name": true, 10 | "deprecation": { 11 | "severity": "warn" 12 | }, 13 | "forin": true, 14 | "import-blacklist": [true, "rxjs/Rx"], 15 | "interface-over-type-literal": true, 16 | "member-access": false, 17 | "member-ordering": [ 18 | true, 19 | { 20 | "order": [ 21 | "static-field", 22 | "instance-field", 23 | "static-method", 24 | "instance-method" 25 | ] 26 | } 27 | ], 28 | "no-arg": true, 29 | "no-bitwise": true, 30 | "no-console": [true, "debug", "info", "time", "timeEnd", "trace"], 31 | "no-construct": true, 32 | "no-debugger": true, 33 | "no-duplicate-super": true, 34 | "no-empty": false, 35 | "no-empty-interface": true, 36 | "no-eval": true, 37 | "no-inferrable-types": [true, "ignore-params"], 38 | "no-misused-new": true, 39 | "no-non-null-assertion": true, 40 | "no-shadowed-variable": true, 41 | "no-string-literal": false, 42 | "no-string-throw": true, 43 | "no-switch-case-fall-through": true, 44 | "no-unnecessary-initializer": true, 45 | "no-unused-expression": true, 46 | "no-var-keyword": true, 47 | "object-literal-sort-keys": false, 48 | "prefer-const": true, 49 | "radix": true, 50 | "triple-equals": [true, "allow-null-check"], 51 | "unified-signatures": true, 52 | "variable-name": false, 53 | "nx-enforce-module-boundaries": [ 54 | true, 55 | { 56 | "allow": [], 57 | "depConstraints": [ 58 | { 59 | "sourceTag": "*", 60 | "onlyDependOnLibsWithTags": ["*"] 61 | } 62 | ] 63 | } 64 | ], 65 | "directive-selector": [true, "attribute", "app", "camelCase"], 66 | "component-selector": [true, "element", "app", "kebab-case"], 67 | "no-conflicting-lifecycle": true, 68 | "no-host-metadata-property": true, 69 | "no-input-rename": true, 70 | "no-inputs-metadata-property": true, 71 | "no-output-native": true, 72 | "no-output-on-prefix": true, 73 | "no-output-rename": true, 74 | "no-outputs-metadata-property": true, 75 | "template-banana-in-box": true, 76 | "template-no-negated-async": true, 77 | "use-lifecycle-interface": true, 78 | "use-pipe-transform-interface": true 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Patch/HTMLElement.js: -------------------------------------------------------------------------------- 1 | import Native from './Native.js'; 2 | import CustomElementInternals from '../CustomElementInternals.js'; 3 | import CEState from '../CustomElementState.js'; 4 | import AlreadyConstructedMarker from '../AlreadyConstructedMarker.js'; 5 | 6 | /** 7 | * @param {!CustomElementInternals} internals 8 | */ 9 | export default function(internals) { 10 | window['HTMLElement'] = (function() { 11 | /** 12 | * @type {function(new: HTMLElement): !HTMLElement} 13 | */ 14 | function HTMLElement() { 15 | // This should really be `new.target` but `new.target` can't be emulated 16 | // in ES5. Assuming the user keeps the default value of the constructor's 17 | // prototype's `constructor` property, this is equivalent. 18 | /** @type {!Function} */ 19 | const constructor = this.constructor; 20 | 21 | const definition = internals.constructorToDefinition(constructor); 22 | if (!definition) { 23 | throw new Error('The custom element being constructed was not registered with `customElements`.'); 24 | } 25 | 26 | const constructionStack = definition.constructionStack; 27 | 28 | if (constructionStack.length === 0) { 29 | const element = Native.Document_createElement.call(document, definition.localName); 30 | Object.setPrototypeOf(element, constructor.prototype); 31 | element.__CE_state = CEState.custom; 32 | element.__CE_definition = definition; 33 | internals.patch(element); 34 | return element; 35 | } 36 | 37 | const lastIndex = constructionStack.length - 1; 38 | const element = constructionStack[lastIndex]; 39 | if (element === AlreadyConstructedMarker) { 40 | throw new Error('The HTMLElement constructor was either called reentrantly for this constructor or called multiple times.'); 41 | } 42 | constructionStack[lastIndex] = AlreadyConstructedMarker; 43 | 44 | Object.setPrototypeOf(element, constructor.prototype); 45 | internals.patch(/** @type {!HTMLElement} */ (element)); 46 | 47 | return element; 48 | } 49 | 50 | HTMLElement.prototype = Native.HTMLElement.prototype; 51 | // Safari 9 has `writable: false` on the propertyDescriptor 52 | // Make it writable so that TypeScript can patch up the 53 | // constructor in the ES5 compiled code. 54 | Object.defineProperty(HTMLElement.prototype, 'constructor', { 55 | writable: true, 56 | configurable: true, 57 | enumerable: false, 58 | value: HTMLElement 59 | }); 60 | 61 | return HTMLElement; 62 | })(); 63 | }; 64 | -------------------------------------------------------------------------------- /apps/flight-app/src/polyfills.ts: -------------------------------------------------------------------------------- 1 | /** 2 | * This file includes polyfills needed by Angular and is loaded before the app. 3 | * You can add your own extra polyfills to this file. 4 | * 5 | * This file is divided into 2 sections: 6 | * 1. Browser polyfills. These are applied before loading ZoneJS and are sorted by browsers. 7 | * 2. Application imports. Files imported after ZoneJS that should be loaded before your main 8 | * file. 9 | * 10 | * The current setup is for so-called "evergreen" browsers; the last versions of browsers that 11 | * automatically update themselves. This includes Safari >= 10, Chrome >= 55 (including Opera), 12 | * Edge >= 13 on the desktop, and iOS 10 and Chrome on mobile. 13 | * 14 | * Learn more in https://angular.io/docs/ts/latest/guide/browser-support.html 15 | */ 16 | /*************************************************************************************************** 17 | * BROWSER POLYFILLS 18 | */ 19 | /** IE9, IE10 and IE11 requires all of the following polyfills. **/ 20 | // import 'core-js/es6/symbol'; 21 | // import 'core-js/es6/object'; 22 | // import 'core-js/es6/function'; 23 | // import 'core-js/es6/parse-int'; 24 | // import 'core-js/es6/parse-float'; 25 | // import 'core-js/es6/number'; 26 | // import 'core-js/es6/math'; 27 | // import 'core-js/es6/string'; 28 | // import 'core-js/es6/date'; 29 | // import 'core-js/es6/array'; 30 | // import 'core-js/es6/regexp'; 31 | // import 'core-js/es6/map'; 32 | // import 'core-js/es6/weak-map'; 33 | // import 'core-js/es6/set'; 34 | /** IE10 and IE11 requires the following for NgClass support on SVG elements */ 35 | // import 'classlist.js'; // Run `npm install --save classlist.js`. 36 | /** Evergreen browsers require these. **/ 37 | import 'core-js/es6/reflect'; 38 | import 'core-js/es7/reflect'; 39 | /** 40 | * Required to support Web Animations `@angular/animation`. 41 | * Needed for: All but Chrome, Firefox and Opera. http://caniuse.com/#feat=web-animation 42 | **/ 43 | // import 'web-animations-js'; // Run `npm install --save web-animations-js`. 44 | /*************************************************************************************************** 45 | * Zone JS is required by Angular itself. 46 | */ 47 | import 'zone.js/dist/zone'; // Included with Angular CLI. 48 | 49 | 50 | /*************************************************************************************************** 51 | * APPLICATION IMPORTS 52 | */ 53 | 54 | /** 55 | * Date, currency, decimal and percent pipes. 56 | * Needed for: All but Chrome, Firefox, Edge, IE11 and Safari 10 57 | */ 58 | // import 'intl'; // Run `npm install --save intl`. 59 | /** 60 | * Need to import at least one locale-data with intl. 61 | */ 62 | // import 'intl/locale-data/jsonp/en'; -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Patch/Document.js: -------------------------------------------------------------------------------- 1 | import Native from './Native.js'; 2 | import CustomElementInternals from '../CustomElementInternals.js'; 3 | import * as Utilities from '../Utilities.js'; 4 | 5 | import PatchParentNode from './Interface/ParentNode.js'; 6 | 7 | /** 8 | * @param {!CustomElementInternals} internals 9 | */ 10 | export default function(internals) { 11 | Utilities.setPropertyUnchecked(Document.prototype, 'createElement', 12 | /** 13 | * @this {Document} 14 | * @param {string} localName 15 | * @return {!Element} 16 | */ 17 | function(localName) { 18 | // Only create custom elements if this document is associated with the registry. 19 | if (this.__CE_hasRegistry) { 20 | const definition = internals.localNameToDefinition(localName); 21 | if (definition) { 22 | return new (definition.constructor)(); 23 | } 24 | } 25 | 26 | const result = /** @type {!Element} */ 27 | (Native.Document_createElement.call(this, localName)); 28 | internals.patch(result); 29 | return result; 30 | }); 31 | 32 | Utilities.setPropertyUnchecked(Document.prototype, 'importNode', 33 | /** 34 | * @this {Document} 35 | * @param {!Node} node 36 | * @param {boolean=} deep 37 | * @return {!Node} 38 | */ 39 | function(node, deep) { 40 | const clone = Native.Document_importNode.call(this, node, deep); 41 | // Only create custom elements if this document is associated with the registry. 42 | if (!this.__CE_hasRegistry) { 43 | internals.patchTree(clone); 44 | } else { 45 | internals.patchAndUpgradeTree(clone); 46 | } 47 | return clone; 48 | }); 49 | 50 | const NS_HTML = "http://www.w3.org/1999/xhtml"; 51 | 52 | Utilities.setPropertyUnchecked(Document.prototype, 'createElementNS', 53 | /** 54 | * @this {Document} 55 | * @param {?string} namespace 56 | * @param {string} localName 57 | * @return {!Element} 58 | */ 59 | function(namespace, localName) { 60 | // Only create custom elements if this document is associated with the registry. 61 | if (this.__CE_hasRegistry && (namespace === null || namespace === NS_HTML)) { 62 | const definition = internals.localNameToDefinition(localName); 63 | if (definition) { 64 | return new (definition.constructor)(); 65 | } 66 | } 67 | 68 | const result = /** @type {!Element} */ 69 | (Native.Document_createElementNS.call(this, namespace, localName)); 70 | internals.patch(result); 71 | return result; 72 | }); 73 | 74 | PatchParentNode(internals, Document.prototype, { 75 | prepend: Native.Document_prepend, 76 | append: Native.Document_append, 77 | }); 78 | }; 79 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # NxFlights 2 | 3 | This project was generated using [Nx](https://nx.dev). 4 | 5 |

6 | 7 | 🔎 **Nx is a set of Extensible Dev Tools for Monorepos.** 8 | 9 | ## Quick Start & Documentation 10 | 11 | [Nx Documentation](https://nx.dev/angular) 12 | 13 | [10-minute video showing all Nx features](https://nx.dev/angular/getting-started/what-is-nx) 14 | 15 | [Interactive Tutorial](https://nx.dev/angular/tutorial/01-create-application) 16 | 17 | ## Adding capabilities to your workspace 18 | 19 | Nx supports many plugins which add capabilities for developing different types of applications and different tools. 20 | 21 | These capabilities include generating applications, libraries, etc as well as the devtools to test, and build projects as well. 22 | 23 | Below are some plugins which you can add to your workspace: 24 | 25 | - [Angular](https://angular.io) 26 | - `ng add @nrwl/angular` 27 | - [React](https://reactjs.org) 28 | - `ng add @nrwl/react` 29 | - Web (no framework frontends) 30 | - `ng add @nrwl/web` 31 | - [Nest](https://nestjs.com) 32 | - `ng add @nrwl/nest` 33 | - [Express](https://expressjs.com) 34 | - `ng add @nrwl/express` 35 | - [Node](https://nodejs.org) 36 | - `ng add @nrwl/node` 37 | 38 | ## Generate an application 39 | 40 | Run `ng g @nrwl/angular:app my-app` to generate an application. 41 | 42 | > You can use any of the plugins above to generate applications as well. 43 | 44 | When using Nx, you can create multiple applications and libraries in the same workspace. 45 | 46 | ## Generate a library 47 | 48 | Run `ng g @nrwl/angular:lib my-lib` to generate a library. 49 | 50 | > You can also use any of the plugins above to generate libraries as well. 51 | 52 | Libraries are sharable across libraries and applications. They can be imported from `@nx-flights/mylib`. 53 | 54 | ## Development server 55 | 56 | Run `ng serve my-app` for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files. 57 | 58 | ## Code scaffolding 59 | 60 | Run `ng g component my-component --project=my-app` to generate a new component. 61 | 62 | ## Build 63 | 64 | Run `ng build my-app` to build the project. The build artifacts will be stored in the `dist/` directory. Use the `--prod` flag for a production build. 65 | 66 | ## Running unit tests 67 | 68 | Run `ng test my-app` to execute the unit tests via [Jest](https://jestjs.io). 69 | 70 | Run `nx affected:test` to execute the unit tests affected by a change. 71 | 72 | ## Running end-to-end tests 73 | 74 | Run `ng e2e my-app` to execute the end-to-end tests via [Cypress](https://www.cypress.io). 75 | 76 | Run `nx affected:e2e` to execute the end-to-end tests affected by a change. 77 | 78 | ## Understand your workspace 79 | 80 | Run `nx dep-graph` to see a diagram of the dependencies of your projects. 81 | 82 | ## Further help 83 | 84 | Visit the [Nx Documentation](https://nx.dev/angular) to learn more. 85 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_misc.scss: -------------------------------------------------------------------------------- 1 | /* General overwrite */ 2 | .loader-container { 3 | position: fixed; 4 | width: 100%; 5 | height: 100%; 6 | text-align: center; 7 | } 8 | 9 | .loader, 10 | .loader:before, 11 | .loader:after { 12 | border-radius: 50%; 13 | width: 2.5em; 14 | height: 2.5em; 15 | -webkit-animation-fill-mode: both; 16 | animation-fill-mode: both; 17 | -webkit-animation: load7 1.8s infinite ease-in-out; 18 | animation: load7 1.8s infinite ease-in-out; 19 | } 20 | 21 | .loader { 22 | color: #9A9A9A; 23 | top: calc(50% - 40px); 24 | left: calc(50% - 10px); 25 | position: relative; 26 | font-size: 10px; 27 | -webkit-animation-delay: -0.16s; 28 | animation-delay: -0.16s; 29 | } 30 | 31 | .loader:before, 32 | .loader:after { 33 | content: ''; 34 | position: absolute; 35 | top: 0; 36 | } 37 | 38 | .loader:before { 39 | left: -3.5em; 40 | -webkit-animation-delay: -0.32s; 41 | animation-delay: -0.32s; 42 | } 43 | 44 | .loader:after { 45 | left: 3.5em; 46 | } 47 | 48 | @-webkit-keyframes load7 { 49 | 0%, 50 | 80%, 51 | 100% { 52 | box-shadow: 0 2.5em 0 -1.3em; 53 | } 54 | 40% { 55 | box-shadow: 0 2.5em 0 0; 56 | } 57 | } 58 | 59 | @keyframes load7 { 60 | 0%, 61 | 80%, 62 | 100% { 63 | box-shadow: 0 2.5em 0 -1.3em; 64 | } 65 | 40% { 66 | box-shadow: 0 2.5em 0 0; 67 | } 68 | } 69 | 70 | body { 71 | color: $font-color; 72 | font-size: $font-size-base; 73 | font-family: 'Muli', Arial, sans-serif; 74 | .wrapper { 75 | min-height: 100vh; 76 | position: relative; 77 | } 78 | } 79 | 80 | a { 81 | color: $info-color; 82 | 83 | &:hover, &:focus { 84 | color: $info-states-color; 85 | text-decoration: none; 86 | } 87 | } 88 | 89 | a:focus, a:active, 90 | button::-moz-focus-inner, 91 | input::-moz-focus-inner, 92 | select::-moz-focus-inner, 93 | input[type="file"] > input[type="button"]::-moz-focus-inner { 94 | outline: 0 !important; 95 | } 96 | 97 | .ui-slider-handle:focus, 98 | .navbar-toggle, 99 | input:focus, 100 | button:focus { 101 | outline: 0 !important; 102 | } 103 | 104 | /* Animations */ 105 | .form-control, 106 | .input-group-addon, 107 | .tagsinput, 108 | .navbar, 109 | .navbar .alert { 110 | @include transition($general-transition-time, $transition-linear); 111 | } 112 | 113 | .sidebar .nav a, 114 | .table > tbody > tr .td-actions .btn { 115 | @include transition($fast-transition-time, $transition-ease-in); 116 | } 117 | 118 | .btn { 119 | @include transition($ultra-fast-transition-time, $transition-ease-in); 120 | } 121 | 122 | .fa { 123 | width: 21px; 124 | text-align: center; 125 | } 126 | 127 | .fa-base { 128 | font-size: 1.25em !important; 129 | } 130 | 131 | .margin-top { 132 | margin-top: 50px; 133 | } 134 | 135 | hr { 136 | border-color: $medium-pale-bg; 137 | } 138 | 139 | .wrapper { 140 | position: relative; 141 | top: 0; 142 | height: 100vh; 143 | } 144 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_dropdown.scss: -------------------------------------------------------------------------------- 1 | .dropdown-menu { 2 | background-color: $pale-bg; 3 | border: 0 none; 4 | border-radius: $border-radius-extreme; 5 | display: block; 6 | margin-top: 10px; 7 | padding: 0px; 8 | position: absolute; 9 | visibility: hidden; 10 | z-index: 9000; 11 | 12 | @include opacity(0); 13 | @include box-shadow($dropdown-shadow); 14 | 15 | // the style for opening dropdowns on mobile devices; for the desktop version check the _responsive.scss file 16 | .open & { 17 | @include opacity(1); 18 | visibility: visible; 19 | } 20 | 21 | .divider { 22 | background-color: $medium-pale-bg; 23 | margin: 0px; 24 | } 25 | 26 | .dropdown-header { 27 | color: $dark-gray; 28 | font-size: $font-size-small; 29 | padding: $padding-dropdown-vertical $padding-dropdown-horizontal; 30 | } 31 | 32 | // the style for the dropdown menu that appears under select, it is different from the default one 33 | .select & { 34 | border-radius: $border-radius-bottom; 35 | @include box-shadow(none); 36 | @include transform-origin($select-coordinates); 37 | @include transform-scale(1); 38 | @include transition($fast-transition-time, $transition-linear); 39 | margin-top: -20px; 40 | } 41 | .select.open & { 42 | margin-top: -1px; 43 | } 44 | 45 | > li > a { 46 | color: $font-color; 47 | font-size: $font-size-base; 48 | padding: $padding-dropdown-vertical $padding-dropdown-horizontal; 49 | @include transition-none(); 50 | 51 | img { 52 | margin-top: -3px; 53 | } 54 | } 55 | > li > a:focus { 56 | outline: 0 !important; 57 | } 58 | 59 | .btn-group.select & { 60 | min-width: 100%; 61 | } 62 | 63 | > li:first-child > a { 64 | border-top-left-radius: $border-radius-extreme; 65 | border-top-right-radius: $border-radius-extreme; 66 | } 67 | 68 | > li:last-child > a { 69 | border-bottom-left-radius: $border-radius-extreme; 70 | border-bottom-right-radius: $border-radius-extreme; 71 | } 72 | 73 | .select & > li:first-child > a { 74 | border-radius: 0; 75 | border-bottom: 0 none; 76 | } 77 | 78 | > li > a:hover, 79 | > li > a:focus { 80 | background-color: $default-color; 81 | color: $fill-font-color; 82 | opacity: 1; 83 | text-decoration: none; 84 | } 85 | 86 | &.dropdown-primary > li > a:hover, 87 | &.dropdown-primary > li > a:focus { 88 | background-color: $primary-color; 89 | } 90 | &.dropdown-info > li > a:hover, 91 | &.dropdown-info > li > a:focus { 92 | background-color: $info-color; 93 | } 94 | &.dropdown-success > li > a:hover, 95 | &.dropdown-success > li > a:focus { 96 | background-color: $success-color; 97 | } 98 | &.dropdown-warning > li > a:hover, 99 | &.dropdown-warning > li > a:focus { 100 | background-color: $warning-color; 101 | } 102 | &.dropdown-danger > li > a:hover, 103 | &.dropdown-danger > li > a:focus { 104 | background-color: $danger-color; 105 | } 106 | 107 | } 108 | 109 | //fix bug for the select items in btn-group 110 | .btn-group.select { 111 | overflow: hidden; 112 | } 113 | 114 | .btn-group.select.open { 115 | overflow: visible; 116 | } 117 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_typography.scss: -------------------------------------------------------------------------------- 1 | h1, .h1, h2, .h2, h3, .h3, h4, .h4, h5, .h5, h6, .h6, p, .navbar, .brand, a, .td-name, td { 2 | -moz-osx-font-smoothing: grayscale; 3 | -webkit-font-smoothing: antialiased; 4 | font-family: 'Muli', "Helvetica", Arial, sans-serif; 5 | } 6 | 7 | h1, .h1, h2, .h2, h3, .h3, h4, .h4 { 8 | font-weight: $font-weight-normal; 9 | margin: $margin-large-vertical 0 $margin-base-vertical; 10 | } 11 | 12 | h1, .h1 { 13 | font-size: $font-size-h1; 14 | } 15 | 16 | h2, .h2 { 17 | font-size: $font-size-h2; 18 | } 19 | 20 | h3, .h3 { 21 | font-size: $font-size-h3; 22 | line-height: 1.4; 23 | margin: 20px 0 10px; 24 | } 25 | 26 | h4, .h4 { 27 | font-size: $font-size-h4; 28 | font-weight: $font-weight-bold; 29 | line-height: 1.2em; 30 | } 31 | 32 | h5, .h5 { 33 | font-size: $font-size-h5; 34 | font-weight: $font-weight-normal; 35 | line-height: 1.4em; 36 | margin-bottom: 15px; 37 | } 38 | 39 | h6, .h6 { 40 | font-size: $font-size-h6; 41 | font-weight: $font-weight-bold; 42 | text-transform: uppercase; 43 | } 44 | 45 | p { 46 | font-size: $font-paragraph; 47 | line-height: $line-height-general; 48 | } 49 | 50 | h1 small, h2 small, h3 small, h4 small, h5 small, h6 small, .h1 small, .h2 small, .h3 small, .h4 small, .h5 small, .h6 small, h1 .small, h2 .small, h3 .small, h4 .small, h5 .small, h6 .small, .h1 .small, .h2 .small, .h3 .small, .h4 .small, .h5 .small, .h6 .small { 51 | color: $dark-gray; 52 | font-weight: $font-weight-light; 53 | line-height: $line-height-general; 54 | } 55 | 56 | h1 small, h2 small, h3 small, h1 .small, h2 .small, h3 .small { 57 | font-size: 60%; 58 | } 59 | 60 | .title-uppercase { 61 | text-transform: uppercase; 62 | } 63 | 64 | blockquote { 65 | font-style: italic; 66 | } 67 | 68 | blockquote small { 69 | font-style: normal; 70 | } 71 | 72 | .text-muted { 73 | color: $medium-gray; 74 | } 75 | 76 | .text-primary, .text-primary:hover { 77 | color: $primary-states-color; 78 | } 79 | 80 | .text-info, .text-info:hover { 81 | color: $info-states-color; 82 | } 83 | 84 | .text-success, .text-success:hover { 85 | color: $success-states-color; 86 | } 87 | 88 | .text-warning, .text-warning:hover { 89 | color: $warning-states-color; 90 | } 91 | 92 | .text-danger, .text-danger:hover { 93 | color: $danger-states-color; 94 | } 95 | 96 | .glyphicon { 97 | line-height: 1; 98 | } 99 | 100 | strong { 101 | color: $default-states-color; 102 | } 103 | 104 | .icon-primary { 105 | color: $primary-color; 106 | } 107 | 108 | .icon-info { 109 | color: $info-color; 110 | } 111 | 112 | .icon-success { 113 | color: $success-color; 114 | } 115 | 116 | .icon-warning { 117 | color: $warning-color; 118 | } 119 | 120 | .icon-danger { 121 | color: $danger-color; 122 | } 123 | 124 | .chart-legend { 125 | .text-primary, .text-primary:hover { 126 | color: $primary-color; 127 | } 128 | .text-info, .text-info:hover { 129 | color: $info-color; 130 | } 131 | .text-success, .text-success:hover { 132 | color: $success-color; 133 | } 134 | .text-warning, .text-warning:hover { 135 | color: $warning-color; 136 | } 137 | .text-danger, .text-danger:hover { 138 | color: $danger-color; 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/resources/mojo-helpers.js: -------------------------------------------------------------------------------- 1 | /* 2 | * mojo-helpers contains extensions to testharness.js useful for consuming 3 | * and mocking Mojo services directly within test code. 4 | */ 5 | 'use strict'; 6 | 7 | // Fix up the global window.define, since all baked-in Mojo modules expect to 8 | // find it there. This define() also returns a promise to the module. 9 | let define = (function(){ 10 | let moduleCache = new Map(); 11 | 12 | return function(name, deps, factory) { 13 | let promise = moduleCache.get(name); 14 | if (promise === undefined) { 15 | // This promise must be cached as mojo.define will only call the factory 16 | // function the first time the module is defined. 17 | promise = new Promise(resolve => { 18 | mojo.define(name, deps, (...modules) => { 19 | let result = factory(...modules); 20 | resolve(result); 21 | return result; 22 | }); 23 | }); 24 | moduleCache.set(name, promise); 25 | } 26 | return promise; 27 | } 28 | })(); 29 | 30 | define('Mojo Helpers', [ 31 | 'mojo/public/js/core', 32 | 'mojo/public/js/router', 33 | 'mojo/public/js/support', 34 | 'content/public/renderer/frame_interfaces', 35 | 'content/public/renderer/interfaces', 36 | ], (core, router, support, frameInterfaces, interfaces) => { 37 | let tearDown = () => { 38 | frameInterfaces.clearInterfaceOverridesForTesting(); 39 | interfaces.clearInterfaceOverridesForTesting(); 40 | }; 41 | addEventListener('unload', tearDown); 42 | if (window.add_completion_callback) 43 | add_completion_callback(tearDown); 44 | 45 | return { 46 | core, 47 | router, 48 | support, 49 | frameInterfaces, 50 | interfaces, 51 | }; 52 | }); 53 | 54 | // Returns a promise to an object that exposes common Mojo module interfaces. 55 | // Additional modules to load can be specified in the |modules| parameter. The 56 | // result will contain them, in the same order, in the |modules| field. 57 | function loadMojoModules(name, modules = []) { 58 | return define('Mojo modules: ' + name, 59 | [ 'Mojo Helpers' ].concat(modules), 60 | (mojo, ...rest) => { 61 | mojo.modules = rest 62 | return mojo; 63 | }); 64 | } 65 | 66 | // Runs a promise_test which depends on the Mojo system API modules available to 67 | // all layout tests. The test implementation function is called with an Object 68 | // that exposes common Mojo module interfaces. 69 | function mojo_test(func, name, properties) { 70 | promise_test(() => loadMojoModules(name).then(mojo => { 71 | return Promise.resolve(func(mojo)); 72 | }), name, properties); 73 | } 74 | 75 | // Waits for a message to become available on a pipe. 76 | function mojo_wait_for_incoming_message(mojo, pipe) { 77 | return new Promise((resolve, reject) => { 78 | mojo.support.asyncWait(pipe, mojo.core.HANDLE_SIGNAL_READABLE, result => { 79 | if (result != mojo.core.RESULT_OK) { 80 | reject(result); 81 | return; 82 | } 83 | let buffer, handles; 84 | ({ result, buffer, handles } = mojo.core.readMessage(pipe, 0)); 85 | if (result !== mojo.core.RESULT_OK) { 86 | reject(result); 87 | return; 88 | } 89 | resolve({ buffer, handles }); 90 | }); 91 | }); 92 | }; 93 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/js/typescript.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | /* 12 | Original TypeScript source code used in this test suite: 13 | 14 | class XTypescript extends HTMLElement {} 15 | class XTypescript2 extends HTMLElement {} 16 | 17 | */ 18 | suite('TypeScript ES5 Output', function() { 19 | 20 | customElements.enableFlush = true; 21 | 22 | test('TypeScript generated ES5 works via new()', function() { 23 | var __extends = (this && this.__extends) || (function () { 24 | var extendStatics = Object.setPrototypeOf || 25 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 26 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 27 | return function (d, b) { 28 | extendStatics(d, b); 29 | function __() { this.constructor = d; } 30 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 31 | }; 32 | })(); 33 | var XTypescript = /** @class */ (function (_super) { 34 | __extends(XTypescript, _super); 35 | function XTypescript() { 36 | return _super !== null && _super.apply(this, arguments) || this; 37 | } 38 | return XTypescript; 39 | }(HTMLElement)); 40 | 41 | // register x-foo 42 | customElements.define('x-typescript', XTypescript); 43 | // create an instance via new 44 | var e = new XTypescript(); 45 | // test localName 46 | assert.equal(e.localName, 'x-typescript'); 47 | // test instanceof 48 | assert.instanceOf(e, XTypescript); 49 | }); 50 | 51 | test('TypeScript generated ES5 works via createElement', function() { 52 | var __extends = (this && this.__extends) || (function () { 53 | var extendStatics = Object.setPrototypeOf || 54 | ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || 55 | function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; 56 | return function (d, b) { 57 | extendStatics(d, b); 58 | function __() { this.constructor = d; } 59 | d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); 60 | }; 61 | })(); 62 | var XTypescript2 = /** @class */ (function (_super) { 63 | __extends(XTypescript2, _super); 64 | function XTypescript2() { 65 | return _super !== null && _super.apply(this, arguments) || this; 66 | } 67 | return XTypescript2; 68 | }(HTMLElement)); 69 | 70 | // register x-foo 71 | customElements.define('x-typescript2', XTypescript2); 72 | // create an instance via new 73 | var e = document.createElement('x-typescript2'); 74 | // test localName 75 | assert.equal(e.localName, 'x-typescript2'); 76 | // test instanceof 77 | assert.instanceOf(e, XTypescript2); 78 | 79 | }); 80 | 81 | }); 82 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/js/instanceof.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | suite('Built-in Element instanceof', function() { 12 | 13 | test('Built-in Elements are instanceof HTMLElement', function() { 14 | 'use strict'; 15 | 16 | // All tags implementing the HTMLElement interface, according to: 17 | // https://html.spec.whatwg.org/multipage/indices.html#element-interfaces 18 | var elements = [ 19 | 'a', 20 | 'abbr', 21 | 'address', 22 | 'area', 23 | 'article', 24 | 'aside', 25 | 'audio', 26 | 'b', 27 | 'base', 28 | 'bdi', 29 | 'bdo', 30 | 'blockquote', 31 | 'body', 32 | 'br', 33 | 'button', 34 | 'canvas', 35 | 'caption', 36 | 'cite', 37 | 'code', 38 | 'col', 39 | 'colgroup', 40 | 'menuitem', 41 | 'data', 42 | 'datalist', 43 | 'dd', 44 | 'del', 45 | 'details', 46 | 'dfn', 47 | 'dialog', 48 | 'div', 49 | 'dl', 50 | 'dt', 51 | 'em', 52 | 'embed', 53 | 'fieldset', 54 | 'figcaption', 55 | 'figure', 56 | 'footer', 57 | 'form', 58 | 'h1', 59 | 'h2', 60 | 'h3', 61 | 'h4', 62 | 'h5', 63 | 'h6', 64 | 'head', 65 | 'header', 66 | 'hgroup', 67 | 'hr', 68 | 'html', 69 | 'i', 70 | 'iframe', 71 | 'img', 72 | 'input', 73 | 'ins', 74 | 'kbd', 75 | 'keygen', 76 | 'label', 77 | 'legend', 78 | 'li', 79 | 'link', 80 | 'main', 81 | 'map', 82 | 'mark', 83 | 'menu', 84 | 'meta', 85 | 'meter', 86 | 'nav', 87 | 'noscript', 88 | 'object', 89 | 'ol', 90 | 'optgroup', 91 | 'option', 92 | 'output', 93 | 'p', 94 | 'param', 95 | 'picture', 96 | 'pre', 97 | 'progress', 98 | 'q', 99 | 'rp', 100 | 'rt', 101 | 'ruby', 102 | 's', 103 | 'samp', 104 | 'script', 105 | 'section', 106 | 'select', 107 | 'slot', 108 | 'small', 109 | 'source', 110 | 'span', 111 | 'strong', 112 | 'style', 113 | 'sub', 114 | 'summary', 115 | 'sup', 116 | 'table', 117 | 'tbody', 118 | 'td', 119 | 'template', 120 | 'textarea', 121 | 'tfoot', 122 | 'th', 123 | 'thead', 124 | 'time', 125 | 'title', 126 | 'tr', 127 | 'track', 128 | 'u', 129 | 'ul', 130 | 'var', 131 | 'video', 132 | 'wbr', 133 | ]; 134 | 135 | for (var i = 0; i < elements.length; i++) { 136 | var tag = elements[i]; 137 | var e = document.createElement(tag); 138 | assert.isTrue(e instanceof HTMLElement, tag + ' not instanceof HTMLElement'); 139 | } 140 | 141 | }); 142 | 143 | }); 144 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_buttons.scss: -------------------------------------------------------------------------------- 1 | .btn, 2 | .navbar .navbar-nav > li > a.btn { 3 | border-radius: $border-radius-btn-base; 4 | box-sizing: border-box; 5 | border-width: $border-thick; 6 | background-color: $transparent-bg; 7 | font-size: $font-size-base; 8 | font-weight: $font-weight-semi; 9 | 10 | padding: $padding-base-vertical $padding-base-horizontal; 11 | 12 | @include btn-styles($default-color, $default-states-color); 13 | @include transition($fast-transition-time, linear); 14 | 15 | &:hover, 16 | &:focus { 17 | outline: 0 !important; 18 | } 19 | &:active, 20 | &.active, 21 | .open > &.dropdown-toggle { 22 | @include box-shadow(none); 23 | outline: 0 !important; 24 | } 25 | 26 | &.btn-icon { 27 | padding: $padding-base-vertical; 28 | } 29 | } 30 | 31 | .btn-group .btn + .btn, 32 | .btn-group .btn + .btn-group, 33 | .btn-group .btn-group + .btn, 34 | .btn-group .btn-group + .btn-group { 35 | margin-left: -2px; 36 | } 37 | 38 | // Apply the mixin to the buttons 39 | //.btn-default { @include btn-styles($default-color, $default-states-color); } 40 | .navbar .navbar-nav > li > a.btn-primary, .btn-primary { 41 | @include btn-styles($primary-color, $primary-states-color); 42 | } 43 | 44 | .navbar .navbar-nav > li > a.btn-success, .btn-success { 45 | @include btn-styles($success-color, $success-states-color); 46 | } 47 | 48 | .navbar .navbar-nav > li > a.btn-info, .btn-info { 49 | @include btn-styles($info-color, $info-states-color); 50 | } 51 | 52 | .navbar .navbar-nav > li > a.btn-warning, .btn-warning { 53 | @include btn-styles($warning-color, $warning-states-color); 54 | } 55 | 56 | .navbar .navbar-nav > li > a.btn-danger, .btn-danger { 57 | @include btn-styles($danger-color, $danger-states-color); 58 | } 59 | 60 | .btn-neutral { 61 | @include btn-styles($white-color, $white-color); 62 | 63 | &:hover, 64 | &:focus { 65 | color: $default-color; 66 | } 67 | 68 | &:active, 69 | &.active, 70 | .open > &.dropdown-toggle { 71 | background-color: $white-color; 72 | color: $default-color; 73 | } 74 | 75 | &.btn-fill { 76 | color: $default-color; 77 | } 78 | &.btn-fill:hover, 79 | &.btn-fill:focus { 80 | color: $default-states-color; 81 | } 82 | 83 | &.btn-simple:active, 84 | &.btn-simple.active { 85 | background-color: transparent; 86 | } 87 | } 88 | 89 | .btn { 90 | &:disabled, 91 | &[disabled], 92 | &.disabled { 93 | @include opacity(.5); 94 | } 95 | } 96 | 97 | .btn-simple { 98 | border: $none; 99 | padding: $padding-base-vertical $padding-base-horizontal; 100 | 101 | &.btn-icon { 102 | padding: $padding-base-vertical; 103 | } 104 | } 105 | 106 | .btn-lg { 107 | @include btn-size($padding-large-vertical, $padding-large-horizontal, $font-size-large, $border-radius-btn-large, $line-height-small); 108 | font-weight: $font-weight-normal; 109 | } 110 | 111 | .btn-sm { 112 | @include btn-size($padding-small-vertical, $padding-small-horizontal, $font-size-small, $border-radius-btn-small, $line-height-small); 113 | } 114 | 115 | .btn-xs { 116 | @include btn-size($padding-xs-vertical, $padding-xs-horizontal, $font-size-xs, $border-radius-btn-small, $line-height-small); 117 | } 118 | 119 | .btn-wd { 120 | min-width: 140px; 121 | } 122 | 123 | .btn-group.select { 124 | width: 100%; 125 | } 126 | 127 | .btn-group.select .btn { 128 | text-align: left; 129 | } 130 | 131 | .btn-group.select .caret { 132 | position: absolute; 133 | top: 50%; 134 | margin-top: -1px; 135 | right: 8px; 136 | } 137 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/js/babel.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2014 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | suite('Babel ES5 Output', function() { 12 | 13 | customElements.enableFlush = true; 14 | 15 | test('Babel generated ES5 works via new()', function() { 16 | 'use strict'; 17 | 18 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 19 | 20 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 21 | 22 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 23 | 24 | var XBabel = function (_HTMLElement) { 25 | _inherits(XBabel, _HTMLElement); 26 | 27 | function XBabel() { 28 | _classCallCheck(this, XBabel); 29 | 30 | return _possibleConstructorReturn(this, Object.getPrototypeOf(XBabel).call(this)); 31 | } 32 | 33 | return XBabel; 34 | }(HTMLElement); 35 | 36 | // register x-foo 37 | customElements.define('x-babel', XBabel); 38 | // create an instance via new 39 | var e = new XBabel(); 40 | // test localName 41 | assert.equal(e.localName, 'x-babel'); 42 | // test instanceof 43 | assert.instanceOf(e, XBabel); 44 | }); 45 | 46 | test('Babel generated ES5 works via createElement', function() { 47 | 'use strict'; 48 | 49 | function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } } 50 | 51 | function _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return call && (typeof call === "object" || typeof call === "function") ? call : self; } 52 | 53 | function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function, not " + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; } 54 | 55 | var XBabel2 = function (_HTMLElement) { 56 | _inherits(XBabel2, _HTMLElement); 57 | 58 | function XBabel2() { 59 | _classCallCheck(this, XBabel2); 60 | 61 | return _possibleConstructorReturn(this, Object.getPrototypeOf(XBabel2).call(this)); 62 | } 63 | 64 | return XBabel2; 65 | }(HTMLElement); 66 | 67 | // register x-foo 68 | customElements.define('x-babel2', XBabel2); 69 | // create an instance via new 70 | var e = document.createElement('x-babel2'); 71 | // test localName 72 | assert.equal(e.localName, 'x-babel2'); 73 | // test instanceof 74 | assert.instanceOf(e, XBabel2); 75 | }); 76 | 77 | }); 78 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/mixins/_chartist.scss: -------------------------------------------------------------------------------- 1 | // Scales for responsive SVG containers 2 | $ct-scales: ((1), (15/16), (8/9), (5/6), (4/5), (3/4), (2/3), (5/8), (1/1.618), (3/5), (9/16), (8/15), (1/2), (2/5), (3/8), (1/3), (1/4)) !default; 3 | $ct-scales-names: (ct-square, ct-minor-second, ct-major-second, ct-minor-third, ct-major-third, ct-perfect-fourth, ct-perfect-fifth, ct-minor-sixth, ct-golden-section, ct-major-sixth, ct-minor-seventh, ct-major-seventh, ct-octave, ct-major-tenth, ct-major-eleventh, ct-major-twelfth, ct-double-octave) !default; 4 | 5 | // Class names to be used when generating CSS 6 | $ct-class-chart: ct-chart !default; 7 | $ct-class-chart-line: ct-chart-line !default; 8 | $ct-class-chart-bar: ct-chart-bar !default; 9 | $ct-class-horizontal-bars: ct-horizontal-bars !default; 10 | $ct-class-chart-pie: ct-chart-pie !default; 11 | $ct-class-chart-donut: ct-chart-donut !default; 12 | $ct-class-label: ct-label !default; 13 | $ct-class-series: ct-series !default; 14 | $ct-class-line: ct-line !default; 15 | $ct-class-point: ct-point !default; 16 | $ct-class-area: ct-area !default; 17 | $ct-class-bar: ct-bar !default; 18 | $ct-class-slice-pie: ct-slice-pie !default; 19 | $ct-class-slice-donut: ct-slice-donut !default; 20 | $ct-class-grid: ct-grid !default; 21 | $ct-class-vertical: ct-vertical !default; 22 | $ct-class-horizontal: ct-horizontal !default; 23 | $ct-class-start: ct-start !default; 24 | $ct-class-end: ct-end !default; 25 | 26 | // Container ratio 27 | $ct-container-ratio: (1/1.618) !default; 28 | 29 | // Text styles for labels 30 | $ct-text-color: rgba(0, 0, 0, 0.4) !default; 31 | $ct-text-size: 0.9em !default; 32 | $ct-text-align: flex-start !default; 33 | $ct-text-justify: flex-start !default; 34 | $ct-text-line-height: 1; 35 | 36 | // Grid styles 37 | $ct-grid-color: rgba(0, 0, 0, 0.2) !default; 38 | $ct-grid-dasharray: 2px !default; 39 | $ct-grid-width: 1px !default; 40 | 41 | // Line chart properties 42 | $ct-line-width: 4px !default; 43 | $ct-line-dasharray: false !default; 44 | $ct-point-size: 10px !default; 45 | // Line chart point, can be either round or square 46 | $ct-point-shape: round !default; 47 | // Area fill transparency between 0 and 1 48 | $ct-area-opacity: 0.7 !default; 49 | 50 | // Bar chart bar width 51 | $ct-bar-width: 10px !default; 52 | 53 | // Donut width (If donut width is to big it can cause issues where the shape gets distorted) 54 | $ct-donut-width: 60px !default; 55 | 56 | // If set to true it will include the default classes and generate CSS output. If you're planning to use the mixins you 57 | // should set this property to false 58 | $ct-include-classes: true !default; 59 | 60 | // If this is set to true the CSS will contain colored series. You can extend or change the color with the 61 | // properties below 62 | $ct-include-colored-series: $ct-include-classes !default; 63 | 64 | // If set to true this will include all responsive container variations using the scales defined at the top of the script 65 | $ct-include-alternative-responsive-containers: $ct-include-classes !default; 66 | 67 | // Series names and colors. This can be extended or customized as desired. Just add more series and colors. 68 | $ct-series-names: (a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) !default; 69 | $ct-series-colors: ( 70 | $info-color, 71 | $warning-color, 72 | $danger-color, 73 | $success-color, 74 | $primary-color, 75 | rgba($info-color, .8), 76 | rgba($success-color, .8), 77 | rgba($warning-color, .8), 78 | rgba($danger-color, .8), 79 | rgba($primary-color, .8), 80 | rgba($info-color, .6), 81 | rgba($success-color, .6), 82 | rgba($warning-color, .6), 83 | rgba($danger-color, .6), 84 | rgba($primary-color, .6) 85 | ) !default; 86 | 87 | // Paper Kit Colors 88 | 89 | .ct-blue { 90 | stroke: $primary-color !important; 91 | } 92 | 93 | .ct-azure { 94 | stroke: $info-color !important; 95 | } 96 | 97 | .ct-green { 98 | stroke: $success-color !important; 99 | } 100 | 101 | .ct-orange { 102 | stroke: $warning-color !important; 103 | } 104 | 105 | .ct-red { 106 | stroke: $danger-color !important; 107 | } 108 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/resources/intersection-observer-helper-functions.js: -------------------------------------------------------------------------------- 1 | // Some of the js-test.js boilerplate will add stuff to the top of the document early 2 | // enough to screw with frame offsets that are measured by the test. Delay all that 3 | // jazz until the actual test code is finished. 4 | if (self.isJsTest) { 5 | setPrintTestResultsLazily(); 6 | self.jsTestIsAsync = true; 7 | } 8 | 9 | // waitForNotification is a requestIdleCallback wrapped in a setTimeout wrapped in a 10 | // requestAnimationFrame. What in the wide, wide world of sports is going on here? 11 | // 12 | // Here's the order of events: 13 | // 14 | // - firstTestFunction 15 | // - Change layout to generate new IntersectionObserver notifications. 16 | // - waitForNotification(secondTestFunction) 17 | // - requestAnimationFrame 18 | // - BeginFrame 19 | // - requestAnimationFrame handler runs. 20 | // - setTimeout 21 | // - FrameView::updateAllLifecyclePhases 22 | // - IntersectionObserver generates notification based on the new layout. 23 | // - Post idle task to deliver notification. 24 | // - setTimeout handler runs. 25 | // - testRunner.runIdleTasks or requestIdleCallback. 26 | // - Idle tasks run -- more or less immediately if (self.testRunner), 27 | // possibly delayed if (!self.testRunner). 28 | // - IntersectionObserver notifications are delivered. 29 | // - secondTestFunction 30 | // - Verify notifications generated by firstTestFunction. 31 | // - Change layout to generate new IntersectionObserver notifications. 32 | // - waitForNotification(thirdTestFunction) 33 | // 34 | // Note that this should work equally well in these operation conditions: 35 | // 36 | // - layout test using single-threaded compositing (the default) 37 | // - layout test using multi-threaded compositing (virtual/threaded/) 38 | // - Not in a layout test and using multi-threaded compositing (the only configuration we ship) 39 | function waitForNotification(f) { 40 | requestAnimationFrame(() => { 41 | setTimeout(() => { 42 | if (self.testRunner) 43 | testRunner.runIdleTasks(f); 44 | else 45 | requestIdleCallback(f); 46 | }); 47 | }); 48 | } 49 | 50 | function rectToString(rect) { 51 | return "[" + rect.left + ", " + rect.right + ", " + rect.top + ", " + rect.bottom + "]"; 52 | } 53 | 54 | function entryToString(entry) { 55 | var ratio = ((entry.intersectionRect.width * entry.intersectionRect.height) / 56 | (entry.boundingClientRect.width * entry.boundingClientRect.height)); 57 | return ( 58 | "boundingClientRect=" + rectToString(entry.boundingClientRect) + "\n" + 59 | "intersectionRect=" + rectToString(entry.intersectionRect) + "\n" + 60 | "visibleRatio=" + ratio + "\n" + 61 | "rootBounds=" + rectToString(entry.rootBounds) + "\n" + 62 | "target=" + entry.target + "\n" + 63 | "time=" + entry.time); 64 | } 65 | 66 | function rectArea(rect) { 67 | return (rect.left - rect.right) * (rect.bottom - rect.top); 68 | } 69 | 70 | function intersectionRatio(entry) { 71 | var targetArea = rectArea(entry.boundingClientRect); 72 | if (!targetArea) 73 | return 0; 74 | return rectArea(entry.intersectionRect) / targetArea; 75 | } 76 | 77 | function clientRectToJson(rect) { 78 | if (!rect) 79 | return null; 80 | return { 81 | top: rect.top, 82 | right: rect.right, 83 | bottom: rect.bottom, 84 | left: rect.left, 85 | width: rect.width, 86 | height: rect.height 87 | }; 88 | } 89 | 90 | function coordinatesToClientRectJson(top, right, bottom, left) { 91 | return { 92 | top: top, 93 | right: right, 94 | bottom: bottom, 95 | left: left, 96 | width: right - left, 97 | height: bottom - top 98 | }; 99 | } 100 | 101 | function entryToJson(entry) { 102 | return { 103 | boundingClientRect: clientRectToJson(entry.boundingClientRect), 104 | intersectionRect: clientRectToJson(entry.intersectionRect), 105 | rootBounds: clientRectToJson(entry.rootBounds), 106 | time: entry.time, 107 | target: entry.target.id 108 | }; 109 | } 110 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_navbars.scss: -------------------------------------------------------------------------------- 1 | .nav { 2 | > li { 3 | > a:hover, 4 | > a:focus { 5 | background-color: transparent; 6 | } 7 | } 8 | } 9 | 10 | .navbar { 11 | border: $none; 12 | border-radius: 0; 13 | font-size: $font-size-navbar; 14 | 15 | .navbar-brand { 16 | font-weight: $font-weight-bold; 17 | margin: $navbar-margin-brand; 18 | padding: $navbar-padding-brand; 19 | font-size: $font-size-large-navbar; 20 | } 21 | .navbar-nav { 22 | > li > a { 23 | line-height: 1.42857; 24 | margin: $navbar-margin-a; 25 | padding: $navbar-padding-a; 26 | 27 | i, 28 | p { 29 | display: inline-block; 30 | margin: 0; 31 | } 32 | i { 33 | position: relative; 34 | top: 1px; 35 | } 36 | } 37 | > li > a.btn { 38 | margin: $navbar-margin-a-btn; 39 | padding: $padding-base-vertical $padding-base-horizontal; 40 | } 41 | } 42 | .btn { 43 | margin: $navbar-margin-btn; 44 | font-size: $font-size-base; 45 | } 46 | .btn-simple { 47 | font-size: $font-size-medium; 48 | } 49 | } 50 | 51 | .navbar-nav > li > .dropdown-menu { 52 | border-radius: $border-radius-extreme; 53 | margin-top: -5px; 54 | } 55 | 56 | .navbar-default { 57 | background-color: $bg-nude; 58 | border-bottom: 1px solid $medium-gray; 59 | 60 | .brand { 61 | color: $font-color !important; 62 | } 63 | .navbar-nav { 64 | > li > a:not(.btn) { 65 | color: $dark-gray; 66 | } 67 | 68 | > .active > a, 69 | > .active > a:not(.btn):hover, 70 | > .active > a:not(.btn):focus, 71 | > li > a:not(.btn):hover, 72 | > li > a:not(.btn):focus { 73 | background-color: transparent; 74 | border-radius: 3px; 75 | color: $info-color; 76 | @include opacity(1); 77 | } 78 | 79 | > .dropdown > a:hover .caret, 80 | > .dropdown > a:focus .caret { 81 | border-bottom-color: $info-color; 82 | border-top-color: $info-color; 83 | 84 | } 85 | 86 | > .open > a, 87 | > .open > a:hover, 88 | > .open > a:focus { 89 | background-color: transparent; 90 | color: $info-color; 91 | } 92 | 93 | .navbar-toggle:hover, .navbar-toggle:focus { 94 | background-color: transparent; 95 | } 96 | 97 | } 98 | 99 | &:not(.navbar-transparent) .btn-default:hover { 100 | color: $info-color; 101 | border-color: $info-color; 102 | } 103 | &:not(.navbar-transparent) .btn-neutral, 104 | &:not(.navbar-transparent) .btn-neutral:hover, 105 | &:not(.navbar-transparent) .btn-neutral:active { 106 | color: $dark-gray; 107 | } 108 | } 109 | 110 | .navbar-form { 111 | @include box-shadow(none); 112 | .form-control { 113 | @include light-form(); 114 | height: 22px; 115 | font-size: $font-size-navbar; 116 | line-height: $line-height-general; 117 | color: $light-gray; 118 | } 119 | .navbar-transparent & .form-control, 120 | [class*="navbar-ct"] & .form-control { 121 | color: $white-color; 122 | border: $none; 123 | border-bottom: 1px solid rgba($white-color, .6); 124 | } 125 | 126 | } 127 | 128 | .navbar-ct-primary { 129 | @include navbar-color($bg-primary); 130 | } 131 | 132 | .navbar-ct-info { 133 | @include navbar-color($bg-info); 134 | } 135 | 136 | .navbar-ct-success { 137 | @include navbar-color($bg-success); 138 | } 139 | 140 | .navbar-ct-warning { 141 | @include navbar-color($bg-warning); 142 | } 143 | 144 | .navbar-ct-danger { 145 | @include navbar-color($bg-danger); 146 | } 147 | 148 | .navbar-transparent { 149 | padding-top: 15px; 150 | background-color: transparent; 151 | border-bottom: 1px solid transparent; 152 | } 153 | 154 | .navbar-toggle { 155 | margin-top: 19px; 156 | margin-bottom: 19px; 157 | border: $none; 158 | 159 | .icon-bar { 160 | background-color: $white-color; 161 | } 162 | .navbar-collapse, 163 | .navbar-form { 164 | border-color: transparent; 165 | } 166 | 167 | &.navbar-default .navbar-toggle:hover, 168 | &.navbar-default .navbar-toggle:focus { 169 | background-color: transparent; 170 | } 171 | } 172 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_animate.scss: -------------------------------------------------------------------------------- 1 | // This file was modified by Creative Tim to keep only the animation that we need for Bootstrap Notify 2 | 3 | @charset "UTF-8"; 4 | 5 | /* 6 | Animate.css - http://daneden.me/animate 7 | Licensed under the MIT license - http://opensource.org/licenses/MIT 8 | 9 | Copyright (c) 2015 Daniel Eden 10 | */ 11 | 12 | .animated { 13 | -webkit-animation-duration: 1s; 14 | animation-duration: 1s; 15 | -webkit-animation-fill-mode: both; 16 | animation-fill-mode: both; 17 | } 18 | 19 | .animated.infinite { 20 | -webkit-animation-iteration-count: infinite; 21 | animation-iteration-count: infinite; 22 | } 23 | 24 | .animated.hinge { 25 | -webkit-animation-duration: 2s; 26 | animation-duration: 2s; 27 | } 28 | 29 | .animated.bounceIn, 30 | .animated.bounceOut { 31 | -webkit-animation-duration: .75s; 32 | animation-duration: .75s; 33 | } 34 | 35 | .animated.flipOutX, 36 | .animated.flipOutY { 37 | -webkit-animation-duration: .75s; 38 | animation-duration: .75s; 39 | } 40 | 41 | @-webkit-keyframes shake { 42 | from, to { 43 | -webkit-transform: translate3d(0, 0, 0); 44 | transform: translate3d(0, 0, 0); 45 | } 46 | 47 | 10%, 30%, 50%, 70%, 90% { 48 | -webkit-transform: translate3d(-10px, 0, 0); 49 | transform: translate3d(-10px, 0, 0); 50 | } 51 | 52 | 20%, 40%, 60%, 80% { 53 | -webkit-transform: translate3d(10px, 0, 0); 54 | transform: translate3d(10px, 0, 0); 55 | } 56 | } 57 | 58 | @keyframes shake { 59 | from, to { 60 | -webkit-transform: translate3d(0, 0, 0); 61 | transform: translate3d(0, 0, 0); 62 | } 63 | 64 | 10%, 30%, 50%, 70%, 90% { 65 | -webkit-transform: translate3d(-10px, 0, 0); 66 | transform: translate3d(-10px, 0, 0); 67 | } 68 | 69 | 20%, 40%, 60%, 80% { 70 | -webkit-transform: translate3d(10px, 0, 0); 71 | transform: translate3d(10px, 0, 0); 72 | } 73 | } 74 | 75 | .shake { 76 | -webkit-animation-name: shake; 77 | animation-name: shake; 78 | } 79 | 80 | @-webkit-keyframes fadeInDown { 81 | from { 82 | opacity: 0; 83 | -webkit-transform: translate3d(0, -100%, 0); 84 | transform: translate3d(0, -100%, 0); 85 | } 86 | 87 | to { 88 | opacity: 1; 89 | -webkit-transform: none; 90 | transform: none; 91 | } 92 | } 93 | 94 | @keyframes fadeInDown { 95 | from { 96 | opacity: 0; 97 | -webkit-transform: translate3d(0, -100%, 0); 98 | transform: translate3d(0, -100%, 0); 99 | } 100 | 101 | to { 102 | opacity: 1; 103 | -webkit-transform: none; 104 | transform: none; 105 | } 106 | } 107 | 108 | .fadeInDown { 109 | -webkit-animation-name: fadeInDown; 110 | animation-name: fadeInDown; 111 | } 112 | 113 | @-webkit-keyframes fadeOut { 114 | from { 115 | opacity: 1; 116 | } 117 | 118 | to { 119 | opacity: 0; 120 | } 121 | } 122 | 123 | @keyframes fadeOut { 124 | from { 125 | opacity: 1; 126 | } 127 | 128 | to { 129 | opacity: 0; 130 | } 131 | } 132 | 133 | .fadeOut { 134 | -webkit-animation-name: fadeOut; 135 | animation-name: fadeOut; 136 | } 137 | 138 | @-webkit-keyframes fadeOutDown { 139 | from { 140 | opacity: 1; 141 | } 142 | 143 | to { 144 | opacity: 0; 145 | -webkit-transform: translate3d(0, 100%, 0); 146 | transform: translate3d(0, 100%, 0); 147 | } 148 | } 149 | 150 | @keyframes fadeOutDown { 151 | from { 152 | opacity: 1; 153 | } 154 | 155 | to { 156 | opacity: 0; 157 | -webkit-transform: translate3d(0, 100%, 0); 158 | transform: translate3d(0, 100%, 0); 159 | } 160 | } 161 | 162 | .fadeOutDown { 163 | -webkit-animation-name: fadeOutDown; 164 | animation-name: fadeOutDown; 165 | } 166 | 167 | @-webkit-keyframes fadeOutUp { 168 | from { 169 | opacity: 1; 170 | } 171 | 172 | to { 173 | opacity: 0; 174 | -webkit-transform: translate3d(0, -100%, 0); 175 | transform: translate3d(0, -100%, 0); 176 | } 177 | } 178 | 179 | @keyframes fadeOutUp { 180 | from { 181 | opacity: 1; 182 | } 183 | 184 | to { 185 | opacity: 0; 186 | -webkit-transform: translate3d(0, -100%, 0); 187 | transform: translate3d(0, -100%, 0); 188 | } 189 | } 190 | 191 | .fadeOutUp { 192 | -webkit-animation-name: fadeOutUp; 193 | animation-name: fadeOutUp; 194 | } 195 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/js/registry.js: -------------------------------------------------------------------------------- 1 | /** 2 | * @license 3 | * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. 4 | * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt 5 | * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt 6 | * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt 7 | * Code distributed by Google as part of the polymer project is also 8 | * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt 9 | */ 10 | 11 | suite('CustomElementsRegistry', function() { 12 | var work; 13 | var assert = chai.assert; 14 | var HTMLNS = 'http://www.w3.org/1999/xhtml'; 15 | 16 | customElements.enableFlush = true; 17 | 18 | setup(function() { 19 | work = document.createElement('div'); 20 | document.body.appendChild(work); 21 | }); 22 | 23 | teardown(function() { 24 | document.body.removeChild(work); 25 | }); 26 | 27 | suite('window', function () { 28 | 29 | test('customElements.define exists', function() { 30 | assert.isFunction(customElements.define); 31 | }); 32 | 33 | }); 34 | 35 | suite('define', function() { 36 | 37 | test('requires a name argument', function() { 38 | assert.throws(function() { 39 | customElements.define(); 40 | }, '', 'customElements.define failed to throw when given no arguments'); 41 | }); 42 | 43 | test('name must contain a dash', function() { 44 | assert.throws(function () { 45 | customElements.define('xfoo', {prototype: Object.create(HTMLElement.prototype)}); 46 | }, '', 'customElements.define failed to throw when given no arguments'); 47 | }); 48 | 49 | test('name must not be a reserved name', function() { 50 | assert.throws(function() { 51 | customElements.define('font-face', {prototype: Object.create(HTMLElement.prototype)}); 52 | }, '', 'Failed to execute \'defineElement\' on \'Document\': Registration failed for type \'font-face\'. The type name is invalid.'); 53 | }); 54 | 55 | test('name must be unique', function() { 56 | class XDuplicate extends HTMLElement {} 57 | customElements.define('x-duplicate', XDuplicate); 58 | assert.throws(function() { 59 | customElements.define('x-duplicate', XDuplicate); 60 | }, '', 'customElements.define failed to throw when called multiple times with the same element name'); 61 | }); 62 | 63 | test('names are case-sensitive', function() { 64 | class XCase extends HTMLElement {} 65 | assert.throws(function() { customElements.define('X-CASE', XCase); }); 66 | }); 67 | 68 | test('requires a constructor argument', function() { 69 | assert.throws(function () { 70 | customElements.define('x-no-options'); 71 | }, '', 'customElements.define failed to throw without a constructor argument'); 72 | }); 73 | 74 | test('second argument prototype property is required', function() { 75 | assert.throws(function () { 76 | customElements.define('x-no-proto', {}); 77 | }, '', 'customElements.define failed to throw with a constructor argument with no prototype'); 78 | }); 79 | 80 | }); 81 | 82 | suite('get', function() { 83 | 84 | test('returns a defined constructor', function () { 85 | class XGet extends HTMLElement {} 86 | customElements.define('x-get', XGet); 87 | assert.equal(XGet, customElements.get('x-get')); 88 | }); 89 | 90 | test('returns undefined for an undefined constructor', function () { 91 | assert.isUndefined(customElements.get('x-undefined')); 92 | }); 93 | 94 | }); 95 | 96 | suite('whenDefined', function() { 97 | 98 | test('resolves when a tag is defined', function () { 99 | var promise = customElements.whenDefined('x-when-defined').then(function (r) { 100 | assert.isUndefined(r); 101 | }); 102 | class XDefined extends HTMLElement {} 103 | customElements.define('x-when-defined', XDefined); 104 | return promise; 105 | }); 106 | 107 | test('throws for an invalid element name', function () { 108 | return customElements.whenDefined('div').then( 109 | function() { 110 | assert.fail(); 111 | }, 112 | function() { 113 | // pass 114 | return; 115 | }); 116 | }); 117 | 118 | }); 119 | 120 | }); 121 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Utilities.js: -------------------------------------------------------------------------------- 1 | const reservedTagList = new Set([ 2 | 'annotation-xml', 3 | 'color-profile', 4 | 'font-face', 5 | 'font-face-src', 6 | 'font-face-uri', 7 | 'font-face-format', 8 | 'font-face-name', 9 | 'missing-glyph', 10 | ]); 11 | 12 | /** 13 | * @param {string} localName 14 | * @returns {boolean} 15 | */ 16 | export function isValidCustomElementName(localName) { 17 | const reserved = reservedTagList.has(localName); 18 | const validForm = /^[a-z][.0-9_a-z]*-[\-.0-9_a-z]*$/.test(localName); 19 | return !reserved && validForm; 20 | } 21 | 22 | /** 23 | * @private 24 | * @param {!Node} node 25 | * @return {boolean} 26 | */ 27 | export function isConnected(node) { 28 | // Use `Node#isConnected`, if defined. 29 | const nativeValue = node.isConnected; 30 | if (nativeValue !== undefined) { 31 | return nativeValue; 32 | } 33 | 34 | /** @type {?Node|undefined} */ 35 | let current = node; 36 | while (current && !(current.__CE_isImportDocument || current instanceof Document)) { 37 | current = current.parentNode || (window.ShadowRoot && current instanceof ShadowRoot ? current.host : undefined); 38 | } 39 | return !!(current && (current.__CE_isImportDocument || current instanceof Document)); 40 | } 41 | 42 | /** 43 | * @param {!Node} root 44 | * @param {!Node} start 45 | * @return {?Node} 46 | */ 47 | function nextSiblingOrAncestorSibling(root, start) { 48 | let node = start; 49 | while (node && node !== root && !node.nextSibling) { 50 | node = node.parentNode; 51 | } 52 | return (!node || node === root) ? null : node.nextSibling; 53 | } 54 | 55 | /** 56 | * @param {!Node} root 57 | * @param {!Node} start 58 | * @return {?Node} 59 | */ 60 | function nextNode(root, start) { 61 | return start.firstChild ? start.firstChild : nextSiblingOrAncestorSibling(root, start); 62 | } 63 | 64 | /** 65 | * @param {!Node} root 66 | * @param {!function(!Element)} callback 67 | * @param {!Set=} visitedImports 68 | */ 69 | export function walkDeepDescendantElements(root, callback, visitedImports = new Set()) { 70 | let node = root; 71 | while (node) { 72 | if (node.nodeType === Node.ELEMENT_NODE) { 73 | const element = /** @type {!Element} */(node); 74 | 75 | callback(element); 76 | 77 | const localName = element.localName; 78 | if (localName === 'link' && element.getAttribute('rel') === 'import') { 79 | // If this import (polyfilled or not) has it's root node available, 80 | // walk it. 81 | const importNode = /** @type {!Node} */ (element.import); 82 | if (importNode instanceof Node && !visitedImports.has(importNode)) { 83 | // Prevent multiple walks of the same import root. 84 | visitedImports.add(importNode); 85 | 86 | for (let child = importNode.firstChild; child; child = child.nextSibling) { 87 | walkDeepDescendantElements(child, callback, visitedImports); 88 | } 89 | } 90 | 91 | // Ignore descendants of import links to prevent attempting to walk the 92 | // elements created by the HTML Imports polyfill that we just walked 93 | // above. 94 | node = nextSiblingOrAncestorSibling(root, element); 95 | continue; 96 | } else if (localName === 'template') { 97 | // Ignore descendants of templates. There shouldn't be any descendants 98 | // because they will be moved into `.content` during construction in 99 | // browsers that support template but, in case they exist and are still 100 | // waiting to be moved by a polyfill, they will be ignored. 101 | node = nextSiblingOrAncestorSibling(root, element); 102 | continue; 103 | } 104 | 105 | // Walk shadow roots. 106 | const shadowRoot = element.__CE_shadowRoot; 107 | if (shadowRoot) { 108 | for (let child = shadowRoot.firstChild; child; child = child.nextSibling) { 109 | walkDeepDescendantElements(child, callback, visitedImports); 110 | } 111 | } 112 | } 113 | 114 | node = nextNode(root, node); 115 | } 116 | } 117 | 118 | /** 119 | * Used to suppress Closure's "Modifying the prototype is only allowed if the 120 | * constructor is in the same scope" warning without using 121 | * `@suppress {newCheckTypes, duplicate}` because `newCheckTypes` is too broad. 122 | * 123 | * @param {!Object} destination 124 | * @param {string} name 125 | * @param {*} value 126 | */ 127 | export function setPropertyUnchecked(destination, name, value) { 128 | destination[name] = value; 129 | } 130 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/src/Patch/Interface/ChildNode.js: -------------------------------------------------------------------------------- 1 | import CustomElementInternals from '../../CustomElementInternals.js'; 2 | import * as Utilities from '../../Utilities.js'; 3 | 4 | /** 5 | * @typedef {{ 6 | * before: !function(...(!Node|string)), 7 | * after: !function(...(!Node|string)), 8 | * replaceWith: !function(...(!Node|string)), 9 | * remove: !function(), 10 | * }} 11 | */ 12 | let ChildNodeNativeMethods; 13 | 14 | /** 15 | * @param {!CustomElementInternals} internals 16 | * @param {!Object} destination 17 | * @param {!ChildNodeNativeMethods} builtIn 18 | */ 19 | export default function(internals, destination, builtIn) { 20 | /** 21 | * @param {!function(...(!Node|string))} builtInMethod 22 | * @return {!function(...(!Node|string))} 23 | */ 24 | function beforeAfterPatch(builtInMethod) { 25 | return function(...nodes) { 26 | /** 27 | * A copy of `nodes`, with any DocumentFragment replaced by its children. 28 | * @type {!Array} 29 | */ 30 | const flattenedNodes = []; 31 | 32 | /** 33 | * Elements in `nodes` that were connected before this call. 34 | * @type {!Array} 35 | */ 36 | const connectedElements = []; 37 | 38 | for (var i = 0; i < nodes.length; i++) { 39 | const node = nodes[i]; 40 | 41 | if (node instanceof Element && Utilities.isConnected(node)) { 42 | connectedElements.push(node); 43 | } 44 | 45 | if (node instanceof DocumentFragment) { 46 | for (let child = node.firstChild; child; child = child.nextSibling) { 47 | flattenedNodes.push(child); 48 | } 49 | } else { 50 | flattenedNodes.push(node); 51 | } 52 | } 53 | 54 | builtInMethod.apply(this, nodes); 55 | 56 | for (let i = 0; i < connectedElements.length; i++) { 57 | internals.disconnectTree(connectedElements[i]); 58 | } 59 | 60 | if (Utilities.isConnected(this)) { 61 | for (let i = 0; i < flattenedNodes.length; i++) { 62 | const node = flattenedNodes[i]; 63 | if (node instanceof Element) { 64 | internals.connectTree(node); 65 | } 66 | } 67 | } 68 | }; 69 | } 70 | 71 | if (builtIn.before !== undefined) { 72 | Utilities.setPropertyUnchecked(destination, 'before', beforeAfterPatch(builtIn.before)); 73 | } 74 | 75 | if (builtIn.before !== undefined) { 76 | Utilities.setPropertyUnchecked(destination, 'after', beforeAfterPatch(builtIn.after)); 77 | } 78 | 79 | if (builtIn.replaceWith !== undefined) { 80 | Utilities.setPropertyUnchecked(destination, 'replaceWith', 81 | /** 82 | * @param {...(!Node|string)} nodes 83 | */ 84 | function(...nodes) { 85 | /** 86 | * A copy of `nodes`, with any DocumentFragment replaced by its children. 87 | * @type {!Array} 88 | */ 89 | const flattenedNodes = []; 90 | 91 | /** 92 | * Elements in `nodes` that were connected before this call. 93 | * @type {!Array} 94 | */ 95 | const connectedElements = []; 96 | 97 | for (var i = 0; i < nodes.length; i++) { 98 | const node = nodes[i]; 99 | 100 | if (node instanceof Element && Utilities.isConnected(node)) { 101 | connectedElements.push(node); 102 | } 103 | 104 | if (node instanceof DocumentFragment) { 105 | for (let child = node.firstChild; child; child = child.nextSibling) { 106 | flattenedNodes.push(child); 107 | } 108 | } else { 109 | flattenedNodes.push(node); 110 | } 111 | } 112 | 113 | const wasConnected = Utilities.isConnected(this); 114 | 115 | builtIn.replaceWith.apply(this, nodes); 116 | 117 | for (let i = 0; i < connectedElements.length; i++) { 118 | internals.disconnectTree(connectedElements[i]); 119 | } 120 | 121 | if (wasConnected) { 122 | internals.disconnectTree(this); 123 | for (let i = 0; i < flattenedNodes.length; i++) { 124 | const node = flattenedNodes[i]; 125 | if (node instanceof Element) { 126 | internals.connectTree(node); 127 | } 128 | } 129 | } 130 | }); 131 | } 132 | 133 | if (builtIn.remove !== undefined) { 134 | Utilities.setPropertyUnchecked(destination, 'remove', 135 | function() { 136 | const wasConnected = Utilities.isConnected(this); 137 | 138 | builtIn.remove.call(this); 139 | 140 | if (wasConnected) { 141 | internals.disconnectTree(this); 142 | } 143 | }); 144 | } 145 | }; 146 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/sass/paper/_inputs.scss: -------------------------------------------------------------------------------- 1 | .form-control::-moz-placeholder { 2 | @include placeholder($medium-gray, 1); 3 | } 4 | 5 | .form-control:-moz-placeholder { 6 | @include placeholder($medium-gray, 1); 7 | } 8 | 9 | .form-control::-webkit-input-placeholder { 10 | @include placeholder($medium-gray, 1); 11 | } 12 | 13 | .form-control:-ms-input-placeholder { 14 | @include placeholder($medium-gray, 1); 15 | } 16 | 17 | .form-control { 18 | background-color: $gray-input-bg; 19 | border: medium none; 20 | border-radius: $border-radius-base; 21 | color: $font-color; 22 | font-size: $font-size-base; 23 | transition: background-color 0.3s ease 0s; 24 | @include input-size($padding-base-vertical, $padding-base-horizontal, $height-base); 25 | @include box-shadow(none); 26 | 27 | &:focus { 28 | background-color: $white-bg; 29 | @include box-shadow(none); 30 | outline: 0 !important; 31 | } 32 | 33 | .has-success &, 34 | .has-error &, 35 | .has-success &:focus, 36 | .has-error &:focus { 37 | @include box-shadow(none); 38 | } 39 | 40 | .has-success & { 41 | background-color: $success-input-bg; 42 | color: $success-color; 43 | &.border-input { 44 | border: 1px solid $success-color; 45 | } 46 | } 47 | .has-success &:focus { 48 | background-color: $white-bg; 49 | } 50 | .has-error & { 51 | background-color: $danger-input-bg; 52 | color: $danger-color; 53 | &.border-input { 54 | border: 1px solid $danger-color; 55 | } 56 | } 57 | .has-error &:focus { 58 | background-color: $white-bg; 59 | } 60 | 61 | & + .form-control-feedback { 62 | border-radius: $border-radius-large; 63 | font-size: $font-size-base; 64 | margin-top: -7px; 65 | position: absolute; 66 | right: 10px; 67 | top: 50%; 68 | vertical-align: middle; 69 | } 70 | &.border-input { 71 | border: 1px solid $table-line-color; 72 | } 73 | .open & { 74 | border-bottom-color: transparent; 75 | } 76 | } 77 | 78 | .input-lg { 79 | height: 55px; 80 | padding: $padding-large-vertical $padding-large-horizontal; 81 | } 82 | 83 | .has-error { 84 | .form-control-feedback, .control-label { 85 | color: $danger-color; 86 | } 87 | } 88 | 89 | .has-success { 90 | .form-control-feedback, .control-label { 91 | color: $success-color; 92 | } 93 | } 94 | 95 | .input-group-addon { 96 | background-color: $gray-input-bg; 97 | border: medium none; 98 | border-radius: $border-radius-base; 99 | 100 | .has-success &, 101 | .has-error & { 102 | background-color: $white-color; 103 | } 104 | .has-error .form-control:focus + & { 105 | color: $danger-color; 106 | } 107 | .has-success .form-control:focus + & { 108 | color: $success-color; 109 | } 110 | .form-control:focus + &, 111 | .form-control:focus ~ & { 112 | background-color: $white-color; 113 | } 114 | } 115 | 116 | .border-input { 117 | .input-group-addon { 118 | border: solid 1px $table-line-color; 119 | } 120 | } 121 | 122 | .input-group { 123 | margin-bottom: 15px; 124 | } 125 | 126 | .input-group[disabled] { 127 | .input-group-addon { 128 | background-color: $light-gray; 129 | } 130 | } 131 | 132 | .input-group .form-control:first-child, 133 | .input-group-addon:first-child, 134 | .input-group-btn:first-child > .dropdown-toggle, 135 | .input-group-btn:last-child > .btn:not(:last-child):not(.dropdown-toggle) { 136 | border-right: 0 none; 137 | } 138 | 139 | .input-group .form-control:last-child, 140 | .input-group-addon:last-child, 141 | .input-group-btn:last-child > .dropdown-toggle, 142 | .input-group-btn:first-child > .btn:not(:first-child) { 143 | border-left: 0 none; 144 | } 145 | 146 | .form-control[disabled], .form-control[readonly], fieldset[disabled] .form-control { 147 | background-color: $light-gray; 148 | cursor: not-allowed; 149 | @include placeholder($dark-gray, 1); 150 | } 151 | 152 | .form-control[disabled]::-moz-placeholder { 153 | @include placeholder($dark-gray, 1); 154 | } 155 | 156 | .form-control[disabled]:-moz-placeholder { 157 | @include placeholder($medium-gray, 1); 158 | } 159 | 160 | .form-control[disabled]::-webkit-input-placeholder { 161 | @include placeholder($medium-gray, 1); 162 | } 163 | 164 | .form-control[disabled]:-ms-input-placeholder { 165 | @include placeholder($medium-gray, 1); 166 | } 167 | 168 | .input-group-btn .btn { 169 | border-width: $border-thin; 170 | padding: $padding-round-vertical $padding-base-horizontal; 171 | } 172 | 173 | .input-group-btn .btn-default:not(.btn-fill) { 174 | border-color: $medium-gray; 175 | } 176 | 177 | .input-group-btn:last-child > .btn { 178 | margin-left: 0; 179 | } 180 | 181 | textarea.form-control { 182 | max-width: 100%; 183 | padding: 10px 18px; 184 | resize: none; 185 | } 186 | 187 | -------------------------------------------------------------------------------- /apps/flight-app/src/assets/custom-elements/tests/chromium/resources/vendor-prefix.js: -------------------------------------------------------------------------------- 1 | /* 2 | * Distributed under both the W3C Test Suite License [1] and the W3C 3 | * 3-clause BSD License [2]. To contribute to a W3C Test Suite, see the 4 | * policies and contribution forms [3]. 5 | * 6 | * [1] http://www.w3.org/Consortium/Legal/2008/04-testsuite-license 7 | * [2] http://www.w3.org/Consortium/Legal/2008/03-bsd-license 8 | * [3] http://www.w3.org/2004/10/27-testcases 9 | * */ 10 | 11 | /* Source: https://github.com/w3c/web-platform-tests/blob/master/common/vendor-prefix.js 12 | * The file has been modified to always be on (i.e. does not require usePrefixes=1 to 13 | * start replacing prefixes). */ 14 | 15 | /* Use this script when you want to test APIs that use vendor prefixes 16 | and define which objects need to be checked for prefixed versions, à la 17 | 20 | data-prefixed-objects lets prefix objects in the global space 21 | data-prefixed-prototypes adds prefixes to interfaces, for objects that 22 | get created during the tests 23 | 24 | NB: vendor prefixes are expected to go away in favor of putting 25 | new features behind flag, so hopefully there will be only limited 26 | need to use this 27 | */ 28 | 29 | (function () { 30 | var aliases = {}; 31 | var documentingPrefixUsage = document.createElement('div'); 32 | var vendorPrefixes = ["moz", "ms", "o", "webkit", "Moz", "MS", "O", "WebKit", "op"]; 33 | 34 | function getParentObject(ancestors) { 35 | var parent = window; 36 | var currentName = ""; 37 | ancestors.forEach(function (p) { 38 | currentName = currentName ? currentName + "." + p : p; 39 | if (parent[p] === undefined) { 40 | throw currentName + " is undefined, cannot set prefix alias on child object"; 41 | } 42 | parent = parent[p]; 43 | }); 44 | return parent; 45 | } 46 | 47 | function prependPrefix(prefix, name) { 48 | var newName = name[0].toUpperCase() + name.substr(1, name.length); 49 | return prefix + newName; 50 | } 51 | 52 | function setPrototypeAlias(obj) { 53 | var parent = getParentObject(obj.ancestors); 54 | if (!parent.prototype.hasOwnProperty(obj.name)) { 55 | vendorPrefixes.forEach(function (prefix) { 56 | if (parent.prototype.hasOwnProperty(prependPrefix(prefix, obj.name))) { 57 | Object.defineProperty(parent.prototype, obj.name, 58 | {get: function() {return this[prependPrefix(prefix, obj.name)];}, 59 | set: function(v) {this[prependPrefix(prefix, obj.name)] = v;} 60 | }); 61 | aliases[obj.ancestors.join(".") + ".prototype." + obj.name] = obj.ancestors.join(".") + ".prototype." + prependPrefix(prefix, obj.name); 62 | return; 63 | } 64 | }); 65 | } 66 | } 67 | 68 | function setAlias(obj) { 69 | var parent = getParentObject(obj.ancestors); 70 | if (parent[obj.name] === undefined) { 71 | vendorPrefixes.forEach(function (prefix) { 72 | if (parent[prependPrefix(prefix, obj.name)] !== undefined) { 73 | parent[obj.name] = parent[prependPrefix(prefix, obj.name)]; 74 | aliases[obj.ancestors.join(".") + "." + obj.name] = obj.ancestors.join(".") + "." + prependPrefix(prefix, obj.name); 75 | return; 76 | } 77 | }); 78 | } 79 | } 80 | 81 | // For this version of vendor-prefixes.js, always replace the prefixes. 82 | if (document.querySelector("script[data-prefixed-objects]")) { 83 | var prefixObjectsData = document.querySelector("script[data-prefixed-objects]").dataset["prefixedObjects"]; 84 | try { 85 | var prefixedObjects = JSON.parse(prefixObjectsData); 86 | } catch (e) { 87 | throw "couldn't parse data-prefixed-objects as JSON:" + e; 88 | } 89 | prefixedObjects.forEach(setAlias); 90 | } 91 | if (document.querySelector("script[data-prefixed-prototypes]")) { 92 | var prefixProtoData = document.querySelector("script[data-prefixed-prototypes]").dataset["prefixedPrototypes"]; 93 | try { 94 | var prefixedPrototypes = JSON.parse(prefixProtoData); 95 | } catch (e) { 96 | throw "couldn't parse data-prefixed-prototypes as JSON:" + e; 97 | } 98 | prefixedPrototypes.forEach(setPrototypeAlias); 99 | } 100 | })(); 101 | --------------------------------------------------------------------------------