@fasteros/themes 1.0.0
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/README.md +310 -0
- package/fesm2022/fasteros-themes.mjs +3951 -0
- package/fesm2022/fasteros-themes.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/accordion/accordion.component.d.ts +33 -0
- package/lib/accordion/directives/accordion-content.directive.d.ts +8 -0
- package/lib/accordion/directives/accordion-header.directive.d.ts +8 -0
- package/lib/accordion/directives/accordion-item.directive.d.ts +17 -0
- package/lib/accordion/directives/accordion-title.directive.d.ts +8 -0
- package/lib/accordion/directives/ripple.directive.d.ts +14 -0
- package/lib/accordion/toggle.pipe.d.ts +12 -0
- package/lib/directives/nButton.directive.d.ts +23 -0
- package/lib/directives/nClass.directive.d.ts +18 -0
- package/lib/directives/nColor.directive.d.ts +18 -0
- package/lib/directives/nContainer.directive.d.ts +21 -0
- package/lib/directives/nType.directive.d.ts +22 -0
- package/lib/faster-themes.component.d.ts +5 -0
- package/lib/faster-themes.module.d.ts +21 -0
- package/lib/faster-themes.service.d.ts +200 -0
- package/lib/theme-generator/theme-generator.component.d.ts +54 -0
- package/lib/theme.service.d.ts +14 -0
- package/lib/theme.types.d.ts +30 -0
- package/package.json +36 -0
- package/public-api.d.ts +18 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnInit, QueryList } from '@angular/core';
|
|
2
|
+
import { FasterTheme, FasterThemesService } from "../faster-themes.service";
|
|
3
|
+
import { AccordionItem } from "./directives/accordion-item.directive";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class AccordionComponent implements OnInit, AfterViewInit {
|
|
6
|
+
fasterThemes: FasterThemesService;
|
|
7
|
+
private readonly cdr;
|
|
8
|
+
expanded: Set<number>;
|
|
9
|
+
/**
|
|
10
|
+
* Decides if the single item will be open at once or not.
|
|
11
|
+
* In collapsing mode, toggling one would collapse others
|
|
12
|
+
*/
|
|
13
|
+
name: string;
|
|
14
|
+
collapsing: boolean;
|
|
15
|
+
theme: FasterTheme | string;
|
|
16
|
+
themeName: FasterTheme | string;
|
|
17
|
+
accordionName: string | undefined;
|
|
18
|
+
focus: boolean;
|
|
19
|
+
showCaret: boolean;
|
|
20
|
+
headerClicked: EventEmitter<any>;
|
|
21
|
+
items: QueryList<AccordionItem>;
|
|
22
|
+
private readonly destroyRef;
|
|
23
|
+
constructor(fasterThemes: FasterThemesService, cdr: ChangeDetectorRef);
|
|
24
|
+
ngOnInit(): void;
|
|
25
|
+
ngAfterViewInit(): void;
|
|
26
|
+
collapseAll(): void;
|
|
27
|
+
toggleState: (index: number) => boolean;
|
|
28
|
+
activeStyle(index: number): boolean;
|
|
29
|
+
onHeaderClick(event: Event, index: number, item: any): void;
|
|
30
|
+
private closeOtherAccordion;
|
|
31
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionComponent, never>;
|
|
32
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<AccordionComponent, "accordion", never, { "name": { "alias": "name"; "required": false; }; "collapsing": { "alias": "collapsing"; "required": false; }; "theme": { "alias": "theme"; "required": false; }; "themeName": { "alias": "themeName"; "required": false; }; "accordionName": { "alias": "accordionName"; "required": false; }; "focus": { "alias": "focus"; "required": false; }; "showCaret": { "alias": "showCaret"; "required": false; }; }, { "headerClicked": "headerClicked"; }, ["items"], never, false, never>;
|
|
33
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TemplateRef } from "@angular/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AccordionContent {
|
|
4
|
+
templateRef: TemplateRef<any>;
|
|
5
|
+
constructor(templateRef: TemplateRef<any>);
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionContent, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AccordionContent, "[accordionContent]", never, {}, {}, never, never, false, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TemplateRef } from "@angular/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AccordionHeader {
|
|
4
|
+
templateRef: TemplateRef<any>;
|
|
5
|
+
constructor(templateRef: TemplateRef<any>);
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionHeader, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AccordionHeader, "[accordionHeader]", never, {}, {}, never, never, false, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AccordionContent } from "./accordion-content.directive";
|
|
2
|
+
import { AccordionHeader } from "./accordion-header.directive";
|
|
3
|
+
import { AccordionTitle } from "./accordion-title.directive";
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class AccordionItem {
|
|
6
|
+
title: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
expanded: boolean;
|
|
9
|
+
closeOther?: string;
|
|
10
|
+
loaded: boolean;
|
|
11
|
+
content: AccordionContent;
|
|
12
|
+
customTitle: AccordionTitle;
|
|
13
|
+
customHeader: AccordionHeader;
|
|
14
|
+
collapse(): void;
|
|
15
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionItem, never>;
|
|
16
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AccordionItem, "accordion-item", never, { "title": { "alias": "title"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "expanded": { "alias": "expanded"; "required": false; }; "closeOther": { "alias": "closeOther"; "required": false; }; "loaded": { "alias": "loaded"; "required": false; }; }, {}, ["content", "customTitle", "customHeader"], never, false, never>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TemplateRef } from "@angular/core";
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class AccordionTitle {
|
|
4
|
+
templateRef: TemplateRef<any>;
|
|
5
|
+
constructor(templateRef: TemplateRef<any>);
|
|
6
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionTitle, never>;
|
|
7
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<AccordionTitle, "[accordionTitle]", never, {}, {}, never, never, false, never>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { ElementRef, OnInit, Renderer2 } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class RippleDirective implements OnInit {
|
|
4
|
+
private el;
|
|
5
|
+
private renderer;
|
|
6
|
+
rippleDuration: string;
|
|
7
|
+
rippleColor: string;
|
|
8
|
+
noRipple: boolean;
|
|
9
|
+
constructor(el: ElementRef, renderer: Renderer2);
|
|
10
|
+
ngOnInit(): void;
|
|
11
|
+
createRipple(event: MouseEvent): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<RippleDirective, never>;
|
|
13
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<RippleDirective, "[ripple]", never, { "rippleDuration": { "alias": "rippleDuration"; "required": false; }; "rippleColor": { "alias": "rippleColor"; "required": false; }; "noRipple": { "alias": "noRipple"; "required": false; }; }, {}, never, never, true, never>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { PipeTransform } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class TogglePipe implements PipeTransform {
|
|
4
|
+
/**
|
|
5
|
+
* Make the toggle function available to be called from
|
|
6
|
+
* outside.
|
|
7
|
+
* @param index - index of the accordion item
|
|
8
|
+
*/
|
|
9
|
+
transform(i: number, toggleFn: Function): () => any;
|
|
10
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TogglePipe, never>;
|
|
11
|
+
static ɵpipe: i0.ɵɵPipeDeclaration<TogglePipe, "getToggleFunction", false>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { ElementRef, OnChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FasterThemesService } from '../faster-themes.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "../accordion/directives/ripple.directive";
|
|
5
|
+
export declare class nButtonDirective implements OnChanges, OnDestroy {
|
|
6
|
+
private el;
|
|
7
|
+
private fasterThemes;
|
|
8
|
+
theme: any;
|
|
9
|
+
button: string;
|
|
10
|
+
buttonStyle: string;
|
|
11
|
+
set nButton(v: string);
|
|
12
|
+
private appliedProps;
|
|
13
|
+
private resizeSub;
|
|
14
|
+
constructor(el: ElementRef, fasterThemes: FasterThemesService);
|
|
15
|
+
ngOnDestroy(): void;
|
|
16
|
+
ngOnChanges(): void;
|
|
17
|
+
private apply;
|
|
18
|
+
private applyPalette;
|
|
19
|
+
private setStyle;
|
|
20
|
+
private clearAppliedStyles;
|
|
21
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<nButtonDirective, never>;
|
|
22
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<nButtonDirective, "[nButton]", never, { "theme": { "alias": "theme"; "required": false; }; "button": { "alias": "button"; "required": false; }; "buttonStyle": { "alias": "buttonStyle"; "required": false; }; "nButton": { "alias": "nButton"; "required": false; }; }, {}, never, never, false, [{ directive: typeof i1.RippleDirective; inputs: { "rippleDuration": "rippleDuration"; "rippleColor": "rippleColor"; "noRipple": "noRipple"; }; outputs: {}; }]>;
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ElementRef, OnChanges } from '@angular/core';
|
|
2
|
+
import { FasterThemesService } from '../faster-themes.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class nClassDirective implements OnChanges {
|
|
5
|
+
private el;
|
|
6
|
+
private fasterThemes;
|
|
7
|
+
theme: any;
|
|
8
|
+
class: string;
|
|
9
|
+
set nClass(v: string);
|
|
10
|
+
private appliedProps;
|
|
11
|
+
constructor(el: ElementRef, fasterThemes: FasterThemesService);
|
|
12
|
+
ngOnChanges(): void;
|
|
13
|
+
private apply;
|
|
14
|
+
private setStyle;
|
|
15
|
+
private clearAppliedStyles;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<nClassDirective, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<nClassDirective, "[nClass]", never, { "theme": { "alias": "theme"; "required": false; }; "class": { "alias": "class"; "required": false; }; "nClass": { "alias": "nClass"; "required": false; }; }, {}, never, never, false, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ElementRef, OnChanges } from '@angular/core';
|
|
2
|
+
import { FasterThemesService } from '../faster-themes.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class nColorDirective implements OnChanges {
|
|
5
|
+
private el;
|
|
6
|
+
private fasterThemes;
|
|
7
|
+
theme: any;
|
|
8
|
+
color: string;
|
|
9
|
+
set nColor(v: string);
|
|
10
|
+
private appliedProps;
|
|
11
|
+
constructor(el: ElementRef, fasterThemes: FasterThemesService);
|
|
12
|
+
ngOnChanges(): void;
|
|
13
|
+
private apply;
|
|
14
|
+
private setStyle;
|
|
15
|
+
private clearAppliedStyles;
|
|
16
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<nColorDirective, never>;
|
|
17
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<nColorDirective, "[nColor]", never, { "theme": { "alias": "theme"; "required": false; }; "color": { "alias": "color"; "required": false; }; "nColor": { "alias": "nColor"; "required": false; }; }, {}, never, never, false, never>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ElementRef, OnChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FasterThemesService } from '../faster-themes.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class nContainerDirective implements OnChanges, OnDestroy {
|
|
5
|
+
private el;
|
|
6
|
+
private fasterThemes;
|
|
7
|
+
theme: any;
|
|
8
|
+
container: string;
|
|
9
|
+
set nContainer(v: string);
|
|
10
|
+
private appliedProps;
|
|
11
|
+
private resizeSub;
|
|
12
|
+
constructor(el: ElementRef, fasterThemes: FasterThemesService);
|
|
13
|
+
ngOnDestroy(): void;
|
|
14
|
+
ngOnChanges(): void;
|
|
15
|
+
private apply;
|
|
16
|
+
private applyPalette;
|
|
17
|
+
private setStyle;
|
|
18
|
+
private clearAppliedStyles;
|
|
19
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<nContainerDirective, never>;
|
|
20
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<nContainerDirective, "[nContainer]", never, { "theme": { "alias": "theme"; "required": false; }; "container": { "alias": "container"; "required": false; }; "nContainer": { "alias": "nContainer"; "required": false; }; }, {}, never, never, false, never>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ElementRef, OnChanges, OnDestroy } from '@angular/core';
|
|
2
|
+
import { FasterThemesService } from '../faster-themes.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class nTypeDirective implements OnChanges, OnDestroy {
|
|
5
|
+
private el;
|
|
6
|
+
private fasterThemes;
|
|
7
|
+
theme: any;
|
|
8
|
+
type: string;
|
|
9
|
+
typeface: string;
|
|
10
|
+
set nType(v: string);
|
|
11
|
+
private appliedProps;
|
|
12
|
+
private resizeSub;
|
|
13
|
+
constructor(el: ElementRef, fasterThemes: FasterThemesService);
|
|
14
|
+
ngOnDestroy(): void;
|
|
15
|
+
ngOnChanges(): void;
|
|
16
|
+
private apply;
|
|
17
|
+
private applyPalette;
|
|
18
|
+
private setStyle;
|
|
19
|
+
private clearAppliedStyles;
|
|
20
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<nTypeDirective, never>;
|
|
21
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<nTypeDirective, "[nType]", never, { "theme": { "alias": "theme"; "required": false; }; "type": { "alias": "type"; "required": false; }; "typeface": { "alias": "typeface"; "required": false; }; "nType": { "alias": "nType"; "required": false; }; }, {}, never, never, false, never>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class FasterThemesComponent {
|
|
3
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FasterThemesComponent, never>;
|
|
4
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FasterThemesComponent, "lib-faster-themes", never, {}, {}, never, never, false, never>;
|
|
5
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./faster-themes.component";
|
|
3
|
+
import * as i2 from "./accordion/accordion.component";
|
|
4
|
+
import * as i3 from "./accordion/directives/accordion-item.directive";
|
|
5
|
+
import * as i4 from "./accordion/directives/accordion-content.directive";
|
|
6
|
+
import * as i5 from "./accordion/directives/accordion-title.directive";
|
|
7
|
+
import * as i6 from "./accordion/directives/accordion-header.directive";
|
|
8
|
+
import * as i7 from "./accordion/toggle.pipe";
|
|
9
|
+
import * as i8 from "./directives/nColor.directive";
|
|
10
|
+
import * as i9 from "./directives/nContainer.directive";
|
|
11
|
+
import * as i10 from "./directives/nType.directive";
|
|
12
|
+
import * as i11 from "./directives/nButton.directive";
|
|
13
|
+
import * as i12 from "./directives/nClass.directive";
|
|
14
|
+
import * as i13 from "@angular/common";
|
|
15
|
+
import * as i14 from "@angular/common/http";
|
|
16
|
+
import * as i15 from "./accordion/directives/ripple.directive";
|
|
17
|
+
export declare class FasterThemesModule {
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FasterThemesModule, never>;
|
|
19
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<FasterThemesModule, [typeof i1.FasterThemesComponent, typeof i2.AccordionComponent, typeof i3.AccordionItem, typeof i4.AccordionContent, typeof i5.AccordionTitle, typeof i6.AccordionHeader, typeof i7.TogglePipe, typeof i8.nColorDirective, typeof i9.nContainerDirective, typeof i10.nTypeDirective, typeof i11.nButtonDirective, typeof i12.nClassDirective], [typeof i13.CommonModule, typeof i14.HttpClientModule, typeof i15.RippleDirective], [typeof i1.FasterThemesComponent, typeof i2.AccordionComponent, typeof i5.AccordionTitle, typeof i6.AccordionHeader, typeof i4.AccordionContent, typeof i3.AccordionItem, typeof i7.TogglePipe, typeof i15.RippleDirective, typeof i8.nColorDirective, typeof i9.nContainerDirective, typeof i10.nTypeDirective, typeof i11.nButtonDirective, typeof i12.nClassDirective]>;
|
|
20
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<FasterThemesModule>;
|
|
21
|
+
}
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { NgZone } from '@angular/core';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
import { ThemeService } from './theme.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export interface FasterTheme {
|
|
6
|
+
[key: string]: any;
|
|
7
|
+
companyId?: string;
|
|
8
|
+
id?: string;
|
|
9
|
+
formId?: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
description?: string;
|
|
12
|
+
public?: boolean;
|
|
13
|
+
followers?: number;
|
|
14
|
+
coreTheme?: boolean;
|
|
15
|
+
themeId?: string;
|
|
16
|
+
createdAt?: number;
|
|
17
|
+
createdBy?: string;
|
|
18
|
+
editedAt?: number;
|
|
19
|
+
editedBy?: string;
|
|
20
|
+
responsiveName?: string;
|
|
21
|
+
responsiveStandardWidth?: number;
|
|
22
|
+
responsiveFontSizeMin?: number;
|
|
23
|
+
responsiveFontSizeMax?: number;
|
|
24
|
+
responsiveMarginMin?: number;
|
|
25
|
+
responsiveMarginMax?: number;
|
|
26
|
+
responsivePaddingMin?: number;
|
|
27
|
+
responsivePaddingMax?: number;
|
|
28
|
+
containers?: ContainerStyle[];
|
|
29
|
+
buttonStyles?: ButtonStyle[];
|
|
30
|
+
accordions?: AccordionStyle[];
|
|
31
|
+
typeStyles?: TypographyStyle[];
|
|
32
|
+
classes?: ClassStyle[];
|
|
33
|
+
palette?: Palette[];
|
|
34
|
+
}
|
|
35
|
+
export interface Palette {
|
|
36
|
+
colorName: string;
|
|
37
|
+
backgroundColor?: ColorInfo | string;
|
|
38
|
+
color?: ColorInfo | string;
|
|
39
|
+
gradient?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface ColorInfo {
|
|
42
|
+
htmlName?: string;
|
|
43
|
+
colorHex?: string;
|
|
44
|
+
colorRGB?: string;
|
|
45
|
+
colorTags?: string[];
|
|
46
|
+
}
|
|
47
|
+
export interface ClassStyle {
|
|
48
|
+
className?: string;
|
|
49
|
+
class?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface AccordionStyle {
|
|
52
|
+
accordionName?: string;
|
|
53
|
+
accordionPalette?: string;
|
|
54
|
+
accordionBackground?: string;
|
|
55
|
+
accordionLayout?: string;
|
|
56
|
+
accordionAlignment?: string;
|
|
57
|
+
accordionBorder?: string;
|
|
58
|
+
accordionBoxShadow?: string;
|
|
59
|
+
accordionMargin?: string;
|
|
60
|
+
accordionPadding?: string;
|
|
61
|
+
accordionWidth?: string;
|
|
62
|
+
accordionHeight?: string;
|
|
63
|
+
accordionExtra?: string;
|
|
64
|
+
headerOpenPalette?: string;
|
|
65
|
+
headerOpenBackground?: string;
|
|
66
|
+
headerOpenWidth?: string;
|
|
67
|
+
headerOpenType?: string;
|
|
68
|
+
headerOpenLayout?: string;
|
|
69
|
+
headerOpenAlignment?: string;
|
|
70
|
+
headerOpenBorder?: string;
|
|
71
|
+
headerOpenBoxShadow?: string;
|
|
72
|
+
headerOpenMargin?: string;
|
|
73
|
+
headerOpenPadding?: string;
|
|
74
|
+
headerOpenExtra?: string;
|
|
75
|
+
headerClosedPalette?: string;
|
|
76
|
+
headerClosedBackground?: string;
|
|
77
|
+
headerClosedWidth?: string;
|
|
78
|
+
headerClosedType?: string;
|
|
79
|
+
headerClosedLayout?: string;
|
|
80
|
+
headerClosedAlignment?: string;
|
|
81
|
+
headerClosedBorder?: string;
|
|
82
|
+
headerClosedBoxShadow?: string;
|
|
83
|
+
headerClosedMargin?: string;
|
|
84
|
+
headerClosedPadding?: string;
|
|
85
|
+
headerClosedExtra?: string;
|
|
86
|
+
}
|
|
87
|
+
export interface ContainerStyle {
|
|
88
|
+
containerName?: string;
|
|
89
|
+
containerWidth?: string;
|
|
90
|
+
containerHeight?: string;
|
|
91
|
+
containerLineHeight?: string;
|
|
92
|
+
containerOverflowX?: string;
|
|
93
|
+
containerOverflowY?: string;
|
|
94
|
+
containerPosition?: string;
|
|
95
|
+
containerPositioning?: string;
|
|
96
|
+
containerPalette?: string;
|
|
97
|
+
containerBackground?: string;
|
|
98
|
+
containerBackgroundGradient?: string;
|
|
99
|
+
containerAlignment?: string;
|
|
100
|
+
containerAlignmentV?: string;
|
|
101
|
+
containerLayout?: string;
|
|
102
|
+
containerBorder?: string;
|
|
103
|
+
containerBoxShadow?: string;
|
|
104
|
+
containerMargin?: string;
|
|
105
|
+
containerPadding?: string;
|
|
106
|
+
backgroundImage?: string;
|
|
107
|
+
backgroundSize?: string;
|
|
108
|
+
backgroundRepeat?: string;
|
|
109
|
+
backgroundPosition?: string;
|
|
110
|
+
containerStyle?: string;
|
|
111
|
+
}
|
|
112
|
+
export interface TypographyStyle {
|
|
113
|
+
typeName?: string;
|
|
114
|
+
typeFont?: string;
|
|
115
|
+
typeFontSize?: string;
|
|
116
|
+
typeFontWeight?: string;
|
|
117
|
+
typeLineHeight?: string;
|
|
118
|
+
typePalette?: string;
|
|
119
|
+
typeBackground?: string;
|
|
120
|
+
typeFontColor?: string;
|
|
121
|
+
typeFontAlignment?: string;
|
|
122
|
+
typeTextShadow?: string;
|
|
123
|
+
typeBoxShadow?: string;
|
|
124
|
+
typePadding?: string;
|
|
125
|
+
typeMargin?: string;
|
|
126
|
+
typeBorder?: string;
|
|
127
|
+
}
|
|
128
|
+
export interface ButtonStyle {
|
|
129
|
+
buttonName?: string;
|
|
130
|
+
buttonPadding?: string;
|
|
131
|
+
buttonMargin?: string;
|
|
132
|
+
buttonTypeStyle?: string;
|
|
133
|
+
buttonPalette?: string | undefined;
|
|
134
|
+
buttonBackground?: string;
|
|
135
|
+
buttonColor?: string;
|
|
136
|
+
buttonStyle?: string;
|
|
137
|
+
buttonBorder?: string;
|
|
138
|
+
buttonRadius?: string;
|
|
139
|
+
buttonCursor?: string;
|
|
140
|
+
buttonShadow?: string;
|
|
141
|
+
buttonFontWeight?: string;
|
|
142
|
+
buttonFont?: string;
|
|
143
|
+
buttonFontSize?: string;
|
|
144
|
+
}
|
|
145
|
+
export declare class FasterThemesService {
|
|
146
|
+
private ngZone;
|
|
147
|
+
private themeService;
|
|
148
|
+
companyId: any;
|
|
149
|
+
screenWidth: number;
|
|
150
|
+
screenHeight: number;
|
|
151
|
+
parentTheme: FasterTheme;
|
|
152
|
+
readonly resize$: Subject<void>;
|
|
153
|
+
allThemes: FasterTheme[];
|
|
154
|
+
private uid?;
|
|
155
|
+
constructor(ngZone: NgZone, themeService: ThemeService);
|
|
156
|
+
listenToWindowSize(): void;
|
|
157
|
+
/**
|
|
158
|
+
* Fetches themes for the tenant identified by `apiKey` via the Napkin themes
|
|
159
|
+
* API and writes them into `this.allThemes`. Fetch-once; no real-time updates.
|
|
160
|
+
*
|
|
161
|
+
* Delegates to `ThemeService`. The base URL is set by the
|
|
162
|
+
* `THEME_API_BASE_URL` constant in theme.service.ts.
|
|
163
|
+
*
|
|
164
|
+
* If `themeId` is supplied, only that single theme is fetched and the result
|
|
165
|
+
* replaces `allThemes` with a one-element array. Otherwise all themes for the
|
|
166
|
+
* tenant are fetched.
|
|
167
|
+
*
|
|
168
|
+
* On any failure (missing key, network error, non-2xx, `success: false` from
|
|
169
|
+
* the backend) the call logs and returns `[]` — `getTheme()` continues to
|
|
170
|
+
* fall back to `defaultStyle`.
|
|
171
|
+
*
|
|
172
|
+
* @param apiKey tenant API key (required) — sent as Bearer token
|
|
173
|
+
* @param themeId optional theme id; when present fetches only that one theme
|
|
174
|
+
* @returns the loaded themes (the same array that was assigned to `allThemes`)
|
|
175
|
+
*/
|
|
176
|
+
initThemes(apiKey: string, themeId?: string): Promise<FasterTheme[]>;
|
|
177
|
+
/** Map the API's wrapped Theme document to a flat FasterTheme. */
|
|
178
|
+
private toFasterTheme;
|
|
179
|
+
getTheme(themeName?: any): any;
|
|
180
|
+
getPalette(themeName: any, paletteName: string): Palette;
|
|
181
|
+
getContainer(themeName: any, container: string): ContainerStyle;
|
|
182
|
+
getButton(themeName: any, button: string | undefined): ButtonStyle;
|
|
183
|
+
class(themeName?: any, className?: string): string;
|
|
184
|
+
typeObject(themeName?: any, typeName?: string): any;
|
|
185
|
+
type(themeName?: any, typeName?: string): string;
|
|
186
|
+
setPalette(theme: any, paletteName: string): string;
|
|
187
|
+
responsiveType(theme: FasterTheme, type: TypographyStyle): number;
|
|
188
|
+
responsiveSpace(theme: FasterTheme, margin: string, min: number, max: number): string;
|
|
189
|
+
typeFactor(theme: FasterTheme, size: number): number;
|
|
190
|
+
container(themeName?: any, containerName?: string | undefined): string;
|
|
191
|
+
accordionList(themeName: string | undefined): never[];
|
|
192
|
+
accordion(themeName?: any, accordionName?: string): string;
|
|
193
|
+
header(themeName?: any, accordionName?: string, expanded?: any, index?: any): string;
|
|
194
|
+
button(themeName?: any, buttonName?: string | undefined): string;
|
|
195
|
+
paddingAdjustment: any;
|
|
196
|
+
paddingAdjust(theme: any, delta: any): void;
|
|
197
|
+
defaultStyle: FasterTheme;
|
|
198
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FasterThemesService, never>;
|
|
199
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FasterThemesService>;
|
|
200
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { EventEmitter, OnChanges, OnInit, SimpleChanges } from '@angular/core';
|
|
2
|
+
import { FasterTheme, Palette } from '../faster-themes.service';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export type ThemeStyle = 'modern' | 'classic' | 'minimal' | 'bold' | 'playful';
|
|
5
|
+
export type ThemePurpose = 'marketing' | 'dashboard' | 'documentation' | 'form' | 'gallery';
|
|
6
|
+
export type PalettePreset = 'ocean' | 'forest' | 'sunset' | 'monochrome' | 'pastel' | 'corporate' | 'healthcare' | 'finance' | 'tech' | 'legal' | 'hospitality' | 'retail' | 'education';
|
|
7
|
+
export type ThemeLayout = 'row' | 'row wrap' | 'row-reverse' | 'column' | 'column wrap' | 'column-reverse';
|
|
8
|
+
export type ShadowLevel = 'none' | 'small' | 'medium' | 'large';
|
|
9
|
+
export declare class ThemeGeneratorComponent implements OnInit, OnChanges {
|
|
10
|
+
themeStyle: ThemeStyle;
|
|
11
|
+
purpose: ThemePurpose;
|
|
12
|
+
palette: PalettePreset | Palette[];
|
|
13
|
+
layout: ThemeLayout;
|
|
14
|
+
elevation: ShadowLevel;
|
|
15
|
+
textShadow: ShadowLevel;
|
|
16
|
+
name?: string;
|
|
17
|
+
showPreview: boolean;
|
|
18
|
+
responsiveStandardWidth?: number;
|
|
19
|
+
responsiveFontSizeMin?: number;
|
|
20
|
+
responsiveFontSizeMax?: number;
|
|
21
|
+
responsiveMarginMin?: number;
|
|
22
|
+
responsiveMarginMax?: number;
|
|
23
|
+
responsivePaddingMin?: number;
|
|
24
|
+
responsivePaddingMax?: number;
|
|
25
|
+
themeGenerated: EventEmitter<FasterTheme>;
|
|
26
|
+
theme?: FasterTheme;
|
|
27
|
+
ngOnInit(): void;
|
|
28
|
+
ngOnChanges(changes: SimpleChanges): void;
|
|
29
|
+
generate(): FasterTheme;
|
|
30
|
+
/**
|
|
31
|
+
* Map a ShadowLevel to a box-shadow CSS string. Playful style uses an offset
|
|
32
|
+
* "hard" shadow that varies in offset rather than blur, so it gets its own
|
|
33
|
+
* scale.
|
|
34
|
+
*/
|
|
35
|
+
private elevationCss;
|
|
36
|
+
/** Map a ShadowLevel to a text-shadow CSS string. Empty disables. */
|
|
37
|
+
private textShadowCss;
|
|
38
|
+
regenerate(): void;
|
|
39
|
+
resolveSwatch(p: Palette): string;
|
|
40
|
+
private styleProfileFor;
|
|
41
|
+
private purposeProfileFor;
|
|
42
|
+
private semanticColors;
|
|
43
|
+
private buildPalette;
|
|
44
|
+
private bgOf;
|
|
45
|
+
private fgOf;
|
|
46
|
+
private buildTypography;
|
|
47
|
+
private buildContainers;
|
|
48
|
+
private buildButtons;
|
|
49
|
+
private buildAccordions;
|
|
50
|
+
private buildClasses;
|
|
51
|
+
private capitalize;
|
|
52
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeGeneratorComponent, never>;
|
|
53
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ThemeGeneratorComponent, "faster-theme-generator", never, { "themeStyle": { "alias": "themeStyle"; "required": false; }; "purpose": { "alias": "purpose"; "required": false; }; "palette": { "alias": "palette"; "required": false; }; "layout": { "alias": "layout"; "required": false; }; "elevation": { "alias": "elevation"; "required": false; }; "textShadow": { "alias": "textShadow"; "required": false; }; "name": { "alias": "name"; "required": false; }; "showPreview": { "alias": "showPreview"; "required": false; }; "responsiveStandardWidth": { "alias": "responsiveStandardWidth"; "required": false; }; "responsiveFontSizeMin": { "alias": "responsiveFontSizeMin"; "required": false; }; "responsiveFontSizeMax": { "alias": "responsiveFontSizeMax"; "required": false; }; "responsiveMarginMin": { "alias": "responsiveMarginMin"; "required": false; }; "responsiveMarginMax": { "alias": "responsiveMarginMax"; "required": false; }; "responsivePaddingMin": { "alias": "responsivePaddingMin"; "required": false; }; "responsivePaddingMax": { "alias": "responsivePaddingMax"; "required": false; }; }, { "themeGenerated": "themeGenerated"; }, never, never, true, never>;
|
|
54
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { HttpClient } from '@angular/common/http';
|
|
2
|
+
import { ThemeResponse, ThemesResponse } from './theme.types';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare const THEME_API_BASE_URL = "https://bzw27udtrayx7u6pvbnexfdk4i0hcsia.lambda-url.us-east-1.on.aws/api";
|
|
5
|
+
export declare class ThemeService {
|
|
6
|
+
private http;
|
|
7
|
+
private readonly apiUrl;
|
|
8
|
+
constructor(http: HttpClient);
|
|
9
|
+
private headers;
|
|
10
|
+
getThemes(apiKey: string): Promise<ThemesResponse>;
|
|
11
|
+
getTheme(themeId: string, apiKey: string): Promise<ThemeResponse>;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ThemeService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ThemeService>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
export interface ThemeShare {
|
|
2
|
+
readAccess: 'Private' | 'Team';
|
|
3
|
+
writeAccess: 'Private' | 'Team';
|
|
4
|
+
publicReadAccess: string;
|
|
5
|
+
publicWriteAccess: string;
|
|
6
|
+
}
|
|
7
|
+
export interface Theme {
|
|
8
|
+
objectId: string;
|
|
9
|
+
collectionName: 'theme';
|
|
10
|
+
companyId: string;
|
|
11
|
+
createdBy: string;
|
|
12
|
+
created: number;
|
|
13
|
+
updated: number;
|
|
14
|
+
updatedBy: string;
|
|
15
|
+
removed: boolean;
|
|
16
|
+
share: ThemeShare;
|
|
17
|
+
favorite?: boolean;
|
|
18
|
+
tags?: string[];
|
|
19
|
+
data: Record<string, unknown>;
|
|
20
|
+
}
|
|
21
|
+
export interface ThemesResponse {
|
|
22
|
+
success: boolean;
|
|
23
|
+
data?: Theme[];
|
|
24
|
+
error?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface ThemeResponse {
|
|
27
|
+
success: boolean;
|
|
28
|
+
data?: Theme;
|
|
29
|
+
error?: string;
|
|
30
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@fasteros/themes",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "napkin themes - modern styling",
|
|
5
|
+
"peerDependencies": {
|
|
6
|
+
"@angular/common": ">=12.0.0",
|
|
7
|
+
"@angular/core": ">=12.0.0"
|
|
8
|
+
},
|
|
9
|
+
"dependencies": {
|
|
10
|
+
"tslib": ">=2.3.0"
|
|
11
|
+
},
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"keywords": [
|
|
14
|
+
"CSS",
|
|
15
|
+
"Styling",
|
|
16
|
+
"UI",
|
|
17
|
+
"UX"
|
|
18
|
+
],
|
|
19
|
+
"author": "Napkin Apps Corp. - All rights reserved<(https://napkinapps.com/)",
|
|
20
|
+
"license": "Commercial",
|
|
21
|
+
"module": "fesm2022/fasteros-themes.mjs",
|
|
22
|
+
"typings": "index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
"./package.json": {
|
|
25
|
+
"default": "./package.json"
|
|
26
|
+
},
|
|
27
|
+
".": {
|
|
28
|
+
"types": "./index.d.ts",
|
|
29
|
+
"default": "./fesm2022/fasteros-themes.mjs"
|
|
30
|
+
},
|
|
31
|
+
"./samples": {
|
|
32
|
+
"types": "./samples/index.d.ts",
|
|
33
|
+
"default": "./fesm2022/fasteros-themes-samples.mjs"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './lib/faster-themes.module';
|
|
2
|
+
export * from './lib/faster-themes.component';
|
|
3
|
+
export * from './lib/faster-themes.service';
|
|
4
|
+
export * from './lib/accordion/accordion.component';
|
|
5
|
+
export * from './lib/accordion/directives/accordion-title.directive';
|
|
6
|
+
export * from './lib/accordion/directives/accordion-header.directive';
|
|
7
|
+
export * from './lib/accordion/directives/accordion-content.directive';
|
|
8
|
+
export * from './lib/accordion/directives/accordion-item.directive';
|
|
9
|
+
export * from './lib/accordion/toggle.pipe';
|
|
10
|
+
export * from './lib/accordion/directives/ripple.directive';
|
|
11
|
+
export * from './lib/directives/nColor.directive';
|
|
12
|
+
export * from './lib/directives/nContainer.directive';
|
|
13
|
+
export * from './lib/directives/nType.directive';
|
|
14
|
+
export * from './lib/directives/nButton.directive';
|
|
15
|
+
export * from './lib/directives/nClass.directive';
|
|
16
|
+
export * from './lib/theme-generator/theme-generator.component';
|
|
17
|
+
export * from './lib/theme.service';
|
|
18
|
+
export * from './lib/theme.types';
|