c3-components 0.0.12 → 0.0.14

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 (132) hide show
  1. package/CONTRIBUTING.md +80 -0
  2. package/bun.lockb +0 -0
  3. package/ng-package.json +19 -0
  4. package/package.json +5 -15
  5. package/{_index.scss → src/_index.scss} +1 -3
  6. package/src/lib/c3-auto-animate/C3AutoAnimate.directive.ts +18 -0
  7. package/src/lib/c3-dialog/c3-dialog.module.ts +30 -0
  8. package/src/lib/c3-dialog/components/c3-dialog-confirm.component.ts +44 -0
  9. package/src/lib/c3-dialog/components/c3-dialog-embed-child.component.ts +40 -0
  10. package/src/lib/c3-dialog/components/c3-dialog-prompt.component.ts +81 -0
  11. package/src/lib/c3-dialog/services/c3-dialog.service.ts +87 -0
  12. package/src/lib/c3-dropdown/c3-dropdown.module.ts +12 -0
  13. package/src/lib/c3-dropdown/components/c3-dropdown.component.spec.ts +22 -0
  14. package/src/lib/c3-dropdown/components/c3-dropdown.component.ts +39 -0
  15. package/src/lib/c3-dropdown/directives/c3-dropdown.trigger.ts +161 -0
  16. package/src/lib/c3-expansion/c3-expansion.module.ts +24 -0
  17. package/src/lib/c3-expansion/components/c3-expansion/c3-expansion.component.html +9 -0
  18. package/src/lib/c3-expansion/components/c3-expansion/c3-expansion.component.ts +33 -0
  19. package/src/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.html +12 -0
  20. package/src/lib/c3-expansion/components/c3-expansion-header/c3-expansion-header.component.ts +21 -0
  21. package/src/lib/c3-expansion/styles/_c3-expansion.scss +39 -0
  22. package/src/lib/c3-file/c3-download/c3-download.module.ts +7 -0
  23. package/src/lib/c3-file/c3-download/c3-download.service.ts +16 -0
  24. package/src/lib/c3-file/c3-input-file/c3-input-file.module.ts +30 -0
  25. package/src/lib/c3-file/c3-input-file/class/c3-input-file.ts +62 -0
  26. package/src/lib/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.html +7 -0
  27. package/src/lib/c3-file/c3-input-file/components/c3-input-file/c3-input-file.component.ts +96 -0
  28. package/src/lib/c3-file/c3-input-file/components/c3-input-file-container/c3-input-file-container.component.ts +53 -0
  29. package/src/lib/c3-file/c3-input-file/components/c3-input-file-displayer/c3-input-file-displayer.component.ts +107 -0
  30. package/src/lib/c3-file/c3-input-file/components/c3-input-file-trigger/c3-input-file-trigger.component.ts +22 -0
  31. package/src/lib/c3-file/c3-input-file/directives/c3-input-file-trigger.directive.ts +27 -0
  32. package/src/lib/c3-file-upload/c3-file-upload.module.ts +8 -0
  33. package/src/lib/c3-file-viewer/c3-file-viewer.module.ts +30 -0
  34. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.html +185 -0
  35. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.spec.ts +23 -0
  36. package/src/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.ts +15 -0
  37. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.html +7 -0
  38. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.spec.ts +23 -0
  39. package/src/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.ts +14 -0
  40. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.html +7 -0
  41. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.spec.ts +23 -0
  42. package/src/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.ts +25 -0
  43. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.css +0 -0
  44. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.html +1 -0
  45. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.spec.ts +23 -0
  46. package/src/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.ts +35 -0
  47. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.html +32 -0
  48. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.spec.ts +23 -0
  49. package/src/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.ts +93 -0
  50. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.spec.ts +23 -0
  51. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.ts +37 -0
  52. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.spec.ts +22 -0
  53. package/src/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.ts +12 -0
  54. package/src/lib/c3-file-viewer/consts/default.config.ts +41 -0
  55. package/src/lib/c3-file-viewer/directives/full-screen.directive.spec.ts +11 -0
  56. package/src/lib/c3-file-viewer/directives/full-screen.directive.ts +68 -0
  57. package/src/lib/c3-file-viewer/models/custom-file-event.model.ts +9 -0
  58. package/src/lib/c3-file-viewer/models/file-metadata.ts +13 -0
  59. package/src/lib/c3-file-viewer/models/file-viewer-config.model.ts +53 -0
  60. package/src/lib/c3-file-viewer/models/file-viewer.ts +259 -0
  61. package/src/lib/c3-file-viewer/models/http.client.ts +23 -0
  62. package/{lib → src/lib}/c3-file-viewer/styles/_c3-file-viewer.sass +2 -20
  63. package/src/lib/c3-highlight-text/c3-highlight-text.module.ts +12 -0
  64. package/src/lib/c3-menu/c3-menu.module.ts +12 -0
  65. package/src/lib/c3-modal/c3-modal.module.ts +12 -0
  66. package/src/lib/c3-navbar/c3-navbar.module.ts +12 -0
  67. package/src/lib/c3-pdf-dialog/c3-pdf-dialog.module.ts +12 -0
  68. package/src/lib/c3-rounded-title/c3-rounded-title.module.ts +12 -0
  69. package/src/lib/c3-safe-url/pipes/c3-safe-url.pipe.spec.ts +8 -0
  70. package/src/lib/c3-safe-url/pipes/c3-safe-url.pipe.ts +13 -0
  71. package/{lib → src/lib}/c3-styles/_c3-core.sass +4 -2
  72. package/src/lib/c3-tabs/c3-tabs.module.ts +12 -0
  73. package/{public-api.d.ts → src/public-api.ts} +20 -0
  74. package/tsconfig.lib.json +14 -0
  75. package/tsconfig.lib.prod.json +10 -0
  76. package/tsconfig.spec.json +14 -0
  77. package/esm2022/c3-components.mjs +0 -5
  78. package/esm2022/lib/c3-dialog/c3-dialog.module.mjs +0 -52
  79. package/esm2022/lib/c3-dialog/components/c3-dialog-confirm.component.mjs +0 -51
  80. package/esm2022/lib/c3-dialog/components/c3-dialog-embed-child.component.mjs +0 -32
  81. package/esm2022/lib/c3-dialog/components/c3-dialog-prompt.component.mjs +0 -95
  82. package/esm2022/lib/c3-dialog/services/c3-dialog.service.mjs +0 -79
  83. package/esm2022/lib/c3-dropdown/c3-dropdown.module.mjs +0 -20
  84. package/esm2022/lib/c3-dropdown/components/c3-dropdown.component.mjs +0 -45
  85. package/esm2022/lib/c3-dropdown/directives/c3-dropdown.trigger.mjs +0 -128
  86. package/esm2022/lib/c3-file-viewer/c3-file-viewer.module.mjs +0 -47
  87. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.mjs +0 -17
  88. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.mjs +0 -20
  89. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.mjs +0 -23
  90. package/esm2022/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.mjs +0 -32
  91. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.mjs +0 -86
  92. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.mjs +0 -40
  93. package/esm2022/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.mjs +0 -26
  94. package/esm2022/lib/c3-file-viewer/consts/default.config.mjs +0 -40
  95. package/esm2022/lib/c3-file-viewer/directives/full-screen.directive.mjs +0 -66
  96. package/esm2022/lib/c3-file-viewer/models/custom-file-event.model.mjs +0 -7
  97. package/esm2022/lib/c3-file-viewer/models/file-metadata.mjs +0 -2
  98. package/esm2022/lib/c3-file-viewer/models/file-viewer-config.model.mjs +0 -2
  99. package/esm2022/lib/c3-file-viewer/models/file-viewer.mjs +0 -206
  100. package/esm2022/lib/c3-file-viewer/models/http.client.mjs +0 -2
  101. package/esm2022/lib/c3-safe-url/pipes/c3-safe-url.pipe.mjs +0 -21
  102. package/esm2022/public-api.mjs +0 -35
  103. package/fesm2022/c3-components.mjs +0 -1056
  104. package/fesm2022/c3-components.mjs.map +0 -1
  105. package/index.d.ts +0 -5
  106. package/lib/c3-dialog/c3-dialog.module.d.ts +0 -15
  107. package/lib/c3-dialog/components/c3-dialog-confirm.component.d.ts +0 -23
  108. package/lib/c3-dialog/components/c3-dialog-embed-child.component.d.ts +0 -18
  109. package/lib/c3-dialog/components/c3-dialog-prompt.component.d.ts +0 -31
  110. package/lib/c3-dialog/services/c3-dialog.service.d.ts +0 -19
  111. package/lib/c3-dropdown/c3-dropdown.module.d.ts +0 -10
  112. package/lib/c3-dropdown/components/c3-dropdown.component.d.ts +0 -15
  113. package/lib/c3-dropdown/directives/c3-dropdown.trigger.d.ts +0 -45
  114. package/lib/c3-file-viewer/c3-file-viewer.module.d.ts +0 -17
  115. package/lib/c3-file-viewer/components/c3-file-viewer-actions/c3-file-viewer-actions.component.d.ts +0 -8
  116. package/lib/c3-file-viewer/components/c3-file-viewer-image/c3-file-viewer-image.component.d.ts +0 -9
  117. package/lib/c3-file-viewer/components/c3-file-viewer-pdf/c3-file-viewer-pdf.component.d.ts +0 -9
  118. package/lib/c3-file-viewer/components/c3-file-viewer-video/c3-file-viewer-video.component.d.ts +0 -12
  119. package/lib/c3-file-viewer/components/public/c3-file-viewer/c3-file-viewer.component.d.ts +0 -25
  120. package/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.component.d.ts +0 -12
  121. package/lib/c3-file-viewer/components/public/c3-file-viewer-dialog/c3-file-viewer-dialog.d.ts +0 -8
  122. package/lib/c3-file-viewer/consts/default.config.d.ts +0 -2
  123. package/lib/c3-file-viewer/directives/full-screen.directive.d.ts +0 -12
  124. package/lib/c3-file-viewer/models/custom-file-event.model.d.ts +0 -5
  125. package/lib/c3-file-viewer/models/file-metadata.d.ts +0 -12
  126. package/lib/c3-file-viewer/models/file-viewer-config.model.d.ts +0 -48
  127. package/lib/c3-file-viewer/models/file-viewer.d.ts +0 -65
  128. package/lib/c3-file-viewer/models/http.client.d.ts +0 -14
  129. package/lib/c3-safe-url/pipes/c3-safe-url.pipe.d.ts +0 -10
  130. /package/{lib → src/lib}/c3-dropdown/styles/_c3-dropdown.sass +0 -0
  131. /package/{lib → src/lib}/c3-styles/_c3-root-variables.sass +0 -0
  132. /package/{lib → src/lib}/c3-styles/_utils.sass +0 -0
@@ -1,1056 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { TemplateRef, Component, ViewChild, Input, forwardRef, Directive, HostListener, NgModule, Inject, ViewContainerRef, Injectable, Pipe, EventEmitter, Output, ViewEncapsulation, Optional, inject } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import * as i2$1 from '@angular/forms';
6
- import { NG_VALUE_ACCESSOR, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
- import * as i1$1 from '@angular/cdk/overlay';
8
- import { OverlayConfig, OverlayModule } from '@angular/cdk/overlay';
9
- import { coerceBooleanProperty } from '@angular/cdk/coercion';
10
- import { TemplatePortal } from '@angular/cdk/portal';
11
- import { Subscription, Subject, merge, takeUntil, BehaviorSubject, filter, skip, debounceTime, mergeMap, tap, map } from 'rxjs';
12
- import * as i1$2 from '@angular/material/dialog';
13
- import { MAT_DIALOG_DATA, MatDialogModule } from '@angular/material/dialog';
14
- import * as i2 from '@angular/material/button';
15
- import { MatButtonModule } from '@angular/material/button';
16
- import * as i5 from '@angular/material/form-field';
17
- import { MatFormFieldModule } from '@angular/material/form-field';
18
- import * as i6 from '@angular/material/input';
19
- import { MatInputModule } from '@angular/material/input';
20
- import * as i7 from '@angular/cdk/text-field';
21
- import * as i1$4 from '@angular/common/http';
22
- import { HttpClient, provideHttpClient, withInterceptorsFromDi } from '@angular/common/http';
23
- import * as i1$3 from '@angular/platform-browser';
24
-
25
- class C3DropdownComponent {
26
- constructor(_changeDetectorRef) {
27
- this._changeDetectorRef = _changeDetectorRef;
28
- /** Classes to be added to the container of the content. Supports the same syntax as `ngClass`. */
29
- this.dropdownClass = '';
30
- }
31
- ngOnChanges(changes) {
32
- if (changes['dropdownClass']) {
33
- this._markForCheck();
34
- }
35
- }
36
- _markForCheck() {
37
- this._changeDetectorRef.markForCheck();
38
- }
39
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
40
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3DropdownComponent, selector: "c3-dropdown", inputs: { dropdownClass: "dropdownClass" }, viewQueries: [{ propertyName: "template", first: true, predicate: TemplateRef, descendants: true }], usesOnChanges: true, ngImport: i0, template: `
41
- <ng-template>
42
- <div class="c3-dropdown-panel" [ngClass]="dropdownClass">
43
- <ng-content></ng-content>
44
- </div>
45
- </ng-template>
46
- `, isInline: true, dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }] }); }
47
- }
48
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownComponent, decorators: [{
49
- type: Component,
50
- args: [{
51
- selector: 'c3-dropdown',
52
- template: `
53
- <ng-template>
54
- <div class="c3-dropdown-panel" [ngClass]="dropdownClass">
55
- <ng-content></ng-content>
56
- </div>
57
- </ng-template>
58
- `,
59
- }]
60
- }], ctorParameters: () => [{ type: i0.ChangeDetectorRef }], propDecorators: { template: [{
61
- type: ViewChild,
62
- args: [TemplateRef]
63
- }], dropdownClass: [{
64
- type: Input
65
- }] } });
66
-
67
- const MAT_DROPDOWN_VALUE_ACCESSOR = {
68
- provide: NG_VALUE_ACCESSOR,
69
- useExisting: forwardRef(() => C3DropdownTrigger),
70
- multi: true,
71
- };
72
- /**
73
- * @description The C3DropdownTrigger directive is used to display or hide a dropdown menu
74
- * C3DropdownComponent when an item is clicked.
75
- * @selector [c3Dropdown]
76
- * @exportAs c3DropdownTrigger
77
- * @input c3Dropdown - A reference to an instance of C3DropdownComponent.
78
- * @input c3DropdownDisabled - A boolean indicating whether the directive should be disabled.
79
- * @input c3DropdownClass - A string, an array of strings, a set of strings or a
80
- * object representing the CSS classes to be applied to the dropdown menu.
81
- */
82
- class C3DropdownTrigger {
83
- /** Whether the dropdown is disabled. */
84
- get dropdownDisabled() {
85
- return this._dropdownDisabled;
86
- }
87
- set dropdownDisabled(value) {
88
- this._dropdownDisabled = coerceBooleanProperty(value);
89
- }
90
- constructor(_element, _overlay, _viewContainerRef) {
91
- this._element = _element;
92
- this._overlay = _overlay;
93
- this._viewContainerRef = _viewContainerRef;
94
- this._closingActionsSubscription = Subscription.EMPTY;
95
- this._destroyed = new Subject();
96
- this._dropdownClass = '';
97
- this._dropdownDisabled = false;
98
- /** Classes to be passed to the dropdown menu. Supports the same syntax as `ngClass`. */
99
- this.dropdownClass = '';
100
- }
101
- onClick() {
102
- this.show();
103
- }
104
- ngOnChanges(changes) {
105
- if (changes['dropdownClass'] && this.dropdown) {
106
- this.dropdown.dropdownClass = this._dropdownClass;
107
- this.dropdown._markForCheck();
108
- }
109
- }
110
- ngOnDestroy() {
111
- this._destroyed.next();
112
- this._destroyed.complete();
113
- this._closingActionsSubscription.unsubscribe();
114
- this.close();
115
- }
116
- show() {
117
- if (!this.dropdown)
118
- return;
119
- const overlayRef = this._overlay.create(this._getOverlayConfig());
120
- const portal = new TemplatePortal(this.dropdown.template, this._viewContainerRef);
121
- overlayRef.attach(portal);
122
- this.overlayRef = overlayRef;
123
- this._closingActionsSubscription = this._menuClosingActions().subscribe(() => this.close());
124
- }
125
- close() {
126
- if (this.overlayRef && this.overlayRef.hasAttached())
127
- this.overlayRef.detach();
128
- }
129
- _getOverlayConfig() {
130
- const belowPosition = {
131
- originX: 'start',
132
- originY: 'bottom',
133
- overlayX: 'start',
134
- overlayY: 'top',
135
- };
136
- const abovePosition = {
137
- originX: 'start',
138
- originY: 'top',
139
- overlayX: 'start',
140
- overlayY: 'bottom',
141
- // The overlay edge connected to the trigger should have squared corners, while
142
- // the opposite end has rounded corners. We apply a CSS class to swap the
143
- // border-radius based on the overlay position.
144
- panelClass: 'mat-autocomplete-panel-above',
145
- };
146
- const positionStrategy = this._overlay
147
- .position()
148
- .flexibleConnectedTo(this._element)
149
- .withLockedPosition()
150
- .withPositions([belowPosition, abovePosition]);
151
- return new OverlayConfig({
152
- positionStrategy,
153
- backdropClass: 'cdk-overlay-transparent-backdrop',
154
- hasBackdrop: true,
155
- });
156
- }
157
- /** Returns a stream that emits whenever an action that should close the menu occurs. */
158
- _menuClosingActions() {
159
- const backdrop = this.overlayRef.backdropClick();
160
- const detachments = this.overlayRef.detachments();
161
- return merge(backdrop, detachments).pipe(takeUntil(this._destroyed));
162
- }
163
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownTrigger, deps: [{ token: i0.ElementRef }, { token: i1$1.Overlay }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
164
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0", type: C3DropdownTrigger, selector: "[c3Dropdown]", inputs: { dropdown: ["c3Dropdown", "dropdown"], dropdownDisabled: ["c3DropdownDisabled", "dropdownDisabled"], dropdownClass: ["c3DropdownClass", "dropdownClass"] }, host: { listeners: { "click": "onClick()" } }, providers: [MAT_DROPDOWN_VALUE_ACCESSOR], exportAs: ["c3DropdownTrigger"], usesOnChanges: true, ngImport: i0 }); }
165
- }
166
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownTrigger, decorators: [{
167
- type: Directive,
168
- args: [{
169
- selector: '[c3Dropdown]',
170
- exportAs: 'c3DropdownTrigger',
171
- providers: [MAT_DROPDOWN_VALUE_ACCESSOR],
172
- }]
173
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i1$1.Overlay }, { type: i0.ViewContainerRef }], propDecorators: { dropdown: [{
174
- type: Input,
175
- args: ['c3Dropdown']
176
- }], dropdownDisabled: [{
177
- type: Input,
178
- args: ['c3DropdownDisabled']
179
- }], dropdownClass: [{
180
- type: Input,
181
- args: ['c3DropdownClass']
182
- }], onClick: [{
183
- type: HostListener,
184
- args: ['click']
185
- }] } });
186
-
187
- class C3DropdownModule {
188
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
189
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownModule, declarations: [C3DropdownComponent, C3DropdownTrigger], imports: [CommonModule, OverlayModule], exports: [C3DropdownComponent, C3DropdownTrigger] }); }
190
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownModule, imports: [CommonModule, OverlayModule] }); }
191
- }
192
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DropdownModule, decorators: [{
193
- type: NgModule,
194
- args: [{
195
- imports: [CommonModule, OverlayModule],
196
- declarations: [C3DropdownComponent, C3DropdownTrigger],
197
- exports: [C3DropdownComponent, C3DropdownTrigger],
198
- }]
199
- }] });
200
-
201
- class ConfirmDialogComponent {
202
- constructor(dialogRef, data) {
203
- this.dialogRef = dialogRef;
204
- this.data = data;
205
- }
206
- onNoClick() {
207
- this.dialogRef.close();
208
- }
209
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: ConfirmDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
210
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: ConfirmDialogComponent, selector: "ConfirmDialogComponent", ngImport: i0, template: `
211
- <mat-dialog-content>
212
- <div [innerHtml]="data.text"></div>
213
- </mat-dialog-content>
214
- <mat-dialog-actions class="flex flex-row justify-end items-center">
215
- <button mat-button mat-dialog-close [color]="data.reject?.color">
216
- {{ data.reject?.text }}
217
- </button>
218
- <button mat-button [color]="data.accept?.color" [mat-dialog-close]="true">
219
- {{ data.accept?.text }}
220
- </button>
221
- </mat-dialog-actions>
222
- `, isInline: true, dependencies: [{ kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }] }); }
223
- }
224
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: ConfirmDialogComponent, decorators: [{
225
- type: Component,
226
- args: [{
227
- selector: 'ConfirmDialogComponent',
228
- template: `
229
- <mat-dialog-content>
230
- <div [innerHtml]="data.text"></div>
231
- </mat-dialog-content>
232
- <mat-dialog-actions class="flex flex-row justify-end items-center">
233
- <button mat-button mat-dialog-close [color]="data.reject?.color">
234
- {{ data.reject?.text }}
235
- </button>
236
- <button mat-button [color]="data.accept?.color" [mat-dialog-close]="true">
237
- {{ data.accept?.text }}
238
- </button>
239
- </mat-dialog-actions>
240
- `,
241
- }]
242
- }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
243
- type: Inject,
244
- args: [MAT_DIALOG_DATA]
245
- }] }] });
246
-
247
- class C3PromptDialogComponent {
248
- constructor(dialogRef, data, _fb) {
249
- this.dialogRef = dialogRef;
250
- this.data = data;
251
- this._fb = _fb;
252
- this.result = this._fb.control(data.defaultValue, data.validators);
253
- }
254
- onNoClick() {
255
- this.dialogRef.close();
256
- }
257
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3PromptDialogComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i2$1.FormBuilder }], target: i0.ɵɵFactoryTarget.Component }); }
258
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3PromptDialogComponent, selector: "PrompDialogComponent", ngImport: i0, template: `
259
- <div mat-dialog-title>{{ data.text }}</div>
260
- <mat-dialog-content>
261
- <mat-form-field>
262
- <mat-label *ngIf="data.placeholder">{{ data.placeholder }}</mat-label>
263
- <input
264
- *ngIf="!data.multiline"
265
- matInput
266
- [formControl]="result"
267
- (keydown.enter)="dialogRef.close(result.value)"
268
- />
269
- <textarea
270
- *ngIf="data.multiline"
271
- matInput
272
- [formControl]="result"
273
- cdkTextareaAutosize
274
- ></textarea>
275
- </mat-form-field>
276
- </mat-dialog-content>
277
- <mat-dialog-actions align="center">
278
- <button mat-raised-button mat-dialog-close [class]="data.reject?.color">
279
- {{ data.reject?.text }}
280
- </button>
281
- <button
282
- mat-raised-button
283
- [disabled]="result.invalid || (data.required && !result.value)"
284
- [class]="data.accept?.color"
285
- [mat-dialog-close]="result.value"
286
- >
287
- {{ data.accept?.text }}
288
- </button>
289
- </mat-dialog-actions>
290
- `, isInline: true, styles: ["mat-form-field{width:100%}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1$2.MatDialogClose, selector: "[mat-dialog-close], [matDialogClose]", inputs: ["aria-label", "type", "mat-dialog-close", "matDialogClose"], exportAs: ["matDialogClose"] }, { kind: "directive", type: i1$2.MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: i1$2.MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "component", type: i2.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: i5.MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: i5.MatLabel, selector: "mat-label" }, { kind: "directive", type: i6.MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly"], exportAs: ["matInput"] }, { kind: "directive", type: i7.CdkTextareaAutosize, selector: "textarea[cdkTextareaAutosize]", inputs: ["cdkAutosizeMinRows", "cdkAutosizeMaxRows", "cdkTextareaAutosize", "placeholder"], exportAs: ["cdkTextareaAutosize"] }, { kind: "directive", type: i2$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }] }); }
291
- }
292
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3PromptDialogComponent, decorators: [{
293
- type: Component,
294
- args: [{ selector: 'PrompDialogComponent', template: `
295
- <div mat-dialog-title>{{ data.text }}</div>
296
- <mat-dialog-content>
297
- <mat-form-field>
298
- <mat-label *ngIf="data.placeholder">{{ data.placeholder }}</mat-label>
299
- <input
300
- *ngIf="!data.multiline"
301
- matInput
302
- [formControl]="result"
303
- (keydown.enter)="dialogRef.close(result.value)"
304
- />
305
- <textarea
306
- *ngIf="data.multiline"
307
- matInput
308
- [formControl]="result"
309
- cdkTextareaAutosize
310
- ></textarea>
311
- </mat-form-field>
312
- </mat-dialog-content>
313
- <mat-dialog-actions align="center">
314
- <button mat-raised-button mat-dialog-close [class]="data.reject?.color">
315
- {{ data.reject?.text }}
316
- </button>
317
- <button
318
- mat-raised-button
319
- [disabled]="result.invalid || (data.required && !result.value)"
320
- [class]="data.accept?.color"
321
- [mat-dialog-close]="result.value"
322
- >
323
- {{ data.accept?.text }}
324
- </button>
325
- </mat-dialog-actions>
326
- `, styles: ["mat-form-field{width:100%}\n"] }]
327
- }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
328
- type: Inject,
329
- args: [MAT_DIALOG_DATA]
330
- }] }, { type: i2$1.FormBuilder }] });
331
-
332
- class C3DialogEmbedChildComponent {
333
- constructor(dialogRef, data, _cdr) {
334
- this.dialogRef = dialogRef;
335
- this.data = data;
336
- this._cdr = _cdr;
337
- }
338
- ngAfterViewInit() {
339
- this.createdComponent = this.target.createComponent(this.data.component);
340
- this._cdr.detectChanges();
341
- }
342
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogEmbedChildComponent, deps: [{ token: i1$2.MatDialogRef }, { token: MAT_DIALOG_DATA }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
343
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3DialogEmbedChildComponent, selector: "C3DialogEmbedChildComponent", viewQueries: [{ propertyName: "target", first: true, predicate: ["target"], descendants: true, read: ViewContainerRef }], ngImport: i0, template: `<mat-dialog-content>
344
- <ng-template #target></ng-template>
345
- </mat-dialog-content>`, isInline: true, dependencies: [{ kind: "directive", type: i1$2.MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }] }); }
346
- }
347
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogEmbedChildComponent, decorators: [{
348
- type: Component,
349
- args: [{ selector: 'C3DialogEmbedChildComponent', template: `<mat-dialog-content>
350
- <ng-template #target></ng-template>
351
- </mat-dialog-content>` }]
352
- }], ctorParameters: () => [{ type: i1$2.MatDialogRef }, { type: undefined, decorators: [{
353
- type: Inject,
354
- args: [MAT_DIALOG_DATA]
355
- }] }, { type: i0.ChangeDetectorRef }], propDecorators: { target: [{
356
- type: ViewChild,
357
- args: ['target', { read: ViewContainerRef }]
358
- }] } });
359
-
360
- class C3DialogService {
361
- constructor(dialog) {
362
- this.dialog = dialog;
363
- }
364
- confirm(data) {
365
- return new Promise((resolve, reject) => {
366
- const dialogRef = this.dialog.open(ConfirmDialogComponent, {
367
- width: data.width || '250px',
368
- data: {
369
- text: data.text,
370
- reject: {
371
- color: data.reject && data.reject.color ? data.reject.color : undefined,
372
- text: (data.reject && data.reject.text) || 'Annuler',
373
- },
374
- accept: {
375
- color: (data.accept && data.accept.color) || 'primary',
376
- text: (data.accept && data.accept.text) || 'Accepter',
377
- },
378
- },
379
- });
380
- dialogRef.afterClosed().subscribe(async (result) => {
381
- if (result)
382
- resolve(true);
383
- else
384
- resolve(false);
385
- });
386
- });
387
- }
388
- prompt(data) {
389
- return new Promise((resolve, reject) => {
390
- const dialogRef = this.dialog.open(C3PromptDialogComponent, {
391
- width: data.width || '250px',
392
- maxWidth: data.maxWidth || '100vw',
393
- data: {
394
- text: data.text,
395
- defaultValue: data.defaultValue,
396
- placeholder: data.placeholder,
397
- multiline: data.multiline,
398
- validators: data.validators,
399
- required: data.required,
400
- reject: {
401
- color: data.reject && data.reject.color
402
- ? data.reject.color
403
- : undefined,
404
- text: (data.reject && data.reject.text) || 'Annuler',
405
- },
406
- accept: {
407
- color: (data.accept && data.accept.color) || 'primary',
408
- text: (data.accept && data.accept.text) || 'Accepter',
409
- },
410
- },
411
- });
412
- dialogRef.afterClosed().subscribe(async (result) => {
413
- if (result)
414
- resolve(result);
415
- else
416
- resolve(false);
417
- });
418
- });
419
- }
420
- createDialgFromComponent(config) {
421
- return this.dialog.open(C3DialogEmbedChildComponent, config);
422
- }
423
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogService, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Injectable }); }
424
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogService, providedIn: 'root' }); }
425
- }
426
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogService, decorators: [{
427
- type: Injectable,
428
- args: [{
429
- providedIn: 'root',
430
- }]
431
- }], ctorParameters: () => [{ type: i1$2.MatDialog }] });
432
-
433
- class C3DialogModule {
434
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
435
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: C3DialogModule, declarations: [ConfirmDialogComponent,
436
- C3PromptDialogComponent,
437
- C3DialogEmbedChildComponent], imports: [CommonModule,
438
- MatDialogModule,
439
- MatButtonModule,
440
- MatFormFieldModule,
441
- MatInputModule,
442
- FormsModule,
443
- ReactiveFormsModule] }); }
444
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogModule, providers: [C3DialogService], imports: [CommonModule,
445
- MatDialogModule,
446
- MatButtonModule,
447
- MatFormFieldModule,
448
- MatInputModule,
449
- FormsModule,
450
- ReactiveFormsModule] }); }
451
- }
452
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3DialogModule, decorators: [{
453
- type: NgModule,
454
- args: [{
455
- declarations: [
456
- ConfirmDialogComponent,
457
- C3PromptDialogComponent,
458
- C3DialogEmbedChildComponent,
459
- ],
460
- imports: [
461
- CommonModule,
462
- MatDialogModule,
463
- MatButtonModule,
464
- MatFormFieldModule,
465
- MatInputModule,
466
- FormsModule,
467
- ReactiveFormsModule,
468
- ],
469
- providers: [C3DialogService],
470
- }]
471
- }] });
472
-
473
- class FullScreenDirective {
474
- set fullscreenState(value) {
475
- this._fullscreenState.next(value?.valueOf() || false);
476
- }
477
- set fullscreenStateSetter(value) {
478
- this.fullscreenState = value;
479
- }
480
- constructor(el) {
481
- this.el = el;
482
- this._fullscreenState = new BehaviorSubject(false);
483
- this._fullscreenState
484
- .pipe(filter((value) => value !== null), skip(2), debounceTime(100))
485
- .subscribe(() => {
486
- this.defineState();
487
- });
488
- }
489
- defineState() {
490
- if (this._fullscreenState.getValue()) {
491
- const element = this.el.nativeElement;
492
- const requestMethod = element.requestFullscreen ||
493
- element.webkitRequestFullScreen ||
494
- element.mozRequestFullScreen ||
495
- element.msRequestFullScreen;
496
- if (requestMethod) {
497
- // Native full screen.
498
- requestMethod.call(element);
499
- }
500
- else {
501
- console.log('FullScreen Request Method Not Supported on this browser.');
502
- }
503
- }
504
- else {
505
- const element = document;
506
- const requestMethod = element.cancelFullscreen ||
507
- element.webkitExitFullscreen ||
508
- element.webkitCancelFullScreen ||
509
- element.mozCancelFullScreen ||
510
- element.msExitFullScreen;
511
- if (requestMethod) {
512
- // Native Cancel full screen.
513
- requestMethod.call(element);
514
- }
515
- else {
516
- console.log('FullScreen Cancel Request Method Not Supported on this browser.');
517
- }
518
- }
519
- }
520
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: FullScreenDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
521
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "18.0.0", type: FullScreenDirective, selector: "[C3FullScreen], [c3-full-screen]", inputs: { fullscreenState: ["c3Screenfull", "fullscreenState"], fullscreenStateSetter: ["c3-full-screen", "fullscreenStateSetter"] }, ngImport: i0 }); }
522
- }
523
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: FullScreenDirective, decorators: [{
524
- type: Directive,
525
- args: [{
526
- selector: '[C3FullScreen], [c3-full-screen]',
527
- }]
528
- }], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { fullscreenState: [{
529
- type: Input,
530
- args: ['c3Screenfull']
531
- }], fullscreenStateSetter: [{
532
- type: Input,
533
- args: ['c3-full-screen']
534
- }] } });
535
-
536
- class C3FileViewerActionsComponent {
537
- get config() {
538
- return this.fileViewer.config;
539
- }
540
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
541
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3FileViewerActionsComponent, selector: "c3-file-viewer-actions", inputs: { fileViewer: "fileViewer" }, ngImport: i0, template: "<div class=\"nav-button-container\">\n <button\n *ngIf=\"config.btnShow?.prev\"\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.previousImage($event)\"\n [disabled]=\"fileViewer.currentIndex === 0\"\n >\n <span\n *ngIf=\"config.btnIcons?.prev?.classes\"\n [class]=\"config.btnIcons?.prev?.classes\"\n ></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.prev?.text\"\n (click)=\"fileViewer.previousImage($event)\"\n >\n <span [class]=\"config.btnSubClass\">{{ config.btnIcons?.prev?.text }}</span>\n </a>\n <button\n *ngIf=\"config.btnShow?.next\"\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.nextImage($event)\"\n [disabled]=\"fileViewer.currentIndex === fileViewer.files.length - 1\"\n >\n <span\n *ngIf=\"config.btnIcons?.next?.classes\"\n [class]=\"config.btnIcons?.next?.classes\"\n ></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.next?.text\"\n (click)=\"fileViewer.nextImage($event)\"\n >\n <span [class]=\"config.btnSubClass\">{{ config.btnIcons?.next?.text }}</span>\n </a>\n</div>\n\n<!-- Button Container -->\n<div\n class=\"btn-container\"\n [class]=\"config.btnContainerClass\"\n *ngIf=\"fileViewer.currentFile.type.startsWith('image')\"\n>\n <!-- Rotate Counter Clockwise -->\n <ng-container *ngIf=\"config.btnShow?.rotateCounterClockwise\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.rotateCounterClockwise()\"\n *ngIf=\"config.btnIcons?.rotateCounterClockwise?.classes\"\n >\n <span [class]=\"config.btnIcons?.rotateCounterClockwise?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.rotateCounterClockwise?.text\"\n (click)=\"fileViewer.rotateCounterClockwise()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.rotateCounterClockwise?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Rotate Clockwise -->\n <ng-container *ngIf=\"config.btnShow?.rotateClockwise\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.rotateClockwise()\"\n *ngIf=\"config.btnIcons?.rotateClockwise?.classes\"\n >\n <span [class]=\"config.btnIcons?.rotateClockwise?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.rotateClockwise?.text\"\n (click)=\"fileViewer.rotateClockwise()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.rotateClockwise?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Zoom Out -->\n <ng-container *ngIf=\"config.btnShow?.zoomOut\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.zoomOut()\"\n *ngIf=\"config.btnIcons?.zoomOut?.classes\"\n >\n <span [class]=\"config.btnIcons?.zoomOut?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.zoomOut?.text\"\n (click)=\"fileViewer.zoomOut()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.zoomOut?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Zoom In -->\n <ng-container *ngIf=\"config.btnShow?.zoomIn\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.zoomIn()\"\n *ngIf=\"config.btnIcons?.zoomIn?.classes\"\n >\n <span [class]=\"config.btnIcons?.zoomIn?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.zoomIn?.text\"\n (click)=\"fileViewer.zoomIn()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.zoomIn?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Fullscreen -->\n <ng-container *ngIf=\"config.allowFullscreen\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.toggleFullscreen()\"\n *ngIf=\"config.btnIcons?.fullscreen?.classes\"\n >\n <span [class]=\"config.btnIcons?.fullscreen?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.fullscreen?.text\"\n (click)=\"fileViewer.toggleFullscreen()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.fullscreen?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Reset -->\n <ng-container *ngIf=\"config.btnShow?.reset\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.reset()\"\n *ngIf=\"config.btnIcons?.reset?.classes\"\n >\n <span [class]=\"config.btnIcons?.reset?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.reset?.text\"\n (click)=\"fileViewer.reset()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.reset?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Custom Buttons -->\n <ng-container *ngFor=\"let cBtn of config.customBtns\">\n <button *ngIf=\"cBtn.icon.classes\" type=\"button\" [class]=\"config.btnClass\">\n <span *ngIf=\"cBtn.icon.classes\" [class]=\"cBtn.icon.classes\"></span>\n </button>\n <ng-container *ngIf=\"cBtn.icon.text\">\n <a [class]=\"config.btnClass\" *ngIf=\"cBtn.icon.text\">\n <span [class]=\"config.btnSubClass\">{{ cBtn.icon.text }}</span>\n </a>\n </ng-container>\n </ng-container>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] }); }
542
- }
543
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerActionsComponent, decorators: [{
544
- type: Component,
545
- args: [{ selector: 'c3-file-viewer-actions', template: "<div class=\"nav-button-container\">\n <button\n *ngIf=\"config.btnShow?.prev\"\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.previousImage($event)\"\n [disabled]=\"fileViewer.currentIndex === 0\"\n >\n <span\n *ngIf=\"config.btnIcons?.prev?.classes\"\n [class]=\"config.btnIcons?.prev?.classes\"\n ></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.prev?.text\"\n (click)=\"fileViewer.previousImage($event)\"\n >\n <span [class]=\"config.btnSubClass\">{{ config.btnIcons?.prev?.text }}</span>\n </a>\n <button\n *ngIf=\"config.btnShow?.next\"\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.nextImage($event)\"\n [disabled]=\"fileViewer.currentIndex === fileViewer.files.length - 1\"\n >\n <span\n *ngIf=\"config.btnIcons?.next?.classes\"\n [class]=\"config.btnIcons?.next?.classes\"\n ></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.next?.text\"\n (click)=\"fileViewer.nextImage($event)\"\n >\n <span [class]=\"config.btnSubClass\">{{ config.btnIcons?.next?.text }}</span>\n </a>\n</div>\n\n<!-- Button Container -->\n<div\n class=\"btn-container\"\n [class]=\"config.btnContainerClass\"\n *ngIf=\"fileViewer.currentFile.type.startsWith('image')\"\n>\n <!-- Rotate Counter Clockwise -->\n <ng-container *ngIf=\"config.btnShow?.rotateCounterClockwise\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.rotateCounterClockwise()\"\n *ngIf=\"config.btnIcons?.rotateCounterClockwise?.classes\"\n >\n <span [class]=\"config.btnIcons?.rotateCounterClockwise?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.rotateCounterClockwise?.text\"\n (click)=\"fileViewer.rotateCounterClockwise()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.rotateCounterClockwise?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Rotate Clockwise -->\n <ng-container *ngIf=\"config.btnShow?.rotateClockwise\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.rotateClockwise()\"\n *ngIf=\"config.btnIcons?.rotateClockwise?.classes\"\n >\n <span [class]=\"config.btnIcons?.rotateClockwise?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.rotateClockwise?.text\"\n (click)=\"fileViewer.rotateClockwise()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.rotateClockwise?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Zoom Out -->\n <ng-container *ngIf=\"config.btnShow?.zoomOut\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.zoomOut()\"\n *ngIf=\"config.btnIcons?.zoomOut?.classes\"\n >\n <span [class]=\"config.btnIcons?.zoomOut?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.zoomOut?.text\"\n (click)=\"fileViewer.zoomOut()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.zoomOut?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Zoom In -->\n <ng-container *ngIf=\"config.btnShow?.zoomIn\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.zoomIn()\"\n *ngIf=\"config.btnIcons?.zoomIn?.classes\"\n >\n <span [class]=\"config.btnIcons?.zoomIn?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.zoomIn?.text\"\n (click)=\"fileViewer.zoomIn()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.zoomIn?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Fullscreen -->\n <ng-container *ngIf=\"config.allowFullscreen\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.toggleFullscreen()\"\n *ngIf=\"config.btnIcons?.fullscreen?.classes\"\n >\n <span [class]=\"config.btnIcons?.fullscreen?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.fullscreen?.text\"\n (click)=\"fileViewer.toggleFullscreen()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.fullscreen?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Reset -->\n <ng-container *ngIf=\"config.btnShow?.reset\">\n <button\n type=\"button\"\n [class]=\"config.btnClass\"\n (click)=\"fileViewer.reset()\"\n *ngIf=\"config.btnIcons?.reset?.classes\"\n >\n <span [class]=\"config.btnIcons?.reset?.classes\"></span>\n </button>\n <a\n [class]=\"config.btnClass\"\n *ngIf=\"config.btnIcons?.reset?.text\"\n (click)=\"fileViewer.reset()\"\n >\n <span [class]=\"config.btnSubClass\">{{\n config.btnIcons?.reset?.text\n }}</span>\n </a>\n </ng-container>\n\n <!-- Custom Buttons -->\n <ng-container *ngFor=\"let cBtn of config.customBtns\">\n <button *ngIf=\"cBtn.icon.classes\" type=\"button\" [class]=\"config.btnClass\">\n <span *ngIf=\"cBtn.icon.classes\" [class]=\"cBtn.icon.classes\"></span>\n </button>\n <ng-container *ngIf=\"cBtn.icon.text\">\n <a [class]=\"config.btnClass\" *ngIf=\"cBtn.icon.text\">\n <span [class]=\"config.btnSubClass\">{{ cBtn.icon.text }}</span>\n </a>\n </ng-container>\n </ng-container>\n</div>\n" }]
546
- }], propDecorators: { fileViewer: [{
547
- type: Input
548
- }] } });
549
-
550
- class C3SafeUrlPipe {
551
- constructor(sanitizer) {
552
- this.sanitizer = sanitizer;
553
- }
554
- transform(url) {
555
- return url ? this.sanitizer.bypassSecurityTrustResourceUrl(url) : '';
556
- }
557
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3SafeUrlPipe, deps: [{ token: i1$3.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe }); }
558
- static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: C3SafeUrlPipe, isStandalone: true, name: "c3SafeUrl" }); }
559
- }
560
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3SafeUrlPipe, decorators: [{
561
- type: Pipe,
562
- args: [{
563
- name: 'c3SafeUrl',
564
- standalone: true,
565
- }]
566
- }], ctorParameters: () => [{ type: i1$3.DomSanitizer }] });
567
-
568
- class C3FileViewerImageComponent {
569
- constructor() {
570
- this.dragstart = new EventEmitter();
571
- }
572
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerImageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
573
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3FileViewerImageComponent, selector: "c3-file-viewer-image, [c3-file-viewer-image]", inputs: { fileViewer: "fileViewer" }, outputs: { dragstart: "dragstart" }, ngImport: i0, template: "<img\n *ngIf=\"fileViewer.currentFile.objectUrl\"\n [src]=\"fileViewer.currentFile.objectUrl | async | c3SafeUrl\"\n [ngStyle]=\"fileViewer.style\"\n alt=\"Image not found...\"\n (dragstart)=\"dragstart.emit($event)\"\n/>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: C3SafeUrlPipe, name: "c3SafeUrl" }] }); }
574
- }
575
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerImageComponent, decorators: [{
576
- type: Component,
577
- args: [{ selector: 'c3-file-viewer-image, [c3-file-viewer-image]', template: "<img\n *ngIf=\"fileViewer.currentFile.objectUrl\"\n [src]=\"fileViewer.currentFile.objectUrl | async | c3SafeUrl\"\n [ngStyle]=\"fileViewer.style\"\n alt=\"Image not found...\"\n (dragstart)=\"dragstart.emit($event)\"\n/>\n" }]
578
- }], propDecorators: { fileViewer: [{
579
- type: Input
580
- }], dragstart: [{
581
- type: Output
582
- }] } });
583
-
584
- class C3FileViewerPdfComponent {
585
- constructor() {
586
- this.dragstart = new EventEmitter();
587
- }
588
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerPdfComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
589
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3FileViewerPdfComponent, selector: "c3-file-viewer-pdf", inputs: { fileViewer: "fileViewer" }, outputs: { dragstart: "dragstart" }, host: { styleAttribute: "display: block", classAttribute: "c3-file-viewer-pdf" }, ngImport: i0, template: "<!-- pdf viewer -->\n<embed\n type=\"application/pdf\"\n [src]=\"fileViewer.currentFile.objectUrl | async | c3SafeUrl\"\n [style.height]=\"'100%'\"\n [style.width]=\"'100%'\"\n/>\n", dependencies: [{ kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: C3SafeUrlPipe, name: "c3SafeUrl" }], encapsulation: i0.ViewEncapsulation.None }); }
590
- }
591
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerPdfComponent, decorators: [{
592
- type: Component,
593
- args: [{ selector: 'c3-file-viewer-pdf', encapsulation: ViewEncapsulation.None, host: {
594
- style: 'display: block',
595
- class: 'c3-file-viewer-pdf',
596
- }, template: "<!-- pdf viewer -->\n<embed\n type=\"application/pdf\"\n [src]=\"fileViewer.currentFile.objectUrl | async | c3SafeUrl\"\n [style.height]=\"'100%'\"\n [style.width]=\"'100%'\"\n/>\n" }]
597
- }], propDecorators: { fileViewer: [{
598
- type: Input
599
- }], dragstart: [{
600
- type: Output
601
- }] } });
602
-
603
- class C3FileViewerVideoComponent {
604
- set _srcUpdated({ location }) {
605
- this.src$.next(location);
606
- }
607
- constructor() {
608
- this.src = '';
609
- this.src$ = new Subject();
610
- this.src$
611
- .pipe(mergeMap((src) => this.fileViewer.getFile(src)), filter((blob) => blob.type.startsWith('application/pdf')), tap((blob) => (this.src = URL.createObjectURL(blob))))
612
- .subscribe({
613
- next: () => null,
614
- error: (error) => {
615
- console.log(error);
616
- },
617
- });
618
- }
619
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerVideoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
620
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3FileViewerVideoComponent, selector: "c3-file-viewer-video", inputs: { _srcUpdated: ["file", "_srcUpdated"], fileViewer: "fileViewer" }, ngImport: i0, template: "<video controls [src]=\"src\" crossorigin=\"*\"></video>\n" }); }
621
- }
622
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerVideoComponent, decorators: [{
623
- type: Component,
624
- args: [{ selector: 'c3-file-viewer-video', template: "<video controls [src]=\"src\" crossorigin=\"*\"></video>\n" }]
625
- }], ctorParameters: () => [], propDecorators: { _srcUpdated: [{
626
- type: Input,
627
- args: ['file']
628
- }], fileViewer: [{
629
- type: Input
630
- }] } });
631
-
632
- class C3FileViewerComponent {
633
- constructor(moduleConfig, _http) {
634
- this.moduleConfig = moduleConfig;
635
- this._http = _http;
636
- this.indexChange = new EventEmitter();
637
- this.configChange = new EventEmitter();
638
- this.customFileEvent = new EventEmitter();
639
- }
640
- ngOnInit() {
641
- this.defineStyleHeight();
642
- this.fileViewer.customFile$.subscribe((event) => {
643
- this.customFileEvent.emit(event);
644
- });
645
- this.fileViewer.index$.subscribe((index) => {
646
- this.indexChange.emit(index);
647
- });
648
- this.fileViewer.config$.subscribe((config) => {
649
- this.configChange.emit(config);
650
- });
651
- }
652
- onMouseOver() {
653
- this.fileViewer.hovered = true;
654
- }
655
- onMouseLeave() {
656
- this.fileViewer.hovered = false;
657
- }
658
- ngOnChanges(changes) {
659
- if (changes['screenHeightOccupied'] && this.fileViewer)
660
- this.defineStyleHeight();
661
- }
662
- next(event) {
663
- this.fileViewer.nextImage(event);
664
- }
665
- previous(event) {
666
- this.fileViewer.previousImage(event);
667
- }
668
- defineStyleHeight() {
669
- this.fileViewer.styleHeight =
670
- 'calc(100% - ' + this.screenHeightOccupied + 'px)';
671
- }
672
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerComponent, deps: [{ token: 'config', optional: true }, { token: i1$4.HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
673
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3FileViewerComponent, selector: "c3-file-viewer", inputs: { screenHeightOccupied: "screenHeightOccupied", fileViewer: "fileViewer" }, outputs: { indexChange: "indexChange", configChange: "configChange", customFileEvent: "customFileEvent" }, host: { listeners: { "mouseover": "onMouseOver()", "mouseleave": "onMouseLeave()", "window:keyup.ArrowRight": "next($event)", "window:keyup.ArrowLeft": "previous($event)" }, classAttribute: "c3-file-viewer" }, usesOnChanges: true, ngImport: i0, template: "<div\n class=\"container\"\n *ngIf=\"fileViewer\"\n [c3-full-screen]=\"fileViewer.fullscreen$ | async\"\n [style.height]=\"fileViewer.styleHeight\"\n [style.backgroundColor]=\"fileViewer.config.containerBackgroundColor\"\n (wheel)=\"fileViewer.scrollZoom($event)\"\n (dragover)=\"fileViewer.onDragOver($event)\"\n>\n <c3-file-viewer-image\n *ngIf=\"fileViewer.currentFile.type.startsWith('image')\"\n [fileViewer]=\"fileViewer\"\n [style]=\"fileViewer.style\"\n (dragstart)=\"fileViewer.onDragStart($event)\"\n />\n\n <c3-file-viewer-video\n *ngIf=\"fileViewer.currentFile.type.startsWith('video')\"\n />\n\n <c3-file-viewer-pdf\n *ngIf=\"fileViewer.currentFile.type.startsWith('application/pdf')\"\n [fileViewer]=\"fileViewer\"\n />\n <!-- Div below will be used to hide the 'ghost' image when dragging -->\n <div></div>\n <div class=\"spinner-container\" *ngIf=\"fileViewer.loading\">\n <div class=\"spinner\"></div>\n </div>\n\n <c3-file-viewer-actions [fileViewer]=\"fileViewer\" />\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: FullScreenDirective, selector: "[C3FullScreen], [c3-full-screen]", inputs: ["c3Screenfull", "c3-full-screen"] }, { kind: "component", type: C3FileViewerActionsComponent, selector: "c3-file-viewer-actions", inputs: ["fileViewer"] }, { kind: "component", type: C3FileViewerImageComponent, selector: "c3-file-viewer-image, [c3-file-viewer-image]", inputs: ["fileViewer"], outputs: ["dragstart"] }, { kind: "component", type: C3FileViewerPdfComponent, selector: "c3-file-viewer-pdf", inputs: ["fileViewer"], outputs: ["dragstart"] }, { kind: "component", type: C3FileViewerVideoComponent, selector: "c3-file-viewer-video", inputs: ["file", "fileViewer"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], encapsulation: i0.ViewEncapsulation.None }); }
674
- }
675
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerComponent, decorators: [{
676
- type: Component,
677
- args: [{ selector: 'c3-file-viewer', encapsulation: ViewEncapsulation.None, host: {
678
- class: 'c3-file-viewer',
679
- }, template: "<div\n class=\"container\"\n *ngIf=\"fileViewer\"\n [c3-full-screen]=\"fileViewer.fullscreen$ | async\"\n [style.height]=\"fileViewer.styleHeight\"\n [style.backgroundColor]=\"fileViewer.config.containerBackgroundColor\"\n (wheel)=\"fileViewer.scrollZoom($event)\"\n (dragover)=\"fileViewer.onDragOver($event)\"\n>\n <c3-file-viewer-image\n *ngIf=\"fileViewer.currentFile.type.startsWith('image')\"\n [fileViewer]=\"fileViewer\"\n [style]=\"fileViewer.style\"\n (dragstart)=\"fileViewer.onDragStart($event)\"\n />\n\n <c3-file-viewer-video\n *ngIf=\"fileViewer.currentFile.type.startsWith('video')\"\n />\n\n <c3-file-viewer-pdf\n *ngIf=\"fileViewer.currentFile.type.startsWith('application/pdf')\"\n [fileViewer]=\"fileViewer\"\n />\n <!-- Div below will be used to hide the 'ghost' image when dragging -->\n <div></div>\n <div class=\"spinner-container\" *ngIf=\"fileViewer.loading\">\n <div class=\"spinner\"></div>\n </div>\n\n <c3-file-viewer-actions [fileViewer]=\"fileViewer\" />\n</div>\n" }]
680
- }], ctorParameters: () => [{ type: undefined, decorators: [{
681
- type: Optional
682
- }, {
683
- type: Inject,
684
- args: ['config']
685
- }] }, { type: i1$4.HttpClient }], propDecorators: { screenHeightOccupied: [{
686
- type: Input
687
- }], fileViewer: [{
688
- type: Input
689
- }], indexChange: [{
690
- type: Output
691
- }], configChange: [{
692
- type: Output
693
- }], customFileEvent: [{
694
- type: Output
695
- }], onMouseOver: [{
696
- type: HostListener,
697
- args: ['mouseover']
698
- }], onMouseLeave: [{
699
- type: HostListener,
700
- args: ['mouseleave']
701
- }], next: [{
702
- type: HostListener,
703
- args: ['window:keyup.ArrowRight', ['$event']]
704
- }], previous: [{
705
- type: HostListener,
706
- args: ['window:keyup.ArrowLeft', ['$event']]
707
- }] } });
708
-
709
- const DEFAULT_CONFIG = {
710
- btnContainerClass: 'btn-container',
711
- btnClass: 'default',
712
- btnSubClass: 'material-icons',
713
- zoomFactor: 0.1,
714
- containerBackgroundColor: '#00000000',
715
- wheelZoom: false,
716
- allowFullscreen: true,
717
- allowKeyboardNavigation: true,
718
- btnShow: {
719
- zoomIn: true,
720
- zoomOut: true,
721
- rotateClockwise: true,
722
- rotateCounterClockwise: true,
723
- next: true,
724
- prev: true,
725
- reset: true,
726
- },
727
- btnIcons: {
728
- zoomIn: {
729
- text: 'zoom_in',
730
- },
731
- zoomOut: {
732
- text: 'zoom_out',
733
- },
734
- rotateClockwise: {
735
- text: 'rotate_right',
736
- },
737
- rotateCounterClockwise: {
738
- text: 'rotate_left',
739
- },
740
- fullscreen: {
741
- text: 'fullscreen',
742
- },
743
- reset: {
744
- text: 'restore',
745
- },
746
- },
747
- };
748
-
749
- class CustomFileEvent {
750
- constructor(name, fileUrl) {
751
- this.name = name;
752
- this.fileUrl = fileUrl;
753
- }
754
- }
755
-
756
- class C3FileViewer {
757
- get config() {
758
- return this._config;
759
- }
760
- set config(value) {
761
- this._config = this.mergeConfig(DEFAULT_CONFIG, value);
762
- this.config$.next(this._config);
763
- }
764
- get currentFile() {
765
- return this.filesObjectUrl[this.currentIndex];
766
- }
767
- set files(value) {
768
- this._files = value;
769
- this.currentIndex = 0;
770
- this.index$.next(this.currentIndex);
771
- this.filesObjectUrl = value.map((file) => {
772
- return {
773
- ...file,
774
- objectUrl: file.objectUrl || this.createObjectURL(file),
775
- };
776
- });
777
- }
778
- get files() {
779
- return this._files;
780
- }
781
- constructor({ config, files, }) {
782
- this._config = DEFAULT_CONFIG;
783
- this.config$ = new BehaviorSubject(DEFAULT_CONFIG);
784
- this.fullscreen$ = new BehaviorSubject(false);
785
- this.customFile$ = new BehaviorSubject(null);
786
- this.index$ = new BehaviorSubject(0);
787
- this.loading = true;
788
- this.currentIndex = 0;
789
- this.style = {
790
- transform: '',
791
- msTransform: '',
792
- oTransform: '',
793
- webkitTransform: '',
794
- minHeight: 'auto',
795
- maxHeight: 'auto',
796
- height: 'auto',
797
- minWidth: 'auto',
798
- maxWidth: 'auto',
799
- width: 'auto',
800
- };
801
- this.styleHeight = '100%';
802
- this.hovered = false;
803
- this._files = [];
804
- this.filesObjectUrl = [];
805
- this.scale = 1;
806
- this.rotation = 0;
807
- this.translateX = 0;
808
- this.translateY = 0;
809
- this.prevX = 0;
810
- this.prevY = 0;
811
- if (config)
812
- this.config = config;
813
- if (files)
814
- this.files = files;
815
- this.config$.subscribe((config) => {
816
- const { minHeight, maxHeight, minWidth, maxWidth, height, width } = config;
817
- this.style.minHeight = this.valueToCss(minHeight);
818
- this.style.height = this.valueToCss(height);
819
- this.style.width = this.valueToCss(width);
820
- this.style.maxHeight = this.valueToCss(maxHeight);
821
- this.style.minWidth = this.valueToCss(minWidth);
822
- this.style.maxWidth = this.valueToCss(maxWidth);
823
- this.styleHeight = this.valueToCss(height);
824
- this.updateStyle();
825
- });
826
- }
827
- createObjectURL(file) {
828
- this.onLoadStart(file);
829
- return this.getFile(file.location).pipe(map((response) => URL.createObjectURL(response)), tap(() => this.onLoad(file)));
830
- }
831
- getFile(location) {
832
- const client = this.config.customClient ||
833
- inject(HttpClient).get.bind(inject(HttpClient));
834
- if (!client) {
835
- throw new Error('No http client provided. Please provide a custom client or import HttpClientModule');
836
- }
837
- return client(location, {
838
- responseType: 'blob',
839
- });
840
- }
841
- previousImage(event) {
842
- if (this.canNavigate(event)) {
843
- this.loading = true;
844
- if (this.currentIndex > 0)
845
- this.currentIndex--;
846
- else
847
- this.currentIndex = this.files.length - 1;
848
- this.index$.next(this.currentIndex);
849
- this.reset();
850
- }
851
- }
852
- nextImage(event) {
853
- if (this.canNavigate(event)) {
854
- this.loading = true;
855
- if (this.currentIndex < this.files.length - 1)
856
- this.currentIndex++;
857
- else
858
- this.currentIndex = 0;
859
- this.index$.next(this.currentIndex);
860
- this.reset();
861
- }
862
- }
863
- zoomIn() {
864
- this.scale *= 1 + (this.config.zoomFactor || 0);
865
- this.updateStyle();
866
- }
867
- zoomOut() {
868
- if (this.scale > (this.config.zoomFactor || 0)) {
869
- this.scale /= 1 + (this.config.zoomFactor || 0);
870
- }
871
- this.updateStyle();
872
- }
873
- scrollZoom(evt) {
874
- if (this.config.wheelZoom) {
875
- evt.deltaY > 0 ? this.zoomOut() : this.zoomIn();
876
- return false;
877
- }
878
- else {
879
- return true;
880
- }
881
- }
882
- rotateClockwise() {
883
- this.rotation += 90;
884
- this.updateStyle();
885
- }
886
- rotateCounterClockwise() {
887
- this.rotation -= 90;
888
- this.updateStyle();
889
- }
890
- onLoad(file) {
891
- this.loading = false;
892
- }
893
- onLoadStart(file) {
894
- this.loading = true;
895
- }
896
- imageNotFound(file) {
897
- this.loading = false;
898
- this.customFile$.next(new CustomFileEvent('imageNotFound', file.location));
899
- }
900
- onDragOver(evt) {
901
- this.translateX += evt.clientX - this.prevX;
902
- this.translateY += evt.clientY - this.prevY;
903
- this.prevX = evt.clientX;
904
- this.prevY = evt.clientY;
905
- this.updateStyle();
906
- }
907
- onDragStart(evt) {
908
- if (evt.target && evt.dataTransfer && evt.dataTransfer.setDragImage) {
909
- const target = evt.target;
910
- const nextElementSibling = target.nextElementSibling;
911
- if (nextElementSibling)
912
- evt.dataTransfer.setDragImage(nextElementSibling, 0, 0);
913
- }
914
- this.prevX = evt.clientX;
915
- this.prevY = evt.clientY;
916
- }
917
- toggleFullscreen() {
918
- const fullScreenValue = this.fullscreen$.getValue();
919
- this.fullscreen$.next(!fullScreenValue);
920
- if (fullScreenValue)
921
- this.reset();
922
- }
923
- reset() {
924
- this.scale = 1;
925
- this.rotation = 0;
926
- this.translateX = 0;
927
- this.translateY = 0;
928
- this.updateStyle();
929
- }
930
- canNavigate(event) {
931
- return (event == null || (this.config.allowKeyboardNavigation && this.hovered));
932
- }
933
- updateStyle() {
934
- this.style.transform = `translate(${this.translateX}px, ${this.translateY}px) rotate(${this.rotation}deg) scale(${this.scale})`;
935
- this.style.msTransform = this.style.transform;
936
- this.style.webkitTransform = this.style.transform;
937
- this.style.oTransform = this.style.transform;
938
- }
939
- valueToCss(value) {
940
- return value ? (typeof value === 'string' ? value : value + 'px') : 'auto';
941
- }
942
- mergeConfig(defaultValues, overrideValues) {
943
- let result = { ...defaultValues };
944
- if (overrideValues) {
945
- result = { ...defaultValues, ...overrideValues };
946
- if (overrideValues.btnIcons) {
947
- result.btnIcons = {
948
- ...defaultValues.btnIcons,
949
- ...overrideValues.btnIcons,
950
- };
951
- }
952
- }
953
- return result;
954
- }
955
- }
956
-
957
- class C3FileViewerDialog {
958
- constructor(fileViewer) {
959
- this.fileViewer = fileViewer;
960
- }
961
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerDialog, deps: [{ token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component }); }
962
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3FileViewerDialog, selector: "ng-component", ngImport: i0, template: `
963
- <c3-file-viewer [fileViewer]="fileViewer" [screenHeightOccupied]="0" />
964
- `, isInline: true, dependencies: [{ kind: "component", type: C3FileViewerComponent, selector: "c3-file-viewer", inputs: ["screenHeightOccupied", "fileViewer"], outputs: ["indexChange", "configChange", "customFileEvent"] }] }); }
965
- }
966
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerDialog, decorators: [{
967
- type: Component,
968
- args: [{
969
- template: `
970
- <c3-file-viewer [fileViewer]="fileViewer" [screenHeightOccupied]="0" />
971
- `,
972
- }]
973
- }], ctorParameters: () => [{ type: C3FileViewer, decorators: [{
974
- type: Inject,
975
- args: [MAT_DIALOG_DATA]
976
- }] }] });
977
-
978
- class C3FileViewerDialogComponent {
979
- constructor(_dialog) {
980
- this._dialog = _dialog;
981
- this.dialogConfig = {
982
- panelClass: 'c3-file-viewer-dialog',
983
- width: '80%',
984
- height: '80%',
985
- };
986
- }
987
- openDialog() {
988
- this._dialog.open(C3FileViewerDialog, {
989
- data: this.fileViewer,
990
- ...this.dialogConfig,
991
- });
992
- }
993
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerDialogComponent, deps: [{ token: i1$2.MatDialog }], target: i0.ɵɵFactoryTarget.Component }); }
994
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.0.0", type: C3FileViewerDialogComponent, selector: "c3-file-viewer-dialog", inputs: { fileViewer: "fileViewer", dialogConfig: "dialogConfig" }, host: { listeners: { "click": "openDialog()" }, classAttribute: "c3-file-viewer-dialog" }, ngImport: i0, template: ` <ng-content /> `, isInline: true }); }
995
- }
996
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerDialogComponent, decorators: [{
997
- type: Component,
998
- args: [{
999
- selector: 'c3-file-viewer-dialog',
1000
- template: ` <ng-content /> `,
1001
- host: {
1002
- class: 'c3-file-viewer-dialog',
1003
- },
1004
- }]
1005
- }], ctorParameters: () => [{ type: i1$2.MatDialog }], propDecorators: { fileViewer: [{
1006
- type: Input
1007
- }], dialogConfig: [{
1008
- type: Input
1009
- }], openDialog: [{
1010
- type: HostListener,
1011
- args: ['click']
1012
- }] } });
1013
-
1014
- class C3FileViewerModule {
1015
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
1016
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerModule, declarations: [FullScreenDirective,
1017
- C3FileViewerComponent,
1018
- C3FileViewerActionsComponent,
1019
- C3FileViewerImageComponent,
1020
- C3FileViewerPdfComponent,
1021
- C3FileViewerVideoComponent,
1022
- C3FileViewerDialogComponent,
1023
- C3FileViewerDialog], imports: [CommonModule, C3SafeUrlPipe, MatDialogModule], exports: [FullScreenDirective,
1024
- C3FileViewerComponent,
1025
- C3FileViewerDialogComponent] }); }
1026
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerModule, providers: [provideHttpClient(withInterceptorsFromDi())], imports: [CommonModule, MatDialogModule] }); }
1027
- }
1028
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.0", ngImport: i0, type: C3FileViewerModule, decorators: [{
1029
- type: NgModule,
1030
- args: [{ declarations: [
1031
- FullScreenDirective,
1032
- C3FileViewerComponent,
1033
- C3FileViewerActionsComponent,
1034
- C3FileViewerImageComponent,
1035
- C3FileViewerPdfComponent,
1036
- C3FileViewerVideoComponent,
1037
- C3FileViewerDialogComponent,
1038
- C3FileViewerDialog,
1039
- ],
1040
- exports: [
1041
- FullScreenDirective,
1042
- C3FileViewerComponent,
1043
- C3FileViewerDialogComponent,
1044
- ], imports: [CommonModule, C3SafeUrlPipe, MatDialogModule], providers: [provideHttpClient(withInterceptorsFromDi())] }]
1045
- }] });
1046
-
1047
- /*
1048
- * Public API Surface of c3-components
1049
- */
1050
-
1051
- /**
1052
- * Generated bundle index. Do not edit.
1053
- */
1054
-
1055
- export { C3DialogEmbedChildComponent, C3DialogModule, C3DialogService, C3DropdownComponent, C3DropdownModule, C3DropdownTrigger, C3FileViewer, C3FileViewerComponent, C3FileViewerDialog, C3FileViewerDialogComponent, C3FileViewerModule, C3PromptDialogComponent, C3SafeUrlPipe, ConfirmDialogComponent, CustomFileEvent, FullScreenDirective, MAT_DROPDOWN_VALUE_ACCESSOR };
1056
- //# sourceMappingURL=c3-components.mjs.map