@delon/theme 13.0.0-beta.2 → 13.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/esm2020/layout-default/layout-default.mjs +5 -0
- package/esm2020/setting-drawer/setting-drawer.mjs +5 -0
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/theme-btn/theme-btn.mjs +5 -0
- package/fesm2015/layout-blank.mjs +2 -139
- package/fesm2015/layout-blank.mjs.map +1 -1
- package/fesm2015/layout-default.mjs +654 -0
- package/fesm2015/layout-default.mjs.map +1 -0
- package/fesm2015/setting-drawer.mjs +487 -0
- package/fesm2015/setting-drawer.mjs.map +1 -0
- package/fesm2015/theme-btn.mjs +144 -0
- package/fesm2015/theme-btn.mjs.map +1 -0
- package/fesm2015/theme.mjs +1 -1
- package/fesm2015/theme.mjs.map +1 -1
- package/fesm2020/layout-blank.mjs +2 -136
- package/fesm2020/layout-blank.mjs.map +1 -1
- package/fesm2020/layout-default.mjs +654 -0
- package/fesm2020/layout-default.mjs.map +1 -0
- package/fesm2020/setting-drawer.mjs +482 -0
- package/fesm2020/setting-drawer.mjs.map +1 -0
- package/fesm2020/theme-btn.mjs +141 -0
- package/fesm2020/theme-btn.mjs.map +1 -0
- package/fesm2020/theme.mjs +1 -1
- package/fesm2020/theme.mjs.map +1 -1
- package/layout-default/{layout-blank.d.ts → layout-default.d.ts} +0 -0
- package/layout-default/package.json +6 -6
- package/package.json +21 -21
- package/setting-drawer/package.json +6 -6
- package/setting-drawer/{layout-blank.d.ts → setting-drawer.d.ts} +0 -0
- package/system/index.less +0 -2
- package/theme-btn/package.json +6 -6
- package/theme-btn/{layout-blank.d.ts → theme-btn.d.ts} +0 -0
- package/esm2020/layout-default/layout-blank.mjs +0 -5
- package/esm2020/setting-drawer/layout-blank.mjs +0 -5
- package/esm2020/theme-btn/layout-blank.mjs +0 -5
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public_api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF5b3V0LWRlZmF1bHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy90aGVtZS9sYXlvdXQtZGVmYXVsdC9sYXlvdXQtZGVmYXVsdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public_api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2V0dGluZy1kcmF3ZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy90aGVtZS9zZXR0aW5nLWRyYXdlci9zZXR0aW5nLWRyYXdlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
package/esm2020/src/version.mjs
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Version } from '@angular/core';
|
|
2
|
-
export const VERSION = new Version('13.0.0
|
|
2
|
+
export const VERSION = new Version('13.0.0');
|
|
3
3
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidmVyc2lvbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL3RoZW1lL3NyYy92ZXJzaW9uLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxPQUFPLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFFeEMsTUFBTSxDQUFDLE1BQU0sT0FBTyxHQUFHLElBQUksT0FBTyxDQUFDLG1CQUFtQixDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBWZXJzaW9uIH0gZnJvbSAnQGFuZ3VsYXIvY29yZSc7XG5cbmV4cG9ydCBjb25zdCBWRVJTSU9OID0gbmV3IFZlcnNpb24oJzAuMC4wLVBMQUNFSE9MREVSJyk7XG4iXX0=
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './public_api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGhlbWUtYnRuLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcGFja2FnZXMvdGhlbWUvdGhlbWUtYnRuL3RoZW1lLWJ0bi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRztBQUVILGNBQWMsY0FBYyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBHZW5lcmF0ZWQgYnVuZGxlIGluZGV4LiBEbyBub3QgZWRpdC5cbiAqL1xuXG5leHBvcnQgKiBmcm9tICcuL3B1YmxpY19hcGknO1xuIl19
|
|
@@ -1,144 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as i0 from '@angular/core';
|
|
4
|
-
import { InjectionToken, isDevMode, Component, ChangeDetectionStrategy, Inject, Optional, Input, NgModule } from '@angular/core';
|
|
5
|
-
import { Subject } from 'rxjs';
|
|
6
|
-
import { takeUntil } from 'rxjs/operators';
|
|
7
|
-
import * as i1 from '@delon/util/config';
|
|
8
|
-
import * as i2 from '@angular/cdk/platform';
|
|
9
|
-
import * as i3 from '@angular/cdk/bidi';
|
|
10
|
-
import * as i4 from 'ng-zorro-antd/dropdown';
|
|
11
|
-
import { NzDropDownModule } from 'ng-zorro-antd/dropdown';
|
|
12
|
-
import * as i5 from 'ng-zorro-antd/tooltip';
|
|
13
|
-
import { NzToolTipModule } from 'ng-zorro-antd/tooltip';
|
|
14
|
-
import * as i6 from 'ng-zorro-antd/menu';
|
|
15
|
-
|
|
16
|
-
const ALAIN_THEME_BTN_KEYS = new InjectionToken('ALAIN_THEME_BTN_KEYS');
|
|
17
|
-
class ThemeBtnComponent {
|
|
18
|
-
constructor(renderer, configSrv, platform, doc, directionality, KEYS) {
|
|
19
|
-
this.renderer = renderer;
|
|
20
|
-
this.configSrv = configSrv;
|
|
21
|
-
this.platform = platform;
|
|
22
|
-
this.doc = doc;
|
|
23
|
-
this.directionality = directionality;
|
|
24
|
-
this.KEYS = KEYS;
|
|
25
|
-
this.theme = 'default';
|
|
26
|
-
this.isDev = isDevMode();
|
|
27
|
-
this.types = [
|
|
28
|
-
{ key: 'default', text: 'Default Theme' },
|
|
29
|
-
{ key: 'dark', text: 'Dark Theme' },
|
|
30
|
-
{ key: 'compact', text: 'Compact Theme' }
|
|
31
|
-
];
|
|
32
|
-
this.devTips = `When the dark.css file can't be found, you need to run it once: npm run theme`;
|
|
33
|
-
this.deployUrl = '';
|
|
34
|
-
this.destroy$ = new Subject();
|
|
35
|
-
this.dir = 'ltr';
|
|
36
|
-
}
|
|
37
|
-
ngOnInit() {
|
|
38
|
-
var _a;
|
|
39
|
-
this.dir = this.directionality.value;
|
|
40
|
-
(_a = this.directionality.change) === null || _a === void 0 ? void 0 : _a.pipe(takeUntil(this.destroy$)).subscribe((direction) => {
|
|
41
|
-
this.dir = direction;
|
|
42
|
-
});
|
|
43
|
-
this.initTheme();
|
|
44
|
-
}
|
|
45
|
-
initTheme() {
|
|
46
|
-
if (!this.platform.isBrowser) {
|
|
47
|
-
return;
|
|
48
|
-
}
|
|
49
|
-
this.theme = localStorage.getItem(this.KEYS) || 'default';
|
|
50
|
-
this.updateChartTheme();
|
|
51
|
-
this.onThemeChange(this.theme);
|
|
52
|
-
}
|
|
53
|
-
updateChartTheme() {
|
|
54
|
-
this.configSrv.set('chart', { theme: this.theme === 'dark' ? 'dark' : '' });
|
|
55
|
-
}
|
|
56
|
-
onThemeChange(theme) {
|
|
57
|
-
if (!this.platform.isBrowser) {
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
this.theme = theme;
|
|
61
|
-
this.renderer.setAttribute(this.doc.body, 'data-theme', theme);
|
|
62
|
-
const dom = this.doc.getElementById(this.KEYS);
|
|
63
|
-
if (dom) {
|
|
64
|
-
dom.remove();
|
|
65
|
-
}
|
|
66
|
-
localStorage.removeItem(this.KEYS);
|
|
67
|
-
if (theme !== 'default') {
|
|
68
|
-
const el = this.doc.createElement('link');
|
|
69
|
-
el.type = 'text/css';
|
|
70
|
-
el.rel = 'stylesheet';
|
|
71
|
-
el.id = this.KEYS;
|
|
72
|
-
el.href = `${this.deployUrl}assets/style.${theme}.css`;
|
|
73
|
-
localStorage.setItem(this.KEYS, theme);
|
|
74
|
-
this.doc.body.append(el);
|
|
75
|
-
}
|
|
76
|
-
this.updateChartTheme();
|
|
77
|
-
}
|
|
78
|
-
ngOnDestroy() {
|
|
79
|
-
const el = this.doc.getElementById(this.KEYS);
|
|
80
|
-
if (el != null) {
|
|
81
|
-
this.doc.body.removeChild(el);
|
|
82
|
-
}
|
|
83
|
-
this.destroy$.next();
|
|
84
|
-
this.destroy$.complete();
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
ThemeBtnComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeBtnComponent, deps: [{ token: i0.Renderer2 }, { token: i1.AlainConfigService }, { token: i2.Platform }, { token: DOCUMENT }, { token: i3.Directionality, optional: true }, { token: ALAIN_THEME_BTN_KEYS }], target: i0.ɵɵFactoryTarget.Component });
|
|
88
|
-
ThemeBtnComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.1.1", type: ThemeBtnComponent, selector: "theme-btn", inputs: { types: "types", devTips: "devTips", deployUrl: "deployUrl" }, host: { properties: { "class.theme-btn": "true", "class.theme-btn-rtl": "dir === 'rtl'" } }, ngImport: i0, template: "<div\n class=\"ant-avatar ant-avatar-circle ant-avatar-icon\"\n nz-dropdown\n nzPlacement=\"topCenter\"\n [nzDropdownMenu]=\"types.length > 0 ? menu : null\"\n>\n <svg\n nz-tooltip\n [nzTooltipTitle]=\"isDev ? devTips : null\"\n class=\"anticon\"\n role=\"img\"\n width=\"21\"\n height=\"21\"\n viewBox=\"0 0 21 21\"\n fill=\"currentColor\"\n >\n <g fill-rule=\"evenodd\">\n <g fill-rule=\"nonzero\">\n <path\n d=\"M7.02 3.635l12.518 12.518a1.863 1.863 0 010 2.635l-1.317 1.318a1.863 1.863 0 01-2.635 0L3.068 7.588A2.795 2.795 0 117.02 3.635zm2.09 14.428a.932.932 0 110 1.864.932.932 0 010-1.864zm-.043-9.747L7.75 9.635l9.154 9.153 1.318-1.317-9.154-9.155zM3.52 12.473c.514 0 .931.417.931.931v.932h.932a.932.932 0 110 1.864h-.932v.931a.932.932 0 01-1.863 0l-.001-.931h-.93a.932.932 0 010-1.864h.93v-.932c0-.514.418-.931.933-.931zm15.374-3.727a1.398 1.398 0 110 2.795 1.398 1.398 0 010-2.795zM4.385 4.953a.932.932 0 000 1.317l2.046 2.047L7.75 7 5.703 4.953a.932.932 0 00-1.318 0zM14.701.36a.932.932 0 01.931.932v.931h.932a.932.932 0 010 1.864h-.933l.001.932a.932.932 0 11-1.863 0l-.001-.932h-.93a.932.932 0 110-1.864h.93v-.931a.932.932 0 01.933-.932z\"\n ></path>\n </g>\n </g>\n </svg>\n <nz-dropdown-menu #menu=\"nzDropdownMenu\">\n <ul nz-menu nzSelectable>\n <li nz-menu-item *ngFor=\"let i of types\" (click)=\"onThemeChange(i.key)\">{{ i.text }}</li>\n </ul>\n </nz-dropdown-menu>\n</div>\n", components: [{ type: i4.NzDropdownMenuComponent, selector: "nz-dropdown-menu", exportAs: ["nzDropdownMenu"] }], directives: [{ type: i4.NzDropDownDirective, selector: "[nz-dropdown]", inputs: ["nzDropdownMenu", "nzTrigger", "nzMatchWidthElement", "nzBackdrop", "nzClickHide", "nzDisabled", "nzVisible", "nzOverlayClassName", "nzOverlayStyle", "nzPlacement"], outputs: ["nzVisibleChange"], exportAs: ["nzDropdown"] }, { type: i5.NzTooltipDirective, selector: "[nz-tooltip]", inputs: ["nzTooltipTitle", "nzTooltipTitleContext", "nz-tooltip", "nzTooltipTrigger", "nzTooltipPlacement", "nzTooltipOrigin", "nzTooltipVisible", "nzTooltipMouseEnterDelay", "nzTooltipMouseLeaveDelay", "nzTooltipOverlayClassName", "nzTooltipOverlayStyle", "nzTooltipArrowPointAtCenter", "nzTooltipColor"], outputs: ["nzTooltipVisibleChange"], exportAs: ["nzTooltip"] }, { type: i6.NzMenuDirective, selector: "[nz-menu]", inputs: ["nzInlineIndent", "nzTheme", "nzMode", "nzInlineCollapsed", "nzSelectable"], outputs: ["nzClick"], exportAs: ["nzMenu"] }, { type: i7.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { type: i6.NzMenuItemDirective, selector: "[nz-menu-item]", inputs: ["nzPaddingLeft", "nzDisabled", "nzSelected", "nzDanger", "nzMatchRouterExact", "nzMatchRouter"], exportAs: ["nzMenuItem"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
89
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeBtnComponent, decorators: [{
|
|
90
|
-
type: Component,
|
|
91
|
-
args: [{ selector: 'theme-btn', host: {
|
|
92
|
-
'[class.theme-btn]': `true`,
|
|
93
|
-
'[class.theme-btn-rtl]': `dir === 'rtl'`
|
|
94
|
-
}, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"ant-avatar ant-avatar-circle ant-avatar-icon\"\n nz-dropdown\n nzPlacement=\"topCenter\"\n [nzDropdownMenu]=\"types.length > 0 ? menu : null\"\n>\n <svg\n nz-tooltip\n [nzTooltipTitle]=\"isDev ? devTips : null\"\n class=\"anticon\"\n role=\"img\"\n width=\"21\"\n height=\"21\"\n viewBox=\"0 0 21 21\"\n fill=\"currentColor\"\n >\n <g fill-rule=\"evenodd\">\n <g fill-rule=\"nonzero\">\n <path\n d=\"M7.02 3.635l12.518 12.518a1.863 1.863 0 010 2.635l-1.317 1.318a1.863 1.863 0 01-2.635 0L3.068 7.588A2.795 2.795 0 117.02 3.635zm2.09 14.428a.932.932 0 110 1.864.932.932 0 010-1.864zm-.043-9.747L7.75 9.635l9.154 9.153 1.318-1.317-9.154-9.155zM3.52 12.473c.514 0 .931.417.931.931v.932h.932a.932.932 0 110 1.864h-.932v.931a.932.932 0 01-1.863 0l-.001-.931h-.93a.932.932 0 010-1.864h.93v-.932c0-.514.418-.931.933-.931zm15.374-3.727a1.398 1.398 0 110 2.795 1.398 1.398 0 010-2.795zM4.385 4.953a.932.932 0 000 1.317l2.046 2.047L7.75 7 5.703 4.953a.932.932 0 00-1.318 0zM14.701.36a.932.932 0 01.931.932v.931h.932a.932.932 0 010 1.864h-.933l.001.932a.932.932 0 11-1.863 0l-.001-.932h-.93a.932.932 0 110-1.864h.93v-.931a.932.932 0 01.933-.932z\"\n ></path>\n </g>\n </g>\n </svg>\n <nz-dropdown-menu #menu=\"nzDropdownMenu\">\n <ul nz-menu nzSelectable>\n <li nz-menu-item *ngFor=\"let i of types\" (click)=\"onThemeChange(i.key)\">{{ i.text }}</li>\n </ul>\n </nz-dropdown-menu>\n</div>\n" }]
|
|
95
|
-
}], ctorParameters: function () {
|
|
96
|
-
return [{ type: i0.Renderer2 }, { type: i1.AlainConfigService }, { type: i2.Platform }, { type: undefined, decorators: [{
|
|
97
|
-
type: Inject,
|
|
98
|
-
args: [DOCUMENT]
|
|
99
|
-
}] }, { type: i3.Directionality, decorators: [{
|
|
100
|
-
type: Optional
|
|
101
|
-
}] }, { type: undefined, decorators: [{
|
|
102
|
-
type: Inject,
|
|
103
|
-
args: [ALAIN_THEME_BTN_KEYS]
|
|
104
|
-
}] }];
|
|
105
|
-
}, propDecorators: { types: [{
|
|
106
|
-
type: Input
|
|
107
|
-
}], devTips: [{
|
|
108
|
-
type: Input
|
|
109
|
-
}], deployUrl: [{
|
|
110
|
-
type: Input
|
|
111
|
-
}] } });
|
|
112
|
-
|
|
113
|
-
const COMPONENTS = [ThemeBtnComponent];
|
|
114
|
-
class ThemeBtnModule {
|
|
115
|
-
}
|
|
116
|
-
ThemeBtnModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeBtnModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
117
|
-
ThemeBtnModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeBtnModule, declarations: [ThemeBtnComponent], imports: [CommonModule, NzDropDownModule, NzToolTipModule], exports: [ThemeBtnComponent] });
|
|
118
|
-
ThemeBtnModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeBtnModule, providers: [
|
|
119
|
-
{
|
|
120
|
-
provide: ALAIN_THEME_BTN_KEYS,
|
|
121
|
-
useValue: 'site-theme'
|
|
122
|
-
}
|
|
123
|
-
], imports: [[CommonModule, NzDropDownModule, NzToolTipModule]] });
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.1.1", ngImport: i0, type: ThemeBtnModule, decorators: [{
|
|
125
|
-
type: NgModule,
|
|
126
|
-
args: [{
|
|
127
|
-
imports: [CommonModule, NzDropDownModule, NzToolTipModule],
|
|
128
|
-
providers: [
|
|
129
|
-
{
|
|
130
|
-
provide: ALAIN_THEME_BTN_KEYS,
|
|
131
|
-
useValue: 'site-theme'
|
|
132
|
-
}
|
|
133
|
-
],
|
|
134
|
-
declarations: COMPONENTS,
|
|
135
|
-
exports: COMPONENTS
|
|
136
|
-
}]
|
|
137
|
-
}] });
|
|
1
|
+
// https://github.com/ng-packagr/ng-packagr/issues/1655
|
|
2
|
+
var public_api = void 0;
|
|
138
3
|
|
|
139
4
|
/**
|
|
140
5
|
* Generated bundle index. Do not edit.
|
|
141
6
|
*/
|
|
142
|
-
|
|
143
|
-
export { ALAIN_THEME_BTN_KEYS, ThemeBtnComponent, ThemeBtnModule };
|
|
144
7
|
//# sourceMappingURL=layout-blank.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layout-blank.mjs","sources":["../../../../packages/theme/
|
|
1
|
+
{"version":3,"file":"layout-blank.mjs","sources":["../../../../packages/theme/layout-blank/public_api.ts","../../../../packages/theme/layout-blank/layout-blank.ts"],"sourcesContent":["// https://github.com/ng-packagr/ng-packagr/issues/1655\nexport default void 0;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":"AAAA;AACA,iBAAe,KAAK,CAAC;;ACDrB;;"}
|