@enigmatry/entry-components 1.15.1-preview.2 → 1.15.1-preview.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/assets/fonts/Montserrat/Montserrat-bold.eot +0 -0
- package/assets/fonts/Montserrat/Montserrat-bold.ttf +0 -0
- package/assets/fonts/Montserrat/Montserrat-bold.woff +0 -0
- package/assets/fonts/Montserrat/Montserrat-bold.woff2 +0 -0
- package/assets/fonts/OpenSans/OpenSans-bold.eot +0 -0
- package/assets/fonts/OpenSans/OpenSans-bold.ttf +0 -0
- package/assets/fonts/OpenSans/OpenSans-bold.woff +0 -0
- package/assets/fonts/OpenSans/OpenSans-bold.woff2 +0 -0
- package/assets/fonts/OpenSans/OpenSans-normal.eot +0 -0
- package/assets/fonts/OpenSans/OpenSans-normal.ttf +0 -0
- package/assets/fonts/OpenSans/OpenSans-normal.woff +0 -0
- package/assets/fonts/OpenSans/OpenSans-normal.woff2 +0 -0
- package/assets/fonts/Roboto/Roboto-bold.woff2 +0 -0
- package/assets/fonts/Roboto/Roboto-normal.woff2 +0 -0
- package/button/README.md +47 -0
- package/button/entry-button-config.d.ts +26 -0
- package/button/entry-button.directive.d.ts +18 -0
- package/button/entry-button.module.d.ts +9 -0
- package/button/index.d.ts +5 -0
- package/button/public-api.d.ts +3 -0
- package/esm2020/button/enigmatry-entry-components-button.mjs +5 -0
- package/esm2020/button/entry-button-config.mjs +22 -0
- package/esm2020/button/entry-button.directive.mjs +56 -0
- package/esm2020/button/entry-button.module.mjs +28 -0
- package/esm2020/button/public-api.mjs +4 -0
- package/esm2020/dialog/entry-dialog-buttons-alignment.type.mjs +2 -1
- package/esm2020/public-api.mjs +2 -1
- package/fesm2015/enigmatry-entry-components-button.mjs +110 -0
- package/fesm2015/enigmatry-entry-components-button.mjs.map +1 -0
- package/fesm2015/enigmatry-entry-components.mjs +1 -0
- package/fesm2015/enigmatry-entry-components.mjs.map +1 -1
- package/fesm2020/enigmatry-entry-components-button.mjs +107 -0
- package/fesm2020/enigmatry-entry-components-button.mjs.map +1 -0
- package/fesm2020/enigmatry-entry-components.mjs +1 -0
- package/fesm2020/enigmatry-entry-components.mjs.map +1 -1
- package/package.json +9 -1
- package/public-api.d.ts +1 -0
- package/styles/_generator.scss +15 -0
- package/styles/modules/_default-theme.scss +57 -0
- package/styles/modules/components/dialogs/_generator.scss +11 -0
- package/styles/modules/components/headers/_generator.scss +12 -0
- package/styles/modules/components/tables/_cells.scss +15 -0
- package/styles/modules/components/tables/_generator.scss +7 -0
- package/styles/modules/components/tables/_no-result.scss +10 -0
- package/styles/modules/components/tables/_rows.scss +23 -0
- package/styles/modules/components/tables/_sorting.scss +11 -0
- package/styles/modules/components/tables/_table-body.scss +11 -0
- package/styles/modules/typography/_fonts.scss +46 -68
- package/styles/modules/vendors/angular-material/_generator.scss +44 -0
- package/styles/modules/vendors/angular-material/_palette-generator.scss +32 -0
- package/styles/modules/vendors/angular-material/_typography-generator.scss +100 -0
- package/styles/partials/core/components/_index.scss +4 -0
- package/{dialog/styles → styles}/partials/core/components/dialogs/_general.scss +9 -10
- package/styles/partials/core/components/forms/_general.scss +36 -0
- package/styles/partials/core/components/headers/_general.scss +7 -0
- package/styles/partials/core/components/tables/_general.scss +21 -0
- package/styles/partials/generator-test.scss +27 -0
- package/styles/partials/theming.scss +1 -0
- package/dialog/styles/modules/_generator.scss +0 -11
- package/dialog/styles/modules/components/dialogs/_general.scss +0 -11
- package/dialog/styles/modules/components/dialogs/footers/_general.scss +0 -26
- package/dialog/styles/modules/components/dialogs/headers/_general.scss +0 -16
- package/dialog/styles/modules/theming/_default-theming.scss +0 -29
- package/dialog/styles/partials/core/_index.scss +0 -3
- package/dialog/styles/partials/core/components/_index.scss +0 -1
- package/dialog/styles/partials/core/components/dialogs/_index.scss +0 -1
- package/dialog/styles/partials/core/elements/_general.scss +0 -10
- package/dialog/styles/partials/core/elements/_index.scss +0 -1
- package/dialog/styles/partials/core/layouts/_alignments.scss +0 -13
- package/dialog/styles/partials/core/layouts/_index.scss +0 -1
- package/dialog/styles/partials/main.scss +0 -1
- package/header/styles/modules/_generator.scss +0 -13
- package/header/styles/modules/components/buttons/_general.scss +0 -26
- package/header/styles/modules/components/headers/_general.scss +0 -13
- package/header/styles/modules/theming/_default-theming.scss +0 -21
- package/header/styles/partials/core/_index.scss +0 -3
- package/header/styles/partials/core/components/_index.scss +0 -2
- package/header/styles/partials/core/components/buttons/_general.scss +0 -42
- package/header/styles/partials/core/components/buttons/_index.scss +0 -1
- package/header/styles/partials/core/components/headers/_general.scss +0 -9
- package/header/styles/partials/core/components/headers/_index.scss +0 -1
- package/header/styles/partials/core/elements/_index.scss +0 -1
- package/header/styles/partials/core/elements/headings.scss +0 -3
- package/header/styles/partials/core/layouts/_alignment.scss +0 -6
- package/header/styles/partials/core/layouts/_index.scss +0 -1
- package/header/styles/partials/main.scss +0 -1
- package/styles/_generate.scss +0 -15
- package/styles/modules/_breakpoints.scss +0 -37
- package/styles/modules/_generate.scss +0 -5
- package/styles/modules/_variables.scss +0 -22
- package/styles/modules/states/_hover.scss +0 -27
- package/styles/modules/theming/_default-theming.scss +0 -9
- package/styles/modules/typography/_generate.scss +0 -7
- package/toolbar/styles/modules/_generate.scss +0 -10
- package/toolbar/styles/modules/components/toolbar/_general.scss +0 -34
- package/toolbar/styles/modules/theming/_default-theming.scss +0 -8
- package/toolbar/styles/partials/core/_index.scss +0 -1
- package/toolbar/styles/partials/core/components/_index.scss +0 -1
- package/toolbar/styles/partials/core/components/toolbar/_general.scss +0 -100
- package/toolbar/styles/partials/core/components/toolbar/_index.scss +0 -1
- package/toolbar/styles/partials/main.scss +0 -1
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/button/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Entry Button
|
|
2
|
+
|
|
3
|
+
Simple way of providing mat button type and color for material buttons that are used in other entry components e.g. dialog or form.
|
|
4
|
+
|
|
5
|
+
Allows projects to specify which type: flat, raised or basic, to use for a submit or cancel button.
|
|
6
|
+
|
|
7
|
+
## Integration
|
|
8
|
+
|
|
9
|
+
```npm
|
|
10
|
+
npm i @enigmatry/entry-components
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Import component module:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
## Basic usage
|
|
21
|
+
|
|
22
|
+
Provide configuration for submit or cancel button in feature or shared module.
|
|
23
|
+
|
|
24
|
+
```typescript
|
|
25
|
+
import { ENTRY_BUTTON_CONFIG, EntryButtonConfig, EntryButtonModule } from '@enigmatry/entry-components/button';
|
|
26
|
+
|
|
27
|
+
@NgModule({
|
|
28
|
+
declarations: [],
|
|
29
|
+
imports: [],
|
|
30
|
+
exports: [],
|
|
31
|
+
providers: [{
|
|
32
|
+
provide: ENTRY_BUTTON_CONFIG,
|
|
33
|
+
useValue: new EntryButtonConfig({
|
|
34
|
+
submit: { type: 'raised', color: 'primary' },
|
|
35
|
+
cancel: { type: 'basic', }
|
|
36
|
+
})
|
|
37
|
+
}]
|
|
38
|
+
})
|
|
39
|
+
export class SharedModule { }
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Apply the directive entry-submit-button or entry-cancel-button on a button instead of mat-flat-button or mat-raised-button.
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<button mat-button entry-submit-button>Submit</button>
|
|
46
|
+
<button mat-button entry-cancel-button>Cancel</button>
|
|
47
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
import { ThemePalette } from '@angular/material/core';
|
|
3
|
+
/** Possible mat button variants */
|
|
4
|
+
export declare type MatButtonVariants = 'basic' | 'flat' | 'raised' | 'stroked';
|
|
5
|
+
export interface MatButtonConfig {
|
|
6
|
+
type: MatButtonVariants;
|
|
7
|
+
color?: ThemePalette;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Used to provide button configuration on module or application level.
|
|
11
|
+
*/
|
|
12
|
+
export declare class EntryButtonConfig {
|
|
13
|
+
/** Submit button configuration */
|
|
14
|
+
submit: MatButtonConfig;
|
|
15
|
+
/** Cancel button configuration */
|
|
16
|
+
cancel: MatButtonConfig;
|
|
17
|
+
constructor(config?: Partial<EntryButtonConfig>);
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Entry button config injection token. Can be used to provide custom button configuration.
|
|
21
|
+
*
|
|
22
|
+
* Defaults:
|
|
23
|
+
* - submit: type: 'flat', color: 'primary'
|
|
24
|
+
* - cancel: type: 'basic', color: 'accent'
|
|
25
|
+
*/
|
|
26
|
+
export declare const ENTRY_BUTTON_CONFIG: InjectionToken<EntryButtonConfig>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ElementRef, OnInit } from '@angular/core';
|
|
2
|
+
import { MatButton, MatAnchor } from '@angular/material/button';
|
|
3
|
+
import { EntryButtonConfig } from './entry-button-config';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class EntryButtonDirective implements OnInit {
|
|
6
|
+
private _elementRef;
|
|
7
|
+
private _config;
|
|
8
|
+
private _matButton?;
|
|
9
|
+
private _matAnchor?;
|
|
10
|
+
matClasses: {
|
|
11
|
+
[key: string]: string[];
|
|
12
|
+
};
|
|
13
|
+
constructor(_elementRef: ElementRef<HTMLElement>, _config: EntryButtonConfig, _matButton?: MatButton, _matAnchor?: MatAnchor);
|
|
14
|
+
ngOnInit(): void;
|
|
15
|
+
private getEntryType;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntryButtonDirective, [null, null, { optional: true; }, { optional: true; }]>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<EntryButtonDirective, "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]", never, {}, {}, never, never, false, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./entry-button.directive";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
import * as i3 from "@angular/material/button";
|
|
5
|
+
export declare class EntryButtonModule {
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EntryButtonModule, never>;
|
|
7
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<EntryButtonModule, [typeof i1.EntryButtonDirective], [typeof i2.CommonModule, typeof i3.MatButtonModule], [typeof i1.EntryButtonDirective]>;
|
|
8
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<EntryButtonModule>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW5pZ21hdHJ5LWVudHJ5LWNvbXBvbmVudHMtYnV0dG9uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vbGlicy9lbnRyeS1jb21wb25lbnRzL2J1dHRvbi9lbmlnbWF0cnktZW50cnktY29tcG9uZW50cy1idXR0b24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLGNBQWMsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi9wdWJsaWMtYXBpJztcbiJdfQ==
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InjectionToken } from '@angular/core';
|
|
2
|
+
/**
|
|
3
|
+
* Used to provide button configuration on module or application level.
|
|
4
|
+
*/
|
|
5
|
+
export class EntryButtonConfig {
|
|
6
|
+
constructor(config = {}) {
|
|
7
|
+
this.submit = config.submit ?? { type: 'flat', color: 'primary' };
|
|
8
|
+
this.cancel = config.cancel ?? { type: 'basic', color: 'accent' };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Entry button config injection token. Can be used to provide custom button configuration.
|
|
13
|
+
*
|
|
14
|
+
* Defaults:
|
|
15
|
+
* - submit: type: 'flat', color: 'primary'
|
|
16
|
+
* - cancel: type: 'basic', color: 'accent'
|
|
17
|
+
*/
|
|
18
|
+
export const ENTRY_BUTTON_CONFIG = new InjectionToken('EntryButtonConfig', {
|
|
19
|
+
providedIn: 'root',
|
|
20
|
+
factory: () => new EntryButtonConfig()
|
|
21
|
+
});
|
|
22
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50cnktYnV0dG9uLWNvbmZpZy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZW50cnktY29tcG9uZW50cy9idXR0b24vZW50cnktYnV0dG9uLWNvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBWS9DOztHQUVHO0FBQ0gsTUFBTSxPQUFPLGlCQUFpQjtJQU01QixZQUFZLFNBQXFDLEVBQUU7UUFDakQsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNLENBQUMsTUFBTSxJQUFJLEVBQUUsSUFBSSxFQUFFLE1BQU0sRUFBRSxLQUFLLEVBQUUsU0FBUyxFQUFFLENBQUM7UUFDbEUsSUFBSSxDQUFDLE1BQU0sR0FBRyxNQUFNL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@angular/core';
|
|
2
|
+
import { ENTRY_BUTTON_CONFIG } from './entry-button-config';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/material/button";
|
|
5
|
+
import * as i2 from "./entry-button-config";
|
|
6
|
+
export class EntryButtonDirective {
|
|
7
|
+
constructor(_elementRef, _config, _matButton, _matAnchor) {
|
|
8
|
+
this._elementRef = _elementRef;
|
|
9
|
+
this._config = _config;
|
|
10
|
+
this._matButton = _matButton;
|
|
11
|
+
this._matAnchor = _matAnchor;
|
|
12
|
+
this.matClasses = {
|
|
13
|
+
basic: ['mdc-button', 'mat-mdc-button'],
|
|
14
|
+
raised: ['mdc-button', 'mdc-button--raised', 'mat-mdc-raised-button'],
|
|
15
|
+
stroked: ['mdc-button', 'mdc-button--outlined', 'mat-mdc-outlined-button'],
|
|
16
|
+
flat: ['mdc-button', 'mdc-button--unelevated', 'mat-mdc-unelevated-button']
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
ngOnInit() {
|
|
20
|
+
const entryButtonType = this.getEntryType();
|
|
21
|
+
const buttonConfig = this._config[entryButtonType];
|
|
22
|
+
const entryClasses = ['entry-button', `entry-${entryButtonType}-button`];
|
|
23
|
+
const matClasses = this.matClasses[buttonConfig.type];
|
|
24
|
+
this._elementRef.nativeElement.classList.add(...entryClasses, ...matClasses);
|
|
25
|
+
const color = buttonConfig.color;
|
|
26
|
+
if (color) {
|
|
27
|
+
if (this._matButton) {
|
|
28
|
+
this._matButton.color = color;
|
|
29
|
+
}
|
|
30
|
+
if (this._matAnchor) {
|
|
31
|
+
this._matAnchor.color = color;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
getEntryType() {
|
|
36
|
+
return this._elementRef.nativeElement.hasAttribute('entry-submit-button')
|
|
37
|
+
? 'submit' : 'cancel';
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
EntryButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonDirective, deps: [{ token: i0.ElementRef }, { token: ENTRY_BUTTON_CONFIG }, { token: i1.MatButton, optional: true }, { token: i1.MatAnchor, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
41
|
+
EntryButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]", ngImport: i0 });
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonDirective, decorators: [{
|
|
43
|
+
type: Directive,
|
|
44
|
+
args: [{
|
|
45
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
46
|
+
selector: `[mat-button][entry-submit-button],[mat-button][entry-cancel-button]`
|
|
47
|
+
}]
|
|
48
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i2.EntryButtonConfig, decorators: [{
|
|
49
|
+
type: Inject,
|
|
50
|
+
args: [ENTRY_BUTTON_CONFIG]
|
|
51
|
+
}] }, { type: i1.MatButton, decorators: [{
|
|
52
|
+
type: Optional
|
|
53
|
+
}] }, { type: i1.MatAnchor, decorators: [{
|
|
54
|
+
type: Optional
|
|
55
|
+
}] }]; } });
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50cnktYnV0dG9uLmRpcmVjdGl2ZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZW50cnktY29tcG9uZW50cy9idXR0b24vZW50cnktYnV0dG9uLmRpcmVjdGl2ZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsU0FBUyxFQUFjLE1BQU0sRUFBVSxRQUFRLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFHaEYsT0F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ICA/ICdzdWJtaXQnIDogJ2NhbmNlbCc7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { NgModule } from '@angular/core';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import { EntryButtonDirective } from './entry-button.directive';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export class EntryButtonModule {
|
|
7
|
+
}
|
|
8
|
+
EntryButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
9
|
+
EntryButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, declarations: [EntryButtonDirective], imports: [CommonModule,
|
|
10
|
+
MatButtonModule], exports: [EntryButtonDirective] });
|
|
11
|
+
EntryButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, imports: [CommonModule,
|
|
12
|
+
MatButtonModule] });
|
|
13
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, decorators: [{
|
|
14
|
+
type: NgModule,
|
|
15
|
+
args: [{
|
|
16
|
+
declarations: [
|
|
17
|
+
EntryButtonDirective
|
|
18
|
+
],
|
|
19
|
+
imports: [
|
|
20
|
+
CommonModule,
|
|
21
|
+
MatButtonModule
|
|
22
|
+
],
|
|
23
|
+
exports: [
|
|
24
|
+
EntryButtonDirective
|
|
25
|
+
]
|
|
26
|
+
}]
|
|
27
|
+
}] });
|
|
28
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50cnktYnV0dG9uLm1vZHVsZS5qcyIsInNvdXJjZVJvb3QiOiIiL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hdGVyaWFsL2J1dHRvbic7XG5cbkBOZ01vZHVsZSh7XG4gIGRlY2xhcmF0aW9uczogW1xuICAgIEVudHJ5QnV0dG9uRGlyZWN0aXZlXG4gIF0sXG4gIGltcG9ydHM6IFtcbiAgICBDb21tb25Nb2R1bGUsXG4gICAgTWF0QnV0dG9uTW9kdWxlXG4gIF0sXG4gIGV4cG9ydHM6IFtcbiAgICBFbnRyeUJ1dHRvbkRpcmVjdGl2ZVxuICBdXG59KVxuZXhwb3J0IGNsYXNzIEVudHJ5QnV0dG9uTW9kdWxlIHsgfVxuIl19
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { EntryButtonDirective } from './entry-button.directive';
|
|
2
|
+
export { EntryButtonModule } from './entry-button.module';
|
|
3
|
+
export { ENTRY_BUTTON_CONFIG, EntryButtonConfig } from './entry-button-config';
|
|
4
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL2xpYnMvZW50cnktY29tcG9uZW50cy9idXR0b24vcHVibGljLWFwaS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsb0JBQW9CLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUNoRSxPQUFPLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQUUxRCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsaUJBQWlCLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCB7IEVudHJ5QnV0dG9uRGlyZWN0aXZlIH0gZnJvbSAnLi9lbnRyeS1idXR0b24uZGlyZWN0aXZlJztcbmV4cG9ydCB7IEVudHJ5QnV0dG9uTW9kdWxlIH0gZnJvbSAnLi9lbnRyeS1idXR0b24ubW9kdWxlJztcblxuZXhwb3J0IHsgRU5UUllfQlVUVE9OX0NPTkZJRywgRW50cnlCdXR0b25Db25maWcgfSBmcm9tICcuL2VudHJ5LWJ1dHRvbi1jb25maWcnO1xuIl19
|
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
export {};
|
|
2
|
-
|
|
2
|
+
// TODO: sort out this by using classes from Scss Foundation instead of reinventing the wheel
|
|
3
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZW50cnktZGlhbG9nLWJ1dHRvbnMtYWxpZ25tZW50LnR5cGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9saWJzL2VudHJ5LWNvbXBvbmVudHMvZGlhbG9nL2VudHJ5LWRpYWxvZy1idXR0b25zLWFsaWdubWVudC50eXBlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQSw2RkFBNkYiLCJzb3VyY2VzQ29udGVudCI6WyIvKiogRGVmaW5lcyBob3Jpem9udGFsIGFsaWdubWVudCBvZiBkaWFsb2cgYnV0dG9ucy4gKi9cbmV4cG9ydCB0eXBlIEVudHJ5RGlhbG9nQnV0dG9uc0FsaWdubWVudCA9ICdhbGlnbi1sZWZ0JyB8ICdhbGlnbi1jZW50ZXInIHwgJ2FsaWduLXJpZ2h0Jztcbi8vIFRPRE86IHNvcnQgb3V0IHRoaXMgYnkgdXNpbmcgY2xhc3NlcyBmcm9tIFNjc3MgRm91bmRhdGlvbiBpbnN0ZWFkIG9mIHJlaW52ZW50aW5nIHRoZSB3aGVlbFxuIl19
|
package/esm2020/public-api.mjs
CHANGED
|
@@ -6,4 +6,5 @@ export * from '@enigmatry/entry-components/dialog';
|
|
|
6
6
|
export * from '@enigmatry/entry-components/search-filter';
|
|
7
7
|
export * from '@enigmatry/entry-components/toolbar';
|
|
8
8
|
export * from '@enigmatry/entry-components/validation';
|
|
9
|
-
|
|
9
|
+
export * from '@enigmatry/entry-components/button';
|
|
10
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL2xpYnMvZW50cnktY29tcG9uZW50cy9wdWJsaWMtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOztHQUVHO0FBRUgsY0FBYyxvQ0FBb0MsQ0FBQztBQUNuRCxjQUFjLG9DQUFvQyxDQUFDO0FBQ25ELGNBQWMsMkNBQTJDLENBQUM7QUFDMUQsY0FBYyxxQ0FBcUMsQ0FBQztBQUNwRCxjQUFjLHdDQUF3QyxDQUFDO0FBQ3ZELGNBQWMsb0NBQW9DLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKlxuICogUHVibGljIEFQSSBTdXJmYWNlIG9mIGVudHJ5LWNvbXBvbmVudHNcbiAqL1xuXG5leHBvcnQgKiBmcm9tICdAZW5pZ21hdHJ5L2VudHJ5LWNvbXBvbmVudHMvaGVhZGVyJztcbmV4cG9ydCAqIGZyb20gJ0BlbmlnbWF0cnkvZW50cnktY29tcG9uZW50cy9kaWFsb2cnO1xuZXhwb3J0ICogZnJvbSAnQGVuaWdtYXRyeS9lbnRyeS1jb21wb25lbnRzL3NlYXJjaC1maWx0ZXInO1xuZXhwb3J0ICogZnJvbSAnQGVuaWdtYXRyeS9lbnRyeS1jb21wb25lbnRzL3Rvb2xiYXInO1xuZXhwb3J0ICogZnJvbSAnQGVuaWdtYXRyeS9lbnRyeS1jb21wb25lbnRzL3ZhbGlkYXRpb24nO1xuZXhwb3J0ICogZnJvbSAnQGVuaWdtYXRyeS9lbnRyeS1jb21wb25lbnRzL2J1dHRvbic7XG4iXX0=
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Directive, Inject, Optional, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/button';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to provide button configuration on module or application level.
|
|
9
|
+
*/
|
|
10
|
+
class EntryButtonConfig {
|
|
11
|
+
constructor(config = {}) {
|
|
12
|
+
var _a, _b;
|
|
13
|
+
this.submit = (_a = config.submit) !== null && _a !== void 0 ? _a : { type: 'flat', color: 'primary' };
|
|
14
|
+
this.cancel = (_b = config.cancel) !== null && _b !== void 0 ? _b : { type: 'basic', color: 'accent' };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Entry button config injection token. Can be used to provide custom button configuration.
|
|
19
|
+
*
|
|
20
|
+
* Defaults:
|
|
21
|
+
* - submit: type: 'flat', color: 'primary'
|
|
22
|
+
* - cancel: type: 'basic', color: 'accent'
|
|
23
|
+
*/
|
|
24
|
+
const ENTRY_BUTTON_CONFIG = new InjectionToken('EntryButtonConfig', {
|
|
25
|
+
providedIn: 'root',
|
|
26
|
+
factory: () => new EntryButtonConfig()
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
class EntryButtonDirective {
|
|
30
|
+
constructor(_elementRef, _config, _matButton, _matAnchor) {
|
|
31
|
+
this._elementRef = _elementRef;
|
|
32
|
+
this._config = _config;
|
|
33
|
+
this._matButton = _matButton;
|
|
34
|
+
this._matAnchor = _matAnchor;
|
|
35
|
+
this.matClasses = {
|
|
36
|
+
basic: ['mdc-button', 'mat-mdc-button'],
|
|
37
|
+
raised: ['mdc-button', 'mdc-button--raised', 'mat-mdc-raised-button'],
|
|
38
|
+
stroked: ['mdc-button', 'mdc-button--outlined', 'mat-mdc-outlined-button'],
|
|
39
|
+
flat: ['mdc-button', 'mdc-button--unelevated', 'mat-mdc-unelevated-button']
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
ngOnInit() {
|
|
43
|
+
const entryButtonType = this.getEntryType();
|
|
44
|
+
const buttonConfig = this._config[entryButtonType];
|
|
45
|
+
const entryClasses = ['entry-button', `entry-${entryButtonType}-button`];
|
|
46
|
+
const matClasses = this.matClasses[buttonConfig.type];
|
|
47
|
+
this._elementRef.nativeElement.classList.add(...entryClasses, ...matClasses);
|
|
48
|
+
const color = buttonConfig.color;
|
|
49
|
+
if (color) {
|
|
50
|
+
if (this._matButton) {
|
|
51
|
+
this._matButton.color = color;
|
|
52
|
+
}
|
|
53
|
+
if (this._matAnchor) {
|
|
54
|
+
this._matAnchor.color = color;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
getEntryType() {
|
|
59
|
+
return this._elementRef.nativeElement.hasAttribute('entry-submit-button')
|
|
60
|
+
? 'submit' : 'cancel';
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
EntryButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonDirective, deps: [{ token: i0.ElementRef }, { token: ENTRY_BUTTON_CONFIG }, { token: i1.MatButton, optional: true }, { token: i1.MatAnchor, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
64
|
+
EntryButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]", ngImport: i0 });
|
|
65
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonDirective, decorators: [{
|
|
66
|
+
type: Directive,
|
|
67
|
+
args: [{
|
|
68
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
69
|
+
selector: `[mat-button][entry-submit-button],[mat-button][entry-cancel-button]`
|
|
70
|
+
}]
|
|
71
|
+
}], ctorParameters: function () {
|
|
72
|
+
return [{ type: i0.ElementRef }, { type: EntryButtonConfig, decorators: [{
|
|
73
|
+
type: Inject,
|
|
74
|
+
args: [ENTRY_BUTTON_CONFIG]
|
|
75
|
+
}] }, { type: i1.MatButton, decorators: [{
|
|
76
|
+
type: Optional
|
|
77
|
+
}] }, { type: i1.MatAnchor, decorators: [{
|
|
78
|
+
type: Optional
|
|
79
|
+
}] }];
|
|
80
|
+
} });
|
|
81
|
+
|
|
82
|
+
class EntryButtonModule {
|
|
83
|
+
}
|
|
84
|
+
EntryButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
85
|
+
EntryButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, declarations: [EntryButtonDirective], imports: [CommonModule,
|
|
86
|
+
MatButtonModule], exports: [EntryButtonDirective] });
|
|
87
|
+
EntryButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, imports: [CommonModule,
|
|
88
|
+
MatButtonModule] });
|
|
89
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, decorators: [{
|
|
90
|
+
type: NgModule,
|
|
91
|
+
args: [{
|
|
92
|
+
declarations: [
|
|
93
|
+
EntryButtonDirective
|
|
94
|
+
],
|
|
95
|
+
imports: [
|
|
96
|
+
CommonModule,
|
|
97
|
+
MatButtonModule
|
|
98
|
+
],
|
|
99
|
+
exports: [
|
|
100
|
+
EntryButtonDirective
|
|
101
|
+
]
|
|
102
|
+
}]
|
|
103
|
+
}] });
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* Generated bundle index. Do not edit.
|
|
107
|
+
*/
|
|
108
|
+
|
|
109
|
+
export { ENTRY_BUTTON_CONFIG, EntryButtonConfig, EntryButtonDirective, EntryButtonModule };
|
|
110
|
+
//# sourceMappingURL=enigmatry-entry-components-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enigmatry-entry-components-button.mjs","sources":["../../../../libs/entry-components/button/entry-button-config.ts","../../../../libs/entry-components/button/entry-button.directive.ts","../../../../libs/entry-components/button/entry-button.module.ts","../../../../libs/entry-components/button/enigmatry-entry-components-button.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\r\nimport { ThemePalette } from '@angular/material/core';\r\n\r\n/** Possible mat button variants */\r\nexport declare type MatButtonVariants = 'basic' | 'flat' | 'raised' | 'stroked';\r\n\r\n//** MatButtonConfig containing type and color */\r\nexport interface MatButtonConfig {\r\n type: MatButtonVariants;\r\n color?: ThemePalette;\r\n}\r\n\r\n/**\r\n * Used to provide button configuration on module or application level.\r\n */\r\nexport class EntryButtonConfig {\r\n /** Submit button configuration */\r\n submit: MatButtonConfig;\r\n /** Cancel button configuration */\r\n cancel: MatButtonConfig;\r\n\r\n constructor(config: Partial<EntryButtonConfig> = {}) {\r\n this.submit = config.submit ?? { type: 'flat', color: 'primary' };\r\n this.cancel = config.cancel ?? { type: 'basic', color: 'accent' };\r\n }\r\n}\r\n\r\n/**\r\n * Entry button config injection token. Can be used to provide custom button configuration.\r\n *\r\n * Defaults:\r\n * - submit: type: 'flat', color: 'primary'\r\n * - cancel: type: 'basic', color: 'accent'\r\n */\r\nexport const ENTRY_BUTTON_CONFIG = new InjectionToken<EntryButtonConfig>('EntryButtonConfig',\r\n {\r\n providedIn: 'root',\r\n factory: () => new EntryButtonConfig()\r\n }\r\n);\r\n","import { Directive, ElementRef, Inject, OnInit, Optional } from '@angular/core';\nimport { MatButton, MatAnchor } from '@angular/material/button';\nimport { ThemePalette } from '@angular/material/core';\nimport { ENTRY_BUTTON_CONFIG, EntryButtonConfig, MatButtonConfig } from './entry-button-config';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: `[mat-button][entry-submit-button],[mat-button][entry-cancel-button]`\n})\nexport class EntryButtonDirective implements OnInit {\n\n matClasses: { [key: string]: string[] } = {\n basic: ['mdc-button', 'mat-mdc-button'],\n raised: ['mdc-button', 'mdc-button--raised', 'mat-mdc-raised-button'],\n stroked: ['mdc-button', 'mdc-button--outlined', 'mat-mdc-outlined-button'],\n flat: ['mdc-button', 'mdc-button--unelevated', 'mat-mdc-unelevated-button']\n };\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n @Inject(ENTRY_BUTTON_CONFIG) private _config: EntryButtonConfig,\n @Optional() private _matButton?: MatButton,\n @Optional() private _matAnchor?: MatAnchor) {\n }\n\n ngOnInit(): void {\n const entryButtonType = this.getEntryType();\n const buttonConfig: MatButtonConfig = this._config[entryButtonType];\n\n const entryClasses: string[] = ['entry-button', `entry-${entryButtonType}-button`];\n const matClasses = this.matClasses[buttonConfig.type];\n\n this._elementRef.nativeElement.classList.add(...entryClasses, ...matClasses);\n\n const color: ThemePalette = buttonConfig.color;\n if (color) {\n if (this._matButton) { this._matButton.color = color; }\n if (this._matAnchor) { this._matAnchor.color = color; }\n }\n }\n\n private getEntryType(): string {\n return this._elementRef.nativeElement.hasAttribute('entry-submit-button')\n ? 'submit' : 'cancel';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EntryButtonDirective } from './entry-button.directive';\nimport { MatButtonModule } from '@angular/material/button';\n\n@NgModule({\n declarations: [\n EntryButtonDirective\n ],\n imports: [\n CommonModule,\n MatButtonModule\n ],\n exports: [\n EntryButtonDirective\n ]\n})\nexport class EntryButtonModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAYA;;AAEG;MACU,iBAAiB,CAAA;IAM5B,WAAY,CAAA,SAAqC,EAAE,EAAA;;AACjD,QAAA,IAAI,CAAC,MAAM,GAAG,CAAA,EAAA,GAAA,MAAM,CAAC,MAAM,MAAA,IAAA,IAAA,EAAA,KAAA,KAAA,CAAA,GAAA,EAAA,GA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A,CAAA;kBAJhC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;;AAET,oBAAA,QAAQ,EAAE,CAAqE,mEAAA,CAAA;iBAChF,CAAA;;;8BAYI,MAAM;+BAAC,mBAAmB,CAAA;;8BAC1B,QAAQ;;8BACR,QAAQ;;;;MCLA,iBAAiB,CAAA;;8GAAjB,iBAAiB,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;+GAAjB,iBAAiB,EAAA,YAAA,EAAA,CAV1B,oBAAoB,CAAA,EAAA,OAAA,EAAA,CAGpB,YAAY;QACZ,eAAe,aAGf,oBAAoB,CAAA,EAAA,CAAA,CAAA;AAGX,iBAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,iBAAiB,YAP1B,YAAY;QACZ,eAAe,CAAA,EAAA,CAAA,CAAA;2FAMN,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAZ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;AAChB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;AACrB,qBAAA;iBACF,CAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -3,6 +3,7 @@ export * from '@enigmatry/entry-components/dialog';
|
|
|
3
3
|
export * from '@enigmatry/entry-components/search-filter';
|
|
4
4
|
export * from '@enigmatry/entry-components/toolbar';
|
|
5
5
|
export * from '@enigmatry/entry-components/validation';
|
|
6
|
+
export * from '@enigmatry/entry-components/button';
|
|
6
7
|
|
|
7
8
|
/*
|
|
8
9
|
* Public API Surface of entry-components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enigmatry-entry-components.mjs","sources":["../../../../libs/entry-components/public-api.ts","../../../../libs/entry-components/enigmatry-entry-components.ts"],"sourcesContent":["/*\n * Public API Surface of entry-components\n */\n\nexport * from '@enigmatry/entry-components/header';\nexport * from '@enigmatry/entry-components/dialog';\nexport * from '@enigmatry/entry-components/search-filter';\nexport * from '@enigmatry/entry-components/toolbar';\nexport * from '@enigmatry/entry-components/validation';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enigmatry-entry-components.mjs","sources":["../../../../libs/entry-components/public-api.ts","../../../../libs/entry-components/enigmatry-entry-components.ts"],"sourcesContent":["/*\n * Public API Surface of entry-components\n */\n\nexport * from '@enigmatry/entry-components/header';\nexport * from '@enigmatry/entry-components/dialog';\nexport * from '@enigmatry/entry-components/search-filter';\nexport * from '@enigmatry/entry-components/toolbar';\nexport * from '@enigmatry/entry-components/validation';\nexport * from '@enigmatry/entry-components/button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;AAEG;;ACFH;;AAEG"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Directive, Inject, Optional, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1 from '@angular/material/button';
|
|
4
|
+
import { MatButtonModule } from '@angular/material/button';
|
|
5
|
+
import { CommonModule } from '@angular/common';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Used to provide button configuration on module or application level.
|
|
9
|
+
*/
|
|
10
|
+
class EntryButtonConfig {
|
|
11
|
+
constructor(config = {}) {
|
|
12
|
+
this.submit = config.submit ?? { type: 'flat', color: 'primary' };
|
|
13
|
+
this.cancel = config.cancel ?? { type: 'basic', color: 'accent' };
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Entry button config injection token. Can be used to provide custom button configuration.
|
|
18
|
+
*
|
|
19
|
+
* Defaults:
|
|
20
|
+
* - submit: type: 'flat', color: 'primary'
|
|
21
|
+
* - cancel: type: 'basic', color: 'accent'
|
|
22
|
+
*/
|
|
23
|
+
const ENTRY_BUTTON_CONFIG = new InjectionToken('EntryButtonConfig', {
|
|
24
|
+
providedIn: 'root',
|
|
25
|
+
factory: () => new EntryButtonConfig()
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
class EntryButtonDirective {
|
|
29
|
+
constructor(_elementRef, _config, _matButton, _matAnchor) {
|
|
30
|
+
this._elementRef = _elementRef;
|
|
31
|
+
this._config = _config;
|
|
32
|
+
this._matButton = _matButton;
|
|
33
|
+
this._matAnchor = _matAnchor;
|
|
34
|
+
this.matClasses = {
|
|
35
|
+
basic: ['mdc-button', 'mat-mdc-button'],
|
|
36
|
+
raised: ['mdc-button', 'mdc-button--raised', 'mat-mdc-raised-button'],
|
|
37
|
+
stroked: ['mdc-button', 'mdc-button--outlined', 'mat-mdc-outlined-button'],
|
|
38
|
+
flat: ['mdc-button', 'mdc-button--unelevated', 'mat-mdc-unelevated-button']
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
ngOnInit() {
|
|
42
|
+
const entryButtonType = this.getEntryType();
|
|
43
|
+
const buttonConfig = this._config[entryButtonType];
|
|
44
|
+
const entryClasses = ['entry-button', `entry-${entryButtonType}-button`];
|
|
45
|
+
const matClasses = this.matClasses[buttonConfig.type];
|
|
46
|
+
this._elementRef.nativeElement.classList.add(...entryClasses, ...matClasses);
|
|
47
|
+
const color = buttonConfig.color;
|
|
48
|
+
if (color) {
|
|
49
|
+
if (this._matButton) {
|
|
50
|
+
this._matButton.color = color;
|
|
51
|
+
}
|
|
52
|
+
if (this._matAnchor) {
|
|
53
|
+
this._matAnchor.color = color;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
getEntryType() {
|
|
58
|
+
return this._elementRef.nativeElement.hasAttribute('entry-submit-button')
|
|
59
|
+
? 'submit' : 'cancel';
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
EntryButtonDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonDirective, deps: [{ token: i0.ElementRef }, { token: ENTRY_BUTTON_CONFIG }, { token: i1.MatButton, optional: true }, { token: i1.MatAnchor, optional: true }], target: i0.ɵɵFactoryTarget.Directive });
|
|
63
|
+
EntryButtonDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "15.2.9", type: EntryButtonDirective, selector: "[mat-button][entry-submit-button],[mat-button][entry-cancel-button]", ngImport: i0 });
|
|
64
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonDirective, decorators: [{
|
|
65
|
+
type: Directive,
|
|
66
|
+
args: [{
|
|
67
|
+
// eslint-disable-next-line @angular-eslint/directive-selector
|
|
68
|
+
selector: `[mat-button][entry-submit-button],[mat-button][entry-cancel-button]`
|
|
69
|
+
}]
|
|
70
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: EntryButtonConfig, decorators: [{
|
|
71
|
+
type: Inject,
|
|
72
|
+
args: [ENTRY_BUTTON_CONFIG]
|
|
73
|
+
}] }, { type: i1.MatButton, decorators: [{
|
|
74
|
+
type: Optional
|
|
75
|
+
}] }, { type: i1.MatAnchor, decorators: [{
|
|
76
|
+
type: Optional
|
|
77
|
+
}] }]; } });
|
|
78
|
+
|
|
79
|
+
class EntryButtonModule {
|
|
80
|
+
}
|
|
81
|
+
EntryButtonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
82
|
+
EntryButtonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, declarations: [EntryButtonDirective], imports: [CommonModule,
|
|
83
|
+
MatButtonModule], exports: [EntryButtonDirective] });
|
|
84
|
+
EntryButtonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, imports: [CommonModule,
|
|
85
|
+
MatButtonModule] });
|
|
86
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.9", ngImport: i0, type: EntryButtonModule, decorators: [{
|
|
87
|
+
type: NgModule,
|
|
88
|
+
args: [{
|
|
89
|
+
declarations: [
|
|
90
|
+
EntryButtonDirective
|
|
91
|
+
],
|
|
92
|
+
imports: [
|
|
93
|
+
CommonModule,
|
|
94
|
+
MatButtonModule
|
|
95
|
+
],
|
|
96
|
+
exports: [
|
|
97
|
+
EntryButtonDirective
|
|
98
|
+
]
|
|
99
|
+
}]
|
|
100
|
+
}] });
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Generated bundle index. Do not edit.
|
|
104
|
+
*/
|
|
105
|
+
|
|
106
|
+
export { ENTRY_BUTTON_CONFIG, EntryButtonConfig, EntryButtonDirective, EntryButtonModule };
|
|
107
|
+
//# sourceMappingURL=enigmatry-entry-components-button.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"enigmatry-entry-components-button.mjs","sources":["../../../../libs/entry-components/button/entry-button-config.ts","../../../../libs/entry-components/button/entry-button.directive.ts","../../../../libs/entry-components/button/entry-button.module.ts","../../../../libs/entry-components/button/enigmatry-entry-components-button.ts"],"sourcesContent":["import { InjectionToken } from '@angular/core';\r\nimport { ThemePalette } from '@angular/material/core';\r\n\r\n/** Possible mat button variants */\r\nexport declare type MatButtonVariants = 'basic' | 'flat' | 'raised' | 'stroked';\r\n\r\n//** MatButtonConfig containing type and color */\r\nexport interface MatButtonConfig {\r\n type: MatButtonVariants;\r\n color?: ThemePalette;\r\n}\r\n\r\n/**\r\n * Used to provide button configuration on module or application level.\r\n */\r\nexport class EntryButtonConfig {\r\n /** Submit button configuration */\r\n submit: MatButtonConfig;\r\n /** Cancel button configuration */\r\n cancel: MatButtonConfig;\r\n\r\n constructor(config: Partial<EntryButtonConfig> = {}) {\r\n this.submit = config.submit ?? { type: 'flat', color: 'primary' };\r\n this.cancel = config.cancel ?? { type: 'basic', color: 'accent' };\r\n }\r\n}\r\n\r\n/**\r\n * Entry button config injection token. Can be used to provide custom button configuration.\r\n *\r\n * Defaults:\r\n * - submit: type: 'flat', color: 'primary'\r\n * - cancel: type: 'basic', color: 'accent'\r\n */\r\nexport const ENTRY_BUTTON_CONFIG = new InjectionToken<EntryButtonConfig>('EntryButtonConfig',\r\n {\r\n providedIn: 'root',\r\n factory: () => new EntryButtonConfig()\r\n }\r\n);\r\n","import { Directive, ElementRef, Inject, OnInit, Optional } from '@angular/core';\nimport { MatButton, MatAnchor } from '@angular/material/button';\nimport { ThemePalette } from '@angular/material/core';\nimport { ENTRY_BUTTON_CONFIG, EntryButtonConfig, MatButtonConfig } from './entry-button-config';\n\n@Directive({\n // eslint-disable-next-line @angular-eslint/directive-selector\n selector: `[mat-button][entry-submit-button],[mat-button][entry-cancel-button]`\n})\nexport class EntryButtonDirective implements OnInit {\n\n matClasses: { [key: string]: string[] } = {\n basic: ['mdc-button', 'mat-mdc-button'],\n raised: ['mdc-button', 'mdc-button--raised', 'mat-mdc-raised-button'],\n stroked: ['mdc-button', 'mdc-button--outlined', 'mat-mdc-outlined-button'],\n flat: ['mdc-button', 'mdc-button--unelevated', 'mat-mdc-unelevated-button']\n };\n\n constructor(\n private _elementRef: ElementRef<HTMLElement>,\n @Inject(ENTRY_BUTTON_CONFIG) private _config: EntryButtonConfig,\n @Optional() private _matButton?: MatButton,\n @Optional() private _matAnchor?: MatAnchor) {\n }\n\n ngOnInit(): void {\n const entryButtonType = this.getEntryType();\n const buttonConfig: MatButtonConfig = this._config[entryButtonType];\n\n const entryClasses: string[] = ['entry-button', `entry-${entryButtonType}-button`];\n const matClasses = this.matClasses[buttonConfig.type];\n\n this._elementRef.nativeElement.classList.add(...entryClasses, ...matClasses);\n\n const color: ThemePalette = buttonConfig.color;\n if (color) {\n if (this._matButton) { this._matButton.color = color; }\n if (this._matAnchor) { this._matAnchor.color = color; }\n }\n }\n\n private getEntryType(): string {\n return this._elementRef.nativeElement.hasAttribute('entry-submit-button')\n ? 'submit' : 'cancel';\n }\n}\n","import { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { EntryButtonDirective } from './entry-button.directive';\nimport { MatButtonModule } from '@angular/material/button';\n\n@NgModule({\n declarations: [\n EntryButtonDirective\n ],\n imports: [\n CommonModule,\n MatButtonModule\n ],\n exports: [\n EntryButtonDirective\n ]\n})\nexport class EntryButtonModule { }\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAYA;;AAEG;MACU,iBAAiB,CAAA;AAM5B,IAAA,WAAA,CAAY,SAAqC,EAAE,EAAA;AACjD,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;AAClE,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,IAAI,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;KACnE;AACF,CAAA;AAED;;;;;;AAMG;MACU,mBAAmB,GAAG,IAAI,cAAc,CAAoB,mBAAmB,EAC1F;AACE,IAAA,UAAU,EAAE,MAAM;AAClB,IAAA,OAAO,EAAE,MAAM,IAAI,iBAAiB,EAAE;AACvC,CAAA;;MC7BU,oBAAoB,CAAA;AAS/B,IAAA,WAAA,CACU,WAAoC,EACP,OAA0B,EAC3C,UAAsB,EACtB,UAAsB,EAAA;QAHlC,IAAW,CAAA,WAAA,GAAX,WAAW,CAAyB;QACP,IAAO,CAAA,OAAA,GAAP,OAAO,C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,eAAe,CAAA,EAAA,CAAA,CAAA;2FAMN,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAZ7B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,oBAAoB;AACrB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,eAAe;AAChB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,oBAAoB;AACrB,qBAAA;AACF,iBAAA,CAAA;;;AChBD;;AAEG;;;;"}
|
|
@@ -3,6 +3,7 @@ export * from '@enigmatry/entry-components/dialog';
|
|
|
3
3
|
export * from '@enigmatry/entry-components/search-filter';
|
|
4
4
|
export * from '@enigmatry/entry-components/toolbar';
|
|
5
5
|
export * from '@enigmatry/entry-components/validation';
|
|
6
|
+
export * from '@enigmatry/entry-components/button';
|
|
6
7
|
|
|
7
8
|
/*
|
|
8
9
|
* Public API Surface of entry-components
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enigmatry-entry-components.mjs","sources":["../../../../libs/entry-components/public-api.ts","../../../../libs/entry-components/enigmatry-entry-components.ts"],"sourcesContent":["/*\n * Public API Surface of entry-components\n */\n\nexport * from '@enigmatry/entry-components/header';\nexport * from '@enigmatry/entry-components/dialog';\nexport * from '@enigmatry/entry-components/search-filter';\nexport * from '@enigmatry/entry-components/toolbar';\nexport * from '@enigmatry/entry-components/validation';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"enigmatry-entry-components.mjs","sources":["../../../../libs/entry-components/public-api.ts","../../../../libs/entry-components/enigmatry-entry-components.ts"],"sourcesContent":["/*\n * Public API Surface of entry-components\n */\n\nexport * from '@enigmatry/entry-components/header';\nexport * from '@enigmatry/entry-components/dialog';\nexport * from '@enigmatry/entry-components/search-filter';\nexport * from '@enigmatry/entry-components/toolbar';\nexport * from '@enigmatry/entry-components/validation';\nexport * from '@enigmatry/entry-components/button';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;AAAA;;AAEG;;ACFH;;AAEG"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@enigmatry/entry-components",
|
|
3
|
-
"version": "1.15.1-preview.
|
|
3
|
+
"version": "1.15.1-preview.21",
|
|
4
4
|
"author": "Enigmatry",
|
|
5
5
|
"description": "Enigmatry entry angular material components",
|
|
6
6
|
"homepage": "https://github.com/enigmatry/entry-angular-building-blocks/tree/master/libs/entry-components#readme",
|
|
@@ -42,6 +42,14 @@
|
|
|
42
42
|
"node": "./fesm2015/enigmatry-entry-components.mjs",
|
|
43
43
|
"default": "./fesm2020/enigmatry-entry-components.mjs"
|
|
44
44
|
},
|
|
45
|
+
"./button": {
|
|
46
|
+
"types": "./button/index.d.ts",
|
|
47
|
+
"esm2020": "./esm2020/button/enigmatry-entry-components-button.mjs",
|
|
48
|
+
"es2020": "./fesm2020/enigmatry-entry-components-button.mjs",
|
|
49
|
+
"es2015": "./fesm2015/enigmatry-entry-components-button.mjs",
|
|
50
|
+
"node": "./fesm2015/enigmatry-entry-components-button.mjs",
|
|
51
|
+
"default": "./fesm2020/enigmatry-entry-components-button.mjs"
|
|
52
|
+
},
|
|
45
53
|
"./dialog": {
|
|
46
54
|
"types": "./dialog/index.d.ts",
|
|
47
55
|
"esm2020": "./esm2020/dialog/enigmatry-entry-components-dialog.mjs",
|