From bb8f58f6cbe8be68442a7479ed94862a8ed5688f Mon Sep 17 00:00:00 2001 From: Vadim Marenkov <2dangel84@gmail.com> Date: Wed, 26 Sep 2018 11:49:49 +0700 Subject: [PATCH 1/6] feat(cards): Added cards --- commitlint.config.js | 1 + package.json | 1 + src/lib-dev/cards/module.ts | 42 ++++++ src/lib-dev/cards/styles.scss | 26 ++++ src/lib-dev/cards/template.html | 78 +++++++++++ src/lib/cards/README.md | 0 src/lib/cards/_cards-theme.scss | 99 ++++++++++++++ src/lib/cards/cards.component.html | 15 ++ src/lib/cards/cards.component.scss | 80 +++++++++++ src/lib/cards/cards.component.spec.ts | 114 ++++++++++++++++ src/lib/cards/cards.component.ts | 128 ++++++++++++++++++ src/lib/cards/cards.md | 13 ++ src/lib/cards/cards.module.ts | 30 ++++ src/lib/cards/index.ts | 1 + src/lib/cards/public-api.ts | 2 + src/lib/cards/tsconfig.build.json | 13 ++ src/lib/core/theming/_all-theme.scss | 2 + src/lib/core/theming/_palette.scss | 44 +++--- src/lib/core/theming/prebuilt/dark-theme.scss | 4 +- 19 files changed, 669 insertions(+), 24 deletions(-) create mode 100644 src/lib-dev/cards/module.ts create mode 100644 src/lib-dev/cards/styles.scss create mode 100644 src/lib-dev/cards/template.html create mode 100644 src/lib/cards/README.md create mode 100644 src/lib/cards/_cards-theme.scss create mode 100644 src/lib/cards/cards.component.html create mode 100644 src/lib/cards/cards.component.scss create mode 100644 src/lib/cards/cards.component.spec.ts create mode 100644 src/lib/cards/cards.component.ts create mode 100644 src/lib/cards/cards.md create mode 100644 src/lib/cards/cards.module.ts create mode 100644 src/lib/cards/index.ts create mode 100644 src/lib/cards/public-api.ts create mode 100644 src/lib/cards/tsconfig.build.json diff --git a/commitlint.config.js b/commitlint.config.js index 21774476e..1251eca41 100644 --- a/commitlint.config.js +++ b/commitlint.config.js @@ -9,6 +9,7 @@ module.exports = { 'build', 'button', 'cdk', + 'cards', 'checkbox', 'chore', 'common', diff --git a/package.json b/package.json index c48df5fee..962de1c8a 100644 --- a/package.json +++ b/package.json @@ -139,6 +139,7 @@ "server-dev": "webpack-dev-server --config tools/webpack/webpack.config.js", "server-dev:badge": "npm run server-dev -- --env.component badge", "server-dev:button": "npm run server-dev -- --env.component button", + "server-dev:cards": "npm run server-dev -- --env.component cards", "server-dev:checkbox": "npm run server-dev -- --env.component checkbox", "server-dev:icon": "npm run server-dev -- --env.component icon", "server-dev:input": "npm run server-dev -- --env.component input", diff --git a/src/lib-dev/cards/module.ts b/src/lib-dev/cards/module.ts new file mode 100644 index 000000000..55ca1e006 --- /dev/null +++ b/src/lib-dev/cards/module.ts @@ -0,0 +1,42 @@ +import { Component, NgModule, ViewEncapsulation } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + +import { McCardsModule, Status } from '../../lib/cards'; + + +@Component({ + selector: 'app', + template: require('./template.html'), + styleUrls: ['./styles.scss'], + encapsulation: ViewEncapsulation.None +}) +export class CardsDemoComponent { + state = Status; + + s1 = false; + s2 = false; + s3 = false; + s4 = false; +} + + +@NgModule({ + declarations: [ + CardsDemoComponent + ], + imports: [ + BrowserModule, + McCardsModule + ], + bootstrap: [ + CardsDemoComponent + ] +}) +export class CardsDemoModule {} + +platformBrowserDynamic() + .bootstrapModule(CardsDemoModule) + // tslint:disable-next-line + .catch((error) => console.error(error)); + diff --git a/src/lib-dev/cards/styles.scss b/src/lib-dev/cards/styles.scss new file mode 100644 index 000000000..b12d858f8 --- /dev/null +++ b/src/lib-dev/cards/styles.scss @@ -0,0 +1,26 @@ +@import '~@ptsecurity/mosaic-icons/dist/styles/mc-icons'; + +// Светлая +@import '../../lib/core/theming/prebuilt/default-theme'; + +//// Темная +//@import '../../lib/core/theming/prebuilt/dark-theme'; +// +//html { +// background: mc-color($mc-grey, 800); +// color: white; +//} + +mc-card { + margin-right: 10px; +} + +.line { + margin-bottom: 20px; + display: flex; + flex-direction: row; +} + +.mc-upload-to-cloud_24 { + font-size: 32px; +} diff --git a/src/lib-dev/cards/template.html b/src/lib-dev/cards/template.html new file mode 100644 index 000000000..b261432ef --- /dev/null +++ b/src/lib-dev/cards/template.html @@ -0,0 +1,78 @@ +