2.6.1 • Published 14 days ago

@dangl/angular-material-shared v2.6.1

Weekly downloads
19
License
-
Repository
-
Last release
14 days ago

angular-material-shared

Shared components & styles to be used in Angular Material apps.

Usage

To use these styles in an Angular app, add this package to your project. It's published as @dangl/angular-material-shared. Then, simply import the module:

import { AngularMaterialSharedModule } from '@dangl/angular-material-shared';

Demo

You can run ng serve in the src/angular-material-shared-demo folder to run a demo locally. Make sure that the library was built first with npm run build:library.

Functionality

Styles

This package defines a common theme to be used in all DanglIT apps.

Add this import to your global styles.scss file:

@import '@dangl/angular-material-shared/styles/material-style.scss';

To access color variables, you can add this import to any file:

@import '@dangl/angular-material-shared/styles/material-variables.scss';
// Provides the following colors:
$color-primary: mat-color($dangl-app-primary);
$color-accent:  mat-color($dangl-app-accent);
$color-warn:    mat-color($dangl-app-warn);
$color-dark: #3b4c55;
$color-light: #bdbdbd;

Fonts

The package also includes the Roboto font, which is the default font for Angular Material. To use it, add this import to your global styles.scss file:

@import url(https://fonts.googleapis.com/css?family=Roboto:300,400,500);

Icons

The package includes the Material Icons font. To use it, add this import to your global styles.scss file:

@import url(https://fonts.googleapis.com/icon?family=Material+Icons);

Errors During SCSS Import

Since Angular 13, importing styles via the SASS-Loaded from node_modules has been disabled, so you need to update the angular.json file with the following snippet at the projects:PROJECT_NAME:architect:build:options path:

"stylePreprocessorOptions": {
  "includePaths": ["./node_modules"]
}

Header

The dangl-header component can display a common header in all DanglIT apps. It additionally supports to display an information if it is in a preview environment. The header supports right-aligned content via a projected ng-content.

You can optionally specify the logo initials by setting logoInitials="GD". They default to GD. You can disable the logo by setting [logoInitials]="null".

Header Logo

By setting the iconUrl value on the dangl-header, you can optionally specify an image to be displayed in the header.

Footer

There is a dangl-footer component that shows copyright info.
If the legal notice link is enabled, it can either be configured to route to a location or to emit an event when the legal notice is requested.

You can optionally pass in footer options as [options] to use custom values:

FooterOptions {
    logoInitials?: string;
    copyrightUrl?: string;
    companyNameHtml?: string;
}

TinyMCE Editor

A rich-text WYSIWYG editor is available as dangl-tiny-mce component. This one requires the package tinymce to be referenced and available as global variable. To make it available, add this to your scripts section in .angular-cli.json:

"scripts": [
  "../node_modules/tinymce/tinymce.js"
]

Additionally, TinyMCE must load skins and other assets at runtime and requires the path to it. You can inject it in your AppModule:

providers: [
  {
    provide: 'TINYMCE_BASE_URL',
    useValue: tinyMceBaseUrl // e.g. '/assets/tinymce-assets'
  }
]

Depending on your setup, you can copy these assets via a postinstall script in package.json to a folder in your app:

"postinstall": "xcopy /I /E /Y node_modules\\@dangl\\angular-material-shared\\tinymce-assets src\\assets\\tinymce-assets"

Because the paths might be dependent on your environment, you can use the following helper:

import { environment } from '../environments/environment';

const tinyMceBaseUrl = environment.production
  ? '/dist/assets/tinymce-assets'
  : '/assets/tinymce-assets';

TinyMCE Localization / i18n

By default, the TinyMCE editors language is English. You can include other languages as well. This package includes all the language files. To use them, the following must be done:

  1. Supply the url to the language file and the language code to the component:

Available languages can be found here: https://www.tiny.cloud/get-tiny/language-packages/

GuidGenerator

The GuidGenerator provides a static method to create pseudo-random Guids.

2.5.1-beta0018

14 days ago

2.6.1-beta0001

14 days ago

2.6.1-beta0002

14 days ago

2.6.0-beta0019

14 days ago

2.6.1

14 days ago

2.6.0

14 days ago

2.5.1-beta0012

1 month ago

2.5.1-beta0004

2 months ago

2.5.1-beta0006

2 months ago

2.5.1-beta0002

3 months ago

2.5.0

3 months ago

2.4.2-beta0009

4 months ago

2.5.0-beta0012

4 months ago

2.5.0-beta0010

4 months ago

2.4.0-beta0056

8 months ago

2.4.1

8 months ago

2.4.0

8 months ago

2.4.1-beta0003

8 months ago

2.4.1-beta0002

8 months ago

2.4.0-beta0046

8 months ago

2.4.0-beta0050

8 months ago

2.4.0-beta0042

12 months ago

2.4.0-beta0033

1 year ago

2.4.0-beta0037

1 year ago

2.4.0-beta0031

1 year ago

2.4.0-beta0023

1 year ago

2.4.0-beta0025

1 year ago

2.4.0-beta0027

1 year ago

2.4.0-beta0029

1 year ago

2.4.0-beta0015

1 year ago

2.4.0-beta0019

1 year ago

2.4.0-beta0021

1 year ago

2.3.3-beta0006

1 year ago

2.3.3-beta0004

1 year ago

2.3.3-beta0002

2 years ago

2.3.2

2 years ago

2.3.2-beta0004

2 years ago

2.3.2-beta0003

2 years ago

2.3.1-beta0001

2 years ago

2.3.0

2 years ago

2.3.1

2 years ago

2.3.0-beta0037

2 years ago

2.3.0-beta0038

2 years ago

2.2.1-beta0031

2 years ago

2.2.1-beta0033

2 years ago

1.2.1-beta0028

2 years ago

1.2.1-beta0030

2 years ago

1.2.1-beta0026

2 years ago

1.2.1-beta0024

2 years ago

1.2.1-beta0013

2 years ago

1.2.1-beta0007

2 years ago

1.2.1-beta0009

2 years ago

1.2.1-beta0005

3 years ago

1.2.1-beta0003

3 years ago

2.2.0

3 years ago

1.2.0-beta0035

3 years ago

1.2.1-beta0001

3 years ago

2.1.1-beta0028

3 years ago

2.1.1-beta0022

3 years ago

2.1.1-beta0023

3 years ago

2.1.1-beta0024

3 years ago

2.1.1-beta0021

3 years ago

2.1.1-beta0018

3 years ago

2.1.1-beta0014

3 years ago

2.1.1-beta0016

3 years ago

2.1.1-beta0020

3 years ago

2.1.1-beta0010

3 years ago

2.1.1-beta0012

3 years ago

2.1.1-beta0008

3 years ago

2.1.1-beta0006

3 years ago

2.1.1-beta0004

3 years ago

2.1.1-beta0002

3 years ago

2.1.0

3 years ago

2.1.0-beta0017

3 years ago

2.0.1-beta0011

3 years ago

2.0.1-beta0009

3 years ago

2.0.1-beta0007

3 years ago

2.0.1-beta0005

3 years ago

2.0.1-beta0003

4 years ago

2.0.1-beta0002

4 years ago

2.0.0

4 years ago

2.0.0-beta0009

4 years ago

1.4.1-beta0004

4 years ago

1.4.0

4 years ago

1.4.0-beta0008

4 years ago

1.4.1-beta0002

4 years ago

1.3.1-beta0006

4 years ago

1.3.1-beta0007

4 years ago

1.3.1-beta0003

4 years ago

1.3.1-beta0001

4 years ago

1.3.0

4 years ago

1.3.0-beta0009

4 years ago

1.2.3-beta0006

4 years ago

1.2.3-beta0004

4 years ago

1.2.3-beta0002

4 years ago

1.2.2

4 years ago

1.2.2-beta0005

4 years ago

1.2.2-beta0004

5 years ago

1.2.2-beta0002

5 years ago

1.2.1

5 years ago

1.2.1-beta0002

5 years ago

1.2.0

5 years ago

1.2.0-beta0005

5 years ago

1.1.6-beta0001

5 years ago

1.1.5

5 years ago

1.1.5-beta0002

5 years ago

1.1.4

5 years ago

1.1.4-beta0002

5 years ago

1.1.3

5 years ago

1.1.3-beta0001

5 years ago

1.1.2

6 years ago

1.1.2-beta0010

6 years ago

1.1.2-beta0007

6 years ago

1.1.2-beta0005

6 years ago

1.1.1

6 years ago

1.1.1-beta0002

6 years ago

1.1.0

6 years ago

1.0.1-beta0003

6 years ago

1.0.1-beta0002

6 years ago

1.0.0

6 years ago

0.1.0-beta0040

6 years ago

0.1.0-beta0039

6 years ago

0.1.0-beta0038

6 years ago

0.1.0-ng-lib0001

6 years ago