ng-alain 12.4.2 → 13.1.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/application/files/root/.husky/pre-commit +1 -1
- package/application/files/root/.stylelintrc +1 -0
- package/application/files/src/app/core/i18n/i18n.service.ts +1 -1
- package/application/files/src/app/core/net/default.interceptor.ts +1 -1
- package/application/files/src/app/layout/basic/widgets/clear-storage.component.ts +1 -1
- package/application/files/src/app/layout/basic/widgets/fullscreen.component.ts +5 -8
- package/application/files/src/app/layout/basic/widgets/i18n.component.ts +3 -0
- package/application/files/src/app/layout/passport/passport.component.less +15 -1
- package/application/files/src/app/routes/exception/exception.component.ts +1 -1
- package/application/files/src/app/routes/passport/callback.component.ts +1 -1
- package/application/files/src/app/routes/passport/lock/lock.component.less +1 -0
- package/application/files/src/app/routes/passport/login/login.component.less +13 -3
- package/application/files/src/app/routes/passport/login/login.component.ts +4 -4
- package/application/files/src/app/routes/passport/register/register.component.less +10 -1
- package/application/files/src/app/routes/passport/register/register.component.ts +5 -5
- package/application/files/src/app/routes/passport/register-result/register-result.component.ts +1 -1
- package/application/files/src/styles/theme.less +1 -1
- package/application/files/src/styles.less +5 -5
- package/application/files/src/test.ts +3 -1
- package/application/index.js +45 -44
- package/application/index.js.map +1 -1
- package/application/index.ts +12 -9
- package/collection.json +2 -3
- package/curd/index.js +3 -3
- package/curd/index.js.map +1 -1
- package/curd/index.ts +1 -1
- package/curd/schema.json +16 -0
- package/curd/schema.ts +1 -0
- package/docs/generate.en-US.md +3 -0
- package/docs/generate.zh-CN.md +3 -0
- package/docs/plugin.en-US.md +0 -13
- package/docs/plugin.zh-CN.md +0 -13
- package/edit/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
- package/edit/index.js +1 -1
- package/edit/index.js.map +1 -1
- package/edit/schema.json +16 -0
- package/edit/schema.ts +1 -0
- package/empty/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
- package/empty/index.js +1 -1
- package/empty/index.js.map +1 -1
- package/empty/index.spec.ts +25 -5
- package/empty/schema.json +16 -0
- package/empty/schema.ts +1 -0
- package/list/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
- package/list/index.js +1 -1
- package/list/index.js.map +1 -1
- package/list/index.spec.ts +7 -0
- package/list/schema.json +16 -0
- package/list/schema.ts +1 -0
- package/migration.json +5 -10
- package/module/files/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
- package/module/index.js +46 -20
- package/module/index.js.map +1 -1
- package/module/index.spec.ts +16 -0
- package/module/index.ts +33 -5
- package/module/schema.json +16 -0
- package/module/schema.ts +3 -1
- package/ng-add/index.js +24 -26
- package/ng-add/index.js.map +1 -1
- package/ng-add/index.spec.ts +13 -3
- package/ng-add/index.ts +19 -21
- package/ng-update/data/attribute-selectors.js +1 -1
- package/ng-update/data/attribute-selectors.ts +1 -1
- package/ng-update/data/class-names.js +1 -1
- package/ng-update/data/class-names.ts +1 -1
- package/ng-update/data/constructor-checks.js +1 -1
- package/ng-update/data/constructor-checks.ts +1 -1
- package/ng-update/data/css-selectors.js +1 -1
- package/ng-update/data/css-selectors.ts +1 -1
- package/ng-update/data/element-selectors.js +1 -1
- package/ng-update/data/element-selectors.ts +1 -1
- package/ng-update/data/input-names.js +1 -1
- package/ng-update/data/input-names.ts +1 -1
- package/ng-update/data/method-call-checks.js +1 -1
- package/ng-update/data/method-call-checks.ts +1 -1
- package/ng-update/data/output-names.js +1 -1
- package/ng-update/data/output-names.ts +1 -1
- package/ng-update/data/property-names.js +1 -1
- package/ng-update/data/property-names.ts +1 -1
- package/ng-update/index.js +8 -13
- package/ng-update/index.js.map +1 -1
- package/ng-update/index.ts +5 -10
- package/ng-update/upgrade-data.js +3 -1
- package/ng-update/upgrade-data.js.map +1 -1
- package/ng-update/upgrade-data.ts +3 -2
- package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js +1 -1
- package/ng-update/upgrade-rules/checks/_src-to-nz-image-rule.js.map +1 -1
- package/ng-update/upgrade-rules/v12/index.js +32 -32
- package/ng-update/upgrade-rules/v12/index.js.map +1 -1
- package/ng-update/upgrade-rules/v12/index.ts +1 -5
- package/ng-update/upgrade-rules/v13/index.js +100 -0
- package/ng-update/upgrade-rules/v13/index.js.map +1 -0
- package/ng-update/upgrade-rules/v13/index.spec.ts +39 -0
- package/ng-update/upgrade-rules/v13/index.ts +111 -0
- package/package.json +1 -1
- package/plugin/files/rtl/layout/basic/widgets/rtl.component.ts +1 -1
- package/plugin/index.js +10 -14
- package/plugin/index.js.map +1 -1
- package/plugin/index.ts +0 -4
- package/plugin/plugin.code-style.js +2 -2
- package/plugin/plugin.code-style.js.map +1 -1
- package/plugin/plugin.default-language.js +3 -3
- package/plugin/plugin.default-language.js.map +1 -1
- package/plugin/plugin.default-language.ts +1 -1
- package/plugin/plugin.docker.js +6 -6
- package/plugin/plugin.docker.js.map +1 -1
- package/plugin/plugin.icon.js +7 -7
- package/plugin/plugin.icon.js.map +1 -1
- package/plugin/plugin.icon.ts +2 -2
- package/plugin/plugin.rtl.js +11 -11
- package/plugin/plugin.rtl.js.map +1 -1
- package/plugin/plugin.sts.js +1 -1
- package/plugin/plugin.sts.js.map +1 -1
- package/schema.json +10 -0
- package/sta/index.js +13 -13
- package/sta/index.js.map +1 -1
- package/tpl/index.js +2 -2
- package/tpl/index.js.map +1 -1
- package/tpl/index.ts +1 -1
- package/utils/alain.js +51 -26
- package/utils/alain.js.map +1 -1
- package/utils/alain.ts +45 -10
- package/utils/code-style.js +1 -1
- package/utils/code-style.js.map +1 -1
- package/utils/code-style.ts +1 -1
- package/utils/file.js +2 -2
- package/utils/file.js.map +1 -1
- package/utils/html.js +1 -1
- package/utils/html.js.map +1 -1
- package/utils/json.js +1 -1
- package/utils/json.js.map +1 -1
- package/utils/lib-versions.js +2 -2
- package/utils/lib-versions.ts +2 -2
- package/utils/log.js +3 -3
- package/utils/log.js.map +1 -1
- package/utils/log.ts +3 -3
- package/utils/node.js +8 -0
- package/utils/node.js.map +1 -0
- package/utils/node.ts +3 -0
- package/utils/package.js +4 -4
- package/utils/package.js.map +1 -1
- package/utils/package.ts +2 -2
- package/utils/testing.js +3 -3
- package/utils/testing.js.map +1 -1
- package/utils/versions.js +24 -20
- package/utils/versions.js.map +1 -1
- package/utils/versions.ts +20 -16
- package/utils/workspace.js +25 -6
- package/utils/workspace.js.map +1 -1
- package/utils/workspace.ts +15 -0
- package/view/files/__path__/__name@dasherize@if-flat__/__name@dasherize__.service.ts.template +9 -0
- package/view/index.js +1 -1
- package/view/index.js.map +1 -1
- package/view/schema.json +16 -0
- package/view/schema.ts +1 -0
- package/ng-update/upgrade-rules/v11/files-tpl/main.js +0 -31
- package/ng-update/upgrade-rules/v11/files-tpl/main.js.map +0 -1
- package/ng-update/upgrade-rules/v11/files-tpl/main.ts +0 -28
- package/ng-update/upgrade-rules/v11/hmr.js +0 -103
- package/ng-update/upgrade-rules/v11/hmr.js.map +0 -1
- package/ng-update/upgrade-rules/v11/hmr.ts +0 -109
- package/ng-update/upgrade-rules/v11/index.js +0 -72
- package/ng-update/upgrade-rules/v11/index.js.map +0 -1
- package/ng-update/upgrade-rules/v11/index.spec.ts +0 -51
- package/ng-update/upgrade-rules/v11/index.ts +0 -80
- package/ng-update/upgrade-rules/v11/layout.js +0 -39
- package/ng-update/upgrade-rules/v11/layout.js.map +0 -1
- package/ng-update/upgrade-rules/v11/layout.ts +0 -47
- package/ng-update/upgrade-rules/v117/index.js +0 -82
- package/ng-update/upgrade-rules/v117/index.js.map +0 -1
- package/ng-update/upgrade-rules/v117/index.spec.ts +0 -58
- package/ng-update/upgrade-rules/v117/index.ts +0 -71
- package/plugin/files/ie/tsconfig-es5.app.js +0 -9
- package/plugin/files/ie/tsconfig-es5.app.js.map +0 -1
- package/plugin/files/ie/tsconfig-es5.spec.js +0 -9
- package/plugin/files/ie/tsconfig-es5.spec.js.map +0 -1
- package/plugin/plugin.ie.js +0 -128
- package/plugin/plugin.ie.js.map +0 -1
- package/plugin/plugin.ie.spec.ts +0 -35
- package/plugin/plugin.ie.ts +0 -144
|
@@ -59,7 +59,7 @@ const LANGS: { [key: string]: LangConfigData } = {
|
|
|
59
59
|
|
|
60
60
|
@Injectable({ providedIn: 'root' })
|
|
61
61
|
export class I18NService extends AlainI18nBaseService {
|
|
62
|
-
protected _defaultLang = DEFAULT;
|
|
62
|
+
protected override _defaultLang = DEFAULT;
|
|
63
63
|
private _langs = Object.keys(LANGS).map(code => {
|
|
64
64
|
const item = LANGS[code];
|
|
65
65
|
return { code, text: item.text, abbr: item.abbr };
|
|
@@ -80,7 +80,7 @@ export class DefaultInterceptor implements HttpInterceptor {
|
|
|
80
80
|
*/
|
|
81
81
|
private refreshTokenRequest(): Observable<any> {
|
|
82
82
|
const model = this.tokenSrv.get();
|
|
83
|
-
return this.http.post(`/api/auth/refresh`, null, null, { headers: { refresh_token: model?.refresh_token || '' } });
|
|
83
|
+
return this.http.post(`/api/auth/refresh`, null, null, { headers: { refresh_token: model?.['refresh_token'] || '' } });
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
// #region 刷新Token方式一:使用 401 重新刷新 Token
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ChangeDetectionStrategy, Component, HostListener } from '@angular/core';
|
|
2
|
-
import
|
|
2
|
+
import screenfull from 'screenfull';
|
|
3
3
|
|
|
4
4
|
@Component({
|
|
5
5
|
selector: 'header-fullscreen',
|
|
@@ -8,25 +8,22 @@ import * as screenfull from 'screenfull';
|
|
|
8
8
|
{{ (status ? 'menu.fullscreen.exit' : 'menu.fullscreen') | i18n }}
|
|
9
9
|
`,
|
|
10
10
|
host: {
|
|
11
|
-
'[class.
|
|
11
|
+
'[class.flex-1]': 'true'
|
|
12
12
|
},
|
|
13
13
|
changeDetection: ChangeDetectionStrategy.OnPush
|
|
14
14
|
})
|
|
15
15
|
export class HeaderFullScreenComponent {
|
|
16
16
|
status = false;
|
|
17
|
-
private get sf(): screenfull.Screenfull {
|
|
18
|
-
return screenfull as screenfull.Screenfull;
|
|
19
|
-
}
|
|
20
17
|
|
|
21
18
|
@HostListener('window:resize')
|
|
22
19
|
_resize(): void {
|
|
23
|
-
this.status =
|
|
20
|
+
this.status = screenfull.isFullscreen;
|
|
24
21
|
}
|
|
25
22
|
|
|
26
23
|
@HostListener('click')
|
|
27
24
|
_click(): void {
|
|
28
|
-
if (
|
|
29
|
-
|
|
25
|
+
if (screenfull.isEnabled) {
|
|
26
|
+
screenfull.toggle();
|
|
30
27
|
}
|
|
31
28
|
}
|
|
32
29
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '@delon/theme/index';
|
|
2
|
+
|
|
2
3
|
:host ::ng-deep {
|
|
3
4
|
.container {
|
|
4
5
|
display: flex;
|
|
@@ -6,11 +7,13 @@
|
|
|
6
7
|
min-height: 100%;
|
|
7
8
|
background: #f0f2f5;
|
|
8
9
|
}
|
|
10
|
+
|
|
9
11
|
.langs {
|
|
10
12
|
width: 100%;
|
|
11
13
|
height: 40px;
|
|
12
14
|
line-height: 44px;
|
|
13
15
|
text-align: right;
|
|
16
|
+
|
|
14
17
|
.anticon {
|
|
15
18
|
margin-top: 24px;
|
|
16
19
|
margin-right: 24px;
|
|
@@ -19,10 +22,12 @@
|
|
|
19
22
|
cursor: pointer;
|
|
20
23
|
}
|
|
21
24
|
}
|
|
25
|
+
|
|
22
26
|
.wrap {
|
|
23
27
|
flex: 1;
|
|
24
28
|
padding: 32px 0;
|
|
25
29
|
}
|
|
30
|
+
|
|
26
31
|
.ant-form-item {
|
|
27
32
|
display: flex;
|
|
28
33
|
justify-content: space-between;
|
|
@@ -36,24 +41,30 @@
|
|
|
36
41
|
background-position: center 110px;
|
|
37
42
|
background-size: 100%;
|
|
38
43
|
}
|
|
44
|
+
|
|
39
45
|
.wrap {
|
|
40
46
|
padding: 32px 0 24px;
|
|
41
47
|
}
|
|
42
48
|
}
|
|
49
|
+
|
|
43
50
|
.top {
|
|
44
51
|
text-align: center;
|
|
45
52
|
}
|
|
53
|
+
|
|
46
54
|
.header {
|
|
47
55
|
height: 44px;
|
|
48
56
|
line-height: 44px;
|
|
57
|
+
|
|
49
58
|
a {
|
|
50
59
|
text-decoration: none;
|
|
51
60
|
}
|
|
52
61
|
}
|
|
62
|
+
|
|
53
63
|
.logo {
|
|
54
64
|
height: 44px;
|
|
55
65
|
margin-right: 16px;
|
|
56
66
|
}
|
|
67
|
+
|
|
57
68
|
.title {
|
|
58
69
|
position: relative;
|
|
59
70
|
color: @heading-color;
|
|
@@ -62,6 +73,7 @@
|
|
|
62
73
|
font-family: 'Myriad Pro', 'Helvetica Neue', Arial, Helvetica, sans-serif;
|
|
63
74
|
vertical-align: middle;
|
|
64
75
|
}
|
|
76
|
+
|
|
65
77
|
.desc {
|
|
66
78
|
margin-top: 12px;
|
|
67
79
|
margin-bottom: 40px;
|
|
@@ -75,9 +87,11 @@
|
|
|
75
87
|
.container {
|
|
76
88
|
background: #141414;
|
|
77
89
|
}
|
|
90
|
+
|
|
78
91
|
.title {
|
|
79
92
|
color: fade(@white, 85%);
|
|
80
93
|
}
|
|
94
|
+
|
|
81
95
|
.desc {
|
|
82
96
|
color: fade(@white, 45%);
|
|
83
97
|
}
|
|
@@ -9,7 +9,7 @@ import { ExceptionType } from '@delon/abc/exception';
|
|
|
9
9
|
})
|
|
10
10
|
export class ExceptionComponent {
|
|
11
11
|
get type(): ExceptionType {
|
|
12
|
-
return this.route.snapshot.data
|
|
12
|
+
return this.route.snapshot.data['type'];
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
constructor(private route: ActivatedRoute) {}
|
|
@@ -14,7 +14,7 @@ export class CallbackComponent implements OnInit {
|
|
|
14
14
|
constructor(private socialService: SocialService, private settingsSrv: SettingsService, private route: ActivatedRoute) {}
|
|
15
15
|
|
|
16
16
|
ngOnInit(): void {
|
|
17
|
-
this.type = this.route.snapshot.params
|
|
17
|
+
this.type = this.route.snapshot.params['type'];
|
|
18
18
|
this.mockModel();
|
|
19
19
|
}
|
|
20
20
|
|
|
@@ -1,39 +1,48 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '@delon/theme/index';
|
|
2
|
+
|
|
2
3
|
:host {
|
|
3
4
|
display: block;
|
|
4
5
|
width: 368px;
|
|
5
6
|
margin: 0 auto;
|
|
7
|
+
|
|
6
8
|
::ng-deep {
|
|
7
9
|
.ant-tabs .ant-tabs-bar {
|
|
8
10
|
margin-bottom: 24px;
|
|
9
11
|
text-align: center;
|
|
10
12
|
border-bottom: 0;
|
|
11
13
|
}
|
|
14
|
+
|
|
12
15
|
.ant-tabs-tab {
|
|
13
16
|
font-size: 16px;
|
|
14
17
|
line-height: 24px;
|
|
15
18
|
}
|
|
19
|
+
|
|
16
20
|
.ant-input-affix-wrapper .ant-input:not(:first-child) {
|
|
17
21
|
padding-left: 4px;
|
|
18
22
|
}
|
|
23
|
+
|
|
19
24
|
.icon {
|
|
20
25
|
margin-left: 16px;
|
|
21
|
-
color:
|
|
26
|
+
color: rgb(0 0 0 / 20%);
|
|
22
27
|
font-size: 24px;
|
|
23
28
|
vertical-align: middle;
|
|
24
29
|
cursor: pointer;
|
|
25
30
|
transition: color 0.3s;
|
|
31
|
+
|
|
26
32
|
&:hover {
|
|
27
33
|
color: @primary-color;
|
|
28
34
|
}
|
|
29
35
|
}
|
|
36
|
+
|
|
30
37
|
.other {
|
|
31
38
|
margin-top: 24px;
|
|
32
39
|
line-height: 22px;
|
|
33
40
|
text-align: left;
|
|
41
|
+
|
|
34
42
|
nz-tooltip {
|
|
35
43
|
vertical-align: middle;
|
|
36
44
|
}
|
|
45
|
+
|
|
37
46
|
.register {
|
|
38
47
|
float: right;
|
|
39
48
|
}
|
|
@@ -44,7 +53,8 @@
|
|
|
44
53
|
[data-theme='dark'] {
|
|
45
54
|
:host ::ng-deep {
|
|
46
55
|
.icon {
|
|
47
|
-
color:
|
|
56
|
+
color: rgb(255 255 255 / 20%);
|
|
57
|
+
|
|
48
58
|
&:hover {
|
|
49
59
|
color: #fff;
|
|
50
60
|
}
|
|
@@ -42,16 +42,16 @@ export class UserLoginComponent implements OnDestroy {
|
|
|
42
42
|
// #region fields
|
|
43
43
|
|
|
44
44
|
get userName(): AbstractControl {
|
|
45
|
-
return this.form.
|
|
45
|
+
return this.form.get('userName')!;
|
|
46
46
|
}
|
|
47
47
|
get password(): AbstractControl {
|
|
48
|
-
return this.form.
|
|
48
|
+
return this.form.get('password')!;
|
|
49
49
|
}
|
|
50
50
|
get mobile(): AbstractControl {
|
|
51
|
-
return this.form.
|
|
51
|
+
return this.form.get('mobile')!;
|
|
52
52
|
}
|
|
53
53
|
get captcha(): AbstractControl {
|
|
54
|
-
return this.form.
|
|
54
|
+
return this.form.get('captcha')!;
|
|
55
55
|
}
|
|
56
56
|
form: FormGroup;
|
|
57
57
|
error = '';
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
@import '
|
|
1
|
+
@import '@delon/theme/index';
|
|
2
|
+
|
|
2
3
|
:host {
|
|
3
4
|
display: block;
|
|
4
5
|
width: 368px;
|
|
5
6
|
margin: 0 auto;
|
|
7
|
+
|
|
6
8
|
::ng-deep {
|
|
7
9
|
h3 {
|
|
8
10
|
margin-bottom: 20px;
|
|
9
11
|
font-size: 16px;
|
|
10
12
|
}
|
|
13
|
+
|
|
11
14
|
.submit {
|
|
12
15
|
width: 50%;
|
|
13
16
|
}
|
|
17
|
+
|
|
14
18
|
.login {
|
|
15
19
|
float: right;
|
|
16
20
|
line-height: @btn-height-lg;
|
|
17
21
|
}
|
|
18
22
|
}
|
|
19
23
|
}
|
|
24
|
+
|
|
20
25
|
::ng-deep {
|
|
21
26
|
.register-password-cdk {
|
|
22
27
|
.success,
|
|
@@ -24,15 +29,19 @@
|
|
|
24
29
|
.error {
|
|
25
30
|
transition: color 0.3s;
|
|
26
31
|
}
|
|
32
|
+
|
|
27
33
|
.success {
|
|
28
34
|
color: @success-color;
|
|
29
35
|
}
|
|
36
|
+
|
|
30
37
|
.warning {
|
|
31
38
|
color: @warning-color;
|
|
32
39
|
}
|
|
40
|
+
|
|
33
41
|
.error {
|
|
34
42
|
color: @error-color;
|
|
35
43
|
}
|
|
44
|
+
|
|
36
45
|
.progress-pass > .progress {
|
|
37
46
|
.ant-progress-bg {
|
|
38
47
|
background-color: @warning-color;
|
|
@@ -32,19 +32,19 @@ export class UserRegisterComponent implements OnDestroy {
|
|
|
32
32
|
// #region fields
|
|
33
33
|
|
|
34
34
|
get mail(): AbstractControl {
|
|
35
|
-
return this.form.
|
|
35
|
+
return this.form.get('mail')!;
|
|
36
36
|
}
|
|
37
37
|
get password(): AbstractControl {
|
|
38
|
-
return this.form.
|
|
38
|
+
return this.form.get('password')!;
|
|
39
39
|
}
|
|
40
40
|
get confirm(): AbstractControl {
|
|
41
|
-
return this.form.
|
|
41
|
+
return this.form.get('confirm')!;
|
|
42
42
|
}
|
|
43
43
|
get mobile(): AbstractControl {
|
|
44
|
-
return this.form.
|
|
44
|
+
return this.form.get('mobile')!;
|
|
45
45
|
}
|
|
46
46
|
get captcha(): AbstractControl {
|
|
47
|
-
return this.form.
|
|
47
|
+
return this.form.get('captcha')!;
|
|
48
48
|
}
|
|
49
49
|
form: FormGroup;
|
|
50
50
|
error = '';
|
package/application/files/src/app/routes/passport/register-result/register-result.component.ts
CHANGED
|
@@ -10,6 +10,6 @@ export class UserRegisterResultComponent {
|
|
|
10
10
|
params = { email: '' };
|
|
11
11
|
email = '';
|
|
12
12
|
constructor(route: ActivatedRoute, public msg: NzMessageService) {
|
|
13
|
-
this.params.email = this.email = route.snapshot.queryParams
|
|
13
|
+
this.params.email = this.email = route.snapshot.queryParams['email'] || 'ng-alain@example.com';
|
|
14
14
|
}
|
|
15
15
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// - `default` Default theme
|
|
3
3
|
// - `dark` Import the official dark less style file
|
|
4
4
|
// - `compact` Import the official compact less style file
|
|
5
|
-
@import '
|
|
5
|
+
@import '@delon/theme/theme-default.less';
|
|
6
6
|
|
|
7
7
|
// ==========The following is the custom theme variable area==========
|
|
8
8
|
// The theme paraments can be generated at https://ng-alain.github.io/ng-alain/
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
@import '
|
|
2
|
-
@import '
|
|
3
|
-
@import '
|
|
4
|
-
@import '
|
|
5
|
-
@import '
|
|
1
|
+
@import '@delon/theme/system/index';
|
|
2
|
+
@import '@delon/abc/index';
|
|
3
|
+
@import '@delon/chart/index';
|
|
4
|
+
@import '@delon/theme/layout-default/style/index';
|
|
5
|
+
@import '@delon/theme/layout-blank/style/index';
|
|
6
6
|
|
|
7
7
|
@import './styles/index';
|
|
8
8
|
@import './styles/theme';
|
|
@@ -13,7 +13,9 @@ declare const require: any;
|
|
|
13
13
|
// First, initialize the Angular testing environment.
|
|
14
14
|
getTestBed().initTestEnvironment(
|
|
15
15
|
BrowserDynamicTestingModule,
|
|
16
|
-
platformBrowserDynamicTesting()
|
|
16
|
+
platformBrowserDynamicTesting(), {
|
|
17
|
+
teardown: { destroyAfterEach: false }
|
|
18
|
+
}
|
|
17
19
|
);
|
|
18
20
|
|
|
19
21
|
// Then we find all the tests.
|
package/application/index.js
CHANGED
|
@@ -39,16 +39,16 @@ function removeOrginalFiles() {
|
|
|
39
39
|
};
|
|
40
40
|
}
|
|
41
41
|
function fixAngularJson(options) {
|
|
42
|
-
return workspace_1.updateWorkspace((workspace) => __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
return (0, workspace_1.updateWorkspace)((workspace) => __awaiter(this, void 0, void 0, function* () {
|
|
43
43
|
var _a;
|
|
44
|
-
const p = utils_1.getProjectFromWorkspace(workspace, options.project);
|
|
44
|
+
const p = (0, utils_1.getProjectFromWorkspace)(workspace, options.project);
|
|
45
45
|
// Add proxy.conf.js
|
|
46
46
|
const serveTarget = (_a = p.targets) === null || _a === void 0 ? void 0 : _a.get(utils_1.BUILD_TARGET_SERVE);
|
|
47
47
|
if (serveTarget.options == null)
|
|
48
48
|
serveTarget.options = {};
|
|
49
49
|
serveTarget.options.proxyConfig = 'proxy.conf.js';
|
|
50
50
|
// 调整budgets
|
|
51
|
-
const budgets = utils_1.getProjectTarget(p, utils_1.BUILD_TARGET_BUILD, 'configurations').production
|
|
51
|
+
const budgets = (0, utils_1.getProjectTarget)(p, utils_1.BUILD_TARGET_BUILD, 'configurations').production
|
|
52
52
|
.budgets;
|
|
53
53
|
if (budgets && budgets.length > 0) {
|
|
54
54
|
const initial = budgets.find(w => w.type === 'initial');
|
|
@@ -57,19 +57,20 @@ function fixAngularJson(options) {
|
|
|
57
57
|
initial.maximumError = '3mb';
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
|
+
(0, utils_1.addStylePreprocessorOptionsToAllProject)(workspace);
|
|
60
61
|
}));
|
|
61
62
|
}
|
|
62
63
|
function addDependenciesToPackageJson(options) {
|
|
63
64
|
return (tree) => {
|
|
64
|
-
versions_1.UpgradeMainVersions(tree);
|
|
65
|
+
(0, versions_1.UpgradeMainVersions)(tree);
|
|
65
66
|
// 3rd
|
|
66
|
-
utils_1.addPackage(tree, ['screenfull@^
|
|
67
|
+
(0, utils_1.addPackage)(tree, ['screenfull@^6.0.0']);
|
|
67
68
|
return tree;
|
|
68
69
|
};
|
|
69
70
|
}
|
|
70
71
|
function addRunScriptToPackageJson() {
|
|
71
72
|
return (tree) => {
|
|
72
|
-
const json = utils_1.readPackage(tree, 'scripts');
|
|
73
|
+
const json = (0, utils_1.readPackage)(tree, 'scripts');
|
|
73
74
|
if (json == null)
|
|
74
75
|
return tree;
|
|
75
76
|
json.scripts['ng-high-memory'] = `node --max_old_space_size=8000 ./node_modules/@angular/cli/bin/ng`;
|
|
@@ -83,13 +84,13 @@ function addRunScriptToPackageJson() {
|
|
|
83
84
|
json.scripts.theme = `ng-alain-plugin-theme -t=themeCss`;
|
|
84
85
|
json.scripts.icon = `ng g ng-alain:plugin icon`;
|
|
85
86
|
json.scripts.prepare = `husky install`;
|
|
86
|
-
utils_1.writePackage(tree, json);
|
|
87
|
+
(0, utils_1.writePackage)(tree, json);
|
|
87
88
|
return tree;
|
|
88
89
|
};
|
|
89
90
|
}
|
|
90
91
|
function addPathsToTsConfig() {
|
|
91
92
|
return (tree) => {
|
|
92
|
-
const json = utils_1.readJSON(tree, 'tsconfig.json', 'compilerOptions');
|
|
93
|
+
const json = (0, utils_1.readJSON)(tree, 'tsconfig.json', 'compilerOptions');
|
|
93
94
|
if (json == null)
|
|
94
95
|
return tree;
|
|
95
96
|
if (!json.compilerOptions)
|
|
@@ -100,44 +101,44 @@ function addPathsToTsConfig() {
|
|
|
100
101
|
paths['@shared'] = ['src/app/shared/index'];
|
|
101
102
|
paths['@core'] = ['src/app/core/index'];
|
|
102
103
|
paths['@env/*'] = ['src/environments/*'];
|
|
103
|
-
utils_1.writeJSON(tree, 'tsconfig.json', json);
|
|
104
|
+
(0, utils_1.writeJSON)(tree, 'tsconfig.json', json);
|
|
104
105
|
return tree;
|
|
105
106
|
};
|
|
106
107
|
}
|
|
107
108
|
function addCodeStylesToPackageJson() {
|
|
108
109
|
return (tree) => {
|
|
109
|
-
const json = utils_1.readPackage(tree);
|
|
110
|
+
const json = (0, utils_1.readPackage)(tree);
|
|
110
111
|
if (json == null)
|
|
111
112
|
return tree;
|
|
112
113
|
json.scripts.lint = `npm run lint:ts && npm run lint:style`;
|
|
113
114
|
json.scripts['lint:ts'] = `ng lint --fix`;
|
|
114
|
-
json.scripts['lint:style'] = `stylelint \"src/**/*.less\" --
|
|
115
|
+
json.scripts['lint:style'] = `npx stylelint \"src/**/*.less\" --fix`;
|
|
115
116
|
json.scripts['prepare'] = 'husky install';
|
|
116
|
-
utils_1.writePackage(tree, json);
|
|
117
|
+
(0, utils_1.writePackage)(tree, json);
|
|
117
118
|
// fix polyfills.ts
|
|
118
119
|
const polyfillsPath = `${project.sourceRoot}/polyfills.ts`;
|
|
119
120
|
if (tree.exists(polyfillsPath)) {
|
|
120
|
-
const polyfillsContent = `/* eslint-disable import/no-unassigned-import */\n${utils_1.readContent(tree, polyfillsPath)}`;
|
|
121
|
-
utils_1.writeFile(tree, polyfillsPath, polyfillsContent);
|
|
121
|
+
const polyfillsContent = `/* eslint-disable import/no-unassigned-import */\n${(0, utils_1.readContent)(tree, polyfillsPath)}`;
|
|
122
|
+
(0, utils_1.writeFile)(tree, polyfillsPath, polyfillsContent);
|
|
122
123
|
}
|
|
123
124
|
// dependencies
|
|
124
|
-
utils_1.addPackage(tree, [
|
|
125
|
+
(0, utils_1.addPackage)(tree, [
|
|
125
126
|
`husky@^6.0.0`,
|
|
126
|
-
`lint-staged@^
|
|
127
|
-
`prettier@^2.
|
|
128
|
-
`stylelint@^
|
|
129
|
-
`stylelint-config-prettier@^
|
|
127
|
+
`lint-staged@^12.1.4`,
|
|
128
|
+
`prettier@^2.5.1`,
|
|
129
|
+
`stylelint@^14.2.0`,
|
|
130
|
+
`stylelint-config-prettier@^9.0.3`,
|
|
130
131
|
`stylelint-config-rational-order@^0.1.2`,
|
|
131
|
-
`stylelint-config-standard@^
|
|
132
|
-
`stylelint-declaration-block-no-ignored-properties@^2.
|
|
133
|
-
`stylelint-order@^
|
|
132
|
+
`stylelint-config-standard@^24.0.0`,
|
|
133
|
+
`stylelint-declaration-block-no-ignored-properties@^2.5.0`,
|
|
134
|
+
`stylelint-order@^5.0.0`
|
|
134
135
|
], 'devDependencies');
|
|
135
136
|
return tree;
|
|
136
137
|
};
|
|
137
138
|
}
|
|
138
139
|
function addSchematics(options) {
|
|
139
|
-
return workspace_1.updateWorkspace((workspace) => __awaiter(this, void 0, void 0, function* () {
|
|
140
|
-
const p = utils_1.getProjectFromWorkspace(workspace, options.project);
|
|
140
|
+
return (0, workspace_1.updateWorkspace)((workspace) => __awaiter(this, void 0, void 0, function* () {
|
|
141
|
+
const p = (0, utils_1.getProjectFromWorkspace)(workspace, options.project);
|
|
141
142
|
const schematics = p.extensions.schematics;
|
|
142
143
|
schematics['ng-alain:module'] = {
|
|
143
144
|
routing: true,
|
|
@@ -172,13 +173,13 @@ function addSchematics(options) {
|
|
|
172
173
|
}
|
|
173
174
|
function forceLess() {
|
|
174
175
|
return () => {
|
|
175
|
-
utils_1.addAssetsToTarget([{ type: 'style', value: 'src/styles.less' }], 'add', [utils_1.BUILD_TARGET_BUILD], null, true);
|
|
176
|
+
(0, utils_1.addAssetsToTarget)([{ type: 'style', value: 'src/styles.less' }], 'add', [utils_1.BUILD_TARGET_BUILD], null, true);
|
|
176
177
|
};
|
|
177
178
|
}
|
|
178
179
|
function addStyle() {
|
|
179
180
|
return (tree) => {
|
|
180
|
-
utils_1.addHeadStyle(tree, project, ` <style type="text/css">.preloader{position:fixed;top:0;left:0;width:100%;height:100%;overflow:hidden;background:#49a9ee;z-index:9999;transition:opacity .65s}.preloader-hidden-add{opacity:1;display:block}.preloader-hidden-add-active{opacity:0}.preloader-hidden{display:none}.cs-loader{position:absolute;top:0;left:0;height:100%;width:100%}.cs-loader-inner{transform:translateY(-50%);top:50%;position:absolute;width:100%;color:#fff;text-align:center}.cs-loader-inner label{font-size:20px;opacity:0;display:inline-block}@keyframes lol{0%{opacity:0;transform:translateX(-300px)}33%{opacity:1;transform:translateX(0)}66%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(300px)}}.cs-loader-inner label:nth-child(6){animation:lol 3s infinite ease-in-out}.cs-loader-inner label:nth-child(5){animation:lol 3s .1s infinite ease-in-out}.cs-loader-inner label:nth-child(4){animation:lol 3s .2s infinite ease-in-out}.cs-loader-inner label:nth-child(3){animation:lol 3s .3s infinite ease-in-out}.cs-loader-inner label:nth-child(2){animation:lol 3s .4s infinite ease-in-out}.cs-loader-inner label:nth-child(1){animation:lol 3s .5s infinite ease-in-out}</style>`);
|
|
181
|
-
utils_1.addHtmlToBody(tree, project, ` <div class="preloader"><div class="cs-loader"><div class="cs-loader-inner"><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label></div></div></div>\n`);
|
|
181
|
+
(0, utils_1.addHeadStyle)(tree, project, ` <style type="text/css">.preloader{position:fixed;top:0;left:0;width:100%;height:100%;overflow:hidden;background:#49a9ee;z-index:9999;transition:opacity .65s}.preloader-hidden-add{opacity:1;display:block}.preloader-hidden-add-active{opacity:0}.preloader-hidden{display:none}.cs-loader{position:absolute;top:0;left:0;height:100%;width:100%}.cs-loader-inner{transform:translateY(-50%);top:50%;position:absolute;width:100%;color:#fff;text-align:center}.cs-loader-inner label{font-size:20px;opacity:0;display:inline-block}@keyframes lol{0%{opacity:0;transform:translateX(-300px)}33%{opacity:1;transform:translateX(0)}66%{opacity:1;transform:translateX(0)}100%{opacity:0;transform:translateX(300px)}}.cs-loader-inner label:nth-child(6){animation:lol 3s infinite ease-in-out}.cs-loader-inner label:nth-child(5){animation:lol 3s .1s infinite ease-in-out}.cs-loader-inner label:nth-child(4){animation:lol 3s .2s infinite ease-in-out}.cs-loader-inner label:nth-child(3){animation:lol 3s .3s infinite ease-in-out}.cs-loader-inner label:nth-child(2){animation:lol 3s .4s infinite ease-in-out}.cs-loader-inner label:nth-child(1){animation:lol 3s .5s infinite ease-in-out}</style>`);
|
|
182
|
+
(0, utils_1.addHtmlToBody)(tree, project, ` <div class="preloader"><div class="cs-loader"><div class="cs-loader-inner"><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label><label> ●</label></div></div></div>\n`);
|
|
182
183
|
// // add styles
|
|
183
184
|
// [`${project.sourceRoot}/styles/index.less`, `${project.sourceRoot}/styles/theme.less`].forEach(p => {
|
|
184
185
|
// overwriteFile({ tree, filePath: p, content: path.join(overwriteDataFileRoot, p), overwrite: true });
|
|
@@ -187,18 +188,18 @@ function addStyle() {
|
|
|
187
188
|
};
|
|
188
189
|
}
|
|
189
190
|
function addFilesToRoot(options) {
|
|
190
|
-
return schematics_1.chain([
|
|
191
|
-
schematics_1.mergeWith(schematics_1.apply(schematics_1.url('./files/src'), [
|
|
192
|
-
options.i18n ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('i18n') === -1),
|
|
193
|
-
options.form ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('json-schema') === -1),
|
|
194
|
-
schematics_1.template(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
|
|
191
|
+
return (0, schematics_1.chain)([
|
|
192
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/src'), [
|
|
193
|
+
options.i18n ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('i18n') === -1),
|
|
194
|
+
options.form ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('json-schema') === -1),
|
|
195
|
+
(0, schematics_1.template)(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
|
|
195
196
|
ZORROVERSION: utils_1.ZORROVERSION })),
|
|
196
|
-
schematics_1.move(project.sourceRoot)
|
|
197
|
+
(0, schematics_1.move)(project.sourceRoot)
|
|
197
198
|
])),
|
|
198
|
-
schematics_1.mergeWith(schematics_1.apply(schematics_1.url('./files/root'), [
|
|
199
|
-
options.i18n ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('i18n') === -1),
|
|
200
|
-
options.form ? schematics_1.noop() : schematics_1.filter(p => p.indexOf('json-schema') === -1),
|
|
201
|
-
schematics_1.template(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
|
|
199
|
+
(0, schematics_1.mergeWith)((0, schematics_1.apply)((0, schematics_1.url)('./files/root'), [
|
|
200
|
+
options.i18n ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('i18n') === -1),
|
|
201
|
+
options.form ? (0, schematics_1.noop)() : (0, schematics_1.filter)(p => p.indexOf('json-schema') === -1),
|
|
202
|
+
(0, schematics_1.template)(Object.assign(Object.assign({ utils: core_1.strings }, options), { dot: '.', VERSION: utils_1.VERSION,
|
|
202
203
|
ZORROVERSION: utils_1.ZORROVERSION }))
|
|
203
204
|
// move('/')
|
|
204
205
|
]), schematics_1.MergeStrategy.Overwrite)
|
|
@@ -208,7 +209,7 @@ function fixLang(options) {
|
|
|
208
209
|
return (tree, context) => {
|
|
209
210
|
if (options.i18n)
|
|
210
211
|
return;
|
|
211
|
-
const langs = lang_config_1.getLangData(options.defaultLanguage);
|
|
212
|
+
const langs = (0, lang_config_1.getLangData)(options.defaultLanguage);
|
|
212
213
|
if (!langs)
|
|
213
214
|
return;
|
|
214
215
|
context.logger.info(`Translating template into ${options.defaultLanguage} language, please wait...`);
|
|
@@ -261,32 +262,32 @@ function fixLangInHtml(tree, p, langs) {
|
|
|
261
262
|
function fixVsCode() {
|
|
262
263
|
return (tree) => {
|
|
263
264
|
const filePath = '.vscode/extensions.json';
|
|
264
|
-
let json = utils_1.readJSON(tree, filePath);
|
|
265
|
+
let json = (0, utils_1.readJSON)(tree, filePath);
|
|
265
266
|
if (json == null) {
|
|
266
267
|
tree.create(filePath, '');
|
|
267
268
|
json = {};
|
|
268
269
|
}
|
|
269
270
|
json.recommendations = ['cipchk.ng-alain-extension-pack'];
|
|
270
|
-
utils_1.writeJSON(tree, filePath, json);
|
|
271
|
+
(0, utils_1.writeJSON)(tree, filePath, json);
|
|
271
272
|
};
|
|
272
273
|
}
|
|
273
274
|
function default_1(options) {
|
|
274
275
|
return (tree, context) => __awaiter(this, void 0, void 0, function* () {
|
|
275
|
-
project = (yield utils_1.getProject(tree, options.project)).project;
|
|
276
|
+
project = (yield (0, utils_1.getProject)(tree, options.project)).project;
|
|
276
277
|
context.logger.info(`Generating NG-ALAIN scaffold...`);
|
|
277
|
-
return schematics_1.chain([
|
|
278
|
+
return (0, schematics_1.chain)([
|
|
278
279
|
// @delon/* dependencies
|
|
279
280
|
addDependenciesToPackageJson(options),
|
|
280
281
|
// Configuring CommonJS dependencies
|
|
281
282
|
// https://angular.io/guide/build#configuring-commonjs-dependencies
|
|
282
|
-
utils_1.addAllowedCommonJsDependencies([]),
|
|
283
|
+
(0, utils_1.addAllowedCommonJsDependencies)([]),
|
|
283
284
|
// ci
|
|
284
285
|
addRunScriptToPackageJson(),
|
|
285
286
|
addPathsToTsConfig(),
|
|
286
287
|
// code style
|
|
287
288
|
addCodeStylesToPackageJson(),
|
|
288
289
|
addSchematics(options),
|
|
289
|
-
versions_1.addESLintRule(context, false),
|
|
290
|
+
(0, versions_1.addESLintRule)(context, false),
|
|
290
291
|
// files
|
|
291
292
|
removeOrginalFiles(),
|
|
292
293
|
addFilesToRoot(options),
|