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