├── .browserslistrc
├── .editorconfig
├── .gitignore
├── .vscode
├── extensions.json
├── launch.json
└── tasks.json
├── README.md
├── angular.json
├── karma.conf.js
├── package-lock.json
├── package.json
├── src
├── app
│ ├── accordion
│ │ ├── accordion.component.html
│ │ ├── accordion.component.scss
│ │ └── accordion.component.ts
│ ├── app-routing.module.ts
│ ├── app.component.html
│ ├── app.component.scss
│ ├── app.component.spec.ts
│ ├── app.component.ts
│ ├── app.module.ts
│ ├── collections
│ │ ├── collections.component.html
│ │ ├── collections.component.scss
│ │ └── collections.component.ts
│ ├── layout
│ │ ├── layout.component.html
│ │ ├── layout.component.scss
│ │ └── layout.component.ts
│ ├── observer
│ │ ├── card
│ │ │ ├── card.component.html
│ │ │ ├── card.component.scss
│ │ │ └── card.component.ts
│ │ ├── observer.component.html
│ │ ├── observer.component.scss
│ │ └── observer.component.ts
│ └── overlay
│ │ ├── overlay.component.html
│ │ ├── overlay.component.scss
│ │ ├── overlay.component.ts
│ │ └── popup
│ │ ├── popup.component.html
│ │ ├── popup.component.scss
│ │ └── popup.component.ts
├── assets
│ └── .gitkeep
├── environments
│ ├── environment.prod.ts
│ └── environment.ts
├── favicon.ico
├── index.html
├── main.ts
├── polyfills.ts
├── styles.scss
└── test.ts
├── tsconfig.app.json
├── tsconfig.json
└── tsconfig.spec.json
/.browserslistrc:
--------------------------------------------------------------------------------
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 | # For the full list of supported browsers by the Angular framework, please see:
6 | # https://angular.io/guide/browser-support
7 |
8 | # You can see what browsers were selected by your queries by running:
9 | # npx browserslist
10 |
11 | last 1 Chrome version
12 | last 1 Firefox version
13 | last 2 Edge major versions
14 | last 2 Safari major versions
15 | last 2 iOS major versions
16 | Firefox ESR
17 |
--------------------------------------------------------------------------------
/.editorconfig:
--------------------------------------------------------------------------------
1 | # Editor configuration, see https://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 | [*.ts]
12 | quote_type = single
13 |
14 | [*.md]
15 | max_line_length = off
16 | trim_trailing_whitespace = false
17 |
--------------------------------------------------------------------------------
/.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 | /bazel-out
8 |
9 | # Node
10 | /node_modules
11 | npm-debug.log
12 | yarn-error.log
13 |
14 | # IDEs and editors
15 | .idea/
16 | .project
17 | .classpath
18 | .c9/
19 | *.launch
20 | .settings/
21 | *.sublime-workspace
22 |
23 | # Visual Studio Code
24 | .vscode/*
25 | !.vscode/settings.json
26 | !.vscode/tasks.json
27 | !.vscode/launch.json
28 | !.vscode/extensions.json
29 | .history/*
30 |
31 | # Miscellaneous
32 | /.angular/cache
33 | .sass-cache/
34 | /connect.lock
35 | /coverage
36 | /libpeerconnection.log
37 | testem.log
38 | /typings
39 |
40 | # System files
41 | .DS_Store
42 | Thumbs.db
43 |
--------------------------------------------------------------------------------
/.vscode/extensions.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=827846
3 | "recommendations": ["angular.ng-template"]
4 | }
5 |
--------------------------------------------------------------------------------
/.vscode/launch.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
3 | "version": "0.2.0",
4 | "configurations": [
5 | {
6 | "name": "ng serve",
7 | "type": "pwa-chrome",
8 | "request": "launch",
9 | "preLaunchTask": "npm: start",
10 | "url": "http://localhost:4200/"
11 | },
12 | {
13 | "name": "ng test",
14 | "type": "chrome",
15 | "request": "launch",
16 | "preLaunchTask": "npm: test",
17 | "url": "http://localhost:9876/debug.html"
18 | }
19 | ]
20 | }
21 |
--------------------------------------------------------------------------------
/.vscode/tasks.json:
--------------------------------------------------------------------------------
1 | {
2 | // For more information, visit: https://go.microsoft.com/fwlink/?LinkId=733558
3 | "version": "2.0.0",
4 | "tasks": [
5 | {
6 | "type": "npm",
7 | "script": "start",
8 | "isBackground": true,
9 | "problemMatcher": {
10 | "owner": "typescript",
11 | "pattern": "$tsc",
12 | "background": {
13 | "activeOnStart": true,
14 | "beginsPattern": {
15 | "regexp": "(.*?)"
16 | },
17 | "endsPattern": {
18 | "regexp": "bundle generation complete"
19 | }
20 | }
21 | }
22 | },
23 | {
24 | "type": "npm",
25 | "script": "test",
26 | "isBackground": true,
27 | "problemMatcher": {
28 | "owner": "typescript",
29 | "pattern": "$tsc",
30 | "background": {
31 | "activeOnStart": true,
32 | "beginsPattern": {
33 | "regexp": "(.*?)"
34 | },
35 | "endsPattern": {
36 | "regexp": "bundle generation complete"
37 | }
38 | }
39 | }
40 | }
41 | ]
42 | }
43 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AngularCdk
2 |
3 | This project was generated with [Angular CLI](https://github.com/angular/angular-cli) version 13.3.6.
4 |
5 | ## Development server
6 |
7 | Run `ng serve` for a dev server. Navigate to `http://localhost:4200/`. The application will automatically reload if you change any of the source files.
8 |
9 | ## Code scaffolding
10 |
11 | Run `ng generate component component-name` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module`.
12 |
13 | ## Build
14 |
15 | Run `ng build` to build the project. The build artifacts will be stored in the `dist/` directory.
16 |
17 | ## Running unit tests
18 |
19 | Run `ng test` to execute the unit tests via [Karma](https://karma-runner.github.io).
20 |
21 | ## Running end-to-end tests
22 |
23 | Run `ng e2e` to execute the end-to-end tests via a platform of your choice. To use this command, you need to first add a package that implements end-to-end testing capabilities.
24 |
25 | ## Further help
26 |
27 | To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
28 |
--------------------------------------------------------------------------------
/angular.json:
--------------------------------------------------------------------------------
1 | {
2 | "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
3 | "version": 1,
4 | "newProjectRoot": "projects",
5 | "projects": {
6 | "angularCdk": {
7 | "projectType": "application",
8 | "schematics": {
9 | "@schematics/angular:component": {
10 | "style": "scss"
11 | },
12 | "@schematics/angular:application": {
13 | "strict": true
14 | }
15 | },
16 | "root": "",
17 | "sourceRoot": "src",
18 | "prefix": "app",
19 | "architect": {
20 | "build": {
21 | "builder": "@angular-devkit/build-angular:browser",
22 | "options": {
23 | "outputPath": "dist/angular-cdk",
24 | "index": "src/index.html",
25 | "main": "src/main.ts",
26 | "polyfills": "src/polyfills.ts",
27 | "tsConfig": "tsconfig.app.json",
28 | "inlineStyleLanguage": "scss",
29 | "assets": [
30 | "src/favicon.ico",
31 | "src/assets"
32 | ],
33 | "styles": [
34 | "src/styles.scss"
35 | ],
36 | "scripts": []
37 | },
38 | "configurations": {
39 | "production": {
40 | "budgets": [
41 | {
42 | "type": "initial",
43 | "maximumWarning": "500kb",
44 | "maximumError": "1mb"
45 | },
46 | {
47 | "type": "anyComponentStyle",
48 | "maximumWarning": "2kb",
49 | "maximumError": "4kb"
50 | }
51 | ],
52 | "fileReplacements": [
53 | {
54 | "replace": "src/environments/environment.ts",
55 | "with": "src/environments/environment.prod.ts"
56 | }
57 | ],
58 | "outputHashing": "all"
59 | },
60 | "development": {
61 | "buildOptimizer": false,
62 | "optimization": false,
63 | "vendorChunk": true,
64 | "extractLicenses": false,
65 | "sourceMap": true,
66 | "namedChunks": true
67 | }
68 | },
69 | "defaultConfiguration": "production"
70 | },
71 | "serve": {
72 | "builder": "@angular-devkit/build-angular:dev-server",
73 | "configurations": {
74 | "production": {
75 | "browserTarget": "angularCdk:build:production"
76 | },
77 | "development": {
78 | "browserTarget": "angularCdk:build:development"
79 | }
80 | },
81 | "defaultConfiguration": "development"
82 | },
83 | "extract-i18n": {
84 | "builder": "@angular-devkit/build-angular:extract-i18n",
85 | "options": {
86 | "browserTarget": "angularCdk:build"
87 | }
88 | },
89 | "test": {
90 | "builder": "@angular-devkit/build-angular:karma",
91 | "options": {
92 | "main": "src/test.ts",
93 | "polyfills": "src/polyfills.ts",
94 | "tsConfig": "tsconfig.spec.json",
95 | "karmaConfig": "karma.conf.js",
96 | "inlineStyleLanguage": "scss",
97 | "assets": [
98 | "src/favicon.ico",
99 | "src/assets"
100 | ],
101 | "styles": [
102 | "./node_modules/@angular/material/prebuilt-themes/indigo-pink.css",
103 | "src/styles.scss"
104 | ],
105 | "scripts": []
106 | }
107 | }
108 | }
109 | }
110 | },
111 | "defaultProject": "angularCdk"
112 | }
113 |
--------------------------------------------------------------------------------
/karma.conf.js:
--------------------------------------------------------------------------------
1 | // Karma configuration file, see link for more information
2 | // https://karma-runner.github.io/1.0/config/configuration-file.html
3 |
4 | module.exports = function (config) {
5 | config.set({
6 | basePath: '',
7 | frameworks: ['jasmine', '@angular-devkit/build-angular'],
8 | plugins: [
9 | require('karma-jasmine'),
10 | require('karma-chrome-launcher'),
11 | require('karma-jasmine-html-reporter'),
12 | require('karma-coverage'),
13 | require('@angular-devkit/build-angular/plugins/karma')
14 | ],
15 | client: {
16 | jasmine: {
17 | // you can add configuration options for Jasmine here
18 | // the possible options are listed at https://jasmine.github.io/api/edge/Configuration.html
19 | // for example, you can disable the random execution with `random: false`
20 | // or set a specific seed with `seed: 4321`
21 | },
22 | clearContext: false // leave Jasmine Spec Runner output visible in browser
23 | },
24 | jasmineHtmlReporter: {
25 | suppressAll: true // removes the duplicated traces
26 | },
27 | coverageReporter: {
28 | dir: require('path').join(__dirname, './coverage/angular-cdk'),
29 | subdir: '.',
30 | reporters: [
31 | { type: 'html' },
32 | { type: 'text-summary' }
33 | ]
34 | },
35 | reporters: ['progress', 'kjhtml'],
36 | port: 9876,
37 | colors: true,
38 | logLevel: config.LOG_INFO,
39 | autoWatch: true,
40 | browsers: ['Chrome'],
41 | singleRun: false,
42 | restartOnFileChange: true
43 | });
44 | };
45 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "angular-cdk",
3 | "version": "0.0.0",
4 | "scripts": {
5 | "ng": "ng",
6 | "start": "ng serve",
7 | "build": "ng build",
8 | "watch": "ng build --watch --configuration development",
9 | "test": "ng test"
10 | },
11 | "private": true,
12 | "dependencies": {
13 | "@angular/animations": "~13.3.0",
14 | "@angular/cdk": "^13.3.0",
15 | "@angular/common": "~13.3.0",
16 | "@angular/compiler": "~13.3.0",
17 | "@angular/core": "~13.3.0",
18 | "@angular/forms": "~13.3.0",
19 | "@angular/material": "^13.3.0",
20 | "@angular/platform-browser": "~13.3.0",
21 | "@angular/platform-browser-dynamic": "~13.3.0",
22 | "@angular/router": "~13.3.0",
23 | "rxjs": "~7.5.0",
24 | "tslib": "^2.3.0",
25 | "zone.js": "~0.11.4"
26 | },
27 | "devDependencies": {
28 | "@angular-devkit/build-angular": "~13.3.6",
29 | "@angular/cli": "~13.3.6",
30 | "@angular/compiler-cli": "~13.3.0",
31 | "@types/jasmine": "~3.10.0",
32 | "@types/node": "^12.11.1",
33 | "jasmine-core": "~4.0.0",
34 | "karma": "~6.3.0",
35 | "karma-chrome-launcher": "~3.1.0",
36 | "karma-coverage": "~2.1.0",
37 | "karma-jasmine": "~4.0.0",
38 | "karma-jasmine-html-reporter": "~1.7.0",
39 | "typescript": "~4.6.2"
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/app/accordion/accordion.component.html:
--------------------------------------------------------------------------------
1 |
19 |
20 | {{ selection.selected | json }}
21 |
22 |
--------------------------------------------------------------------------------
/src/app/collections/collections.component.scss:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/kevindaviladev/angularCdk/928b2fc67b761b6346e5e083a356b5e14d27292b/src/app/collections/collections.component.scss
--------------------------------------------------------------------------------
/src/app/collections/collections.component.ts:
--------------------------------------------------------------------------------
1 | import { SelectionModel } from '@angular/cdk/collections';
2 | import { Component, OnInit } from '@angular/core';
3 |
4 | @Component({
5 | selector: 'app-collections',
6 | templateUrl: './collections.component.html',
7 | styleUrls: ['./collections.component.scss'],
8 | })
9 | export class CollectionsComponent implements OnInit {
10 | selection = new SelectionModel2 | Resize your browser window to see the current screen size change. 3 |
4 |5 | The current screen size is {{currentScreenSize}}
6 | 7 |The layout orientation is {{orientation}}
8 | -------------------------------------------------------------------------------- /src/app/layout/layout.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevindaviladev/angularCdk/928b2fc67b761b6346e5e083a356b5e14d27292b/src/app/layout/layout.component.scss -------------------------------------------------------------------------------- /src/app/layout/layout.component.ts: -------------------------------------------------------------------------------- 1 | import { BreakpointObserver, Breakpoints } from '@angular/cdk/layout'; 2 | import { Component, OnInit } from '@angular/core'; 3 | 4 | @Component({ 5 | selector: 'app-layout', 6 | templateUrl: './layout.component.html', 7 | styleUrls: ['./layout.component.scss'], 8 | }) 9 | export class LayoutComponent implements OnInit { 10 | currentScreenSize = ''; 11 | orientation = ''; 12 | // Create a map to display breakpoint names for demonstration purposes. 13 | displayNameMap = new Map([ 14 | [Breakpoints.XSmall, 'XSmall'], 15 | [Breakpoints.Small, 'Small'], 16 | [Breakpoints.Medium, 'Medium'], 17 | [Breakpoints.Large, 'Large'], 18 | [Breakpoints.XLarge, 'XLarge'], 19 | ['(orientation: portrait)', 'Portrait'], 20 | ['(orientation: landscape)', 'Landscape'], 21 | ]); 22 | 23 | constructor(breakpointObserver: BreakpointObserver) { 24 | breakpointObserver 25 | .observe([ 26 | Breakpoints.XSmall, 27 | Breakpoints.Small, 28 | Breakpoints.Medium, 29 | Breakpoints.Large, 30 | Breakpoints.XLarge, 31 | ]) 32 | .subscribe((result) => { 33 | for (const query of Object.keys(result.breakpoints)) { 34 | if (result.breakpoints[query]) { 35 | console.log(query); 36 | this.currentScreenSize = 37 | this.displayNameMap.get(query) ?? 'Unknown'; 38 | } 39 | } 40 | }); 41 | 42 | breakpointObserver 43 | .observe(['(orientation: portrait)', '(orientation: landscape)']) 44 | .subscribe((result) => { 45 | for (const query of Object.keys(result.breakpoints)) { 46 | if (result.breakpoints[query]) { 47 | console.log(query); 48 | this.orientation = this.displayNameMap.get(query) ?? 'Unknown'; 49 | } 50 | } 51 | }); 52 | } 53 | 54 | ngOnInit(): void {} 55 | } 56 | -------------------------------------------------------------------------------- /src/app/observer/card/card.component.html: -------------------------------------------------------------------------------- 1 |Suscribete!
2 | -------------------------------------------------------------------------------- /src/app/overlay/popup/popup.component.scss: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevindaviladev/angularCdk/928b2fc67b761b6346e5e083a356b5e14d27292b/src/app/overlay/popup/popup.component.scss -------------------------------------------------------------------------------- /src/app/overlay/popup/popup.component.ts: -------------------------------------------------------------------------------- 1 | import { Component, OnInit } from '@angular/core'; 2 | 3 | @Component({ 4 | selector: 'app-popup', 5 | templateUrl: './popup.component.html', 6 | styleUrls: ['./popup.component.scss'] 7 | }) 8 | export class PopupComponent implements OnInit { 9 | 10 | constructor() { } 11 | 12 | ngOnInit(): void { 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevindaviladev/angularCdk/928b2fc67b761b6346e5e083a356b5e14d27292b/src/assets/.gitkeep -------------------------------------------------------------------------------- /src/environments/environment.prod.ts: -------------------------------------------------------------------------------- 1 | export const environment = { 2 | production: true 3 | }; 4 | -------------------------------------------------------------------------------- /src/environments/environment.ts: -------------------------------------------------------------------------------- 1 | // This file can be replaced during build by using the `fileReplacements` array. 2 | // `ng build` replaces `environment.ts` with `environment.prod.ts`. 3 | // The list of file replacements can be found in `angular.json`. 4 | 5 | export const environment = { 6 | production: false 7 | }; 8 | 9 | /* 10 | * For easier debugging in development mode, you can import the following file 11 | * to ignore zone related error stack frames such as `zone.run`, `zoneDelegate.invokeTask`. 12 | * 13 | * This import should be commented out in production mode because it will have a negative impact 14 | * on performance if an error is thrown. 15 | */ 16 | // import 'zone.js/plugins/zone-error'; // Included with Angular CLI. 17 | -------------------------------------------------------------------------------- /src/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/kevindaviladev/angularCdk/928b2fc67b761b6346e5e083a356b5e14d27292b/src/favicon.ico -------------------------------------------------------------------------------- /src/index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 |