c3-components 0.0.14 → 0.0.15

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 (141) hide show
  1. package/esm2022/c3-components.mjs +5 -0
  2. package/esm2022/lib/c3-auto-animate/C3AutoAnimate.directive.mjs +23 -0
  3. package/esm2022/lib/c3-dialog/c3-dialog.module.mjs +52 -0
  4. package/esm2022/lib/c3-dialog/components/c3-dialog-confirm.component.mjs +51 -0
  5. package/esm2022/lib/c3-dialog/components/c3-dialog-embed-child.component.mjs +32 -0
  6. package/esm2022/lib/c3-dialog/components/c3-dialog-prompt.component.mjs +95 -0
  7. package/esm2022/lib/c3-dialog/services/c3-dialog.service.mjs +77 -0
  8. package/esm2022/lib/c3-dropdown/c3-dropdown.module.mjs +20 -0
  9. package/esm2022/lib/c3-dropdown/components/c3-dropdown.component.mjs +45 -0
  10. package/esm2022/lib/c3-dropdown/directives/c3-dropdown.trigger.mjs +128 -0
  11. package/esm2022/lib/c3-expansion/c3-expansion.module.mjs +43 -0
  12. package/esm2022/lib/c3-expansion/components/c3-expansion/c3-expansion.component.mjs +34 -0
  13. package/esm2022/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.mjs +24 -0
  14. package/esm2022/lib/c3-file-viewer/c3-file-viewer.module.mjs +47 -0
  15. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.mjs +17 -0
  16. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.mjs +20 -0
  17. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.mjs +23 -0
  18. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.mjs +32 -0
  19. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.mjs +86 -0
  20. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.mjs +40 -0
  21. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.mjs +26 -0
  22. package/esm2022/lib/c3-file-viewer/consts/default.config.mjs +40 -0
  23. package/esm2022/lib/c3-file-viewer/directives/full-screen.directive.mjs +66 -0
  24. package/esm2022/lib/c3-file-viewer/models/custom-file-event.model.mjs +7 -0
  25. package/esm2022/lib/c3-file-viewer/models/file-metadata.mjs +2 -0
  26. package/esm2022/lib/c3-file-viewer/models/file-viewer-config.model.mjs +2 -0
  27. package/esm2022/lib/c3-file-viewer/models/file-viewer.mjs +206 -0
  28. package/esm2022/lib/c3-file-viewer/models/http.client.mjs +2 -0
  29. package/esm2022/lib/c3-safe-url/pipes/c3-safe-url.pipe.mjs +21 -0
  30. package/esm2022/public-api.mjs +45 -0
  31. package/fesm2022/c3-components.mjs +1160 -0
  32. package/fesm2022/c3-components.mjs.map +1 -0
  33. package/index.d.ts +5 -0
  34. package/lib/c3-auto-animate/C3AutoAnimate.directive.d.ts +11 -0
  35. package/lib/c3-dialog/c3-dialog.module.d.ts +15 -0
  36. package/lib/c3-dialog/components/c3-dialog-confirm.component.d.ts +23 -0
  37. package/lib/c3-dialog/components/c3-dialog-embed-child.component.d.ts +18 -0
  38. package/lib/c3-dialog/components/c3-dialog-prompt.component.d.ts +31 -0
  39. package/lib/c3-dialog/services/c3-dialog.service.d.ts +18 -0
  40. package/lib/c3-dropdown/c3-dropdown.module.d.ts +10 -0
  41. package/lib/c3-dropdown/components/c3-dropdown.component.d.ts +15 -0
  42. package/lib/c3-dropdown/directives/c3-dropdown.trigger.d.ts +45 -0
  43. package/lib/c3-expansion/c3-expansion.module.d.ts +14 -0
  44. package/lib/c3-expansion/components/c3-expansion/c3-expansion.component.d.ts +13 -0
  45. package/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.d.ts +9 -0
  46. package/lib/c3-file-viewer/c3-file-viewer.module.d.ts +17 -0
  47. package/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.d.ts +8 -0
  48. package/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.d.ts +9 -0
  49. package/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.d.ts +9 -0
  50. package/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.d.ts +12 -0
  51. package/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.d.ts +25 -0
  52. package/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.d.ts +12 -0
  53. package/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.d.ts +8 -0
  54. package/lib/c3-file-viewer/consts/default.config.d.ts +2 -0
  55. package/lib/c3-file-viewer/directives/full-screen.directive.d.ts +12 -0
  56. package/lib/c3-file-viewer/models/custom-file-event.model.d.ts +5 -0
  57. package/lib/c3-file-viewer/models/file-metadata.d.ts +12 -0
  58. package/lib/c3-file-viewer/models/file-viewer-config.model.d.ts +48 -0
  59. package/lib/c3-file-viewer/models/file-viewer.d.ts +65 -0
  60. package/lib/c3-file-viewer/models/http.client.d.ts +14 -0
  61. package/lib/c3-safe-url/pipes/c3-safe-url.pipe.d.ts +10 -0
  62. package/package.json +13 -4
  63. package/{src/public-api.ts → public-api.d.ts} +0 -10
  64. package/CONTRIBUTING.md +0 -80
  65. package/bun.lockb +0 -0
  66. package/ng-package.json +0 -19
  67. package/src/lib/c3-auto-animate/C3AutoAnimate.directive.ts +0 -18
  68. package/src/lib/c3-dialog/c3-dialog.module.ts +0 -30
  69. package/src/lib/c3-dialog/components/c3-dialog-confirm.component.ts +0 -44
  70. package/src/lib/c3-dialog/components/c3-dialog-embed-child.component.ts +0 -40
  71. package/src/lib/c3-dialog/components/c3-dialog-prompt.component.ts +0 -81
  72. package/src/lib/c3-dialog/services/c3-dialog.service.ts +0 -87
  73. package/src/lib/c3-dropdown/c3-dropdown.module.ts +0 -12
  74. package/src/lib/c3-dropdown/components/c3-dropdown.component.spec.ts +0 -22
  75. package/src/lib/c3-dropdown/components/c3-dropdown.component.ts +0 -39
  76. package/src/lib/c3-dropdown/directives/c3-dropdown.trigger.ts +0 -161
  77. package/src/lib/c3-expansion/c3-expansion.module.ts +0 -24
  78. package/src/lib/c3-expansion/components/c3-expansion/c3-expansion.component.html +0 -9
  79. package/src/lib/c3-expansion/components/c3-expansion/c3-expansion.component.ts +0 -33
  80. package/src/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.html +0 -12
  81. package/src/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.ts +0 -21
  82. package/src/lib/c3-file/c3-download/c3-download.module.ts +0 -7
  83. package/src/lib/c3-file/c3-download/c3-download.service.ts +0 -16
  84. package/src/lib/c3-file/c3-input-file/c3-input-file.module.ts +0 -30
  85. package/src/lib/c3-file/c3-input-file/class/c3-input-file.ts +0 -62
  86. package/src/lib/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.html +0 -7
  87. package/src/lib/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.ts +0 -96
  88. package/src/lib/c3-file/c3-input-file/components/c3-input-file-container/c3-input-file-container.component.ts +0 -53
  89. package/src/lib/c3-file/c3-input-file/components/c3-input-file-displayer/c3-input-file-displayer.component.ts +0 -107
  90. package/src/lib/c3-file/c3-input-file/components/c3-input-file-trigger/c3-input-file-trigger.component.ts +0 -22
  91. package/src/lib/c3-file/c3-input-file/directives/c3-input-file-trigger.directive.ts +0 -27
  92. package/src/lib/c3-file-upload/c3-file-upload.module.ts +0 -8
  93. package/src/lib/c3-file-viewer/c3-file-viewer.module.ts +0 -30
  94. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.html +0 -185
  95. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.spec.ts +0 -23
  96. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.ts +0 -15
  97. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.html +0 -7
  98. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.spec.ts +0 -23
  99. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.ts +0 -14
  100. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.html +0 -7
  101. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.spec.ts +0 -23
  102. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.ts +0 -25
  103. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.css +0 -0
  104. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.html +0 -1
  105. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.spec.ts +0 -23
  106. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.ts +0 -35
  107. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.html +0 -32
  108. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.spec.ts +0 -23
  109. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.ts +0 -93
  110. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.spec.ts +0 -23
  111. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.ts +0 -37
  112. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.spec.ts +0 -22
  113. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.ts +0 -12
  114. package/src/lib/c3-file-viewer/consts/default.config.ts +0 -41
  115. package/src/lib/c3-file-viewer/directives/full-screen.directive.spec.ts +0 -11
  116. package/src/lib/c3-file-viewer/directives/full-screen.directive.ts +0 -68
  117. package/src/lib/c3-file-viewer/models/custom-file-event.model.ts +0 -9
  118. package/src/lib/c3-file-viewer/models/file-metadata.ts +0 -13
  119. package/src/lib/c3-file-viewer/models/file-viewer-config.model.ts +0 -53
  120. package/src/lib/c3-file-viewer/models/file-viewer.ts +0 -259
  121. package/src/lib/c3-file-viewer/models/http.client.ts +0 -23
  122. package/src/lib/c3-highlight-text/c3-highlight-text.module.ts +0 -12
  123. package/src/lib/c3-menu/c3-menu.module.ts +0 -12
  124. package/src/lib/c3-modal/c3-modal.module.ts +0 -12
  125. package/src/lib/c3-navbar/c3-navbar.module.ts +0 -12
  126. package/src/lib/c3-pdf-dialog/c3-pdf-dialog.module.ts +0 -12
  127. package/src/lib/c3-rounded-title/c3-rounded-title.module.ts +0 -12
  128. package/src/lib/c3-safe-url/pipes/c3-safe-url.pipe.spec.ts +0 -8
  129. package/src/lib/c3-safe-url/pipes/c3-safe-url.pipe.ts +0 -13
  130. package/src/lib/c3-tabs/c3-tabs.module.ts +0 -12
  131. package/tsconfig.lib.json +0 -14
  132. package/tsconfig.lib.prod.json +0 -10
  133. package/tsconfig.spec.json +0 -14
  134. /package/{src/_index.scss → _index.scss} +0 -0
  135. /package/{src/lib → lib}/c3-dropdown/styles/_c3-dropdown.sass +0 -0
  136. /package/{src/lib → lib}/c3-expansion/styles/_c3-expansion.scss +0 -0
  137. /package/{src/lib → lib}/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.scss +0 -0
  138. /package/{src/lib → lib}/c3-file-viewer/styles/_c3-file-viewer.sass +0 -0
  139. /package/{src/lib → lib}/c3-styles/_c3-core.sass +0 -0
  140. /package/{src/lib → lib}/c3-styles/_c3-root-variables.sass +0 -0
  141. /package/{src/lib → lib}/c3-styles/_utils.sass +0 -0
@@ -0,0 +1,5 @@
1
+ export declare class CustomFileEvent {
2
+ name: string;
3
+ fileUrl: string;
4
+ constructor(name: string, fileUrl: string);
5
+ }
@@ -0,0 +1,12 @@
1
+ import { Observable } from 'rxjs';
2
+ export interface FileMetadata {
3
+ name: string;
4
+ size?: number;
5
+ type: string;
6
+ lastModified?: Date;
7
+ created?: Date;
8
+ extension?: string;
9
+ location: string;
10
+ objectUrl?: Observable<string>;
11
+ metadata?: Record<string, any>;
12
+ }
@@ -0,0 +1,48 @@
1
+ import { HttpClient } from '@angular/common/http';
2
+ export interface C3FileViewerConfig {
3
+ btnContainerClass?: string;
4
+ btnClass?: string;
5
+ btnSubClass?: string;
6
+ zoomFactor?: number;
7
+ containerBackgroundColor?: string;
8
+ wheelZoom?: boolean;
9
+ allowFullscreen?: boolean;
10
+ allowKeyboardNavigation?: boolean;
11
+ customClient?: HttpClient['get'];
12
+ minHeight?: number | string;
13
+ minWidth?: number | string;
14
+ width?: number | string;
15
+ maxHeight?: number | string;
16
+ height?: number | string;
17
+ maxWidth?: number | string;
18
+ btnShow?: {
19
+ zoomIn?: boolean;
20
+ zoomOut?: boolean;
21
+ rotateClockwise?: boolean;
22
+ rotateCounterClockwise?: boolean;
23
+ next?: boolean;
24
+ prev?: boolean;
25
+ reset?: boolean;
26
+ };
27
+ btnIcons?: {
28
+ zoomIn?: MultiBtn['btn'];
29
+ zoomOut?: MultiBtn['btn'];
30
+ rotateClockwise?: MultiBtn['btn'];
31
+ rotateCounterClockwise?: MultiBtn['btn'];
32
+ next?: MultiBtn['btn'];
33
+ prev?: MultiBtn['btn'];
34
+ fullscreen?: MultiBtn['btn'];
35
+ reset?: MultiBtn['btn'];
36
+ };
37
+ customBtns?: Array<{
38
+ name: string;
39
+ icon: MultiBtn['btn'];
40
+ }>;
41
+ }
42
+ interface MultiBtn {
43
+ btn: {
44
+ classes?: string;
45
+ text?: string;
46
+ };
47
+ }
48
+ export {};
@@ -0,0 +1,65 @@
1
+ import { BehaviorSubject, Observable } from 'rxjs';
2
+ import { C3FileViewerConfig } from './file-viewer-config.model';
3
+ import { FileMetadata } from './file-metadata';
4
+ export declare class C3FileViewer {
5
+ private _config;
6
+ get config(): C3FileViewerConfig;
7
+ set config(value: C3FileViewerConfig);
8
+ config$: BehaviorSubject<C3FileViewerConfig>;
9
+ fullscreen$: BehaviorSubject<Boolean>;
10
+ customFile$: BehaviorSubject<any>;
11
+ index$: BehaviorSubject<number>;
12
+ loading: boolean;
13
+ currentIndex: number;
14
+ get currentFile(): FileMetadata;
15
+ style: {
16
+ transform: string;
17
+ msTransform: string;
18
+ oTransform: string;
19
+ webkitTransform: string;
20
+ minHeight: string;
21
+ maxHeight: string;
22
+ height: string;
23
+ minWidth: string;
24
+ maxWidth: string;
25
+ width: string;
26
+ };
27
+ styleHeight: string;
28
+ hovered: boolean;
29
+ set files(value: FileMetadata[]);
30
+ get files(): FileMetadata[];
31
+ private _files;
32
+ filesObjectUrl: Array<FileMetadata & {
33
+ objectUrl?: Observable<string>;
34
+ }>;
35
+ private scale;
36
+ private rotation;
37
+ private translateX;
38
+ private translateY;
39
+ private prevX;
40
+ private prevY;
41
+ constructor({ config, files, }: {
42
+ config?: C3FileViewerConfig;
43
+ files?: FileMetadata[];
44
+ });
45
+ createObjectURL(file: FileMetadata): Observable<string>;
46
+ getFile(location: string): Observable<Blob>;
47
+ previousImage(event: KeyboardEvent | MouseEvent): void;
48
+ nextImage(event: KeyboardEvent | MouseEvent): void;
49
+ zoomIn(): void;
50
+ zoomOut(): void;
51
+ scrollZoom(evt: WheelEvent): boolean;
52
+ rotateClockwise(): void;
53
+ rotateCounterClockwise(): void;
54
+ onLoad(file: FileMetadata): void;
55
+ onLoadStart(file: FileMetadata): void;
56
+ imageNotFound(file: FileMetadata): void;
57
+ onDragOver(evt: DragEvent): void;
58
+ onDragStart(evt: DragEvent): void;
59
+ toggleFullscreen(): void;
60
+ reset(): void;
61
+ private canNavigate;
62
+ private updateStyle;
63
+ private valueToCss;
64
+ private mergeConfig;
65
+ }
@@ -0,0 +1,14 @@
1
+ import { HttpContext, HttpHeaders, HttpParams } from '@angular/common/http';
2
+ export interface HttpClientOptions {
3
+ headers?: HttpHeaders | {
4
+ [header: string]: string | string[];
5
+ };
6
+ context?: HttpContext;
7
+ observe?: 'body';
8
+ params?: HttpParams | {
9
+ [param: string]: string | number | boolean | ReadonlyArray<string | number | boolean>;
10
+ };
11
+ reportProgress?: boolean;
12
+ responseType: 'blob';
13
+ withCredentials?: boolean;
14
+ }
@@ -0,0 +1,10 @@
1
+ import { PipeTransform } from '@angular/core';
2
+ import { DomSanitizer } from '@angular/platform-browser';
3
+ import * as i0 from "@angular/core";
4
+ export declare class C3SafeUrlPipe implements PipeTransform {
5
+ private sanitizer;
6
+ constructor(sanitizer: DomSanitizer);
7
+ transform(url: string | null): import("@angular/platform-browser").SafeResourceUrl;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<C3SafeUrlPipe, never>;
9
+ static ɵpipe: i0.ɵɵPipeDeclaration<C3SafeUrlPipe, "c3SafeUrl", true>;
10
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "c3-components",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "C3 Components Library",
5
5
  "author": "Kroenen62",
6
6
  "license": "MIT",
@@ -19,7 +19,16 @@
19
19
  "sideEffects": false,
20
20
  "exports": {
21
21
  ".": {
22
- "sass": "./_index.scss"
22
+ "sass": "./_index.scss",
23
+ "types": "./index.d.ts",
24
+ "esm2022": "./esm2022/c3-components.mjs",
25
+ "esm": "./esm2022/c3-components.mjs",
26
+ "default": "./fesm2022/c3-components.mjs"
27
+ },
28
+ "./package.json": {
29
+ "default": "./package.json"
23
30
  }
24
- }
25
- }
31
+ },
32
+ "module": "fesm2022/c3-components.mjs",
33
+ "typings": "index.d.ts"
34
+ }
@@ -1,16 +1,10 @@
1
- /*
2
- * Public API Surface of c3-components
3
- */
4
-
5
1
  export * from './lib/c3-file-viewer/models/http.client';
6
-
7
2
  /**
8
3
  * Dropdown
9
4
  */
10
5
  export * from './lib/c3-dropdown/components/c3-dropdown.component';
11
6
  export * from './lib/c3-dropdown/directives/c3-dropdown.trigger';
12
7
  export * from './lib/c3-dropdown/c3-dropdown.module';
13
-
14
8
  /**
15
9
  * Dialog
16
10
  */
@@ -19,7 +13,6 @@ export * from './lib/c3-dialog/components/c3-dialog-prompt.component';
19
13
  export * from './lib/c3-dialog/components/c3-dialog-embed-child.component';
20
14
  export * from './lib/c3-dialog/services/c3-dialog.service';
21
15
  export * from './lib/c3-dialog/c3-dialog.module';
22
-
23
16
  /**
24
17
  * File Viewer
25
18
  */
@@ -32,19 +25,16 @@ export * from './lib/c3-file-viewer/models/file-viewer-config.model';
32
25
  export * from './lib/c3-file-viewer/models/file-viewer';
33
26
  export * from './lib/c3-file-viewer/models/file-metadata';
34
27
  export * from './lib/c3-file-viewer/c3-file-viewer.module';
35
-
36
28
  /**
37
29
  * Safe Url
38
30
  */
39
31
  export * from './lib/c3-safe-url/pipes/c3-safe-url.pipe';
40
-
41
32
  /**
42
33
  * Expansion
43
34
  */
44
35
  export * from './lib/c3-expansion/c3-expansion.module';
45
36
  export * from './lib/c3-expansion/components/c3-expansion/c3-expansion.component';
46
37
  export * from './lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component';
47
-
48
38
  /**
49
39
  * Auto Animate
50
40
  */
package/CONTRIBUTING.md DELETED
@@ -1,80 +0,0 @@
1
- # Contributing to c3-components
2
-
3
- First of all, thank you for your interest in contributing to the c3-components project! We appreciate your effort and look forward to collaborating with you. This document provides guidelines and best practices for contributing to the project.
4
-
5
- ## Table of Contents
6
-
7
- - [Code of Conduct](#code-of-conduct)
8
- - [Getting Started](#getting-started)
9
- - [Reporting Issues](#reporting-issues)
10
- - [Submitting Pull Requests](#submitting-pull-requests)
11
- - [Coding Style](#coding-style)
12
- - [Testing](#testing)
13
- - [Documentation](#documentation)
14
- - [Additional Resources](#additional-resources)
15
-
16
- ## Code of Conduct
17
-
18
- By participating in this project, you are expected to uphold our [Code of Conduct](./CODE_OF_CONDUCT.md). Please take a moment to read it before contributing.
19
-
20
- ## Getting Started
21
-
22
- 1. Fork the repository on GitHub.
23
- 2. Clone your fork of the repository to your local machine.
24
- 3. Install the required dependencies with `npm install`.
25
- 4. Create a new branch for your changes using `git checkout -b your-feature-branch`.
26
- 5. Implement your changes, following the [coding style](#coding-style) and [testing](#testing) guidelines.
27
- 6. Commit your changes and push them to your fork on GitHub.
28
- 7. Create a pull request with a clear description of your changes.
29
-
30
- ## Reporting Issues
31
-
32
- If you encounter any issues or bugs, please report them on the [issue tracker](https://github.com/Kroenen62/c3-components/issues). When submitting an issue, make sure to:
33
-
34
- - Use a clear and descriptive title.
35
- - Provide a detailed description of the issue and steps to reproduce it.
36
- - Include any relevant code snippets or screenshots.
37
-
38
- ## Submitting Pull Requests
39
-
40
- When submitting a pull request, please follow these guidelines:
41
-
42
- - Use a clear and descriptive title.
43
- - Provide a detailed description of your changes.
44
- - Reference any related issues in the pull request description.
45
- - Make sure your changes follow the [coding style](#coding-style) and [testing](#testing) guidelines.
46
- - Update the documentation if necessary.
47
-
48
- ## Coding Style
49
-
50
- To ensure consistency and readability, please adhere to the following coding style guidelines:
51
-
52
- - Use 2 spaces for indentation.
53
- - Follow the [Angular style guide](https://angular.io/guide/styleguide).
54
- - Use camelCase for variable and function names.
55
- - Use PascalCase for class names.
56
- - Add comments to explain complex or non-obvious code.
57
- - Break down long functions or classes into smaller, more manageable pieces.
58
-
59
- ## Testing
60
-
61
- Before submitting a pull request, make sure to test your changes thoroughly. Follow these testing guidelines:
62
-
63
- - Write unit tests for new features and bug fixes.
64
- - Ensure all tests pass by running `ng test`.
65
- - Test your changes in multiple browsers and screen sizes.
66
-
67
- ## Documentation
68
-
69
- Keep the documentation up-to-date by following these guidelines:
70
-
71
- - Update the README.md file if you add or change any functionality.
72
- - Document any new components or features in the [documentation website](https://c3-components.example.com/).
73
- - Use clear and concise language, and provide examples when possible.
74
-
75
- ## Additional Resources
76
-
77
- - [Angular Documentation](https://angular.io/docs)
78
- - [@angular/material Documentation](https://material.angular.io/)
79
-
80
- Once again, thank you for your interest in contributing to the c3-components project. Your time and expertise are greatly appreciated!
package/bun.lockb DELETED
Binary file
package/ng-package.json DELETED
@@ -1,19 +0,0 @@
1
- {
2
- "$schema": "../../node_modules/ng-packagr/ng-package.schema.json",
3
- "dest": "../../dist/c3-components",
4
- "assets": [
5
- {
6
- "glob": "**/**.scss",
7
- "input": "./src",
8
- "output": "."
9
- },
10
- {
11
- "glob": "**/**.sass",
12
- "input": "./src",
13
- "output": "."
14
- }
15
- ],
16
- "lib": {
17
- "entryFile": "src/public-api.ts"
18
- }
19
- }
@@ -1,18 +0,0 @@
1
- import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core';
2
- import autoAnimate, {
3
- AutoAnimateOptions,
4
- AutoAnimationPlugin,
5
- } from '@formkit/auto-animate';
6
-
7
- @Directive({
8
- selector: '[c3AutoAnimate]',
9
- standalone: true,
10
- })
11
- export class C3AutoAnimateDirective implements AfterViewInit {
12
- @Input() options?: Partial<AutoAnimateOptions> | AutoAnimationPlugin;
13
- constructor(private el: ElementRef) {}
14
-
15
- ngAfterViewInit(): void {
16
- autoAnimate(this.el.nativeElement, this.options);
17
- }
18
- }
@@ -1,30 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { MatButtonModule } from '@angular/material/button';
4
- import { MatDialogModule } from '@angular/material/dialog';
5
- import { MatFormFieldModule } from '@angular/material/form-field';
6
- import { FormsModule, ReactiveFormsModule } from '@angular/forms';
7
- import { MatInputModule } from '@angular/material/input';
8
- import { ConfirmDialogComponent } from './components/c3-dialog-confirm.component';
9
- import { C3DialogEmbedChildComponent } from './components/c3-dialog-embed-child.component';
10
- import { C3PromptDialogComponent } from './components/c3-dialog-prompt.component';
11
- import { C3DialogService } from './services/c3-dialog.service';
12
-
13
- @NgModule({
14
- declarations: [
15
- ConfirmDialogComponent,
16
- C3PromptDialogComponent,
17
- C3DialogEmbedChildComponent,
18
- ],
19
- imports: [
20
- CommonModule,
21
- MatDialogModule,
22
- MatButtonModule,
23
- MatFormFieldModule,
24
- MatInputModule,
25
- FormsModule,
26
- ReactiveFormsModule,
27
- ],
28
- providers: [C3DialogService],
29
- })
30
- export class C3DialogModule {}
@@ -1,44 +0,0 @@
1
- import { Component, Inject } from '@angular/core';
2
- import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
3
-
4
- export interface ConfirmConfig {
5
- text: string;
6
- placeholder?: string;
7
- reject?: {
8
- color?: string;
9
- text?: string;
10
- };
11
- accept?: {
12
- color?: string;
13
- text: string;
14
- };
15
- width?: string;
16
- }
17
-
18
- @Component({
19
- selector: 'ConfirmDialogComponent',
20
- template: `
21
- <mat-dialog-content>
22
- <div [innerHtml]="data.text"></div>
23
- </mat-dialog-content>
24
- <mat-dialog-actions class="flex flex-row justify-end items-center">
25
- <button mat-button mat-dialog-close [color]="data.reject?.color">
26
- {{ data.reject?.text }}
27
- </button>
28
- <button mat-button [color]="data.accept?.color" [mat-dialog-close]="true">
29
- {{ data.accept?.text }}
30
- </button>
31
- </mat-dialog-actions>
32
- `,
33
- })
34
- export class ConfirmDialogComponent {
35
- constructor(
36
- public dialogRef: MatDialogRef<ConfirmDialogComponent>,
37
- @Inject(MAT_DIALOG_DATA)
38
- public data: ConfirmConfig
39
- ) {}
40
-
41
- onNoClick(): void {
42
- this.dialogRef.close();
43
- }
44
- }
@@ -1,40 +0,0 @@
1
- import {
2
- AfterViewInit,
3
- ChangeDetectorRef,
4
- Component,
5
- ComponentRef,
6
- Inject,
7
- Type,
8
- ViewChild,
9
- ViewContainerRef,
10
- } from '@angular/core';
11
- import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
12
-
13
- @Component({
14
- selector: 'C3DialogEmbedChildComponent',
15
- template: `<mat-dialog-content>
16
- <ng-template #target></ng-template>
17
- </mat-dialog-content>`,
18
- styles: [],
19
- })
20
- export class C3DialogEmbedChildComponent<ComponenyType>
21
- implements AfterViewInit
22
- {
23
- @ViewChild('target', { read: ViewContainerRef }) target!: ViewContainerRef;
24
-
25
- createdComponent?: ComponentRef<ComponenyType>;
26
-
27
- constructor(
28
- public dialogRef: MatDialogRef<C3DialogEmbedChildComponent<ComponenyType>>,
29
- @Inject(MAT_DIALOG_DATA)
30
- public data: {
31
- component: Type<ComponenyType>;
32
- },
33
- private _cdr: ChangeDetectorRef
34
- ) {}
35
-
36
- ngAfterViewInit() {
37
- this.createdComponent = this.target.createComponent(this.data.component);
38
- this._cdr.detectChanges();
39
- }
40
- }
@@ -1,81 +0,0 @@
1
- import { Component, Inject } from '@angular/core';
2
- import { FormBuilder, FormControl, ValidatorFn } from '@angular/forms';
3
- import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
4
-
5
- export interface PromptConfig {
6
- text: string;
7
- defaultValue?: string;
8
- placeholder?: string;
9
- multiline?: boolean;
10
- validators?: ValidatorFn | ValidatorFn[];
11
- required?: boolean;
12
- reject?: {
13
- color: string;
14
- text: string;
15
- };
16
- accept?: {
17
- color: string;
18
- text: string;
19
- };
20
- width?: string;
21
- maxWidth?: string;
22
- }
23
-
24
- @Component({
25
- selector: 'PrompDialogComponent',
26
- template: `
27
- <div mat-dialog-title>{{ data.text }}</div>
28
- <mat-dialog-content>
29
- <mat-form-field>
30
- <mat-label *ngIf="data.placeholder">{{ data.placeholder }}</mat-label>
31
- <input
32
- *ngIf="!data.multiline"
33
- matInput
34
- [formControl]="result"
35
- (keydown.enter)="dialogRef.close(result.value)"
36
- />
37
- <textarea
38
- *ngIf="data.multiline"
39
- matInput
40
- [formControl]="result"
41
- cdkTextareaAutosize
42
- ></textarea>
43
- </mat-form-field>
44
- </mat-dialog-content>
45
- <mat-dialog-actions align="center">
46
- <button mat-raised-button mat-dialog-close [class]="data.reject?.color">
47
- {{ data.reject?.text }}
48
- </button>
49
- <button
50
- mat-raised-button
51
- [disabled]="result.invalid || (data.required && !result.value)"
52
- [class]="data.accept?.color"
53
- [mat-dialog-close]="result.value"
54
- >
55
- {{ data.accept?.text }}
56
- </button>
57
- </mat-dialog-actions>
58
- `,
59
- styles: [
60
- `
61
- mat-form-field {
62
- width: 100%;
63
- }
64
- `,
65
- ],
66
- })
67
- export class C3PromptDialogComponent {
68
- result: FormControl;
69
- constructor(
70
- public dialogRef: MatDialogRef<C3PromptDialogComponent>,
71
- @Inject(MAT_DIALOG_DATA)
72
- public data: PromptConfig,
73
- private _fb: FormBuilder
74
- ) {
75
- this.result = this._fb.control(data.defaultValue, data.validators);
76
- }
77
-
78
- onNoClick(): void {
79
- this.dialogRef.close();
80
- }
81
- }
@@ -1,87 +0,0 @@
1
- import { Injectable, Type, inject } from '@angular/core';
2
- import { MatDialog, MatDialogConfig } from '@angular/material/dialog';
3
- import {
4
- ConfirmConfig,
5
- ConfirmDialogComponent,
6
- } from '../components/c3-dialog-confirm.component';
7
- import { C3DialogEmbedChildComponent } from '../components/c3-dialog-embed-child.component';
8
- import {
9
- PromptConfig,
10
- C3PromptDialogComponent,
11
- } from '../components/c3-dialog-prompt.component';
12
-
13
- @Injectable({
14
- providedIn: 'root',
15
- })
16
- export class C3DialogService {
17
- readonly #dialog = inject(MatDialog);
18
-
19
- public confirm(data: ConfirmConfig): Promise<boolean> {
20
- return new Promise((resolve, reject) => {
21
- const dialogRef = this.#dialog.open(ConfirmDialogComponent, {
22
- width: data.width || '250px',
23
- data: {
24
- text: data.text,
25
- reject: {
26
- color:
27
- data.reject && data.reject.color ? data.reject.color : undefined,
28
- text: (data.reject && data.reject.text) || 'Annuler',
29
- },
30
- accept: {
31
- color: (data.accept && data.accept.color) || 'primary',
32
- text: (data.accept && data.accept.text) || 'Accepter',
33
- },
34
- },
35
- });
36
-
37
- dialogRef.afterClosed().subscribe(async (result) => {
38
- if (result) resolve(true);
39
- else resolve(false);
40
- });
41
- });
42
- }
43
-
44
- public prompt<T = any>(data: PromptConfig): Promise<false | T> {
45
- return new Promise((resolve, reject) => {
46
- const dialogRef = this.#dialog.open<C3PromptDialogComponent, any, T>(
47
- C3PromptDialogComponent,
48
- {
49
- width: data.width || '250px',
50
- maxWidth: data.maxWidth || '100vw',
51
- data: {
52
- text: data.text,
53
- defaultValue: data.defaultValue,
54
- placeholder: data.placeholder,
55
- multiline: data.multiline,
56
- validators: data.validators,
57
- required: data.required,
58
- reject: {
59
- color:
60
- data.reject && data.reject.color
61
- ? data.reject.color
62
- : undefined,
63
- text: (data.reject && data.reject.text) || 'Annuler',
64
- },
65
- accept: {
66
- color: (data.accept && data.accept.color) || 'primary',
67
- text: (data.accept && data.accept.text) || 'Accepter',
68
- },
69
- },
70
- }
71
- );
72
-
73
- dialogRef.afterClosed().subscribe(async (result) => {
74
- if (result) resolve(result);
75
- else resolve(false);
76
- });
77
- });
78
- }
79
-
80
- createDialgFromComponent<T>(
81
- config: Partial<MatDialogConfig> & {
82
- data: { component: Type<T> };
83
- }
84
- ) {
85
- return this.#dialog.open(C3DialogEmbedChildComponent, config);
86
- }
87
- }
@@ -1,12 +0,0 @@
1
- import { NgModule } from '@angular/core';
2
- import { CommonModule } from '@angular/common';
3
- import { C3DropdownComponent } from './components/c3-dropdown.component';
4
- import { C3DropdownTrigger } from './directives/c3-dropdown.trigger';
5
- import { OverlayModule } from '@angular/cdk/overlay';
6
-
7
- @NgModule({
8
- imports: [CommonModule, OverlayModule],
9
- declarations: [C3DropdownComponent, C3DropdownTrigger],
10
- exports: [C3DropdownComponent, C3DropdownTrigger],
11
- })
12
- export class C3DropdownModule {}
@@ -1,22 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { C3DropdownComponent } from './c3-dropdown.component';
4
-
5
- describe('C3DropdownComponent', () => {
6
- let component: C3DropdownComponent;
7
- let fixture: ComponentFixture<C3DropdownComponent>;
8
-
9
- beforeEach(async () => {
10
- await TestBed.configureTestingModule({
11
- declarations: [C3DropdownComponent],
12
- }).compileComponents();
13
-
14
- fixture = TestBed.createComponent(C3DropdownComponent);
15
- component = fixture.componentInstance;
16
- fixture.detectChanges();
17
- });
18
-
19
- it('should create', () => {
20
- expect(component).toBeTruthy();
21
- });
22
- });