eiu-app-kit 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 +88 -0
- package/esm2020/eiu-app-kit.mjs +5 -0
- package/esm2020/lib/app-launcher/eiu-app-launcher-menu.model.mjs +2 -0
- package/esm2020/lib/app-launcher/eiu-app-launcher-menu.token.mjs +6 -0
- package/esm2020/lib/app-launcher/eiu-app-launcher.component.mjs +89 -0
- package/esm2020/lib/app-launcher/eiu-app-launcher.module.mjs +22 -0
- package/esm2020/lib/eiu-app-kit.tokens.mjs +7 -0
- package/esm2020/lib/feature-news/constants.mjs +8 -0
- package/esm2020/lib/feature-news/eiu-app-feature-news.module.mjs +22 -0
- package/esm2020/lib/feature-news/feature-news-dialog.component.mjs +41 -0
- package/esm2020/lib/feature-news/feature-news-dialog.service.mjs +30 -0
- package/esm2020/lib/feature-news/feature-news.service.mjs +55 -0
- package/esm2020/lib/feature-news/models/operation-result.model.mjs +2 -0
- package/esm2020/lib/feature-news/models/redmine-news.model.mjs +2 -0
- package/esm2020/lib/feature-news/news-api.service.mjs +36 -0
- package/esm2020/lib/footer/eiu-app-footer.component.mjs +38 -0
- package/esm2020/lib/footer/eiu-app-footer.module.mjs +18 -0
- package/esm2020/lib/sidebar-shared/contact/eiu-contact-support.component.mjs +23 -0
- package/esm2020/lib/sidebar-shared/eiu-sidebar-shared.module.mjs +20 -0
- package/esm2020/lib/sidebar-shared/logo/eiu-sidebar-logo.component.mjs +26 -0
- package/esm2020/lib/sidebar-shared/sidebar-shared.model.mjs +2 -0
- package/esm2020/public-api.mjs +23 -0
- package/fesm2015/eiu-app-kit.mjs +418 -0
- package/fesm2015/eiu-app-kit.mjs.map +1 -0
- package/fesm2020/eiu-app-kit.mjs +409 -0
- package/fesm2020/eiu-app-kit.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/lib/app-launcher/eiu-app-launcher-menu.model.d.ts +10 -0
- package/lib/app-launcher/eiu-app-launcher-menu.token.d.ts +10 -0
- package/lib/app-launcher/eiu-app-launcher.component.d.ts +30 -0
- package/lib/app-launcher/eiu-app-launcher.module.d.ts +12 -0
- package/lib/eiu-app-kit.tokens.d.ts +6 -0
- package/lib/feature-news/constants.d.ts +7 -0
- package/lib/feature-news/eiu-app-feature-news.module.d.ts +12 -0
- package/lib/feature-news/feature-news-dialog.component.d.ts +16 -0
- package/lib/feature-news/feature-news-dialog.service.d.ts +15 -0
- package/lib/feature-news/feature-news.service.d.ts +13 -0
- package/lib/feature-news/models/operation-result.model.d.ts +6 -0
- package/lib/feature-news/models/redmine-news.model.d.ts +17 -0
- package/lib/feature-news/news-api.service.d.ts +11 -0
- package/lib/footer/eiu-app-footer.component.d.ts +14 -0
- package/lib/footer/eiu-app-footer.module.d.ts +8 -0
- package/lib/sidebar-shared/contact/eiu-contact-support.component.d.ts +9 -0
- package/lib/sidebar-shared/eiu-sidebar-shared.module.d.ts +10 -0
- package/lib/sidebar-shared/logo/eiu-sidebar-logo.component.d.ts +9 -0
- package/lib/sidebar-shared/sidebar-shared.model.d.ts +12 -0
- package/package.json +54 -0
- package/public-api.d.ts +19 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AfterViewInit, ChangeDetectorRef, EventEmitter, OnInit } from '@angular/core';
|
|
2
|
+
import { EiuAppLauncherMenuLoader } from './eiu-app-launcher-menu.token';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export interface EiuAppLauncherViewItem {
|
|
5
|
+
label: string;
|
|
6
|
+
icon: string;
|
|
7
|
+
link: string;
|
|
8
|
+
isActive: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare class EiuAppLauncherComponent implements OnInit, AfterViewInit {
|
|
11
|
+
private readonly _menuLoader;
|
|
12
|
+
private readonly _cdr;
|
|
13
|
+
/** Phát ra khi user bấm icon menu (sidebar). Host gắn với store / layout. */
|
|
14
|
+
readonly sidebarToggle: EventEmitter<void>;
|
|
15
|
+
appLabel: string;
|
|
16
|
+
isScreenWide: boolean;
|
|
17
|
+
menuItems: EiuAppLauncherViewItem[];
|
|
18
|
+
private readonly _apiBase;
|
|
19
|
+
constructor(_menuLoader: EiuAppLauncherMenuLoader, apiBaseUrl: string, _cdr: ChangeDetectorRef);
|
|
20
|
+
ngOnInit(): void;
|
|
21
|
+
onResize(): void;
|
|
22
|
+
ngAfterViewInit(): void;
|
|
23
|
+
onToggleMenuSidebar(): void;
|
|
24
|
+
private _adjustMenuPosition;
|
|
25
|
+
private _loadMenu;
|
|
26
|
+
private _iconUrl;
|
|
27
|
+
private _isActive;
|
|
28
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuAppLauncherComponent, never>;
|
|
29
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EiuAppLauncherComponent, "app-eiu-app-launcher", never, { "appLabel": "appLabel"; }, { "sidebarToggle": "sidebarToggle"; }, never, never, false, never>;
|
|
30
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./eiu-app-launcher.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
/**
|
|
5
|
+
* Import ở shell layout (ví dụ `ThemeModule`).
|
|
6
|
+
* Cần `EIU_APP_API_BASE_URL` và `EIU_APP_LAUNCHER_MENU_LOADER` trong `providers`.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EiuAppLauncherModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuAppLauncherModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<EiuAppLauncherModule, [typeof i1.EiuAppLauncherComponent], [typeof i2.CommonModule], [typeof i1.EiuAppLauncherComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<EiuAppLauncherModule>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** Prefix localStorage: feature_news_seen::<userId>::<projectIdentifier> */
|
|
2
|
+
export declare const FEATURE_NEWS_SEEN_STORAGE_KEY_PREFIX = "feature_news_seen::";
|
|
3
|
+
/**
|
|
4
|
+
* Mặc định project identifier trên Redmine (EIU App).
|
|
5
|
+
* Ứng dụng host có thể dùng hằng này hoặc chuỗi riêng khi gọi service.
|
|
6
|
+
*/
|
|
7
|
+
export declare const FEATURE_NEWS_REDMINE_PROJECT_IDENTIFIER = "login-sso-quan-ly-nhan-su";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./feature-news-dialog.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
/**
|
|
5
|
+
* Import module này ở shell layout (hoặc `AppModule`) để có `<app-feature-news-dialog />`.
|
|
6
|
+
* Nhớ cung cấp `EIU_APP_API_BASE_URL` trong providers.
|
|
7
|
+
*/
|
|
8
|
+
export declare class EiuAppFeatureNewsModule {
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuAppFeatureNewsModule, never>;
|
|
10
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<EiuAppFeatureNewsModule, [typeof i1.FeatureNewsDialogComponent], [typeof i2.CommonModule], [typeof i1.FeatureNewsDialogComponent]>;
|
|
11
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<EiuAppFeatureNewsModule>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { OnDestroy, OnInit } from '@angular/core';
|
|
2
|
+
import { RedmineNewsItem } from './models/redmine-news.model';
|
|
3
|
+
import { FeatureNewsDialogState } from './feature-news-dialog.service';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class FeatureNewsDialogComponent implements OnInit, OnDestroy {
|
|
6
|
+
private readonly _featureNewsDialogService;
|
|
7
|
+
private _subscription;
|
|
8
|
+
protected dialogState: FeatureNewsDialogState | null;
|
|
9
|
+
ngOnInit(): void;
|
|
10
|
+
ngOnDestroy(): void;
|
|
11
|
+
getSummary(item: RedmineNewsItem): string;
|
|
12
|
+
closeDialog(): void;
|
|
13
|
+
private _truncateText;
|
|
14
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FeatureNewsDialogComponent, never>;
|
|
15
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<FeatureNewsDialogComponent, "app-feature-news-dialog", never, {}, {}, never, never, false, never>;
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { RedmineNewsItem } from './models/redmine-news.model';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export interface FeatureNewsDialogState {
|
|
5
|
+
news: RedmineNewsItem[];
|
|
6
|
+
}
|
|
7
|
+
export declare class FeatureNewsDialogService {
|
|
8
|
+
private readonly _dialogState;
|
|
9
|
+
private _closeNotifier;
|
|
10
|
+
readonly dialogState$: Observable<FeatureNewsDialogState | null>;
|
|
11
|
+
open(news: RedmineNewsItem[]): Observable<void>;
|
|
12
|
+
close(): void;
|
|
13
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FeatureNewsDialogService, never>;
|
|
14
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FeatureNewsDialogService>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class FeatureNewsService {
|
|
4
|
+
private readonly _newsApiService;
|
|
5
|
+
private readonly _featureNewsDialogService;
|
|
6
|
+
buildSeenKey(userId: string, projectIdentifier: string): string;
|
|
7
|
+
hasSeenLatestNews(userId: string, projectIdentifier: string, latestNewsId: number): boolean;
|
|
8
|
+
markSeen(userId: string, projectIdentifier: string, latestNewsId: number): void;
|
|
9
|
+
checkAndShowFeatureNews(userId: string, projectIdentifier: string): Observable<void>;
|
|
10
|
+
showLatestFeatureNewsManually(userId: string, projectIdentifier: string): Observable<void>;
|
|
11
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FeatureNewsService, never>;
|
|
12
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FeatureNewsService>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export interface RedmineAuthor {
|
|
2
|
+
id: number;
|
|
3
|
+
name: string;
|
|
4
|
+
}
|
|
5
|
+
export interface RedmineNewsItem {
|
|
6
|
+
id: number;
|
|
7
|
+
title: string;
|
|
8
|
+
summary: string;
|
|
9
|
+
description: string;
|
|
10
|
+
createdOn: string;
|
|
11
|
+
author: RedmineAuthor | null;
|
|
12
|
+
}
|
|
13
|
+
export interface RedmineNewsResponse {
|
|
14
|
+
projectName: string;
|
|
15
|
+
projectIdentifier: string;
|
|
16
|
+
news: RedmineNewsItem[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { OperationResult } from './models/operation-result.model';
|
|
3
|
+
import { RedmineNewsResponse } from './models/redmine-news.model';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class NewsApiService {
|
|
6
|
+
private readonly _httpClient;
|
|
7
|
+
private readonly _apiBaseUrl;
|
|
8
|
+
getNewsByProjectIdentifier(projectIdentifier: string, limit?: number): Observable<OperationResult<RedmineNewsResponse>>;
|
|
9
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<NewsApiService, never>;
|
|
10
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<NewsApiService>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventEmitter } from '@angular/core';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class EiuAppFooterComponent {
|
|
4
|
+
appVersion: string;
|
|
5
|
+
copyrightYear: string;
|
|
6
|
+
companyName: string;
|
|
7
|
+
companyUrl: string;
|
|
8
|
+
allRightsText: string;
|
|
9
|
+
ringLabel: string;
|
|
10
|
+
readonly ringClick: EventEmitter<void>;
|
|
11
|
+
onRingClick(event: Event): void;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuAppFooterComponent, never>;
|
|
13
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EiuAppFooterComponent, "app-eiu-app-footer", never, { "appVersion": "appVersion"; "copyrightYear": "copyrightYear"; "companyName": "companyName"; "companyUrl": "companyUrl"; "allRightsText": "allRightsText"; "ringLabel": "ringLabel"; }, { "ringClick": "ringClick"; }, never, never, false, never>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./eiu-app-footer.component";
|
|
3
|
+
import * as i2 from "@angular/common";
|
|
4
|
+
export declare class EiuAppFooterModule {
|
|
5
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuAppFooterModule, never>;
|
|
6
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<EiuAppFooterModule, [typeof i1.EiuAppFooterComponent], [typeof i2.CommonModule], [typeof i1.EiuAppFooterComponent]>;
|
|
7
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<EiuAppFooterModule>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EiuAppSidebarContactItem } from '../sidebar-shared.model';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class EiuContactSupportComponent {
|
|
4
|
+
title: string;
|
|
5
|
+
contacts: EiuAppSidebarContactItem[];
|
|
6
|
+
get sortedContacts(): EiuAppSidebarContactItem[];
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuContactSupportComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EiuContactSupportComponent, "app-eiu-contact-support", never, { "title": "title"; "contacts": "contacts"; }, {}, never, never, false, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import * as i1 from "./logo/eiu-sidebar-logo.component";
|
|
3
|
+
import * as i2 from "./contact/eiu-contact-support.component";
|
|
4
|
+
import * as i3 from "@angular/common";
|
|
5
|
+
import * as i4 from "@angular/router";
|
|
6
|
+
export declare class EiuSidebarSharedModule {
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuSidebarSharedModule, never>;
|
|
8
|
+
static ɵmod: i0.ɵɵNgModuleDeclaration<EiuSidebarSharedModule, [typeof i1.EiuSidebarLogoComponent, typeof i2.EiuContactSupportComponent], [typeof i3.CommonModule, typeof i4.RouterModule], [typeof i1.EiuSidebarLogoComponent, typeof i2.EiuContactSupportComponent]>;
|
|
9
|
+
static ɵinj: i0.ɵɵInjectorDeclaration<EiuSidebarSharedModule>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
export declare class EiuSidebarLogoComponent {
|
|
3
|
+
imageUrl: string;
|
|
4
|
+
alt: string;
|
|
5
|
+
text: string;
|
|
6
|
+
homeLink: string;
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<EiuSidebarLogoComponent, never>;
|
|
8
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<EiuSidebarLogoComponent, "app-eiu-sidebar-logo", never, { "imageUrl": "imageUrl"; "alt": "alt"; "text": "text"; "homeLink": "homeLink"; }, {}, never, never, false, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface EiuAppSidebarContactItem {
|
|
2
|
+
fullName?: string | null;
|
|
3
|
+
phoneNumber?: string | null;
|
|
4
|
+
email?: string | null;
|
|
5
|
+
sortOrder?: number | null;
|
|
6
|
+
}
|
|
7
|
+
export interface EiuAppSidebarLogo {
|
|
8
|
+
imageUrl: string | null;
|
|
9
|
+
alt?: string;
|
|
10
|
+
text?: string;
|
|
11
|
+
homeLink?: string;
|
|
12
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "eiu-app-kit",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "Thư viện Angular dùng chung cho các SPA EIU: app launcher (header), tin Redmine / feature news.",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"angular",
|
|
7
|
+
"angular15",
|
|
8
|
+
"eiu",
|
|
9
|
+
"library",
|
|
10
|
+
"launcher",
|
|
11
|
+
"feature-news"
|
|
12
|
+
],
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/eiuitsoft/eiu-app-kit.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/eiuitsoft/eiu-app-kit/issues"
|
|
20
|
+
},
|
|
21
|
+
"homepage": "https://github.com/eiuitsoft/eiu-app-kit#readme",
|
|
22
|
+
"peerDependencies": {
|
|
23
|
+
"@angular/common": "^15.0.0",
|
|
24
|
+
"@angular/core": "^15.0.0",
|
|
25
|
+
"rxjs": "^7.5.0"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"tslib": "^2.3.0"
|
|
29
|
+
},
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"publishConfig": {
|
|
32
|
+
"access": "public",
|
|
33
|
+
"registry": "https://registry.npmjs.org/"
|
|
34
|
+
},
|
|
35
|
+
"module": "fesm2015/eiu-app-kit.mjs",
|
|
36
|
+
"es2020": "fesm2020/eiu-app-kit.mjs",
|
|
37
|
+
"esm2020": "esm2020/eiu-app-kit.mjs",
|
|
38
|
+
"fesm2020": "fesm2020/eiu-app-kit.mjs",
|
|
39
|
+
"fesm2015": "fesm2015/eiu-app-kit.mjs",
|
|
40
|
+
"typings": "index.d.ts",
|
|
41
|
+
"exports": {
|
|
42
|
+
"./package.json": {
|
|
43
|
+
"default": "./package.json"
|
|
44
|
+
},
|
|
45
|
+
".": {
|
|
46
|
+
"types": "./index.d.ts",
|
|
47
|
+
"esm2020": "./esm2020/eiu-app-kit.mjs",
|
|
48
|
+
"es2020": "./fesm2020/eiu-app-kit.mjs",
|
|
49
|
+
"es2015": "./fesm2015/eiu-app-kit.mjs",
|
|
50
|
+
"node": "./fesm2015/eiu-app-kit.mjs",
|
|
51
|
+
"default": "./fesm2020/eiu-app-kit.mjs"
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
package/public-api.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export * from './lib/eiu-app-kit.tokens';
|
|
2
|
+
export * from './lib/app-launcher/eiu-app-launcher-menu.model';
|
|
3
|
+
export * from './lib/app-launcher/eiu-app-launcher-menu.token';
|
|
4
|
+
export * from './lib/app-launcher/eiu-app-launcher.component';
|
|
5
|
+
export * from './lib/app-launcher/eiu-app-launcher.module';
|
|
6
|
+
export * from './lib/sidebar-shared/sidebar-shared.model';
|
|
7
|
+
export * from './lib/sidebar-shared/logo/eiu-sidebar-logo.component';
|
|
8
|
+
export * from './lib/sidebar-shared/contact/eiu-contact-support.component';
|
|
9
|
+
export * from './lib/sidebar-shared/eiu-sidebar-shared.module';
|
|
10
|
+
export * from './lib/footer/eiu-app-footer.component';
|
|
11
|
+
export * from './lib/footer/eiu-app-footer.module';
|
|
12
|
+
export * from './lib/feature-news/constants';
|
|
13
|
+
export * from './lib/feature-news/models/operation-result.model';
|
|
14
|
+
export * from './lib/feature-news/models/redmine-news.model';
|
|
15
|
+
export * from './lib/feature-news/news-api.service';
|
|
16
|
+
export * from './lib/feature-news/feature-news-dialog.service';
|
|
17
|
+
export * from './lib/feature-news/feature-news.service';
|
|
18
|
+
export * from './lib/feature-news/feature-news-dialog.component';
|
|
19
|
+
export * from './lib/feature-news/eiu-app-feature-news.module';
|