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