@matechat/ng 0.0.1-alpha.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.
Files changed (64) hide show
  1. package/Base/base.component.d.ts +11 -0
  2. package/Bubble/avatar/avatar.component.d.ts +23 -0
  3. package/Bubble/avatar-body-icon/avatar-body-icon.component.d.ts +7 -0
  4. package/Bubble/avatar-no-body-icon/avatar-no-body-icon.component.d.ts +7 -0
  5. package/Bubble/bubble-loading/bubble-loading.component.d.ts +5 -0
  6. package/Bubble/bubble.component.d.ts +24 -0
  7. package/Bubble/bubble.module.d.ts +10 -0
  8. package/Bubble/index.d.ts +6 -0
  9. package/Input/button/button.component.d.ts +31 -0
  10. package/Input/index.d.ts +2 -0
  11. package/Input/input.component.d.ts +56 -0
  12. package/Input/input.module.d.ts +11 -0
  13. package/Input/send-icon/send-icon.component.d.ts +5 -0
  14. package/Locale/index.d.ts +5 -0
  15. package/Locale/locale.module.d.ts +17 -0
  16. package/Locale/locale.service.d.ts +50 -0
  17. package/Locale/translate.pipe.d.ts +23 -0
  18. package/README.md +24 -0
  19. package/components-common/Base/foundation.d.ts +43 -0
  20. package/components-common/Bubble/common/bubble-constants.d.ts +4 -0
  21. package/components-common/Bubble/common/bubble-types.d.ts +12 -0
  22. package/components-common/Bubble/foundation.d.ts +9 -0
  23. package/components-common/Input/button-foundation.d.ts +15 -0
  24. package/components-common/Input/common/types.d.ts +16 -0
  25. package/components-common/Input/foundation.d.ts +20 -0
  26. package/components-common/Locale/lang/en-us.d.ts +26 -0
  27. package/components-common/Locale/lang/zh-cn.d.ts +26 -0
  28. package/esm2022/Base/base.component.mjs +46 -0
  29. package/esm2022/Bubble/avatar/avatar.component.mjs +121 -0
  30. package/esm2022/Bubble/avatar-body-icon/avatar-body-icon.component.mjs +19 -0
  31. package/esm2022/Bubble/avatar-no-body-icon/avatar-no-body-icon.component.mjs +19 -0
  32. package/esm2022/Bubble/bubble-loading/bubble-loading.component.mjs +11 -0
  33. package/esm2022/Bubble/bubble.component.mjs +82 -0
  34. package/esm2022/Bubble/bubble.module.mjs +36 -0
  35. package/esm2022/Bubble/index.mjs +7 -0
  36. package/esm2022/Input/button/button.component.mjs +83 -0
  37. package/esm2022/Input/index.mjs +3 -0
  38. package/esm2022/Input/input.component.mjs +181 -0
  39. package/esm2022/Input/input.module.mjs +34 -0
  40. package/esm2022/Input/send-icon/send-icon.component.mjs +11 -0
  41. package/esm2022/Locale/index.mjs +6 -0
  42. package/esm2022/Locale/locale.module.mjs +39 -0
  43. package/esm2022/Locale/locale.service.mjs +140 -0
  44. package/esm2022/Locale/translate.pipe.mjs +38 -0
  45. package/esm2022/components-common/Base/foundation.mjs +63 -0
  46. package/esm2022/components-common/Bubble/common/bubble-constants.mjs +5 -0
  47. package/esm2022/components-common/Bubble/common/bubble-types.mjs +2 -0
  48. package/esm2022/components-common/Bubble/foundation.mjs +30 -0
  49. package/esm2022/components-common/Input/button-foundation.mjs +33 -0
  50. package/esm2022/components-common/Input/common/types.mjs +21 -0
  51. package/esm2022/components-common/Input/foundation.mjs +72 -0
  52. package/esm2022/components-common/Locale/lang/en-us.mjs +26 -0
  53. package/esm2022/components-common/Locale/lang/zh-cn.mjs +26 -0
  54. package/esm2022/matechat-ng.mjs +5 -0
  55. package/esm2022/public-api.mjs +7 -0
  56. package/fesm2022/matechat-ng-en-us-DsYnUbZd.mjs +28 -0
  57. package/fesm2022/matechat-ng-en-us-DsYnUbZd.mjs.map +1 -0
  58. package/fesm2022/matechat-ng-zh-cn--_YVZHnW.mjs +28 -0
  59. package/fesm2022/matechat-ng-zh-cn--_YVZHnW.mjs.map +1 -0
  60. package/fesm2022/matechat-ng.mjs +1027 -0
  61. package/fesm2022/matechat-ng.mjs.map +1 -0
  62. package/index.d.ts +5 -0
  63. package/package.json +31 -0
  64. package/public-api.d.ts +3 -0
@@ -0,0 +1,11 @@
1
+ import { DefaultAdapter } from '../components-common/Base/foundation';
2
+ import * as i0 from "@angular/core";
3
+ export default class BaseComponent {
4
+ foundation: any;
5
+ cache: any;
6
+ constructor();
7
+ ngOnDestroy(): void;
8
+ get adapter(): DefaultAdapter;
9
+ static ɵfac: i0.ɵɵFactoryDeclaration<BaseComponent, never>;
10
+ static ɵcmp: i0.ɵɵComponentDeclaration<BaseComponent, "mate-base-component", never, {}, {}, never, never, true, never>;
11
+ }
@@ -0,0 +1,23 @@
1
+ import { OnInit, OnChanges, SimpleChanges } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class AvatarComponent implements OnInit, OnChanges {
4
+ imgSrc: string;
5
+ name: string;
6
+ width: number;
7
+ height: number;
8
+ isRound: boolean;
9
+ gender: string;
10
+ isErrorImg: boolean;
11
+ isNobody: boolean;
12
+ code: number;
13
+ fontSize: number;
14
+ nameDisplay: string;
15
+ ngOnInit(): void;
16
+ ngOnChanges(changes: SimpleChanges): void;
17
+ onErrorImg(): void;
18
+ private getBackgroundColor;
19
+ private setDisplayName;
20
+ private calcValues;
21
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvatarComponent, never>;
22
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvatarComponent, "mc-avatar", never, { "imgSrc": { "alias": "imgSrc"; "required": false; }; "name": { "alias": "name"; "required": false; }; "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; "isRound": { "alias": "isRound"; "required": false; }; "gender": { "alias": "gender"; "required": false; }; }, {}, never, never, true, never>;
23
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class AvatarBodyIconComponent {
3
+ width: number;
4
+ height: number;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvatarBodyIconComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvatarBodyIconComponent, "mc-avatar-body-icon", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; }, {}, never, never, true, never>;
7
+ }
@@ -0,0 +1,7 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class AvatarNoBodyIconComponent {
3
+ width: number;
4
+ height: number;
5
+ static ɵfac: i0.ɵɵFactoryDeclaration<AvatarNoBodyIconComponent, never>;
6
+ static ɵcmp: i0.ɵɵComponentDeclaration<AvatarNoBodyIconComponent, "mc-avatar-no-body-icon", never, { "width": { "alias": "width"; "required": false; }; "height": { "alias": "height"; "required": false; }; }, {}, never, never, true, never>;
7
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class BubbleLoadingComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<BubbleLoadingComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<BubbleLoadingComponent, "mc-bubble-loading", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,24 @@
1
+ import { TemplateRef } from '@angular/core';
2
+ import { BubbleAlign, BubbleVariant, AvatarPosition, BubbleAvatar } from '../components-common//Bubble/common/bubble-types';
3
+ import { BubbleAdapter } from '../components-common/Bubble/foundation';
4
+ import BaseComponent from '../Base/base.component';
5
+ import * as i0 from "@angular/core";
6
+ export declare class BubbleComponent extends BaseComponent {
7
+ content: string;
8
+ loading: boolean;
9
+ align: BubbleAlign;
10
+ avatarPosition: AvatarPosition;
11
+ variant: BubbleVariant;
12
+ avatarConfig?: BubbleAvatar;
13
+ topTemplate: TemplateRef<any> | null;
14
+ loadingTplTemplate: TemplateRef<any> | null;
15
+ defaultTemplate: TemplateRef<any> | null;
16
+ bottomTemplate: TemplateRef<any> | null;
17
+ constructor();
18
+ ngOnInit(): void;
19
+ get adapter(): BubbleAdapter;
20
+ get bubbleClasses(): string;
21
+ get isEmptyAvatar(): boolean;
22
+ static ɵfac: i0.ɵɵFactoryDeclaration<BubbleComponent, never>;
23
+ static ɵcmp: i0.ɵɵComponentDeclaration<BubbleComponent, "mc-bubble", never, { "content": { "alias": "content"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "align": { "alias": "align"; "required": false; }; "avatarPosition": { "alias": "avatarPosition"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "avatarConfig": { "alias": "avatarConfig"; "required": false; }; }, {}, ["topTemplate", "loadingTplTemplate", "defaultTemplate", "bottomTemplate"], ["[top]", "[loadingTpl]", "*", "[bottom]"], true, never>;
24
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "./bubble.component";
4
+ import * as i3 from "./bubble-loading/bubble-loading.component";
5
+ import * as i4 from "./avatar/avatar.component";
6
+ export declare class BubbleModule {
7
+ static ɵfac: i0.ɵɵFactoryDeclaration<BubbleModule, never>;
8
+ static ɵmod: i0.ɵɵNgModuleDeclaration<BubbleModule, never, [typeof i1.CommonModule, typeof i2.BubbleComponent, typeof i3.BubbleLoadingComponent, typeof i4.AvatarComponent], [typeof i2.BubbleComponent, typeof i3.BubbleLoadingComponent, typeof i4.AvatarComponent]>;
9
+ static ɵinj: i0.ɵɵInjectorDeclaration<BubbleModule>;
10
+ }
@@ -0,0 +1,6 @@
1
+ export * from './bubble.component';
2
+ export * from './bubble.module';
3
+ export * from './bubble-loading/bubble-loading.component';
4
+ export * from './avatar/avatar.component';
5
+ export * from './avatar-body-icon/avatar-body-icon.component';
6
+ export * from './avatar-no-body-icon/avatar-no-body-icon.component';
@@ -0,0 +1,31 @@
1
+ import { EventEmitter, ElementRef } from '@angular/core';
2
+ import { SendBtnVariant } from '../../components-common/Input/common/types';
3
+ import BaseComponent from '../../Base/base.component';
4
+ import { LocaleService } from '../../Locale';
5
+ import * as i0 from "@angular/core";
6
+ export declare class ButtonComponent extends BaseComponent {
7
+ private localeService;
8
+ disabled: boolean;
9
+ loading: boolean;
10
+ inputValue: string;
11
+ sendBtnVariant: SendBtnVariant;
12
+ submit: EventEmitter<string>;
13
+ cancel: EventEmitter<void>;
14
+ change: EventEmitter<string>;
15
+ buttonElement: ElementRef<HTMLButtonElement>;
16
+ isMouseDown: boolean;
17
+ showWave: boolean;
18
+ waveStyle: {
19
+ top: string;
20
+ left: string;
21
+ };
22
+ constructor(localeService: LocaleService);
23
+ get buttonClasses(): string;
24
+ ngOnInit(): void;
25
+ onMouseDown(): void;
26
+ onMouseUp(): void;
27
+ showClickWave(event: MouseEvent): void;
28
+ onConfirm(event: MouseEvent): void;
29
+ static ɵfac: i0.ɵɵFactoryDeclaration<ButtonComponent, never>;
30
+ static ɵcmp: i0.ɵɵComponentDeclaration<ButtonComponent, "mc-button", never, { "disabled": { "alias": "disabled"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "inputValue": { "alias": "inputValue"; "required": false; }; "sendBtnVariant": { "alias": "sendBtnVariant"; "required": false; }; }, { "submit": "submit"; "cancel": "cancel"; "change": "change"; }, never, never, true, never>;
31
+ }
@@ -0,0 +1,2 @@
1
+ export * from './input.component';
2
+ export * from './input.module';
@@ -0,0 +1,56 @@
1
+ import { EventEmitter, OnInit, ElementRef, TemplateRef, SimpleChanges } from '@angular/core';
2
+ import { DisplayType, InputVariant, SendBtnVariant, SubmitShortKey } from '../components-common/Input/common/types';
3
+ import BaseComponent from '../Base/base.component';
4
+ import { InputAdapter } from '../components-common/Input/foundation';
5
+ import { LocaleService } from '../Locale/locale.service';
6
+ import * as i0 from "@angular/core";
7
+ export declare const inputContextToken = "input-context";
8
+ export declare class InputComponent extends BaseComponent implements OnInit {
9
+ private localeService;
10
+ value: string;
11
+ placeholder: string;
12
+ disabled: boolean;
13
+ displayType: DisplayType;
14
+ variant: InputVariant;
15
+ sendBtnVariant: SendBtnVariant;
16
+ loading: boolean;
17
+ showCount: boolean;
18
+ maxLength: number | null;
19
+ submitShortKey: SubmitShortKey | null | string;
20
+ autofocus: boolean;
21
+ change: EventEmitter<string>;
22
+ submit: EventEmitter<string>;
23
+ cancel: EventEmitter<void>;
24
+ focus: EventEmitter<FocusEvent>;
25
+ blur: EventEmitter<FocusEvent>;
26
+ textareaElement: ElementRef<HTMLTextAreaElement>;
27
+ headTemplate: TemplateRef<any> | null;
28
+ prefixTemplate: TemplateRef<any> | null;
29
+ suffixTemplate: TemplateRef<any> | null;
30
+ buttonTemplate: TemplateRef<any> | null;
31
+ extraTemplate: TemplateRef<any> | null;
32
+ inputValue: string;
33
+ lock: boolean;
34
+ constructor(localeService: LocaleService);
35
+ ngOnInit(): void;
36
+ get adapter(): InputAdapter;
37
+ onChange(e: any): void;
38
+ ngOnChanges(changes: SimpleChanges): void;
39
+ get inputClasses(): string;
40
+ get maxlengthValue(): number | null;
41
+ onInput(): void;
42
+ onCompositionStart(): void;
43
+ onCompositionEnd(): void;
44
+ onKeydown(event: KeyboardEvent): void;
45
+ clearInput(): void;
46
+ getInput(): string;
47
+ onButtonSubmit(value: string): void;
48
+ onButtonCancel(): void;
49
+ onButtonChange(value: string): void;
50
+ ngAfterViewInit(): void;
51
+ get placeholderText(): string;
52
+ onFocus(event: FocusEvent): void;
53
+ onBlur(event: FocusEvent): void;
54
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
55
+ static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "mc-input", never, { "value": { "alias": "value"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "disabled": { "alias": "disabled"; "required": false; }; "displayType": { "alias": "displayType"; "required": false; }; "variant": { "alias": "variant"; "required": false; }; "sendBtnVariant": { "alias": "sendBtnVariant"; "required": false; }; "loading": { "alias": "loading"; "required": false; }; "showCount": { "alias": "showCount"; "required": false; }; "maxLength": { "alias": "maxLength"; "required": false; }; "submitShortKey": { "alias": "submitShortKey"; "required": false; }; "autofocus": { "alias": "autofocus"; "required": false; }; }, { "change": "change"; "submit": "submit"; "cancel": "cancel"; "focus": "focus"; "blur": "blur"; }, ["headTemplate", "prefixTemplate", "suffixTemplate", "buttonTemplate", "extraTemplate"], never, true, never>;
56
+ }
@@ -0,0 +1,11 @@
1
+ import * as i0 from "@angular/core";
2
+ import * as i1 from "@angular/common";
3
+ import * as i2 from "@angular/forms";
4
+ import * as i3 from "./button/button.component";
5
+ import * as i4 from "./send-icon/send-icon.component";
6
+ import * as i5 from "./input.component";
7
+ export declare class InputModule {
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<InputModule, never>;
9
+ static ɵmod: i0.ɵɵNgModuleDeclaration<InputModule, never, [typeof i1.CommonModule, typeof i2.FormsModule, typeof i3.ButtonComponent, typeof i4.SendIconComponent, typeof i5.InputComponent], [typeof i5.InputComponent]>;
10
+ static ɵinj: i0.ɵɵInjectorDeclaration<InputModule>;
11
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class SendIconComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<SendIconComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<SendIconComponent, "mc-send-icon", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,5 @@
1
+ import { LocaleService } from './locale.service';
2
+ import { LocaleModule } from './locale.module';
3
+ import { TranslatePipe } from './translate.pipe';
4
+ export type { LanguageCode, LocaleData } from './locale.service';
5
+ export { LocaleService, LocaleModule, TranslatePipe };
@@ -0,0 +1,17 @@
1
+ import { ModuleWithProviders } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export declare class LocaleModule {
4
+ /**
5
+ * 静态方法,用于配置模块并提供服务
6
+ * 可以在AppModule中使用LocaleModule.forRoot()来初始化
7
+ */
8
+ static forRoot(): ModuleWithProviders<LocaleModule>;
9
+ /**
10
+ * 普通导入方法,用于特性模块中导入
11
+ * 避免服务被多次实例化
12
+ */
13
+ static forChild(): ModuleWithProviders<LocaleModule>;
14
+ static ɵfac: i0.ɵɵFactoryDeclaration<LocaleModule, never>;
15
+ static ɵmod: i0.ɵɵNgModuleDeclaration<LocaleModule, never, never, never>;
16
+ static ɵinj: i0.ɵɵInjectorDeclaration<LocaleModule>;
17
+ }
@@ -0,0 +1,50 @@
1
+ import * as i0 from "@angular/core";
2
+ export interface LocaleData {
3
+ [key: string]: any;
4
+ }
5
+ export type LanguageCode = 'zh-cn' | 'en-us' | string;
6
+ export declare class LocaleService {
7
+ private _currentLanguage;
8
+ private _localeData;
9
+ private _languageChange;
10
+ languageChange$: import("rxjs").Observable<string>;
11
+ constructor();
12
+ /**
13
+ * 加载默认语言包
14
+ */
15
+ private loadDefaultLocales;
16
+ /**
17
+ * 设置当前语言
18
+ */
19
+ setLanguage(language: LanguageCode): void;
20
+ /**
21
+ * 获取当前语言
22
+ */
23
+ getLanguage(): LanguageCode;
24
+ /**
25
+ * 翻译文本
26
+ * @param key 翻译键,支持嵌套路径如 'Input.send'
27
+ * @param params 替换参数
28
+ */
29
+ translate(key: string, params?: {
30
+ [key: string]: string | number;
31
+ }): string;
32
+ /**
33
+ * 添加新的语言
34
+ */
35
+ addLanguage(language: LanguageCode, localeData: LocaleData): void;
36
+ /**
37
+ * 覆盖现有语言的部分翻译
38
+ */
39
+ overrideLocale(language: LanguageCode, localeData: LocaleData): void;
40
+ /**
41
+ * 获取所有支持的语言
42
+ */
43
+ getSupportedLanguages(): LanguageCode[];
44
+ /**
45
+ * 深度合并对象
46
+ */
47
+ private deepMerge;
48
+ static ɵfac: i0.ɵɵFactoryDeclaration<LocaleService, never>;
49
+ static ɵprov: i0.ɵɵInjectableDeclaration<LocaleService>;
50
+ }
@@ -0,0 +1,23 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { LocaleService } from './locale.service';
3
+ import * as i0 from "@angular/core";
4
+ /**
5
+ * 翻译管道,用于在Angular模板中直接使用翻译功能
6
+ * 用法:{{ 'Input.send' | translate }}
7
+ * 带参数:{{ 'Input.pleaseEnterPlaceholder' | translate:{ enterKey: 'Enter', shiftEnterKey: 'Shift + Enter' } }}
8
+ */
9
+ export declare class TranslatePipe implements PipeTransform {
10
+ private localeService;
11
+ constructor(localeService: LocaleService);
12
+ /**
13
+ * 转换方法,实现PipeTransform接口
14
+ * @param key 翻译键
15
+ * @param params 替换参数
16
+ */
17
+ transform(key: string, params?: {
18
+ [key: string]: string | number;
19
+ }): string;
20
+ static ɵfac: i0.ɵɵFactoryDeclaration<TranslatePipe, never>;
21
+ static ɵpipe: i0.ɵɵPipeDeclaration<TranslatePipe, "translate", true>;
22
+ static ɵprov: i0.ɵɵInjectableDeclaration<TranslatePipe>;
23
+ }
package/README.md ADDED
@@ -0,0 +1,24 @@
1
+ # ComponentsNg
2
+
3
+ This library was generated with [Angular CLI](https://github.com/angular/angular-cli) version 17.3.0.
4
+
5
+ ## Code scaffolding
6
+
7
+ Run `ng generate component component-name --project components-ng` to generate a new component. You can also use `ng generate directive|pipe|service|class|guard|interface|enum|module --project components-ng`.
8
+ > Note: Don't forget to add `--project components-ng` or else it will be added to the default project in your `angular.json` file.
9
+
10
+ ## Build
11
+
12
+ Run `ng build components-ng` to build the project. The build artifacts will be stored in the `dist/` directory.
13
+
14
+ ## Publishing
15
+
16
+ After building your library with `ng build components-ng`, go to the dist folder `cd dist/components-ng` and run `npm publish`.
17
+
18
+ ## Running unit tests
19
+
20
+ Run `ng test components-ng` to execute the unit tests via [Karma](https://karma-runner.github.io).
21
+
22
+ ## Further help
23
+
24
+ To get more help on the Angular CLI use `ng help` or go check out the [Angular CLI Overview and Command Reference](https://angular.io/cli) page.
@@ -0,0 +1,43 @@
1
+ export type noopFunction = (...args: any) => any;
2
+ export interface DefaultAdapter {
3
+ getProp(key: string): any;
4
+ getProps(): any;
5
+ getState(key: string): any;
6
+ getStates(): any;
7
+ setState(s: any, callback?: any): void;
8
+ getCache(c: string): any;
9
+ getCaches(): any;
10
+ setCache(key: any, value: any): void;
11
+ }
12
+ declare class BaseFoundation<T extends DefaultAdapter> {
13
+ static get cssClasses(): {};
14
+ static get strings(): {};
15
+ static get numbers(): {};
16
+ static get defaultAdapter(): {
17
+ getProp: () => void;
18
+ getProps: () => void;
19
+ getState: () => void;
20
+ getStates: () => void;
21
+ setState: () => void;
22
+ getContext: () => void;
23
+ getContexts: () => void;
24
+ getCache: () => void;
25
+ setCache: () => void;
26
+ getCaches: () => void;
27
+ stopPropagation: () => void;
28
+ };
29
+ _adapter: T;
30
+ constructor(adapter: T);
31
+ getProp(key: string): any;
32
+ getProps(): any;
33
+ getState(key: string): any;
34
+ getStates(): any;
35
+ setState(states: any, cb?: (...args: any) => void): void;
36
+ getCaches(): any;
37
+ getCache(key: string): any;
38
+ setCache(key: string, value: any): void | "";
39
+ _isInProps(key: string): boolean;
40
+ init(lifecycle?: any): void;
41
+ destroy(): void;
42
+ }
43
+ export default BaseFoundation;
@@ -0,0 +1,4 @@
1
+ export declare const DEFAULT_AVATAR_WIDTH = 36;
2
+ export declare const DEFAULT_AVATAR_HEIGHT = 36;
3
+ export declare const AVATAR_NAME = "name";
4
+ export declare const AVATAR_IMG = "imgSrc";
@@ -0,0 +1,12 @@
1
+ export type BubbleVariant = 'filled' | 'none' | 'bordered';
2
+ export type AvatarPosition = 'top' | 'side';
3
+ export type BubbleAlign = 'left' | 'right';
4
+ export interface BubbleAvatar {
5
+ name?: string;
6
+ gender?: string;
7
+ width?: number;
8
+ height?: number;
9
+ isRound?: boolean;
10
+ imgSrc?: string;
11
+ displayName?: string;
12
+ }
@@ -0,0 +1,9 @@
1
+ import { BubbleAvatar } from "./common/bubble-types";
2
+ import BaseFoundation, { DefaultAdapter } from "../Base/foundation";
3
+ export interface BubbleAdapter extends DefaultAdapter {
4
+ }
5
+ export declare class BubbleFoundation extends BaseFoundation<BubbleAdapter> {
6
+ constructor(adapter: BubbleAdapter);
7
+ getBubbleClasses(): string;
8
+ getIsEmptyAvatar(avatarConfig: BubbleAvatar | undefined): boolean;
9
+ }
@@ -0,0 +1,15 @@
1
+ import BaseFoundation, { DefaultAdapter } from '../Base/foundation';
2
+ export interface InputButtonAdapter extends DefaultAdapter {
3
+ locale(key: string, params?: Record<string, string>): string;
4
+ emitChange(): void;
5
+ }
6
+ export declare class InputButtonFoundation extends BaseFoundation<InputButtonAdapter> {
7
+ constructor(adapter: InputButtonAdapter);
8
+ showClickWave(nativeElement: HTMLElement, event: MouseEvent): void;
9
+ getButtonClasses(): {
10
+ 'mc-button': boolean;
11
+ 'mc-button-loading': any;
12
+ mousedown: any;
13
+ 'mc-button-simple': boolean;
14
+ };
15
+ }
@@ -0,0 +1,16 @@
1
+ export declare enum DisplayType {
2
+ Simple = "simple",
3
+ Full = "full"
4
+ }
5
+ export declare enum InputVariant {
6
+ Bordered = "bordered",
7
+ BorderLess = "borderless"
8
+ }
9
+ export declare enum SendBtnVariant {
10
+ Simple = "simple",
11
+ Full = "full"
12
+ }
13
+ export declare enum SubmitShortKey {
14
+ Enter = "enter",
15
+ ShiftEnter = "shiftEnter"
16
+ }
@@ -0,0 +1,20 @@
1
+ import BaseFoundation, { DefaultAdapter } from '../Base/foundation';
2
+ export interface InputAdapter extends DefaultAdapter {
3
+ locale(key: string, params?: Record<string, string>): string;
4
+ emitChange(): void;
5
+ submit(inputValue: string): void;
6
+ }
7
+ export declare class InputFoundation extends BaseFoundation<InputAdapter> {
8
+ constructor(adapter: InputAdapter);
9
+ getInputClasses(): {
10
+ 'mc-input': boolean;
11
+ 'mc-input-disabled': any;
12
+ 'mc-input-simple': boolean;
13
+ 'mc-input-borderless': boolean;
14
+ };
15
+ getPlaceholderText(): any;
16
+ clearInput(): void;
17
+ emitChange(): void;
18
+ submit(inputValue: string): void;
19
+ onKeydown(event: KeyboardEvent): void;
20
+ }
@@ -0,0 +1,26 @@
1
+ declare const _default: {
2
+ Input: {
3
+ send: string;
4
+ pauseAnswer: string;
5
+ pleaseEnter: string;
6
+ pleaseEnterPlaceholder: string;
7
+ ariaLabel: string;
8
+ };
9
+ Md: {
10
+ toggle: string;
11
+ copy: string;
12
+ diagram: string;
13
+ code: string;
14
+ zoomIn: string;
15
+ zoomOut: string;
16
+ downLoad: string;
17
+ };
18
+ Bubble: {
19
+ ariaLabel: string;
20
+ emptyAvatar: string;
21
+ userName: string;
22
+ content: string;
23
+ avatar: string;
24
+ };
25
+ };
26
+ export default _default;
@@ -0,0 +1,26 @@
1
+ declare const _default: {
2
+ Input: {
3
+ send: string;
4
+ pauseAnswer: string;
5
+ pleaseEnter: string;
6
+ pleaseEnterPlaceholder: string;
7
+ ariaLabel: string;
8
+ };
9
+ Md: {
10
+ toggle: string;
11
+ copy: string;
12
+ diagram: string;
13
+ code: string;
14
+ zoomIn: string;
15
+ zoomOut: string;
16
+ downLoad: string;
17
+ };
18
+ Bubble: {
19
+ ariaLabel: string;
20
+ emptyAvatar: string;
21
+ userName: string;
22
+ content: string;
23
+ avatar: string;
24
+ };
25
+ };
26
+ export default _default;
@@ -0,0 +1,46 @@
1
+ import { Component } from '@angular/core';
2
+ import * as i0 from "@angular/core";
3
+ export default class BaseComponent {
4
+ constructor() {
5
+ this.foundation = null;
6
+ }
7
+ ngOnDestroy() {
8
+ this.foundation &&
9
+ typeof this.foundation.destroy === 'function' &&
10
+ this.foundation.destroy();
11
+ }
12
+ get adapter() {
13
+ return {
14
+ getProp: (key) => {
15
+ return this[key];
16
+ },
17
+ getProps: () => {
18
+ return this;
19
+ },
20
+ setState: (states, cb) => {
21
+ for (const key in states) {
22
+ if (states.hasOwnProperty(key)) {
23
+ this[key] = states[key];
24
+ }
25
+ cb && cb();
26
+ }
27
+ },
28
+ getState: (key) => this[key],
29
+ getStates: () => this,
30
+ getCache: (key) => key && this.cache[key],
31
+ getCaches: () => this.cache,
32
+ setCache: (key, value) => key && (this.cache[key] = value),
33
+ };
34
+ }
35
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: BaseComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
36
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "17.3.0", type: BaseComponent, isStandalone: true, selector: "mate-base-component", ngImport: i0, template: '', isInline: true }); }
37
+ }
38
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.0", ngImport: i0, type: BaseComponent, decorators: [{
39
+ type: Component,
40
+ args: [{
41
+ selector: 'mate-base-component',
42
+ standalone: true,
43
+ template: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