ngx-sfc-common 0.0.1
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/README.md +460 -0
- package/esm2020/lib/components/button/button-type.enum.mjs +9 -0
- package/esm2020/lib/components/button/button.component.mjs +38 -0
- package/esm2020/lib/components/checkmark/checkmark.component.mjs +27 -0
- package/esm2020/lib/components/delimeter/delimeter.component.mjs +11 -0
- package/esm2020/lib/components/dots/dots.component.mjs +30 -0
- package/esm2020/lib/components/hamburger/hamburger.component.mjs +24 -0
- package/esm2020/lib/components/index.mjs +20 -0
- package/esm2020/lib/components/loader/bounce/bounce-loader.component.mjs +13 -0
- package/esm2020/lib/components/loader/circle/circle-loader-type.enum.mjs +6 -0
- package/esm2020/lib/components/loader/circle/circle-loader.component.mjs +20 -0
- package/esm2020/lib/components/loader/loader-base.component.mjs +51 -0
- package/esm2020/lib/components/loader/loader.constants.mjs +6 -0
- package/esm2020/lib/components/loader/loader.event.mjs +2 -0
- package/esm2020/lib/components/loader/service/loader.service.mjs +76 -0
- package/esm2020/lib/components/modal/directive/modal-open-on-click.directive.mjs +50 -0
- package/esm2020/lib/components/modal/footer/default/default-modal-footer.component.mjs +48 -0
- package/esm2020/lib/components/modal/footer/default/default-modal-footer.model.mjs +2 -0
- package/esm2020/lib/components/modal/header/default/default-modal-header.component.mjs +31 -0
- package/esm2020/lib/components/modal/header/default/default-modal-header.model.mjs +2 -0
- package/esm2020/lib/components/modal/modal-template.enum.mjs +7 -0
- package/esm2020/lib/components/modal/modal.component.mjs +107 -0
- package/esm2020/lib/components/modal/service/modal.service.mjs +26 -0
- package/esm2020/lib/components/toggle-switcher/toggle-switcher.component.mjs +31 -0
- package/esm2020/lib/components/toggle-switcher/toggle-switcher.model.mjs +2 -0
- package/esm2020/lib/components/tooltip/tooltip-type.enum.mjs +6 -0
- package/esm2020/lib/components/tooltip/tooltip.component.mjs +69 -0
- package/esm2020/lib/constants/common.constants.mjs +6 -0
- package/esm2020/lib/constants/date-time.constants.mjs +8 -0
- package/esm2020/lib/constants/index.mjs +4 -0
- package/esm2020/lib/constants/ui.constants.mjs +16 -0
- package/esm2020/lib/directives/click-outside/click-outside.directive.mjs +65 -0
- package/esm2020/lib/directives/click-outside/click-outside.event.mjs +2 -0
- package/esm2020/lib/directives/component-size/component-size.directive.mjs +46 -0
- package/esm2020/lib/directives/index.mjs +7 -0
- package/esm2020/lib/directives/mouse-down/mouse-down.directive.mjs +37 -0
- package/esm2020/lib/directives/show-hide-element/show-hide-element.directive.mjs +42 -0
- package/esm2020/lib/directives/template-reference/template-reference.directive.mjs +21 -0
- package/esm2020/lib/directives/throw-element-on-hover/throw-element-on-hover.directive.mjs +38 -0
- package/esm2020/lib/enums/common.enums.mjs +69 -0
- package/esm2020/lib/enums/index.mjs +2 -0
- package/esm2020/lib/ngx-sfc-common.module.mjs +135 -0
- package/esm2020/lib/services/document-ref.service.mjs +70 -0
- package/esm2020/lib/services/index.mjs +4 -0
- package/esm2020/lib/services/resize.service.mjs +42 -0
- package/esm2020/lib/services/window-ref.service.mjs +70 -0
- package/esm2020/lib/utils/collections.utils.mjs +244 -0
- package/esm2020/lib/utils/common.utils.mjs +86 -0
- package/esm2020/lib/utils/date-time.utils.mjs +208 -0
- package/esm2020/lib/utils/file.utils.mjs +52 -0
- package/esm2020/lib/utils/index.mjs +7 -0
- package/esm2020/lib/utils/string.utils.mjs +31 -0
- package/esm2020/lib/utils/ui.utils.mjs +39 -0
- package/esm2020/ngx-sfc-common.mjs +5 -0
- package/esm2020/public-api.mjs +11 -0
- package/fesm2015/ngx-sfc-common.mjs +1908 -0
- package/fesm2015/ngx-sfc-common.mjs.map +1 -0
- package/fesm2020/ngx-sfc-common.mjs +1900 -0
- package/fesm2020/ngx-sfc-common.mjs.map +1 -0
- package/lib/components/button/button-type.enum.d.ts +7 -0
- package/lib/components/button/button.component.d.ts +13 -0
- package/lib/components/checkmark/checkmark.component.d.ts +8 -0
- package/lib/components/delimeter/delimeter.component.d.ts +5 -0
- package/lib/components/dots/dots.component.d.ts +9 -0
- package/lib/components/hamburger/hamburger.component.d.ts +7 -0
- package/lib/components/index.d.ts +21 -0
- package/lib/components/loader/bounce/bounce-loader.component.d.ts +6 -0
- package/lib/components/loader/circle/circle-loader-type.enum.d.ts +4 -0
- package/lib/components/loader/circle/circle-loader.component.d.ts +8 -0
- package/lib/components/loader/loader-base.component.d.ts +27 -0
- package/lib/components/loader/loader.constants.d.ts +5 -0
- package/lib/components/loader/loader.event.d.ts +4 -0
- package/lib/components/loader/service/loader.service.d.ts +33 -0
- package/lib/components/modal/directive/modal-open-on-click.directive.d.ts +17 -0
- package/lib/components/modal/footer/default/default-modal-footer.component.d.ts +19 -0
- package/lib/components/modal/footer/default/default-modal-footer.model.d.ts +6 -0
- package/lib/components/modal/header/default/default-modal-header.component.d.ts +14 -0
- package/lib/components/modal/header/default/default-modal-header.model.d.ts +5 -0
- package/lib/components/modal/modal-template.enum.d.ts +5 -0
- package/lib/components/modal/modal.component.d.ts +25 -0
- package/lib/components/modal/service/modal.service.d.ts +12 -0
- package/lib/components/toggle-switcher/toggle-switcher.component.d.ts +11 -0
- package/lib/components/toggle-switcher/toggle-switcher.model.d.ts +4 -0
- package/lib/components/tooltip/tooltip-type.enum.d.ts +4 -0
- package/lib/components/tooltip/tooltip.component.d.ts +22 -0
- package/lib/constants/common.constants.d.ts +5 -0
- package/lib/constants/date-time.constants.d.ts +7 -0
- package/lib/constants/index.d.ts +3 -0
- package/lib/constants/ui.constants.d.ts +15 -0
- package/lib/directives/click-outside/click-outside.directive.d.ts +23 -0
- package/lib/directives/click-outside/click-outside.event.d.ts +4 -0
- package/lib/directives/component-size/component-size.directive.d.ts +13 -0
- package/lib/directives/index.d.ts +7 -0
- package/lib/directives/mouse-down/mouse-down.directive.d.ts +12 -0
- package/lib/directives/show-hide-element/show-hide-element.directive.d.ts +13 -0
- package/lib/directives/template-reference/template-reference.directive.d.ts +9 -0
- package/lib/directives/throw-element-on-hover/throw-element-on-hover.directive.d.ts +13 -0
- package/lib/enums/common.enums.d.ts +61 -0
- package/lib/enums/index.d.ts +1 -0
- package/lib/ngx-sfc-common.module.d.ts +27 -0
- package/lib/services/document-ref.service.d.ts +43 -0
- package/lib/services/index.d.ts +3 -0
- package/lib/services/resize.service.d.ts +32 -0
- package/lib/services/window-ref.service.d.ts +43 -0
- package/lib/utils/collections.utils.d.ts +135 -0
- package/lib/utils/common.utils.d.ts +50 -0
- package/lib/utils/date-time.utils.d.ts +131 -0
- package/lib/utils/file.utils.d.ts +25 -0
- package/lib/utils/index.d.ts +6 -0
- package/lib/utils/string.utils.d.ts +19 -0
- package/lib/utils/ui.utils.d.ts +24 -0
- package/ngx-sfc-common.d.ts +5 -0
- package/package.json +53 -0
- package/public-api.d.ts +7 -0
|
@@ -0,0 +1,1908 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { InjectionToken, Injectable, PLATFORM_ID, EventEmitter, Directive, Inject, Input, Output, HostListener, Component, HostBinding, ContentChildren, NgModule } from '@angular/core';
|
|
3
|
+
import * as i1$1 from '@angular/common';
|
|
4
|
+
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
5
|
+
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
|
|
6
|
+
import { Subject, fromEvent, Observable, startWith, BehaviorSubject, filter, distinctUntilChanged, map, EMPTY } from 'rxjs';
|
|
7
|
+
import * as i1 from '@angular/platform-browser';
|
|
8
|
+
import { trigger, state, style, transition, group, query, animate, animateChild } from '@angular/animations';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Create a new injection token for injecting the Document into a component.
|
|
12
|
+
*/
|
|
13
|
+
const DOCUMENT = new InjectionToken('DocumentToken');
|
|
14
|
+
/**
|
|
15
|
+
* Define abstract class for obtaining reference to the global Document object.
|
|
16
|
+
*/
|
|
17
|
+
class DocumentRef {
|
|
18
|
+
get nativeDocument() {
|
|
19
|
+
throw new Error('Not implemented.');
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Define class that implements the abstract class and returns the native Document object.
|
|
24
|
+
*/
|
|
25
|
+
class BrowserDocumentRef extends DocumentRef {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* @returns Document object
|
|
31
|
+
*/
|
|
32
|
+
get nativeDocument() {
|
|
33
|
+
return document;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
BrowserDocumentRef.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BrowserDocumentRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
37
|
+
BrowserDocumentRef.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BrowserDocumentRef });
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BrowserDocumentRef, decorators: [{
|
|
39
|
+
type: Injectable
|
|
40
|
+
}], ctorParameters: function () { return []; } });
|
|
41
|
+
/**
|
|
42
|
+
* Create an factory function that returns the native Document object.
|
|
43
|
+
* @param browserDocumentRef Native Document object
|
|
44
|
+
* @param platformId id of platform
|
|
45
|
+
* @returns type of platform of empty object
|
|
46
|
+
*/
|
|
47
|
+
function documentFactory(browserDocumentRef, platformId) {
|
|
48
|
+
if (isPlatformBrowser(platformId)) {
|
|
49
|
+
return browserDocumentRef.nativeDocument;
|
|
50
|
+
}
|
|
51
|
+
const doc = {
|
|
52
|
+
hidden: false,
|
|
53
|
+
visibilityState: 'visible'
|
|
54
|
+
};
|
|
55
|
+
return doc;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Create a injectable provider for the DocumentRef token that uses the BrowserDocumentRef class.
|
|
59
|
+
*/
|
|
60
|
+
const browserDocumentProvider = {
|
|
61
|
+
provide: DocumentRef,
|
|
62
|
+
useClass: BrowserDocumentRef
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Create an injectable provider that uses the DocumentFactory function for returning the native Document object.
|
|
66
|
+
*/
|
|
67
|
+
const documentProvider = {
|
|
68
|
+
provide: DOCUMENT,
|
|
69
|
+
useFactory: documentFactory,
|
|
70
|
+
deps: [DocumentRef, PLATFORM_ID]
|
|
71
|
+
};
|
|
72
|
+
/**
|
|
73
|
+
* Create an array of providers.
|
|
74
|
+
*/
|
|
75
|
+
const DOCUMENT_PROVIDERS = [browserDocumentProvider, documentProvider];
|
|
76
|
+
|
|
77
|
+
/**
|
|
78
|
+
* Create a new injection token for injecting the window into a component.
|
|
79
|
+
*/
|
|
80
|
+
const WINDOW = new InjectionToken('WindowToken');
|
|
81
|
+
/**
|
|
82
|
+
* Define abstract class for obtaining reference to the global window object.
|
|
83
|
+
*/
|
|
84
|
+
class WindowRef {
|
|
85
|
+
get nativeWindow() {
|
|
86
|
+
throw new Error('Not implemented.');
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Define class that implements the abstract class and returns the native window object.
|
|
91
|
+
*/
|
|
92
|
+
class BrowserWindowRef extends WindowRef {
|
|
93
|
+
constructor() {
|
|
94
|
+
super();
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* @returns window object
|
|
98
|
+
*/
|
|
99
|
+
get nativeWindow() {
|
|
100
|
+
return window;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
BrowserWindowRef.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BrowserWindowRef, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
104
|
+
BrowserWindowRef.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BrowserWindowRef });
|
|
105
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BrowserWindowRef, decorators: [{
|
|
106
|
+
type: Injectable
|
|
107
|
+
}], ctorParameters: function () { return []; } });
|
|
108
|
+
/**
|
|
109
|
+
* Create an factory function that returns the native window object.
|
|
110
|
+
* @param browserWindowRef Native window object
|
|
111
|
+
* @param platformId id of platform
|
|
112
|
+
* @returns type of platform of empty object
|
|
113
|
+
*/
|
|
114
|
+
function windowFactory(browserWindowRef, platformId) {
|
|
115
|
+
if (isPlatformBrowser(platformId)) {
|
|
116
|
+
return browserWindowRef.nativeWindow;
|
|
117
|
+
}
|
|
118
|
+
const obj = {
|
|
119
|
+
setTimeout: (func, time) => { },
|
|
120
|
+
clearTimeout: (a) => { }
|
|
121
|
+
};
|
|
122
|
+
return obj;
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Create a injectable provider for the WindowRef token that uses the BrowserWindowRef class.
|
|
126
|
+
*/
|
|
127
|
+
const browserWindowProvider = {
|
|
128
|
+
provide: WindowRef,
|
|
129
|
+
useClass: BrowserWindowRef
|
|
130
|
+
};
|
|
131
|
+
/**
|
|
132
|
+
* Create an injectable provider that uses the windowFactory function for returning the native window object.
|
|
133
|
+
*/
|
|
134
|
+
const windowProvider = {
|
|
135
|
+
provide: WINDOW,
|
|
136
|
+
useFactory: windowFactory,
|
|
137
|
+
deps: [WindowRef, PLATFORM_ID]
|
|
138
|
+
};
|
|
139
|
+
/**
|
|
140
|
+
* Create an array of providers.
|
|
141
|
+
*/
|
|
142
|
+
const WINDOW_PROVIDERS = [browserWindowProvider, windowProvider];
|
|
143
|
+
|
|
144
|
+
class ResizeService {
|
|
145
|
+
constructor(eventManager) {
|
|
146
|
+
this.eventManager = eventManager;
|
|
147
|
+
this.resizeSubject = new Subject();
|
|
148
|
+
this.eventManager.addGlobalEventListener('window', 'resize', this.onResize.bind(this));
|
|
149
|
+
this.eventManager.addGlobalEventListener('window', 'onload', this.onLoaded.bind(this));
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Makes resizeSubject become Observable
|
|
153
|
+
* @returns Observable of resizeSubject
|
|
154
|
+
*/
|
|
155
|
+
get onResize$() {
|
|
156
|
+
return this.resizeSubject.asObservable();
|
|
157
|
+
}
|
|
158
|
+
/**
|
|
159
|
+
* Handler of 'resize' event. Passes data throw resizeSubject
|
|
160
|
+
* @param event Event Object of 'resize' event
|
|
161
|
+
*/
|
|
162
|
+
onResize(event) {
|
|
163
|
+
this.resizeSubject.next(event.target);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Handler of 'onload' event. Defines the width of window
|
|
167
|
+
* @param event Event Object of 'onload' event
|
|
168
|
+
*/
|
|
169
|
+
onLoaded(event) {
|
|
170
|
+
this.windowWidth = event.target;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
ResizeService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ResizeService, deps: [{ token: i1.EventManager }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
174
|
+
ResizeService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ResizeService, providedIn: 'root' });
|
|
175
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ResizeService, decorators: [{
|
|
176
|
+
type: Injectable,
|
|
177
|
+
args: [{
|
|
178
|
+
providedIn: 'root'
|
|
179
|
+
}]
|
|
180
|
+
}], ctorParameters: function () { return [{ type: i1.EventManager }]; } });
|
|
181
|
+
|
|
182
|
+
class ClickOutsideDirective {
|
|
183
|
+
constructor(elementRef, document) {
|
|
184
|
+
this.elementRef = elementRef;
|
|
185
|
+
this.document = document;
|
|
186
|
+
/**
|
|
187
|
+
* Toggler for checking ouside click event
|
|
188
|
+
*/
|
|
189
|
+
this.listening = false;
|
|
190
|
+
/**
|
|
191
|
+
* Emitter for click event
|
|
192
|
+
*/
|
|
193
|
+
this.action = new EventEmitter();
|
|
194
|
+
}
|
|
195
|
+
ngOnInit() {
|
|
196
|
+
this._clickSubscription = fromEvent(this.document, 'click')
|
|
197
|
+
.subscribe(event => {
|
|
198
|
+
this.onClick(event);
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
ngOnDestroy() {
|
|
202
|
+
var _a;
|
|
203
|
+
(_a = this._clickSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
204
|
+
}
|
|
205
|
+
onClick(event) {
|
|
206
|
+
if (event instanceof MouseEvent && this.listening) {
|
|
207
|
+
const clickOutsideEvent = {
|
|
208
|
+
target: event.target,
|
|
209
|
+
value: !this.isDescendant(this.elementRef.nativeElement, event.target)
|
|
210
|
+
};
|
|
211
|
+
this.action.emit(clickOutsideEvent);
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
isDescendant(parent, child) {
|
|
215
|
+
let node = child;
|
|
216
|
+
while (node !== null) {
|
|
217
|
+
if (node === parent) {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
else {
|
|
221
|
+
node = node.parentNode;
|
|
222
|
+
}
|
|
223
|
+
}
|
|
224
|
+
return false;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
ClickOutsideDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ClickOutsideDirective, deps: [{ token: i0.ElementRef }, { token: DOCUMENT }], target: i0.ɵɵFactoryTarget.Directive });
|
|
228
|
+
ClickOutsideDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: ClickOutsideDirective, selector: "[sfcClickOutside]", inputs: { listening: ["sfcClickOutside", "listening"] }, outputs: { action: "action" }, ngImport: i0 });
|
|
229
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ClickOutsideDirective, decorators: [{
|
|
230
|
+
type: Directive,
|
|
231
|
+
args: [{
|
|
232
|
+
selector: '[sfcClickOutside]'
|
|
233
|
+
}]
|
|
234
|
+
}], ctorParameters: function () {
|
|
235
|
+
return [{ type: i0.ElementRef }, { type: Document, decorators: [{
|
|
236
|
+
type: Inject,
|
|
237
|
+
args: [DOCUMENT]
|
|
238
|
+
}] }];
|
|
239
|
+
}, propDecorators: { listening: [{
|
|
240
|
+
type: Input,
|
|
241
|
+
args: ['sfcClickOutside']
|
|
242
|
+
}], action: [{
|
|
243
|
+
type: Output
|
|
244
|
+
}] } });
|
|
245
|
+
|
|
246
|
+
class CommonConstants {
|
|
247
|
+
}
|
|
248
|
+
CommonConstants.NOT_FOUND_INDEX = -1;
|
|
249
|
+
CommonConstants.EMPTY_STRING = '';
|
|
250
|
+
CommonConstants.MOUSE_BUTTON_LEFT = 0;
|
|
251
|
+
|
|
252
|
+
class DateTimeConstants {
|
|
253
|
+
}
|
|
254
|
+
DateTimeConstants.DAYS_IN_WEEK = 7;
|
|
255
|
+
DateTimeConstants.HOURS_IN_SHORT_TIME = 12;
|
|
256
|
+
DateTimeConstants.MINUTES_IN_HOUR = 60;
|
|
257
|
+
DateTimeConstants.DAYS_OF_WEEK = ["S", "M", "T", "W", "T", "F", "S"];
|
|
258
|
+
DateTimeConstants.DAYS_OF_WEEK_3 = ["SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT"];
|
|
259
|
+
|
|
260
|
+
class UIConstants {
|
|
261
|
+
}
|
|
262
|
+
UIConstants.CSS_PIXELS = 'px';
|
|
263
|
+
UIConstants.CSS_PERCENTAGE = '%';
|
|
264
|
+
UIConstants.CSS_DEGREES = 'deg';
|
|
265
|
+
UIConstants.CSS_EM = 'em';
|
|
266
|
+
UIConstants.CSS_VISIBILITY_VISIBLE = 'visible';
|
|
267
|
+
UIConstants.CSS_VISIBILITY_HIDDEN = 'hidden';
|
|
268
|
+
UIConstants.DEFAULT_THEME = 'sfc-default-theme';
|
|
269
|
+
UIConstants.DARK_THEME = 'sfc-dark-theme';
|
|
270
|
+
UIConstants.CSS_WIDTH = 'width';
|
|
271
|
+
UIConstants.CSS_LEFT = 'left';
|
|
272
|
+
UIConstants.CSS_CLASS_FIXED = 'fixed';
|
|
273
|
+
UIConstants.CSS_CLASS_BACKGROUND = 'background';
|
|
274
|
+
UIConstants.CSS_CLASS_TOP = 'top';
|
|
275
|
+
|
|
276
|
+
class ShowHideElementDirective {
|
|
277
|
+
constructor(el) {
|
|
278
|
+
this.el = el;
|
|
279
|
+
this.SHOW_HIDE_TRANSITION_DELAY_DEFAULT = 0.5;
|
|
280
|
+
this.style.transition = this.getTransitionValue();
|
|
281
|
+
}
|
|
282
|
+
set showHideElement(show) {
|
|
283
|
+
this.style.visibility = show
|
|
284
|
+
? UIConstants.CSS_VISIBILITY_VISIBLE
|
|
285
|
+
: UIConstants.CSS_VISIBILITY_HIDDEN;
|
|
286
|
+
this.style.opacity = show ? 1 : 0;
|
|
287
|
+
}
|
|
288
|
+
set delay(value) {
|
|
289
|
+
this.style.transition = this.getTransitionValue(value);
|
|
290
|
+
}
|
|
291
|
+
;
|
|
292
|
+
get style() {
|
|
293
|
+
return this.el.nativeElement.style;
|
|
294
|
+
}
|
|
295
|
+
getTransitionValue(delay = this.SHOW_HIDE_TRANSITION_DELAY_DEFAULT) {
|
|
296
|
+
return `visibility ${delay}s,
|
|
297
|
+
opacity ${delay}s
|
|
298
|
+
linear`;
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
ShowHideElementDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ShowHideElementDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
302
|
+
ShowHideElementDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: ShowHideElementDirective, selector: "[sfcShowHideElement]", inputs: { showHideElement: ["sfcShowHideElement", "showHideElement"], delay: "delay" }, ngImport: i0 });
|
|
303
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ShowHideElementDirective, decorators: [{
|
|
304
|
+
type: Directive,
|
|
305
|
+
args: [{
|
|
306
|
+
selector: '[sfcShowHideElement]'
|
|
307
|
+
}]
|
|
308
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { showHideElement: [{
|
|
309
|
+
type: Input,
|
|
310
|
+
args: ['sfcShowHideElement']
|
|
311
|
+
}], delay: [{
|
|
312
|
+
type: Input
|
|
313
|
+
}] } });
|
|
314
|
+
|
|
315
|
+
/**
|
|
316
|
+
* Return true if value defined
|
|
317
|
+
* @param value Value to check
|
|
318
|
+
* @returns True if value is not null and defined
|
|
319
|
+
*/
|
|
320
|
+
function isDefined(value) {
|
|
321
|
+
return value !== undefined && value !== null;
|
|
322
|
+
}
|
|
323
|
+
/**
|
|
324
|
+
* Return true if value is object
|
|
325
|
+
* @param value Value to check
|
|
326
|
+
* @returns True if value is object
|
|
327
|
+
*/
|
|
328
|
+
function isObject(value) {
|
|
329
|
+
return (isDefined(value) && typeof value === 'object' && !Array.isArray(value));
|
|
330
|
+
}
|
|
331
|
+
/**
|
|
332
|
+
* Return true if data is observable
|
|
333
|
+
* @param data Object to check
|
|
334
|
+
* @returns True if data is observable
|
|
335
|
+
*/
|
|
336
|
+
function isAsyncData(data) {
|
|
337
|
+
return data instanceof Observable;
|
|
338
|
+
}
|
|
339
|
+
/**
|
|
340
|
+
* Return extended object with new property
|
|
341
|
+
* @param obj Object to extend by property
|
|
342
|
+
* @param property New property name
|
|
343
|
+
* @param value Value for new property
|
|
344
|
+
* @returns Extended object with new property
|
|
345
|
+
*/
|
|
346
|
+
function addPropertyToObject(obj, property, value = null) {
|
|
347
|
+
if (!isDefined(property) && !obj.hasOwnProperty(property)) {
|
|
348
|
+
let newObj = {};
|
|
349
|
+
newObj[property] = value;
|
|
350
|
+
obj = Object.assign(Object.assign({}, obj), newObj);
|
|
351
|
+
}
|
|
352
|
+
return obj;
|
|
353
|
+
}
|
|
354
|
+
/**
|
|
355
|
+
* Remove property from object
|
|
356
|
+
* @param obj Object for removing property
|
|
357
|
+
* @param property Property name to remove
|
|
358
|
+
*/
|
|
359
|
+
function removePropertyFromObject(obj, property) {
|
|
360
|
+
if (obj.hasOwnProperty(property)) {
|
|
361
|
+
delete obj[property];
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
/**
|
|
365
|
+
* Deep merge object with others
|
|
366
|
+
* @param target Object to merge
|
|
367
|
+
* @param sources
|
|
368
|
+
*/
|
|
369
|
+
/**
|
|
370
|
+
* Deep merge object with others
|
|
371
|
+
* @param target Object to merge
|
|
372
|
+
* @param sources Objects to be merged with target
|
|
373
|
+
* @returns Merged object
|
|
374
|
+
*/
|
|
375
|
+
function mergeDeep(target, ...sources) {
|
|
376
|
+
if (!isDefined(sources))
|
|
377
|
+
return target;
|
|
378
|
+
const source = sources.shift();
|
|
379
|
+
if (isObject(target) && isObject(source)) {
|
|
380
|
+
for (const key in source) {
|
|
381
|
+
if (isObject(source[key])) {
|
|
382
|
+
if (!target[key])
|
|
383
|
+
Object.assign(target, { [key]: {} });
|
|
384
|
+
mergeDeep(target[key], source[key]);
|
|
385
|
+
}
|
|
386
|
+
else {
|
|
387
|
+
Object.assign(target, { [key]: source[key] });
|
|
388
|
+
}
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
return mergeDeep(target, ...sources);
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* Get type's property name safety
|
|
395
|
+
* @param name KeyOf property
|
|
396
|
+
* @returns Type's property name
|
|
397
|
+
*/
|
|
398
|
+
const nameof = (name) => name;
|
|
399
|
+
|
|
400
|
+
/**
|
|
401
|
+
* Return true if string has value(not empty string)
|
|
402
|
+
* @param value String value to check
|
|
403
|
+
* @returns True if string is not null and defined(not empty string)
|
|
404
|
+
*/
|
|
405
|
+
function isNullOrEmptyString(value) {
|
|
406
|
+
return isDefined(value) || value === CommonConstants.EMPTY_STRING;
|
|
407
|
+
}
|
|
408
|
+
/**
|
|
409
|
+
* Return true if value contains includeValue
|
|
410
|
+
* @param value String value to check
|
|
411
|
+
* @param includeValue Value to check if it include
|
|
412
|
+
* @returns True if value contains includeValue
|
|
413
|
+
*/
|
|
414
|
+
function contains(value, includeValue) {
|
|
415
|
+
return !isNullOrEmptyString(value) && !isNullOrEmptyString(includeValue)
|
|
416
|
+
? value.toLowerCase()
|
|
417
|
+
.includes(includeValue.toLowerCase())
|
|
418
|
+
: false;
|
|
419
|
+
}
|
|
420
|
+
/**
|
|
421
|
+
* Return trimed value
|
|
422
|
+
* @param value Value for trim modification
|
|
423
|
+
* @returns Trimed value
|
|
424
|
+
*/
|
|
425
|
+
function trim(value) {
|
|
426
|
+
return isNullOrEmptyString(value) ? value : value.replace(/\s/g, '');
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/**
|
|
430
|
+
* Set minutes for date
|
|
431
|
+
* @param date Date value
|
|
432
|
+
* @param minute Minute value
|
|
433
|
+
* @returns Date with minute value
|
|
434
|
+
*/
|
|
435
|
+
function setMinutes(date, minute) {
|
|
436
|
+
date.setMinutes(minute);
|
|
437
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes());
|
|
438
|
+
}
|
|
439
|
+
/**
|
|
440
|
+
* Set hours for date
|
|
441
|
+
* @param date Date value
|
|
442
|
+
* @param hour Hour value
|
|
443
|
+
* @returns Date with hour value
|
|
444
|
+
*/
|
|
445
|
+
function setHours(date, hour) {
|
|
446
|
+
date.setHours(hour);
|
|
447
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes());
|
|
448
|
+
}
|
|
449
|
+
/**
|
|
450
|
+
* Set day for date value
|
|
451
|
+
* @param date Date value
|
|
452
|
+
* @param dayNumber Day number
|
|
453
|
+
* @returns Date with day number
|
|
454
|
+
*/
|
|
455
|
+
function setDay(date, dayNumber) {
|
|
456
|
+
const nextDate = new Date(date);
|
|
457
|
+
nextDate.setDate(dayNumber);
|
|
458
|
+
return nextDate;
|
|
459
|
+
}
|
|
460
|
+
/**
|
|
461
|
+
* Set year for date
|
|
462
|
+
* @param date Date value
|
|
463
|
+
* @param year Year value
|
|
464
|
+
* @returns Date with year value
|
|
465
|
+
*/
|
|
466
|
+
function setYear(date, year) {
|
|
467
|
+
date.setFullYear(year);
|
|
468
|
+
return new Date(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes());
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Get next month as date
|
|
472
|
+
* @param date Date value
|
|
473
|
+
* @returns Next month as date
|
|
474
|
+
*/
|
|
475
|
+
function getNextMonth(date) {
|
|
476
|
+
const nextMonth = new Date(date);
|
|
477
|
+
nextMonth.setMonth(date.getMonth() + 1);
|
|
478
|
+
return nextMonth;
|
|
479
|
+
}
|
|
480
|
+
/**
|
|
481
|
+
* Get previous month as date
|
|
482
|
+
* @param date Date value
|
|
483
|
+
* @returns Previous month as date
|
|
484
|
+
*/
|
|
485
|
+
function getPreviousMonth(date) {
|
|
486
|
+
const prevMonth = new Date(date);
|
|
487
|
+
prevMonth.setMonth(date.getMonth() - 1);
|
|
488
|
+
return prevMonth;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Get next year as date
|
|
492
|
+
* @param date Date value
|
|
493
|
+
* @returns Next year as date
|
|
494
|
+
*/
|
|
495
|
+
function getNextYear(date) {
|
|
496
|
+
const nextYear = new Date(date);
|
|
497
|
+
nextYear.setFullYear(date.getFullYear() + 1);
|
|
498
|
+
return nextYear;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Get previous year as date
|
|
502
|
+
* @param date Date value
|
|
503
|
+
* @returns Previous year as date
|
|
504
|
+
*/
|
|
505
|
+
function getPreviousYear(date) {
|
|
506
|
+
const prevYear = new Date(date);
|
|
507
|
+
prevYear.setFullYear(date.getFullYear() - 1);
|
|
508
|
+
return prevYear;
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Return first day of month as date from date value
|
|
512
|
+
* @param date Date value
|
|
513
|
+
* @returns First day of month as date
|
|
514
|
+
*/
|
|
515
|
+
function getFirstDayOfMonth(date) {
|
|
516
|
+
if (isDefined(date) && date instanceof Date) {
|
|
517
|
+
const year = date.getFullYear(), month = date.getMonth();
|
|
518
|
+
return new Date(year, month, 1);
|
|
519
|
+
}
|
|
520
|
+
return date;
|
|
521
|
+
}
|
|
522
|
+
/**
|
|
523
|
+
* Return last day of month as date from date value
|
|
524
|
+
* @param date Date value
|
|
525
|
+
* @returns Last day of month as date
|
|
526
|
+
*/
|
|
527
|
+
function getLastDayOfMonth(date) {
|
|
528
|
+
if (isDefined(date) && date instanceof Date) {
|
|
529
|
+
const year = date.getFullYear(), month = date.getMonth();
|
|
530
|
+
return new Date(year, month + 1, 0);
|
|
531
|
+
}
|
|
532
|
+
return date;
|
|
533
|
+
}
|
|
534
|
+
/**
|
|
535
|
+
* Return first day of year as date from date value
|
|
536
|
+
* @param date Date value
|
|
537
|
+
* @returns First day of year as date
|
|
538
|
+
*/
|
|
539
|
+
function getFirstDayOfYear(date) {
|
|
540
|
+
if (isDefined(date) && date instanceof Date) {
|
|
541
|
+
return new Date(date.getFullYear(), 0, 1);
|
|
542
|
+
}
|
|
543
|
+
return date;
|
|
544
|
+
}
|
|
545
|
+
/**
|
|
546
|
+
* Return last day of year as date from date value
|
|
547
|
+
* @param date Date value
|
|
548
|
+
* @returns Last day of year as date
|
|
549
|
+
*/
|
|
550
|
+
function getLastDayOfYear(date) {
|
|
551
|
+
if (isDefined(date) && date instanceof Date) {
|
|
552
|
+
return new Date(date.getFullYear(), 12, 0);
|
|
553
|
+
}
|
|
554
|
+
return date;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Return first day of month as date
|
|
558
|
+
* @param year Year value
|
|
559
|
+
* @param month Month value
|
|
560
|
+
* @returns First day of month
|
|
561
|
+
*/
|
|
562
|
+
function getFirstDayOfMonthByYearAndMonth(year, month) {
|
|
563
|
+
return new Date(year, month, 1);
|
|
564
|
+
}
|
|
565
|
+
/**
|
|
566
|
+
* Return last day of month as date
|
|
567
|
+
* @param year Year value
|
|
568
|
+
* @param month Month value
|
|
569
|
+
* @returns Last day of month
|
|
570
|
+
*/
|
|
571
|
+
function getLastDayOfMonthByYearAndMonth(year, month) {
|
|
572
|
+
return new Date(year, month + 1, 0);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Return week number in month from date value
|
|
576
|
+
* @param date Date value
|
|
577
|
+
* @returns Week number
|
|
578
|
+
*/
|
|
579
|
+
function getWeeksNumberInMonth(date) {
|
|
580
|
+
const firstOfMonth = getFirstDayOfMonth(date), lastOfMonth = getLastDayOfMonth(date), used = firstOfMonth.getDay() + lastOfMonth.getDate();
|
|
581
|
+
return Math.ceil(used / DateTimeConstants.DAYS_IN_WEEK);
|
|
582
|
+
}
|
|
583
|
+
/**
|
|
584
|
+
* Return true if first and second date are equal
|
|
585
|
+
* @param date1 First date value
|
|
586
|
+
* @param date2 Second date value
|
|
587
|
+
* @returns True if first and second date are equal
|
|
588
|
+
*/
|
|
589
|
+
function isEqualDates(date1, date2) {
|
|
590
|
+
date1.setHours(0, 0, 0, 0);
|
|
591
|
+
date2.setHours(0, 0, 0, 0);
|
|
592
|
+
return date1.getTime() === date2.getTime();
|
|
593
|
+
}
|
|
594
|
+
/**
|
|
595
|
+
* Return true if first date greater than second date
|
|
596
|
+
* @param date1 First date value
|
|
597
|
+
* @param date2 Second date value
|
|
598
|
+
* @returns True if first date greater than second date
|
|
599
|
+
*/
|
|
600
|
+
function isDateGreat(date1, date2) {
|
|
601
|
+
return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate())
|
|
602
|
+
> new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
|
|
603
|
+
}
|
|
604
|
+
/**
|
|
605
|
+
* Return true if first date greater or equal to second date
|
|
606
|
+
* @param date1 First date value
|
|
607
|
+
* @param date2 Second date value
|
|
608
|
+
* @returns True if first date greater or equal to second date
|
|
609
|
+
*/
|
|
610
|
+
function isDateGreatOrEqual(date1, date2) {
|
|
611
|
+
return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate())
|
|
612
|
+
>= new Date(date2.getFullYear(), date2.getMonth(), date2.getDate());
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* Return true if first date time greater than second date time
|
|
616
|
+
* @param date1 First date time value
|
|
617
|
+
* @param date2 Second date time value
|
|
618
|
+
* @returns True if first date time greater than second date time
|
|
619
|
+
*/
|
|
620
|
+
function isDateTimeGreat(date1, date2) {
|
|
621
|
+
return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate(), date1.getHours(), date1.getMinutes())
|
|
622
|
+
> new Date(date2.getFullYear(), date2.getMonth(), date2.getDate(), date2.getHours(), date2.getMinutes());
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Return true if first date time greater or equal to second date time
|
|
626
|
+
* @param date1 First date time value
|
|
627
|
+
* @param date2 Second date time value
|
|
628
|
+
* @returns True if first date time greater or equal to second date time
|
|
629
|
+
*/
|
|
630
|
+
function isDateTimeGreatOrEqual(date1, date2) {
|
|
631
|
+
return new Date(date1.getFullYear(), date1.getMonth(), date1.getDate(), date1.getHours(), date1.getMinutes())
|
|
632
|
+
>= new Date(date2.getFullYear(), date2.getMonth(), date2.getDate(), date2.getHours(), date2.getMinutes());
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* Return parsed file size as string
|
|
637
|
+
* @param bytes Bytes count
|
|
638
|
+
* @param decimals Value after dot
|
|
639
|
+
* @returns Parsed file size
|
|
640
|
+
*/
|
|
641
|
+
function parseFileSize(bytes, decimals = 2) {
|
|
642
|
+
if (bytes === 0)
|
|
643
|
+
return '0';
|
|
644
|
+
const k = 1024;
|
|
645
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
646
|
+
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
|
|
647
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
648
|
+
return parseFloat((bytes / Math.pow(k, i)).toFixed(dm)) + ' ' + sizes[i];
|
|
649
|
+
}
|
|
650
|
+
/**
|
|
651
|
+
* Return file extension
|
|
652
|
+
* @param file File value
|
|
653
|
+
* @returns File extension
|
|
654
|
+
*/
|
|
655
|
+
function getFileExtension(file) {
|
|
656
|
+
if (!isDefined(file))
|
|
657
|
+
return CommonConstants.EMPTY_STRING;
|
|
658
|
+
if (file.name.indexOf('.') === CommonConstants.NOT_FOUND_INDEX) {
|
|
659
|
+
return CommonConstants.EMPTY_STRING;
|
|
660
|
+
}
|
|
661
|
+
return file.name.split('.').pop();
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* Read file as data URL
|
|
665
|
+
* @param file File value
|
|
666
|
+
* @param onLoad On load action
|
|
667
|
+
*/
|
|
668
|
+
function readAsDataURL(file, onLoad) {
|
|
669
|
+
if (isDefined(file)) {
|
|
670
|
+
const reader = new FileReader();
|
|
671
|
+
reader.onload = () => onLoad(reader.result);
|
|
672
|
+
reader.readAsDataURL(file);
|
|
673
|
+
}
|
|
674
|
+
throw new Error('File utils | Read as data URL function --> File is empty.');
|
|
675
|
+
}
|
|
676
|
+
/**
|
|
677
|
+
* Return true if file is image
|
|
678
|
+
* @param file File value
|
|
679
|
+
* @returns True if file is image
|
|
680
|
+
*/
|
|
681
|
+
function isImage(file) {
|
|
682
|
+
return (/\.(gif|jpe?g|jpg|tiff|png|webp|bmp)$/i).test(file.name);
|
|
683
|
+
}
|
|
684
|
+
|
|
685
|
+
/**
|
|
686
|
+
* Return CSS like value
|
|
687
|
+
* @param value Value as number
|
|
688
|
+
* @returns Value as '1px'
|
|
689
|
+
*/
|
|
690
|
+
function getCssLikeValue(value, type = UIConstants.CSS_PIXELS) {
|
|
691
|
+
return value + type;
|
|
692
|
+
}
|
|
693
|
+
/**
|
|
694
|
+
* Parse CSS like value to number
|
|
695
|
+
* @param value CSS like value
|
|
696
|
+
* @returns Number value
|
|
697
|
+
*/
|
|
698
|
+
function getValueFromCssLikeValue(value, type = UIConstants.CSS_PIXELS) {
|
|
699
|
+
return +value.replace(type, CommonConstants.EMPTY_STRING);
|
|
700
|
+
}
|
|
701
|
+
/**
|
|
702
|
+
* Add classes to HTML element
|
|
703
|
+
* @param element HTML element
|
|
704
|
+
* @param classNames Array of CSS classes
|
|
705
|
+
*/
|
|
706
|
+
function addClasses(element, ...classNames) {
|
|
707
|
+
if (isDefined(element)) {
|
|
708
|
+
classNames.forEach((className) => element.classList.add(className));
|
|
709
|
+
}
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Remove classes to HTML element
|
|
713
|
+
* @param element HTML element
|
|
714
|
+
* @param classNames Array of CSS classes
|
|
715
|
+
*/
|
|
716
|
+
function removeClasses(element, ...classNames) {
|
|
717
|
+
if (isDefined(element)) {
|
|
718
|
+
classNames.forEach((className) => element.classList.remove(className));
|
|
719
|
+
}
|
|
720
|
+
}
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Component sizes
|
|
724
|
+
*/
|
|
725
|
+
var ComponentSize;
|
|
726
|
+
(function (ComponentSize) {
|
|
727
|
+
ComponentSize["Small"] = "small";
|
|
728
|
+
ComponentSize["Medium"] = "medium";
|
|
729
|
+
ComponentSize["Large"] = "large";
|
|
730
|
+
ComponentSize["Custom"] = "custom";
|
|
731
|
+
})(ComponentSize || (ComponentSize = {}));
|
|
732
|
+
/**
|
|
733
|
+
* Type of sorting
|
|
734
|
+
*/
|
|
735
|
+
var SortingDirection;
|
|
736
|
+
(function (SortingDirection) {
|
|
737
|
+
SortingDirection["Ascending"] = "ascending";
|
|
738
|
+
SortingDirection["Descending"] = "descending";
|
|
739
|
+
})(SortingDirection || (SortingDirection = {}));
|
|
740
|
+
/**
|
|
741
|
+
* UI classes
|
|
742
|
+
*/
|
|
743
|
+
var UIClass;
|
|
744
|
+
(function (UIClass) {
|
|
745
|
+
UIClass["Active"] = "active";
|
|
746
|
+
UIClass["Valid"] = "valid";
|
|
747
|
+
UIClass["Invalid"] = "invalid";
|
|
748
|
+
UIClass["Enabled"] = "enabled";
|
|
749
|
+
UIClass["Disabled"] = "disabled";
|
|
750
|
+
UIClass["Selected"] = "selected";
|
|
751
|
+
UIClass["Empty"] = "empty";
|
|
752
|
+
UIClass["Focus"] = "focus";
|
|
753
|
+
UIClass["Open"] = "open";
|
|
754
|
+
UIClass["Loading"] = "loading";
|
|
755
|
+
UIClass["Removed"] = "removed";
|
|
756
|
+
UIClass["Visible"] = "visible";
|
|
757
|
+
UIClass["Hidden"] = "hidden";
|
|
758
|
+
UIClass["Animated"] = "animated";
|
|
759
|
+
UIClass["Expanded"] = "expanded";
|
|
760
|
+
UIClass["Fixed"] = "fixed";
|
|
761
|
+
})(UIClass || (UIClass = {}));
|
|
762
|
+
;
|
|
763
|
+
/**
|
|
764
|
+
* Position directions
|
|
765
|
+
*/
|
|
766
|
+
var Position;
|
|
767
|
+
(function (Position) {
|
|
768
|
+
Position["Top"] = "top";
|
|
769
|
+
Position["Bottom"] = "bottom";
|
|
770
|
+
Position["Left"] = "left";
|
|
771
|
+
Position["Right"] = "right";
|
|
772
|
+
})(Position || (Position = {}));
|
|
773
|
+
/**
|
|
774
|
+
* CSS Media limits
|
|
775
|
+
*/
|
|
776
|
+
var MediaLimits;
|
|
777
|
+
(function (MediaLimits) {
|
|
778
|
+
MediaLimits[MediaLimits["Laptop"] = 1200] = "Laptop";
|
|
779
|
+
MediaLimits[MediaLimits["Tablet"] = 767] = "Tablet";
|
|
780
|
+
MediaLimits[MediaLimits["Phone"] = 430] = "Phone";
|
|
781
|
+
})(MediaLimits || (MediaLimits = {}));
|
|
782
|
+
/**
|
|
783
|
+
* Direction types
|
|
784
|
+
*/
|
|
785
|
+
var Direction;
|
|
786
|
+
(function (Direction) {
|
|
787
|
+
Direction["Horizontal"] = "horizontal";
|
|
788
|
+
Direction["Vertical"] = "vertical";
|
|
789
|
+
})(Direction || (Direction = {}));
|
|
790
|
+
|
|
791
|
+
/**
|
|
792
|
+
* Return true if collection not empty
|
|
793
|
+
* @param collection Array of items
|
|
794
|
+
* @returns True if collection not empty
|
|
795
|
+
*/
|
|
796
|
+
function any(collection) {
|
|
797
|
+
return isDefined(collection) && collection.length > 0;
|
|
798
|
+
}
|
|
799
|
+
/**
|
|
800
|
+
* Return true if collection has such value
|
|
801
|
+
* @param collection Array of items
|
|
802
|
+
* @param value Value to check
|
|
803
|
+
* @returns True if found value in collection
|
|
804
|
+
*/
|
|
805
|
+
function hasItem(collection, value) {
|
|
806
|
+
return any(collection)
|
|
807
|
+
&& collection.findIndex(item => item === value) !== CommonConstants.NOT_FOUND_INDEX;
|
|
808
|
+
}
|
|
809
|
+
/**
|
|
810
|
+
* Return true if collection has such value by predicate function
|
|
811
|
+
* @param collection Array of items
|
|
812
|
+
* @param predicate Function to define check logic
|
|
813
|
+
* @returns True if found value in collection
|
|
814
|
+
*/
|
|
815
|
+
function hasItemBy(collection, predicate) {
|
|
816
|
+
return any(collection) && collection.findIndex(predicate) !== CommonConstants.NOT_FOUND_INDEX;
|
|
817
|
+
}
|
|
818
|
+
/**
|
|
819
|
+
* Return true if collection of objects has such value as object
|
|
820
|
+
* @param collection Array of objects
|
|
821
|
+
* @param property Property name
|
|
822
|
+
* @param value Value to check
|
|
823
|
+
* @returns True if found value in collection
|
|
824
|
+
*/
|
|
825
|
+
function hasObjectItem(collection, // TODO <-- Array<T>
|
|
826
|
+
property, value) {
|
|
827
|
+
return any(collection)
|
|
828
|
+
&& collection.findIndex(item => item.hasOwnProperty(property)
|
|
829
|
+
&& item[property] === value) !== CommonConstants.NOT_FOUND_INDEX;
|
|
830
|
+
}
|
|
831
|
+
/**
|
|
832
|
+
* Return value from collection by predicate function
|
|
833
|
+
* @param collection Array of items
|
|
834
|
+
* @param predicate Function to define search logic
|
|
835
|
+
* @returns Value from collection
|
|
836
|
+
*/
|
|
837
|
+
function firstOrDefault(collection, predicate) {
|
|
838
|
+
return any(collection) ? collection === null || collection === void 0 ? void 0 : collection.find(predicate) : undefined;
|
|
839
|
+
}
|
|
840
|
+
/**
|
|
841
|
+
* Return first item from collection
|
|
842
|
+
* @param collection Array of items
|
|
843
|
+
* @returns First value from collection
|
|
844
|
+
*/
|
|
845
|
+
function firstItem(collection) {
|
|
846
|
+
return any(collection) ? collection[0] : null;
|
|
847
|
+
}
|
|
848
|
+
/**
|
|
849
|
+
* Return last item from collection
|
|
850
|
+
* @param collection Array of items
|
|
851
|
+
* @returns Last value from collection
|
|
852
|
+
*/
|
|
853
|
+
function lastItem(collection) {
|
|
854
|
+
return any(collection) ? collection[collection.length - 1] : null;
|
|
855
|
+
}
|
|
856
|
+
/**
|
|
857
|
+
* Return True if all values match predicate function
|
|
858
|
+
* @param collection Array of objects
|
|
859
|
+
* @param predicate Function to define check logic
|
|
860
|
+
* @returns True if all values match predicate
|
|
861
|
+
*/
|
|
862
|
+
function all(collection, predicate) {
|
|
863
|
+
return any(collection) ? collection.filter(predicate).length == collection.length : false;
|
|
864
|
+
}
|
|
865
|
+
/**
|
|
866
|
+
* Return items from collection by predicate function
|
|
867
|
+
* @param collection Array of items
|
|
868
|
+
* @param predicate Function to define search logic
|
|
869
|
+
* @returns Values from collection
|
|
870
|
+
*/
|
|
871
|
+
function where(collection, predicate) {
|
|
872
|
+
return any(collection) ? collection.filter(predicate) : null;
|
|
873
|
+
}
|
|
874
|
+
/**
|
|
875
|
+
* Return sliced collection by page number and page size
|
|
876
|
+
* @param collection Array of items
|
|
877
|
+
* @param page Page number
|
|
878
|
+
* @param size Page size
|
|
879
|
+
* @returns Sliced collection
|
|
880
|
+
*/
|
|
881
|
+
function skip(collection, page, size) {
|
|
882
|
+
if (any(collection)) {
|
|
883
|
+
let start = (page - 1) * size;
|
|
884
|
+
return collection.slice(start, start + size);
|
|
885
|
+
}
|
|
886
|
+
return collection;
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Return sorted collection of objects by property
|
|
890
|
+
* @param collection Array of items
|
|
891
|
+
* @param property Property name
|
|
892
|
+
* @param direction Sorting direction
|
|
893
|
+
* @returns Sorted collection
|
|
894
|
+
*/
|
|
895
|
+
function sortBy(collection, property, direction) {
|
|
896
|
+
if (any(collection)) {
|
|
897
|
+
let _sortFunc = (a, b) => (t1, t2) => (a[property] > b[property] ? t1 : t2);
|
|
898
|
+
return direction == SortingDirection.Ascending
|
|
899
|
+
? collection.sort((a, b) => _sortFunc(a, b)(1, -1))
|
|
900
|
+
: collection.sort((a, b) => _sortFunc(a, b)(-1, 1));
|
|
901
|
+
}
|
|
902
|
+
return collection;
|
|
903
|
+
}
|
|
904
|
+
/**
|
|
905
|
+
* Return sorted collection of objects by path
|
|
906
|
+
* @param collection Array of items
|
|
907
|
+
* @param path Path to property
|
|
908
|
+
* @param direction Sorting direction
|
|
909
|
+
* @returns Sorted collection
|
|
910
|
+
*/
|
|
911
|
+
function sortByPath(collection, path, direction) {
|
|
912
|
+
if (any(collection)) {
|
|
913
|
+
if (isNullOrEmptyString(path))
|
|
914
|
+
throw new Error('Collection utils | Sort By Path function --> Path is empty.');
|
|
915
|
+
const pathParts = path.split('.');
|
|
916
|
+
if (!any(pathParts))
|
|
917
|
+
throw new Error('Collection utils | Sort By Path function --> Path is incorrect.');
|
|
918
|
+
const partsLength = pathParts.length;
|
|
919
|
+
collection.sort((a, b) => {
|
|
920
|
+
var i = 0;
|
|
921
|
+
while (i < partsLength) {
|
|
922
|
+
a = a[pathParts[i]];
|
|
923
|
+
b = b[pathParts[i]];
|
|
924
|
+
i++;
|
|
925
|
+
}
|
|
926
|
+
return direction == SortingDirection.Ascending
|
|
927
|
+
? a > b ? 1 : -1
|
|
928
|
+
: a > b ? -1 : 1;
|
|
929
|
+
});
|
|
930
|
+
return collection;
|
|
931
|
+
}
|
|
932
|
+
return collection;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* Return collection without matches
|
|
936
|
+
* @param collection Array of items
|
|
937
|
+
* @returns Collection without matches
|
|
938
|
+
*/
|
|
939
|
+
function distinct(collection) {
|
|
940
|
+
return any(collection)
|
|
941
|
+
? collection.filter((value, index, self) => self.indexOf(value) === index)
|
|
942
|
+
: collection;
|
|
943
|
+
}
|
|
944
|
+
/**
|
|
945
|
+
* Return sum value from collection items by map function
|
|
946
|
+
* @param collection Array of items
|
|
947
|
+
* @param select Map function
|
|
948
|
+
* @returns Sum value of colection items
|
|
949
|
+
*/
|
|
950
|
+
function sum(collection, select) {
|
|
951
|
+
return any(collection)
|
|
952
|
+
? collection
|
|
953
|
+
.map(select)
|
|
954
|
+
.reduce((a, b) => { return a + b; }, 0)
|
|
955
|
+
: 0;
|
|
956
|
+
}
|
|
957
|
+
/**
|
|
958
|
+
* Return max value from collection items by map function
|
|
959
|
+
* @param collection Array of items
|
|
960
|
+
* @param select Map function
|
|
961
|
+
* @returns Max value of collection items
|
|
962
|
+
*/
|
|
963
|
+
function max(collection, select) {
|
|
964
|
+
if (any(collection))
|
|
965
|
+
return Math.max(...collection.map(select));
|
|
966
|
+
throw new Error('Collection utils | Max function --> Collection is empty.');
|
|
967
|
+
}
|
|
968
|
+
/**
|
|
969
|
+
* Delete items from collection by predicate
|
|
970
|
+
* @param collection Array of items
|
|
971
|
+
* @param predicate Function to define remove logic
|
|
972
|
+
*/
|
|
973
|
+
function remove(collection, predicate) {
|
|
974
|
+
var i = collection.length;
|
|
975
|
+
while (i--) {
|
|
976
|
+
if (predicate(collection[i])) {
|
|
977
|
+
collection.splice(i, 1);
|
|
978
|
+
}
|
|
979
|
+
}
|
|
980
|
+
}
|
|
981
|
+
/**
|
|
982
|
+
* Add item to collection
|
|
983
|
+
* @param collection Array of items
|
|
984
|
+
* @param item New item
|
|
985
|
+
* @param predicate Function to define if allowed to add new item
|
|
986
|
+
* @returns True if successfully added
|
|
987
|
+
*/
|
|
988
|
+
function addItem(collection, item, predicate) {
|
|
989
|
+
if (!isDefined(collection))
|
|
990
|
+
collection = new Array();
|
|
991
|
+
if (isDefined(predicate) && predicate(item))
|
|
992
|
+
return false;
|
|
993
|
+
collection.push(item);
|
|
994
|
+
return true;
|
|
995
|
+
}
|
|
996
|
+
/**
|
|
997
|
+
* Delete item from collection by predicate
|
|
998
|
+
* @param collection Array of items
|
|
999
|
+
* @param predicate Function to define remove logic
|
|
1000
|
+
* @returns True if successfully removed
|
|
1001
|
+
*/
|
|
1002
|
+
function removeItem(collection, predicate) {
|
|
1003
|
+
const foundItem = firstOrDefault(collection, predicate);
|
|
1004
|
+
if (isDefined(foundItem)) {
|
|
1005
|
+
collection.splice(collection.indexOf(foundItem), 1);
|
|
1006
|
+
return true;
|
|
1007
|
+
}
|
|
1008
|
+
return false;
|
|
1009
|
+
}
|
|
1010
|
+
function updateItem(collection, predicate, newItem) {
|
|
1011
|
+
const itemIndex = collection.findIndex(predicate);
|
|
1012
|
+
if (itemIndex !== CommonConstants.NOT_FOUND_INDEX) {
|
|
1013
|
+
const result = collection.slice(0);
|
|
1014
|
+
result[itemIndex] = Object.assign(Object.assign({}, collection[itemIndex]), newItem);
|
|
1015
|
+
return result;
|
|
1016
|
+
}
|
|
1017
|
+
return null;
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* Return collection or empty if collection is not defined
|
|
1021
|
+
* @param collection Array of items
|
|
1022
|
+
* @returns Collection or empty
|
|
1023
|
+
*/
|
|
1024
|
+
function getCollectionOrEmpty(collection) {
|
|
1025
|
+
return isDefined(collection) ? collection : [];
|
|
1026
|
+
}
|
|
1027
|
+
|
|
1028
|
+
class ThrowElementOnHoverDirective {
|
|
1029
|
+
constructor(el) {
|
|
1030
|
+
this.el = el;
|
|
1031
|
+
}
|
|
1032
|
+
onMouseEnter() {
|
|
1033
|
+
this.throw(this.throwValue);
|
|
1034
|
+
}
|
|
1035
|
+
onMouseLeave() {
|
|
1036
|
+
this.throw(null);
|
|
1037
|
+
}
|
|
1038
|
+
get style() {
|
|
1039
|
+
return this.el.nativeElement.style;
|
|
1040
|
+
}
|
|
1041
|
+
throw(value) {
|
|
1042
|
+
this.style.transform = value ? `translateY(${getCssLikeValue(value)})` : null;
|
|
1043
|
+
}
|
|
1044
|
+
}
|
|
1045
|
+
ThrowElementOnHoverDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ThrowElementOnHoverDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1046
|
+
ThrowElementOnHoverDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: ThrowElementOnHoverDirective, selector: "[sfcThrowElementOnHover]", inputs: { throwValue: ["sfcThrowElementOnHover", "throwValue"] }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 });
|
|
1047
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ThrowElementOnHoverDirective, decorators: [{
|
|
1048
|
+
type: Directive,
|
|
1049
|
+
args: [{
|
|
1050
|
+
selector: '[sfcThrowElementOnHover]'
|
|
1051
|
+
}]
|
|
1052
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { throwValue: [{
|
|
1053
|
+
type: Input,
|
|
1054
|
+
args: ['sfcThrowElementOnHover']
|
|
1055
|
+
}], onMouseEnter: [{
|
|
1056
|
+
type: HostListener,
|
|
1057
|
+
args: ['mouseenter']
|
|
1058
|
+
}], onMouseLeave: [{
|
|
1059
|
+
type: HostListener,
|
|
1060
|
+
args: ['mouseleave']
|
|
1061
|
+
}] } });
|
|
1062
|
+
|
|
1063
|
+
class TemplateReferenceDirective {
|
|
1064
|
+
constructor(template) {
|
|
1065
|
+
this.template = template;
|
|
1066
|
+
this.templateName = CommonConstants.EMPTY_STRING;
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
TemplateReferenceDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: TemplateReferenceDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1070
|
+
TemplateReferenceDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: TemplateReferenceDirective, selector: "[sfcTemplateReference]", inputs: { templateName: ["sfcTemplateReference", "templateName"] }, ngImport: i0 });
|
|
1071
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: TemplateReferenceDirective, decorators: [{
|
|
1072
|
+
type: Directive,
|
|
1073
|
+
args: [{
|
|
1074
|
+
selector: '[sfcTemplateReference]'
|
|
1075
|
+
}]
|
|
1076
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }]; }, propDecorators: { templateName: [{
|
|
1077
|
+
type: Input,
|
|
1078
|
+
args: ['sfcTemplateReference']
|
|
1079
|
+
}] } });
|
|
1080
|
+
|
|
1081
|
+
class MouseDownDirective {
|
|
1082
|
+
constructor() {
|
|
1083
|
+
/**
|
|
1084
|
+
* Allowed mouse button
|
|
1085
|
+
*/
|
|
1086
|
+
this.button = CommonConstants.MOUSE_BUTTON_LEFT;
|
|
1087
|
+
this.action = new EventEmitter();
|
|
1088
|
+
}
|
|
1089
|
+
onMouseDown($event) {
|
|
1090
|
+
if ($event.button === this.button) {
|
|
1091
|
+
this.action.emit($event);
|
|
1092
|
+
}
|
|
1093
|
+
else {
|
|
1094
|
+
$event.preventDefault();
|
|
1095
|
+
}
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
MouseDownDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MouseDownDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
1099
|
+
MouseDownDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: MouseDownDirective, selector: "[sfcMouseDown]", inputs: { button: "button" }, outputs: { action: "sfcMouseDown" }, host: { listeners: { "mousedown": "onMouseDown($event)" } }, ngImport: i0 });
|
|
1100
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: MouseDownDirective, decorators: [{
|
|
1101
|
+
type: Directive,
|
|
1102
|
+
args: [{
|
|
1103
|
+
selector: '[sfcMouseDown]'
|
|
1104
|
+
}]
|
|
1105
|
+
}], propDecorators: { button: [{
|
|
1106
|
+
type: Input
|
|
1107
|
+
}], action: [{
|
|
1108
|
+
type: Output,
|
|
1109
|
+
args: ['sfcMouseDown']
|
|
1110
|
+
}], onMouseDown: [{
|
|
1111
|
+
type: HostListener,
|
|
1112
|
+
args: ['mousedown', ['$event']]
|
|
1113
|
+
}] } });
|
|
1114
|
+
|
|
1115
|
+
class ComponentSizeDirective {
|
|
1116
|
+
constructor(el) {
|
|
1117
|
+
this.el = el;
|
|
1118
|
+
this.style.fontSize = this.getSizeValue(this.size);
|
|
1119
|
+
}
|
|
1120
|
+
set size(value) {
|
|
1121
|
+
this.style.fontSize = this.getSizeValue(value);
|
|
1122
|
+
}
|
|
1123
|
+
set customSize(value) {
|
|
1124
|
+
this.style.fontSize = getCssLikeValue(value, UIConstants.CSS_EM);
|
|
1125
|
+
}
|
|
1126
|
+
get style() {
|
|
1127
|
+
return this.el.nativeElement.style;
|
|
1128
|
+
}
|
|
1129
|
+
getSizeValue(value) {
|
|
1130
|
+
switch (value) {
|
|
1131
|
+
case ComponentSize.Small:
|
|
1132
|
+
return getCssLikeValue(0.5, UIConstants.CSS_EM);
|
|
1133
|
+
case ComponentSize.Medium:
|
|
1134
|
+
return getCssLikeValue(1, UIConstants.CSS_EM);
|
|
1135
|
+
case ComponentSize.Large:
|
|
1136
|
+
return getCssLikeValue(2, UIConstants.CSS_EM);
|
|
1137
|
+
default:
|
|
1138
|
+
return getCssLikeValue(1, UIConstants.CSS_EM);
|
|
1139
|
+
}
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
ComponentSizeDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ComponentSizeDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1143
|
+
ComponentSizeDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: ComponentSizeDirective, selector: "[sfcComponentSize]", inputs: { size: ["sfcComponentSize", "size"], customSize: "customSize" }, ngImport: i0 });
|
|
1144
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ComponentSizeDirective, decorators: [{
|
|
1145
|
+
type: Directive,
|
|
1146
|
+
args: [{
|
|
1147
|
+
selector: '[sfcComponentSize]'
|
|
1148
|
+
}]
|
|
1149
|
+
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { size: [{
|
|
1150
|
+
type: Input,
|
|
1151
|
+
args: ['sfcComponentSize']
|
|
1152
|
+
}], customSize: [{
|
|
1153
|
+
type: Input
|
|
1154
|
+
}] } });
|
|
1155
|
+
|
|
1156
|
+
var ButtonType;
|
|
1157
|
+
(function (ButtonType) {
|
|
1158
|
+
ButtonType["Bordered"] = "bordered";
|
|
1159
|
+
ButtonType["Filled"] = "filled";
|
|
1160
|
+
ButtonType["Rounded"] = "rounded";
|
|
1161
|
+
ButtonType["Circled"] = "circled";
|
|
1162
|
+
ButtonType["Texted"] = "texted";
|
|
1163
|
+
})(ButtonType || (ButtonType = {}));
|
|
1164
|
+
|
|
1165
|
+
class ButtonComponent {
|
|
1166
|
+
constructor() {
|
|
1167
|
+
this.BUTTON_DEFAULT_TEXT = 'Button';
|
|
1168
|
+
this.text = this.BUTTON_DEFAULT_TEXT;
|
|
1169
|
+
this.disabled = false;
|
|
1170
|
+
this.types = [ButtonType.Bordered];
|
|
1171
|
+
}
|
|
1172
|
+
get classes() {
|
|
1173
|
+
const classes = {};
|
|
1174
|
+
if (this.disabled)
|
|
1175
|
+
classes[UIClass.Disabled] = true;
|
|
1176
|
+
distinct(this.types).forEach(type => classes[type] = true);
|
|
1177
|
+
return classes;
|
|
1178
|
+
}
|
|
1179
|
+
}
|
|
1180
|
+
ButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1181
|
+
ButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: ButtonComponent, selector: "sfc-button", inputs: { text: "text", iconBefore: "iconBefore", iconAfter: "iconAfter", disabled: "disabled", types: "types" }, ngImport: i0, template: "<a class=\"button\" [ngClass]=\"classes\">\r\n <i *ngIf=\"iconBefore\" class=\"icon before\" [ngClass]=\"iconBefore\"></i>\r\n <span class=\"text\">{{text}}</span>\r\n <i *ngIf=\"iconAfter\" class=\"icon after\" [ngClass]=\"iconAfter\"></i>\r\n</a>", styles: [":host-context(.sfc-default-theme) .button.texted:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.texted:not(:hover):not(.disabled){color:#ccd1d9}.button.bordered{border:solid 2px}:host-context(.sfc-default-theme) .button.bordered:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.bordered:not(:hover):not(.disabled){color:#ccd1d9}:host-context(.sfc-default-theme) .button.bordered:not(:hover):not(.disabled){border-color:#545e61}:host-context(.sfc-dark-theme) .button.bordered:not(:hover):not(.disabled){border-color:#ccd1d9}.button.filled{color:#fff!important;border-color:#545e61;background:#545e61}.button.filled:hover{color:#fff!important;border-color:#aab2bd;background:#aab2bd}.button.filled.disabled{color:#fff!important;border-color:#bdbdbd;background:#bdbdbd}.button.rounded{border:solid 2px;border-radius:20px;padding:.4em 1.2em}:host-context(.sfc-default-theme) .button.rounded:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.rounded:not(:hover):not(.disabled){color:#ccd1d9}:host-context(.sfc-default-theme) .button.rounded:not(:hover):not(.disabled){border-color:#545e61}:host-context(.sfc-dark-theme) .button.rounded:not(:hover):not(.disabled){border-color:#ccd1d9}.button.circled{border:solid 2px;width:5em;height:5em;border-radius:50%}:host-context(.sfc-default-theme) .button.circled:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.circled:not(:hover):not(.disabled){color:#ccd1d9}:host-context(.sfc-default-theme) .button.circled:not(:hover):not(.disabled){border-color:#545e61}:host-context(.sfc-dark-theme) .button.circled:not(:hover):not(.disabled){border-color:#ccd1d9}.button.circled .text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host{display:inline-block;font-size:1em}.button{box-sizing:border-box;display:inline-flex;justify-content:center;flex-wrap:wrap;align-items:center;overflow:hidden;text-align:center;text-decoration:none;white-space:nowrap;font-size:.8em;cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .5s ease,border-color .5s ease,background .5s ease}.button:hover{color:#2bbbad;border-color:#2bbbad}.button.disabled{pointer-events:none}:host-context(.sfc-default-theme) .button.disabled{color:#bdbdbd}:host-context(.sfc-dark-theme) .button.disabled{color:#656d78}:host-context(.sfc-default-theme) .button.disabled{border-color:#bdbdbd}:host-context(.sfc-dark-theme) .button.disabled{border-color:#656d78}.button .icon{padding:3px}.button .text{padding:3px;white-space:initial}.button .text:empty{display:none}\n"], directives: [{ type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1182
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ButtonComponent, decorators: [{
|
|
1183
|
+
type: Component,
|
|
1184
|
+
args: [{ selector: 'sfc-button', template: "<a class=\"button\" [ngClass]=\"classes\">\r\n <i *ngIf=\"iconBefore\" class=\"icon before\" [ngClass]=\"iconBefore\"></i>\r\n <span class=\"text\">{{text}}</span>\r\n <i *ngIf=\"iconAfter\" class=\"icon after\" [ngClass]=\"iconAfter\"></i>\r\n</a>", styles: [":host-context(.sfc-default-theme) .button.texted:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.texted:not(:hover):not(.disabled){color:#ccd1d9}.button.bordered{border:solid 2px}:host-context(.sfc-default-theme) .button.bordered:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.bordered:not(:hover):not(.disabled){color:#ccd1d9}:host-context(.sfc-default-theme) .button.bordered:not(:hover):not(.disabled){border-color:#545e61}:host-context(.sfc-dark-theme) .button.bordered:not(:hover):not(.disabled){border-color:#ccd1d9}.button.filled{color:#fff!important;border-color:#545e61;background:#545e61}.button.filled:hover{color:#fff!important;border-color:#aab2bd;background:#aab2bd}.button.filled.disabled{color:#fff!important;border-color:#bdbdbd;background:#bdbdbd}.button.rounded{border:solid 2px;border-radius:20px;padding:.4em 1.2em}:host-context(.sfc-default-theme) .button.rounded:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.rounded:not(:hover):not(.disabled){color:#ccd1d9}:host-context(.sfc-default-theme) .button.rounded:not(:hover):not(.disabled){border-color:#545e61}:host-context(.sfc-dark-theme) .button.rounded:not(:hover):not(.disabled){border-color:#ccd1d9}.button.circled{border:solid 2px;width:5em;height:5em;border-radius:50%}:host-context(.sfc-default-theme) .button.circled:not(:hover):not(.disabled){color:#545e61}:host-context(.sfc-dark-theme) .button.circled:not(:hover):not(.disabled){color:#ccd1d9}:host-context(.sfc-default-theme) .button.circled:not(:hover):not(.disabled){border-color:#545e61}:host-context(.sfc-dark-theme) .button.circled:not(:hover):not(.disabled){border-color:#ccd1d9}.button.circled .text{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}:host{display:inline-block;font-size:1em}.button{box-sizing:border-box;display:inline-flex;justify-content:center;flex-wrap:wrap;align-items:center;overflow:hidden;text-align:center;text-decoration:none;white-space:nowrap;font-size:.8em;cursor:pointer;-webkit-user-select:none;user-select:none;transition:color .5s ease,border-color .5s ease,background .5s ease}.button:hover{color:#2bbbad;border-color:#2bbbad}.button.disabled{pointer-events:none}:host-context(.sfc-default-theme) .button.disabled{color:#bdbdbd}:host-context(.sfc-dark-theme) .button.disabled{color:#656d78}:host-context(.sfc-default-theme) .button.disabled{border-color:#bdbdbd}:host-context(.sfc-dark-theme) .button.disabled{border-color:#656d78}.button .icon{padding:3px}.button .text{padding:3px;white-space:initial}.button .text:empty{display:none}\n"] }]
|
|
1185
|
+
}], propDecorators: { text: [{
|
|
1186
|
+
type: Input
|
|
1187
|
+
}], iconBefore: [{
|
|
1188
|
+
type: Input
|
|
1189
|
+
}], iconAfter: [{
|
|
1190
|
+
type: Input
|
|
1191
|
+
}], disabled: [{
|
|
1192
|
+
type: Input
|
|
1193
|
+
}], types: [{
|
|
1194
|
+
type: Input
|
|
1195
|
+
}] } });
|
|
1196
|
+
|
|
1197
|
+
var TooltipType;
|
|
1198
|
+
(function (TooltipType) {
|
|
1199
|
+
TooltipType["Hover"] = "hover";
|
|
1200
|
+
TooltipType["Click"] = "click";
|
|
1201
|
+
})(TooltipType || (TooltipType = {}));
|
|
1202
|
+
|
|
1203
|
+
class TooltipComponent {
|
|
1204
|
+
constructor(resizeService, window) {
|
|
1205
|
+
this.resizeService = resizeService;
|
|
1206
|
+
this.window = window;
|
|
1207
|
+
this.tooltipType = TooltipType.Hover;
|
|
1208
|
+
this.tooltipPosition = Position.Top;
|
|
1209
|
+
this.tooltipShow = false;
|
|
1210
|
+
// preserved position
|
|
1211
|
+
this._position = Position.Top;
|
|
1212
|
+
}
|
|
1213
|
+
click() {
|
|
1214
|
+
if (this.tooltipType == TooltipType.Click) {
|
|
1215
|
+
this.tooltipShow = !this.tooltipShow;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
ngOnInit() {
|
|
1219
|
+
this._position = this.tooltipPosition;
|
|
1220
|
+
}
|
|
1221
|
+
ngAfterContentInit() {
|
|
1222
|
+
this._resizeSubscription = this.resizeService.onResize$
|
|
1223
|
+
.pipe(startWith(this.window))
|
|
1224
|
+
.subscribe(window => this.tooltipPosition = window.innerWidth <= MediaLimits.Tablet
|
|
1225
|
+
? Position.Bottom : this._position);
|
|
1226
|
+
}
|
|
1227
|
+
ngOnDestroy() {
|
|
1228
|
+
var _a;
|
|
1229
|
+
(_a = this._resizeSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
TooltipComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: TooltipComponent, deps: [{ token: ResizeService }, { token: WINDOW }], target: i0.ɵɵFactoryTarget.Component });
|
|
1233
|
+
TooltipComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: TooltipComponent, selector: "[sfc-tooltip]", inputs: { value: ["sfc-tooltip", "value"], tooltipType: "tooltipType", tooltipPosition: "tooltipPosition", tooltipShow: "tooltipShow" }, host: { listeners: { "click": "click()" }, properties: { "attr.value": "this.value", "attr.type": "this.tooltipType", "attr.position": "this.tooltipPosition", "class.show": "this.tooltipShow" } }, ngImport: i0, template: `<ng-content></ng-content>`, isInline: true, styles: [":host{position:relative}:host:before,:host:after{position:absolute;left:50%;bottom:calc(100% + 5px);pointer-events:none;transition:.2s;will-change:transform}:host:hover:before,:host.show:before{content:attr(value);padding:.4em .7em;font-size:.8em;font-weight:initial;width:inherit;max-width:18.75em;border-radius:6px;background-color:#545e61;box-shadow:0 0 20.25em #0003;color:#fff;text-align:center;white-space:pre-wrap;overflow:hidden;word-wrap:break-word;z-index:9999}:host:after{content:\"\";border-style:solid;transition-duration:0s;transform:translate(-50%) scaleY(0)}:host[type=hover]:before,:host[type=hover]:after,:host:not(.show):before,:host:not(.show):after{visibility:hidden;opacity:0}:host[type=hover]:hover:before,:host[type=hover]:hover:after,:host.show:before,:host.show:after{visibility:visible;opacity:1}:host[type=hover]:hover:before,:host.show:before{transition-delay:.1s}:host[type=hover]:hover:after,:host.show:after{transition-delay:.3s;transition-duration:.2s;transform:translate(-50%) scaleY(1)}:host[position=top]:before,:host[position=top]:after{left:50%;bottom:calc(100% + 5px)}:host[position=top]:before{transform:translate(-50%,-5px) scale(.5)}:host[position=top]:hover:before,:host[position=top].show:before{transform:translate(-50%,-.25em) scale(1)}:host[position=top]:after{border-width:.25em .25em 0;border-color:#545e61 transparent transparent transparent;transform-origin:top}:host[position=left]:before,:host[position=left]:after{left:auto;right:calc(100% + 5px);bottom:50%}:host[position=left]:before{transform:translate(-.25em,50%) scale(.5)}:host[position=left]:hover:before,:host[position=left].show:before{transform:translate(-.31em,50%) scale(1)}:host[position=left]:after{border-width:.25em 0 .25em .25em;border-color:transparent transparent transparent #545e61;transform-origin:left;transform:translateY(50%) scaleX(0)}:host[position=left]:hover:after,:host[position=left].show:after{transform:translateY(50%) scaleX(1)}:host[position=right]:before,:host[position=right]:after{left:calc(100% + 5px);bottom:50%}:host[position=right]:before{transform:translate(5px,50%) scale(.5)}:host[position=right]:hover:before,:host[position=right].show:before{transform:translate(.31em,50%) scale(1)}:host[position=right]:after{border-width:.25em .25em .25em 0;border-color:transparent #545e61 transparent transparent;transform-origin:right;transform:translateY(50%) scaleX(0)}:host[position=right]:hover:after,:host[position=right].show:after{transform:translateY(50%) scaleX(1)}:host[position=bottom]:before,:host[position=bottom]:after{top:calc(100% + 5px);bottom:auto}:host[position=bottom]:before{transform:translate(-50%,5px) scale(.5)}:host[position=bottom]:hover:before,:host[position=bottom].show:before{transform:translate(-50%,.31em) scale(1)}:host[position=bottom]:after{border-width:0 .25em .25em;border-color:transparent transparent #545e61 transparent;transform-origin:bottom}\n"] });
|
|
1234
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: TooltipComponent, decorators: [{
|
|
1235
|
+
type: Component,
|
|
1236
|
+
args: [{ selector: '[sfc-tooltip]', template: `<ng-content></ng-content>`, styles: [":host{position:relative}:host:before,:host:after{position:absolute;left:50%;bottom:calc(100% + 5px);pointer-events:none;transition:.2s;will-change:transform}:host:hover:before,:host.show:before{content:attr(value);padding:.4em .7em;font-size:.8em;font-weight:initial;width:inherit;max-width:18.75em;border-radius:6px;background-color:#545e61;box-shadow:0 0 20.25em #0003;color:#fff;text-align:center;white-space:pre-wrap;overflow:hidden;word-wrap:break-word;z-index:9999}:host:after{content:\"\";border-style:solid;transition-duration:0s;transform:translate(-50%) scaleY(0)}:host[type=hover]:before,:host[type=hover]:after,:host:not(.show):before,:host:not(.show):after{visibility:hidden;opacity:0}:host[type=hover]:hover:before,:host[type=hover]:hover:after,:host.show:before,:host.show:after{visibility:visible;opacity:1}:host[type=hover]:hover:before,:host.show:before{transition-delay:.1s}:host[type=hover]:hover:after,:host.show:after{transition-delay:.3s;transition-duration:.2s;transform:translate(-50%) scaleY(1)}:host[position=top]:before,:host[position=top]:after{left:50%;bottom:calc(100% + 5px)}:host[position=top]:before{transform:translate(-50%,-5px) scale(.5)}:host[position=top]:hover:before,:host[position=top].show:before{transform:translate(-50%,-.25em) scale(1)}:host[position=top]:after{border-width:.25em .25em 0;border-color:#545e61 transparent transparent transparent;transform-origin:top}:host[position=left]:before,:host[position=left]:after{left:auto;right:calc(100% + 5px);bottom:50%}:host[position=left]:before{transform:translate(-.25em,50%) scale(.5)}:host[position=left]:hover:before,:host[position=left].show:before{transform:translate(-.31em,50%) scale(1)}:host[position=left]:after{border-width:.25em 0 .25em .25em;border-color:transparent transparent transparent #545e61;transform-origin:left;transform:translateY(50%) scaleX(0)}:host[position=left]:hover:after,:host[position=left].show:after{transform:translateY(50%) scaleX(1)}:host[position=right]:before,:host[position=right]:after{left:calc(100% + 5px);bottom:50%}:host[position=right]:before{transform:translate(5px,50%) scale(.5)}:host[position=right]:hover:before,:host[position=right].show:before{transform:translate(.31em,50%) scale(1)}:host[position=right]:after{border-width:.25em .25em .25em 0;border-color:transparent #545e61 transparent transparent;transform-origin:right;transform:translateY(50%) scaleX(0)}:host[position=right]:hover:after,:host[position=right].show:after{transform:translateY(50%) scaleX(1)}:host[position=bottom]:before,:host[position=bottom]:after{top:calc(100% + 5px);bottom:auto}:host[position=bottom]:before{transform:translate(-50%,5px) scale(.5)}:host[position=bottom]:hover:before,:host[position=bottom].show:before{transform:translate(-50%,.31em) scale(1)}:host[position=bottom]:after{border-width:0 .25em .25em;border-color:transparent transparent #545e61 transparent;transform-origin:bottom}\n"] }]
|
|
1237
|
+
}], ctorParameters: function () {
|
|
1238
|
+
return [{ type: ResizeService }, { type: Window, decorators: [{
|
|
1239
|
+
type: Inject,
|
|
1240
|
+
args: [WINDOW]
|
|
1241
|
+
}] }];
|
|
1242
|
+
}, propDecorators: { value: [{
|
|
1243
|
+
type: Input,
|
|
1244
|
+
args: ['sfc-tooltip']
|
|
1245
|
+
}, {
|
|
1246
|
+
type: HostBinding,
|
|
1247
|
+
args: ['attr.value']
|
|
1248
|
+
}], tooltipType: [{
|
|
1249
|
+
type: Input
|
|
1250
|
+
}, {
|
|
1251
|
+
type: HostBinding,
|
|
1252
|
+
args: ['attr.type']
|
|
1253
|
+
}], tooltipPosition: [{
|
|
1254
|
+
type: Input
|
|
1255
|
+
}, {
|
|
1256
|
+
type: HostBinding,
|
|
1257
|
+
args: ['attr.position']
|
|
1258
|
+
}], tooltipShow: [{
|
|
1259
|
+
type: Input
|
|
1260
|
+
}, {
|
|
1261
|
+
type: HostBinding,
|
|
1262
|
+
args: ['class.show']
|
|
1263
|
+
}], click: [{
|
|
1264
|
+
type: HostListener,
|
|
1265
|
+
args: ['click']
|
|
1266
|
+
}] } });
|
|
1267
|
+
|
|
1268
|
+
class DelimeterComponent {
|
|
1269
|
+
}
|
|
1270
|
+
DelimeterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DelimeterComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1271
|
+
DelimeterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: DelimeterComponent, selector: "sfc-delimeter", ngImport: i0, template: ``, isInline: true, styles: [":host{width:100%;height:.07em}:host :host-context(.sfc-default-theme){background:linear-gradient(to right,rgba(0,0,0,0) 0%,rgba(0,0,0,.3) 17%,rgba(0,0,0,.3) 83%,rgba(0,0,0,0) 100%)}:host :host-context(.sfc-dark-theme){background:linear-gradient(to right,rgba(255,255,255,0) 0%,rgba(255,255,255,.4) 17%,rgba(255,255,255,.4) 83%,rgba(255,255,255,0) 100%)}\n"] });
|
|
1272
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DelimeterComponent, decorators: [{
|
|
1273
|
+
type: Component,
|
|
1274
|
+
args: [{ selector: 'sfc-delimeter', template: ``, styles: [":host{width:100%;height:.07em}:host :host-context(.sfc-default-theme){background:linear-gradient(to right,rgba(0,0,0,0) 0%,rgba(0,0,0,.3) 17%,rgba(0,0,0,.3) 83%,rgba(0,0,0,0) 100%)}:host :host-context(.sfc-dark-theme){background:linear-gradient(to right,rgba(255,255,255,0) 0%,rgba(255,255,255,.4) 17%,rgba(255,255,255,.4) 83%,rgba(255,255,255,0) 100%)}\n"] }]
|
|
1275
|
+
}] });
|
|
1276
|
+
|
|
1277
|
+
class LoaderConstants {
|
|
1278
|
+
}
|
|
1279
|
+
LoaderConstants.GLOBAL_LOADER_ID = 'global';
|
|
1280
|
+
LoaderConstants.LOCAL_LOADER_ID = 'local';
|
|
1281
|
+
LoaderConstants.CSS_CLASS_BACKGROUND = 'background';
|
|
1282
|
+
|
|
1283
|
+
class LoaderService {
|
|
1284
|
+
constructor() {
|
|
1285
|
+
this.loaderSubject = new BehaviorSubject([]);
|
|
1286
|
+
this.loaders$ = this.loaderSubject
|
|
1287
|
+
.asObservable()
|
|
1288
|
+
.pipe(filter(loaders => any(loaders)), distinctUntilChanged());
|
|
1289
|
+
}
|
|
1290
|
+
/**
|
|
1291
|
+
* Show loader by Id
|
|
1292
|
+
* @param id Loader Id
|
|
1293
|
+
* @param register If true register loader and show it
|
|
1294
|
+
*/
|
|
1295
|
+
show(id = LoaderConstants.GLOBAL_LOADER_ID, register = false) {
|
|
1296
|
+
return this.setLoaderStatus(id, true, register);
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Hide loader
|
|
1300
|
+
* @param id Loader Id
|
|
1301
|
+
*/
|
|
1302
|
+
hide(id = LoaderConstants.GLOBAL_LOADER_ID) {
|
|
1303
|
+
this.setLoaderStatus(id, false);
|
|
1304
|
+
}
|
|
1305
|
+
/**
|
|
1306
|
+
* Register loader for next use
|
|
1307
|
+
* @param event Loader event
|
|
1308
|
+
* @returns Registred loade observable
|
|
1309
|
+
*/
|
|
1310
|
+
register(event) {
|
|
1311
|
+
const loaders = this.loaderSubject.getValue();
|
|
1312
|
+
if (addItem(loaders, event, () => hasObjectItem(loaders, nameof('id'), event.id))) {
|
|
1313
|
+
this.loaderSubject.next(loaders);
|
|
1314
|
+
}
|
|
1315
|
+
return this.selectLoaderById(event.id);
|
|
1316
|
+
}
|
|
1317
|
+
/**
|
|
1318
|
+
* Remove loader
|
|
1319
|
+
* @param id Loader Id
|
|
1320
|
+
*/
|
|
1321
|
+
remove(id = LoaderConstants.GLOBAL_LOADER_ID) {
|
|
1322
|
+
const loaders = this.loaderSubject.getValue();
|
|
1323
|
+
if (removeItem(loaders, loader => loader.id == id)) {
|
|
1324
|
+
this.loaderSubject.next(loaders);
|
|
1325
|
+
}
|
|
1326
|
+
}
|
|
1327
|
+
selectLoaderById(id) {
|
|
1328
|
+
return this.loaders$
|
|
1329
|
+
.pipe(map(loaders => loaders.find(loader => loader.id == id)), distinctUntilChanged());
|
|
1330
|
+
}
|
|
1331
|
+
setLoaderStatus(id, status, register = false) {
|
|
1332
|
+
const loaders = this.loaderSubject.getValue(), ILoaderEvent = { id, status }, loader = firstOrDefault(loaders, (loader) => loader.id == id);
|
|
1333
|
+
if (isDefined(loader) && (loader === null || loader === void 0 ? void 0 : loader.status) == status)
|
|
1334
|
+
return this.selectLoaderById(id);
|
|
1335
|
+
const updatedLoaders = updateItem(loaders, (loader) => loader.id == id, ILoaderEvent);
|
|
1336
|
+
if (isDefined(updatedLoaders)) {
|
|
1337
|
+
this.loaderSubject.next(updatedLoaders);
|
|
1338
|
+
}
|
|
1339
|
+
if (register) {
|
|
1340
|
+
return this.register(ILoaderEvent);
|
|
1341
|
+
}
|
|
1342
|
+
return null;
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
LoaderService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: LoaderService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1346
|
+
LoaderService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: LoaderService, providedIn: 'root' });
|
|
1347
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: LoaderService, decorators: [{
|
|
1348
|
+
type: Injectable,
|
|
1349
|
+
args: [{
|
|
1350
|
+
providedIn: 'root'
|
|
1351
|
+
}]
|
|
1352
|
+
}] });
|
|
1353
|
+
|
|
1354
|
+
class LoaderBaseComponent {
|
|
1355
|
+
constructor(loaderService) {
|
|
1356
|
+
this.loaderService = loaderService;
|
|
1357
|
+
this.UIClass = UIClass;
|
|
1358
|
+
/**
|
|
1359
|
+
* Loader identificator (global by default)
|
|
1360
|
+
*/
|
|
1361
|
+
this.id = LoaderConstants.GLOBAL_LOADER_ID;
|
|
1362
|
+
/**
|
|
1363
|
+
* Is start on init (loader register with show = True)
|
|
1364
|
+
*/
|
|
1365
|
+
this.start = false;
|
|
1366
|
+
/**
|
|
1367
|
+
* Loader when active(show) has background(low opacity)
|
|
1368
|
+
*/
|
|
1369
|
+
this.background = true;
|
|
1370
|
+
this.show$ = EMPTY;
|
|
1371
|
+
}
|
|
1372
|
+
ngOnInit() {
|
|
1373
|
+
// register new loader
|
|
1374
|
+
this.show$ = this.loaderService.register({ id: this.id, status: this.start })
|
|
1375
|
+
.pipe(map((event) => this.id === event.id && event.status));
|
|
1376
|
+
}
|
|
1377
|
+
get preLoaderClasses() {
|
|
1378
|
+
let classes = {};
|
|
1379
|
+
if (this.id === LoaderConstants.GLOBAL_LOADER_ID)
|
|
1380
|
+
classes[LoaderConstants.GLOBAL_LOADER_ID] = true;
|
|
1381
|
+
else
|
|
1382
|
+
classes[LoaderConstants.LOCAL_LOADER_ID] = true;
|
|
1383
|
+
classes[LoaderConstants.CSS_CLASS_BACKGROUND] = this.background;
|
|
1384
|
+
return classes;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
LoaderBaseComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: LoaderBaseComponent, deps: [{ token: LoaderService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1388
|
+
LoaderBaseComponent.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: LoaderBaseComponent, inputs: { id: "id", start: "start", background: "background" }, ngImport: i0 });
|
|
1389
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: LoaderBaseComponent, decorators: [{
|
|
1390
|
+
type: Directive
|
|
1391
|
+
}], ctorParameters: function () { return [{ type: LoaderService }]; }, propDecorators: { id: [{
|
|
1392
|
+
type: Input
|
|
1393
|
+
}], start: [{
|
|
1394
|
+
type: Input
|
|
1395
|
+
}], background: [{
|
|
1396
|
+
type: Input
|
|
1397
|
+
}] } });
|
|
1398
|
+
|
|
1399
|
+
class BounceLoaderComponent extends LoaderBaseComponent {
|
|
1400
|
+
}
|
|
1401
|
+
BounceLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BounceLoaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1402
|
+
BounceLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: BounceLoaderComponent, selector: "sfc-bounce-loader", usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"show$ | async\" class=\"preloader\" [ngClass]=\"preLoaderClasses\">\r\n <div class=\"spinner\">\r\n <div class=\"bounce\"></div>\r\n <div class=\"bounce\"></div>\r\n <div class=\"bounce\"></div>\r\n </div>\r\n</div>", styles: [".preloader{position:relative;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.preloader.background{opacity:.7}:host-context(.sfc-default-theme) .preloader.background{background-color:#fff}:host-context(.sfc-dark-theme) .preloader.background{background-color:#656d78}.preloader.global{z-index:9999;position:fixed}.preloader.local{z-index:9998;position:absolute}\n", ".spinner{text-align:center}.spinner .bounce{border-radius:100%;display:inline-block;animation:bounce-delay 1.4s infinite ease-in-out both;width:1em;height:1em}:host-context(.sfc-default-theme) .spinner .bounce{background-color:#545e61}:host-context(.sfc-dark-theme) .spinner .bounce{background-color:#fff}.spinner .bounce:nth-child(1){animation-delay:-.32s}.spinner .bounce:nth-child(2){animation-delay:-.16s}@keyframes bounce-delay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}\n"], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i1$1.AsyncPipe } });
|
|
1403
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: BounceLoaderComponent, decorators: [{
|
|
1404
|
+
type: Component,
|
|
1405
|
+
args: [{ selector: 'sfc-bounce-loader', template: "<div *ngIf=\"show$ | async\" class=\"preloader\" [ngClass]=\"preLoaderClasses\">\r\n <div class=\"spinner\">\r\n <div class=\"bounce\"></div>\r\n <div class=\"bounce\"></div>\r\n <div class=\"bounce\"></div>\r\n </div>\r\n</div>", styles: [".preloader{position:relative;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.preloader.background{opacity:.7}:host-context(.sfc-default-theme) .preloader.background{background-color:#fff}:host-context(.sfc-dark-theme) .preloader.background{background-color:#656d78}.preloader.global{z-index:9999;position:fixed}.preloader.local{z-index:9998;position:absolute}\n", ".spinner{text-align:center}.spinner .bounce{border-radius:100%;display:inline-block;animation:bounce-delay 1.4s infinite ease-in-out both;width:1em;height:1em}:host-context(.sfc-default-theme) .spinner .bounce{background-color:#545e61}:host-context(.sfc-dark-theme) .spinner .bounce{background-color:#fff}.spinner .bounce:nth-child(1){animation-delay:-.32s}.spinner .bounce:nth-child(2){animation-delay:-.16s}@keyframes bounce-delay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}\n"] }]
|
|
1406
|
+
}] });
|
|
1407
|
+
|
|
1408
|
+
var CircleLoaderType;
|
|
1409
|
+
(function (CircleLoaderType) {
|
|
1410
|
+
CircleLoaderType["Default"] = "default";
|
|
1411
|
+
CircleLoaderType["Fading"] = "fading";
|
|
1412
|
+
})(CircleLoaderType || (CircleLoaderType = {}));
|
|
1413
|
+
|
|
1414
|
+
class CircleLoaderComponent extends LoaderBaseComponent {
|
|
1415
|
+
constructor() {
|
|
1416
|
+
super(...arguments);
|
|
1417
|
+
this.type = CircleLoaderType.Default;
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
CircleLoaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: CircleLoaderComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
|
|
1421
|
+
CircleLoaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: CircleLoaderComponent, selector: "sfc-circle-loader", inputs: { type: "type" }, usesInheritance: true, ngImport: i0, template: "<div *ngIf=\"show$ | async\" class=\"preloader\" [ngClass]=\"preLoaderClasses\">\r\n <div class=\"circles-container\" [ngClass]=\"type\">\r\n <div class=\"circle1\"></div>\r\n <div class=\"circle2\"></div>\r\n <div class=\"circle3\"></div>\r\n <div class=\"circle4\"></div>\r\n <div class=\"circle5\"></div>\r\n <div class=\"circle6\"></div>\r\n <div class=\"circle7\"></div>\r\n <div class=\"circle8\"></div>\r\n <div class=\"circle9\"></div>\r\n <div class=\"circle10\"></div>\r\n <div class=\"circle11\"></div>\r\n <div class=\"circle12\"></div>\r\n </div>\r\n</div>", styles: [".preloader{position:relative;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.preloader.background{opacity:.7}:host-context(.sfc-default-theme) .preloader.background{background-color:#fff}:host-context(.sfc-dark-theme) .preloader.background{background-color:#656d78}.preloader.global{z-index:9999;position:fixed}.preloader.local{z-index:9998;position:absolute}\n", ".circles-container{position:relative;width:2.5em;height:2.5em}.circles-container div{width:100%;height:100%;position:absolute;left:0;top:0}.circles-container div:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;border-radius:100%;animation:bounce-delay 1.2s infinite ease-in-out both}:host-context(.sfc-default-theme) .circles-container div:before{background-color:#545e61}:host-context(.sfc-dark-theme) .circles-container div:before{background-color:#fff}.circles-container.fading div:before{animation-name:circle-fade-delay}.circles-container .circle2{transform:rotate(30deg)}.circles-container .circle2:before{animation-delay:-1.1s}.circles-container .circle3{transform:rotate(60deg)}.circles-container .circle3:before{animation-delay:-1s}.circles-container .circle4{transform:rotate(90deg)}.circles-container .circle4:before{animation-delay:-.9s}.circles-container .circle5{transform:rotate(120deg)}.circles-container .circle5:before{animation-delay:-.8s}.circles-container .circle6{transform:rotate(150deg)}.circles-container .circle6:before{animation-delay:-.7s}.circles-container .circle7{transform:rotate(180deg)}.circles-container .circle7:before{animation-delay:-.6s}.circles-container .circle8{transform:rotate(210deg)}.circles-container .circle8:before{animation-delay:-.5s}.circles-container .circle9{transform:rotate(240deg)}.circles-container .circle9:before{animation-delay:-.4s}.circles-container .circle10{transform:rotate(270deg)}.circles-container .circle10:before{animation-delay:-.3s}.circles-container .circle11{transform:rotate(300deg)}.circles-container .circle11:before{animation-delay:-.2s}.circles-container .circle12{transform:rotate(330deg)}.circles-container .circle12:before{animation-delay:-.1s}@keyframes bounce-delay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}@keyframes circle-fade-delay{0%,39%,to{opacity:0}40%{opacity:1}}\n"], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }], pipes: { "async": i1$1.AsyncPipe } });
|
|
1422
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: CircleLoaderComponent, decorators: [{
|
|
1423
|
+
type: Component,
|
|
1424
|
+
args: [{ selector: 'sfc-circle-loader', template: "<div *ngIf=\"show$ | async\" class=\"preloader\" [ngClass]=\"preLoaderClasses\">\r\n <div class=\"circles-container\" [ngClass]=\"type\">\r\n <div class=\"circle1\"></div>\r\n <div class=\"circle2\"></div>\r\n <div class=\"circle3\"></div>\r\n <div class=\"circle4\"></div>\r\n <div class=\"circle5\"></div>\r\n <div class=\"circle6\"></div>\r\n <div class=\"circle7\"></div>\r\n <div class=\"circle8\"></div>\r\n <div class=\"circle9\"></div>\r\n <div class=\"circle10\"></div>\r\n <div class=\"circle11\"></div>\r\n <div class=\"circle12\"></div>\r\n </div>\r\n</div>", styles: [".preloader{position:relative;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;text-align:center}.preloader.background{opacity:.7}:host-context(.sfc-default-theme) .preloader.background{background-color:#fff}:host-context(.sfc-dark-theme) .preloader.background{background-color:#656d78}.preloader.global{z-index:9999;position:fixed}.preloader.local{z-index:9998;position:absolute}\n", ".circles-container{position:relative;width:2.5em;height:2.5em}.circles-container div{width:100%;height:100%;position:absolute;left:0;top:0}.circles-container div:before{content:\"\";display:block;margin:0 auto;width:15%;height:15%;border-radius:100%;animation:bounce-delay 1.2s infinite ease-in-out both}:host-context(.sfc-default-theme) .circles-container div:before{background-color:#545e61}:host-context(.sfc-dark-theme) .circles-container div:before{background-color:#fff}.circles-container.fading div:before{animation-name:circle-fade-delay}.circles-container .circle2{transform:rotate(30deg)}.circles-container .circle2:before{animation-delay:-1.1s}.circles-container .circle3{transform:rotate(60deg)}.circles-container .circle3:before{animation-delay:-1s}.circles-container .circle4{transform:rotate(90deg)}.circles-container .circle4:before{animation-delay:-.9s}.circles-container .circle5{transform:rotate(120deg)}.circles-container .circle5:before{animation-delay:-.8s}.circles-container .circle6{transform:rotate(150deg)}.circles-container .circle6:before{animation-delay:-.7s}.circles-container .circle7{transform:rotate(180deg)}.circles-container .circle7:before{animation-delay:-.6s}.circles-container .circle8{transform:rotate(210deg)}.circles-container .circle8:before{animation-delay:-.5s}.circles-container .circle9{transform:rotate(240deg)}.circles-container .circle9:before{animation-delay:-.4s}.circles-container .circle10{transform:rotate(270deg)}.circles-container .circle10:before{animation-delay:-.3s}.circles-container .circle11{transform:rotate(300deg)}.circles-container .circle11:before{animation-delay:-.2s}.circles-container .circle12{transform:rotate(330deg)}.circles-container .circle12:before{animation-delay:-.1s}@keyframes bounce-delay{0%,80%,to{transform:scale(0)}40%{transform:scale(1)}}@keyframes circle-fade-delay{0%,39%,to{opacity:0}40%{opacity:1}}\n"] }]
|
|
1425
|
+
}], propDecorators: { type: [{
|
|
1426
|
+
type: Input
|
|
1427
|
+
}] } });
|
|
1428
|
+
|
|
1429
|
+
var ModalTemplate;
|
|
1430
|
+
(function (ModalTemplate) {
|
|
1431
|
+
ModalTemplate["Body"] = "body";
|
|
1432
|
+
ModalTemplate["Header"] = "header";
|
|
1433
|
+
ModalTemplate["Footer"] = "footer";
|
|
1434
|
+
})(ModalTemplate || (ModalTemplate = {}));
|
|
1435
|
+
|
|
1436
|
+
class ModalService {
|
|
1437
|
+
constructor() {
|
|
1438
|
+
this.subjectClose = new Subject();
|
|
1439
|
+
this.subjectOpen = new Subject();
|
|
1440
|
+
this.close$ = this.subjectClose.asObservable();
|
|
1441
|
+
this.open$ = this.subjectOpen.asObservable();
|
|
1442
|
+
}
|
|
1443
|
+
close() {
|
|
1444
|
+
this.subjectClose.next();
|
|
1445
|
+
}
|
|
1446
|
+
open(options) {
|
|
1447
|
+
this.subjectOpen.next(options);
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1450
|
+
ModalService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ModalService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
1451
|
+
ModalService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ModalService, providedIn: 'root' });
|
|
1452
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ModalService, decorators: [{
|
|
1453
|
+
type: Injectable,
|
|
1454
|
+
args: [{
|
|
1455
|
+
providedIn: 'root'
|
|
1456
|
+
}]
|
|
1457
|
+
}] });
|
|
1458
|
+
|
|
1459
|
+
class DefaultModalHeaderComponent {
|
|
1460
|
+
constructor(modalService) {
|
|
1461
|
+
this.modalService = modalService;
|
|
1462
|
+
this.DEFAULT_MODAL_HEADER_MODEL = {
|
|
1463
|
+
icon: 'fa fa-window-restore',
|
|
1464
|
+
showCloseIcon: true,
|
|
1465
|
+
text: 'Modal'
|
|
1466
|
+
};
|
|
1467
|
+
}
|
|
1468
|
+
ngOnInit() {
|
|
1469
|
+
if (!isDefined(this.model))
|
|
1470
|
+
this.model = this.DEFAULT_MODAL_HEADER_MODEL;
|
|
1471
|
+
}
|
|
1472
|
+
onClose() {
|
|
1473
|
+
this.modalService.close();
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
DefaultModalHeaderComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DefaultModalHeaderComponent, deps: [{ token: ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1477
|
+
DefaultModalHeaderComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: DefaultModalHeaderComponent, selector: "sfc-default-modal-header", inputs: { model: "model" }, ngImport: i0, template: "<div class=\"container\">\r\n <i *ngIf=\"model?.icon\" class=\"icon\" class=\"{{model?.icon}}\"></i>\r\n <span *ngIf=\"model?.text\" class=\"label\">{{model?.text}}</span>\r\n <span *ngIf=\"model?.showCloseIcon\" class=\"close\" (click)=\"onClose()\">\r\n <i class=\"fa fa-times\"></i>\r\n </span>\r\n</div>", styles: [":host{display:inline-flex;width:100%}:host .container{display:flex;align-items:flex-start;width:100%;justify-content:space-between}:host .container i{font-size:1em}:host .container .icon{padding-right:.7em}:host .container .label{font-size:1.2em;font-weight:700;-webkit-user-select:none;user-select:none;padding:0 .7em}:host .container .close{color:#545e61;cursor:pointer;display:flex;padding-left:.7em}:host .container .close:hover{color:#2bbbad}\n"], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1478
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DefaultModalHeaderComponent, decorators: [{
|
|
1479
|
+
type: Component,
|
|
1480
|
+
args: [{ selector: 'sfc-default-modal-header', template: "<div class=\"container\">\r\n <i *ngIf=\"model?.icon\" class=\"icon\" class=\"{{model?.icon}}\"></i>\r\n <span *ngIf=\"model?.text\" class=\"label\">{{model?.text}}</span>\r\n <span *ngIf=\"model?.showCloseIcon\" class=\"close\" (click)=\"onClose()\">\r\n <i class=\"fa fa-times\"></i>\r\n </span>\r\n</div>", styles: [":host{display:inline-flex;width:100%}:host .container{display:flex;align-items:flex-start;width:100%;justify-content:space-between}:host .container i{font-size:1em}:host .container .icon{padding-right:.7em}:host .container .label{font-size:1.2em;font-weight:700;-webkit-user-select:none;user-select:none;padding:0 .7em}:host .container .close{color:#545e61;cursor:pointer;display:flex;padding-left:.7em}:host .container .close:hover{color:#2bbbad}\n"] }]
|
|
1481
|
+
}], ctorParameters: function () { return [{ type: ModalService }]; }, propDecorators: { model: [{
|
|
1482
|
+
type: Input
|
|
1483
|
+
}] } });
|
|
1484
|
+
|
|
1485
|
+
class DefaultModalFooterComponent {
|
|
1486
|
+
constructor(modalService) {
|
|
1487
|
+
this.modalService = modalService;
|
|
1488
|
+
this.DEFAULT_MODAL_FOOTER_MODEL = {
|
|
1489
|
+
cancelButton: true,
|
|
1490
|
+
applyButton: true
|
|
1491
|
+
};
|
|
1492
|
+
this.BUTTON_CUSTOM_SIZE = 0.9;
|
|
1493
|
+
this.ComponentSize = ComponentSize;
|
|
1494
|
+
this.ButtonType = ButtonType;
|
|
1495
|
+
}
|
|
1496
|
+
ngOnInit() {
|
|
1497
|
+
if (!isDefined(this.model)) {
|
|
1498
|
+
this.model = this.DEFAULT_MODAL_FOOTER_MODEL;
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1501
|
+
onButtonClick(isCancelButton = false) {
|
|
1502
|
+
var _a, _b, _c, _d;
|
|
1503
|
+
if (isCancelButton) {
|
|
1504
|
+
if ((_a = this.model) === null || _a === void 0 ? void 0 : _a.onCancel) {
|
|
1505
|
+
return (_b = this.model) === null || _b === void 0 ? void 0 : _b.onCancel();
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
else {
|
|
1509
|
+
if ((_c = this.model) === null || _c === void 0 ? void 0 : _c.onApply) {
|
|
1510
|
+
return (_d = this.model) === null || _d === void 0 ? void 0 : _d.onApply();
|
|
1511
|
+
}
|
|
1512
|
+
}
|
|
1513
|
+
this.modalService.close();
|
|
1514
|
+
}
|
|
1515
|
+
}
|
|
1516
|
+
DefaultModalFooterComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DefaultModalFooterComponent, deps: [{ token: ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1517
|
+
DefaultModalFooterComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: DefaultModalFooterComponent, selector: "sfc-default-modal-footer", inputs: { model: "model" }, ngImport: i0, template: "<div class=\"container\">\r\n <sfc-button *ngIf=\"model?.applyButton\" [sfcComponentSize] [customSize]=\"BUTTON_CUSTOM_SIZE\" text=\"Ok\"\r\n [types]=\"[ButtonType.Rounded]\" (click)=\"onButtonClick()\">\r\n </sfc-button>\r\n <sfc-button *ngIf=\"model?.cancelButton\" [sfcComponentSize] [customSize]=\"BUTTON_CUSTOM_SIZE\" text=\"Cancel\"\r\n [types]=\"[ButtonType.Rounded]\" (click)=\"onButtonClick(true)\">\r\n </sfc-button>\r\n</div>", styles: [":host{display:inline-flex;width:100%}:host .container{display:flex;justify-content:center;align-items:center;width:100%}:host .container sfc-button:first-child{padding-right:.3em}:host .container sfc-button:nth-child(2){padding-left:.3em}:host .container ::ng-deep sfc-button .button.rounded{width:5em}:host .container ::ng-deep sfc-button .button:not(:hover){color:#545e61!important;border-color:#545e61!important}\n"], components: [{ type: ButtonComponent, selector: "sfc-button", inputs: ["text", "iconBefore", "iconAfter", "disabled", "types"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: ComponentSizeDirective, selector: "[sfcComponentSize]", inputs: ["sfcComponentSize", "customSize"] }] });
|
|
1518
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DefaultModalFooterComponent, decorators: [{
|
|
1519
|
+
type: Component,
|
|
1520
|
+
args: [{ selector: 'sfc-default-modal-footer', template: "<div class=\"container\">\r\n <sfc-button *ngIf=\"model?.applyButton\" [sfcComponentSize] [customSize]=\"BUTTON_CUSTOM_SIZE\" text=\"Ok\"\r\n [types]=\"[ButtonType.Rounded]\" (click)=\"onButtonClick()\">\r\n </sfc-button>\r\n <sfc-button *ngIf=\"model?.cancelButton\" [sfcComponentSize] [customSize]=\"BUTTON_CUSTOM_SIZE\" text=\"Cancel\"\r\n [types]=\"[ButtonType.Rounded]\" (click)=\"onButtonClick(true)\">\r\n </sfc-button>\r\n</div>", styles: [":host{display:inline-flex;width:100%}:host .container{display:flex;justify-content:center;align-items:center;width:100%}:host .container sfc-button:first-child{padding-right:.3em}:host .container sfc-button:nth-child(2){padding-left:.3em}:host .container ::ng-deep sfc-button .button.rounded{width:5em}:host .container ::ng-deep sfc-button .button:not(:hover){color:#545e61!important;border-color:#545e61!important}\n"] }]
|
|
1521
|
+
}], ctorParameters: function () { return [{ type: ModalService }]; }, propDecorators: { model: [{
|
|
1522
|
+
type: Input
|
|
1523
|
+
}] } });
|
|
1524
|
+
|
|
1525
|
+
class ModalComponent {
|
|
1526
|
+
constructor(modalService) {
|
|
1527
|
+
this.modalService = modalService;
|
|
1528
|
+
this.ModalTemplate = ModalTemplate;
|
|
1529
|
+
// End Defaults
|
|
1530
|
+
this.hideOnEsc = true;
|
|
1531
|
+
this.hideOnClickOutside = true;
|
|
1532
|
+
}
|
|
1533
|
+
onEscapeKeyDownHandler() {
|
|
1534
|
+
if (this.hideOnEsc)
|
|
1535
|
+
this.close();
|
|
1536
|
+
}
|
|
1537
|
+
getTemplate(template) {
|
|
1538
|
+
var _a;
|
|
1539
|
+
if (!isDefined(this.templates))
|
|
1540
|
+
return null;
|
|
1541
|
+
const templateRef = firstOrDefault((_a = this.templates) === null || _a === void 0 ? void 0 : _a.toArray(), t => t.templateName == template);
|
|
1542
|
+
return isDefined(templateRef) ? templateRef === null || templateRef === void 0 ? void 0 : templateRef.template : null;
|
|
1543
|
+
}
|
|
1544
|
+
isShowDefault(template) {
|
|
1545
|
+
return !isDefined(this.getTemplate(template))
|
|
1546
|
+
&& (template == ModalTemplate.Header
|
|
1547
|
+
? !isDefined(this.header)
|
|
1548
|
+
: !isDefined(this.footer));
|
|
1549
|
+
}
|
|
1550
|
+
close() {
|
|
1551
|
+
this.modalService.close();
|
|
1552
|
+
}
|
|
1553
|
+
}
|
|
1554
|
+
ModalComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ModalComponent, deps: [{ token: ModalService }], target: i0.ɵɵFactoryTarget.Component });
|
|
1555
|
+
ModalComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: ModalComponent, selector: "sfc-modal", inputs: { body: "body", header: "header", footer: "footer", defaultHeaderModel: "defaultHeaderModel", defaultFooterModel: "defaultFooterModel", hideOnEsc: "hideOnEsc", hideOnClickOutside: "hideOnClickOutside" }, host: { listeners: { "document:keydown.escape": "onEscapeKeyDownHandler()" } }, queries: [{ propertyName: "templates", predicate: TemplateReferenceDirective, read: TemplateReferenceDirective }], ngImport: i0, template: "<div class=\"overlay\" [@hideOverlay] (click)=\"hideOnClickOutside && close()\">\r\n <div class=\"content\" [@hideContent] (click)=\"$event.stopPropagation()\">\r\n\r\n <div class=\"header\">\r\n\r\n <ng-container *ngIf=\"header;else headerTemplate\">\r\n <ng-container *ngTemplateOutlet=\"header;\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #headerTemplate>\r\n <ng-container *ngTemplateOutlet=\"getTemplate(ModalTemplate.Header)\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-container *ngIf=\"isShowDefault(ModalTemplate.Header)\">\r\n <sfc-default-modal-header [model]=\"defaultHeaderModel\">\r\n </sfc-default-modal-header>\r\n </ng-container>\r\n\r\n </div>\r\n\r\n <div class=\"body\">\r\n\r\n <ng-container *ngIf=\"body;else bodyTemplate\">\r\n <ng-container *ngTemplateOutlet=\"body;\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #bodyTemplate>\r\n <ng-container #bodyTemplate *ngTemplateOutlet=\"getTemplate(ModalTemplate.Body)\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n </div>\r\n\r\n <div class=\"footer\">\r\n\r\n <ng-container *ngIf=\"footer;else footerTemplate\">\r\n <ng-container *ngTemplateOutlet=\"footer;\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #footerTemplate>\r\n <ng-container *ngTemplateOutlet=\"getTemplate(ModalTemplate.Footer)\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-container *ngIf=\"isShowDefault(ModalTemplate.Footer)\">\r\n <sfc-default-modal-footer [model]=\"defaultFooterModel\">\r\n </sfc-default-modal-footer>\r\n </ng-container>\r\n\r\n </div>\r\n </div>\r\n</div>", styles: [".overlay{display:flex;align-items:center;justify-content:center;position:fixed;top:0;left:0;width:100%;height:100%;z-index:9999;background-color:#0009;-webkit-backface-visibility:visible;backface-visibility:visible;animation:expand-overlay .4s cubic-bezier(.55,0,.1,1)}@keyframes expand-overlay{0%{visibility:hidden;opacity:0}}.overlay .content{display:flex;align-items:center;position:relative;padding:.7em;margin:auto;background-color:#f5f7fa;max-width:calc(100% - 3em);max-height:calc(100% - 3em);border-radius:3px;overflow-y:auto;box-shadow:0 .125em .625em #0003;transform:scale(1);flex-direction:column;animation:expand-modal .4s cubic-bezier(.55,0,.1,1)}@keyframes expand-modal{0%{visibility:hidden;opacity:0;transform:scale(1.2)}}.overlay .content>div{width:100%;flex:0 0 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#545e61;flex-direction:row;display:flex;justify-content:center}\n"], components: [{ type: DefaultModalHeaderComponent, selector: "sfc-default-modal-header", inputs: ["model"] }, { type: DefaultModalFooterComponent, selector: "sfc-default-modal-footer", inputs: ["model"] }], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i1$1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet"] }], animations: [
|
|
1556
|
+
trigger('hideOverlay', [
|
|
1557
|
+
state('initial', style({ opacity: 1, visibility: 'visible' })),
|
|
1558
|
+
state('void', style({ opacity: 0, visibility: 'hidden' })),
|
|
1559
|
+
transition('* => void', [
|
|
1560
|
+
group([
|
|
1561
|
+
query(':self', [
|
|
1562
|
+
animate('400ms cubic-bezier(.55, 0, .1, 1)', style({
|
|
1563
|
+
opacity: 0,
|
|
1564
|
+
visibility: 'hidden'
|
|
1565
|
+
}))
|
|
1566
|
+
]),
|
|
1567
|
+
query('@hideContent', [animateChild()])
|
|
1568
|
+
])
|
|
1569
|
+
])
|
|
1570
|
+
]),
|
|
1571
|
+
trigger('hideContent', [
|
|
1572
|
+
state('initial', style({ opacity: 1, visibility: 'visible', transform: 'scale(1)' })),
|
|
1573
|
+
state('void', style({ opacity: 0, visibility: 'hidden', transform: 'scale(1.2)' })),
|
|
1574
|
+
transition('* => void', animate('400ms cubic-bezier(.55, 0, .1, 1)'))
|
|
1575
|
+
])
|
|
1576
|
+
] });
|
|
1577
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ModalComponent, decorators: [{
|
|
1578
|
+
type: Component,
|
|
1579
|
+
args: [{ selector: 'sfc-modal', animations: [
|
|
1580
|
+
trigger('hideOverlay', [
|
|
1581
|
+
state('initial', style({ opacity: 1, visibility: 'visible' })),
|
|
1582
|
+
state('void', style({ opacity: 0, visibility: 'hidden' })),
|
|
1583
|
+
transition('* => void', [
|
|
1584
|
+
group([
|
|
1585
|
+
query(':self', [
|
|
1586
|
+
animate('400ms cubic-bezier(.55, 0, .1, 1)', style({
|
|
1587
|
+
opacity: 0,
|
|
1588
|
+
visibility: 'hidden'
|
|
1589
|
+
}))
|
|
1590
|
+
]),
|
|
1591
|
+
query('@hideContent', [animateChild()])
|
|
1592
|
+
])
|
|
1593
|
+
])
|
|
1594
|
+
]),
|
|
1595
|
+
trigger('hideContent', [
|
|
1596
|
+
state('initial', style({ opacity: 1, visibility: 'visible', transform: 'scale(1)' })),
|
|
1597
|
+
state('void', style({ opacity: 0, visibility: 'hidden', transform: 'scale(1.2)' })),
|
|
1598
|
+
transition('* => void', animate('400ms cubic-bezier(.55, 0, .1, 1)'))
|
|
1599
|
+
])
|
|
1600
|
+
], template: "<div class=\"overlay\" [@hideOverlay] (click)=\"hideOnClickOutside && close()\">\r\n <div class=\"content\" [@hideContent] (click)=\"$event.stopPropagation()\">\r\n\r\n <div class=\"header\">\r\n\r\n <ng-container *ngIf=\"header;else headerTemplate\">\r\n <ng-container *ngTemplateOutlet=\"header;\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #headerTemplate>\r\n <ng-container *ngTemplateOutlet=\"getTemplate(ModalTemplate.Header)\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-container *ngIf=\"isShowDefault(ModalTemplate.Header)\">\r\n <sfc-default-modal-header [model]=\"defaultHeaderModel\">\r\n </sfc-default-modal-header>\r\n </ng-container>\r\n\r\n </div>\r\n\r\n <div class=\"body\">\r\n\r\n <ng-container *ngIf=\"body;else bodyTemplate\">\r\n <ng-container *ngTemplateOutlet=\"body;\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #bodyTemplate>\r\n <ng-container #bodyTemplate *ngTemplateOutlet=\"getTemplate(ModalTemplate.Body)\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n </div>\r\n\r\n <div class=\"footer\">\r\n\r\n <ng-container *ngIf=\"footer;else footerTemplate\">\r\n <ng-container *ngTemplateOutlet=\"footer;\"></ng-container>\r\n </ng-container>\r\n\r\n <ng-template #footerTemplate>\r\n <ng-container *ngTemplateOutlet=\"getTemplate(ModalTemplate.Footer)\">\r\n </ng-container>\r\n </ng-template>\r\n\r\n <ng-container *ngIf=\"isShowDefault(ModalTemplate.Footer)\">\r\n <sfc-default-modal-footer [model]=\"defaultFooterModel\">\r\n </sfc-default-modal-footer>\r\n </ng-container>\r\n\r\n </div>\r\n </div>\r\n</div>", styles: [".overlay{display:flex;align-items:center;justify-content:center;position:fixed;top:0;left:0;width:100%;height:100%;z-index:9999;background-color:#0009;-webkit-backface-visibility:visible;backface-visibility:visible;animation:expand-overlay .4s cubic-bezier(.55,0,.1,1)}@keyframes expand-overlay{0%{visibility:hidden;opacity:0}}.overlay .content{display:flex;align-items:center;position:relative;padding:.7em;margin:auto;background-color:#f5f7fa;max-width:calc(100% - 3em);max-height:calc(100% - 3em);border-radius:3px;overflow-y:auto;box-shadow:0 .125em .625em #0003;transform:scale(1);flex-direction:column;animation:expand-modal .4s cubic-bezier(.55,0,.1,1)}@keyframes expand-modal{0%{visibility:hidden;opacity:0;transform:scale(1.2)}}.overlay .content>div{width:100%;flex:0 0 auto;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;color:#545e61;flex-direction:row;display:flex;justify-content:center}\n"] }]
|
|
1601
|
+
}], ctorParameters: function () { return [{ type: ModalService }]; }, propDecorators: { body: [{
|
|
1602
|
+
type: Input
|
|
1603
|
+
}], header: [{
|
|
1604
|
+
type: Input
|
|
1605
|
+
}], footer: [{
|
|
1606
|
+
type: Input
|
|
1607
|
+
}], defaultHeaderModel: [{
|
|
1608
|
+
type: Input
|
|
1609
|
+
}], defaultFooterModel: [{
|
|
1610
|
+
type: Input
|
|
1611
|
+
}], hideOnEsc: [{
|
|
1612
|
+
type: Input
|
|
1613
|
+
}], hideOnClickOutside: [{
|
|
1614
|
+
type: Input
|
|
1615
|
+
}], onEscapeKeyDownHandler: [{
|
|
1616
|
+
type: HostListener,
|
|
1617
|
+
args: ['document:keydown.escape']
|
|
1618
|
+
}], templates: [{
|
|
1619
|
+
type: ContentChildren,
|
|
1620
|
+
args: [TemplateReferenceDirective, { read: TemplateReferenceDirective }]
|
|
1621
|
+
}] } });
|
|
1622
|
+
|
|
1623
|
+
class ModalOpenOnClickDirective {
|
|
1624
|
+
constructor(templateRef, viewContainer, modalService) {
|
|
1625
|
+
this.templateRef = templateRef;
|
|
1626
|
+
this.viewContainer = viewContainer;
|
|
1627
|
+
this.modalService = modalService;
|
|
1628
|
+
this.clickHandler = ((event) => {
|
|
1629
|
+
this.viewContainer.clear();
|
|
1630
|
+
this.viewContainer.createEmbeddedView(this.templateRef);
|
|
1631
|
+
this.modalService.open(event.currentTarget);
|
|
1632
|
+
}).bind(this);
|
|
1633
|
+
this.elements = [];
|
|
1634
|
+
}
|
|
1635
|
+
set modalOpenOnClick(elements) {
|
|
1636
|
+
if (!isDefined(elements))
|
|
1637
|
+
return;
|
|
1638
|
+
if (elements instanceof HTMLElement)
|
|
1639
|
+
this.elements = [elements];
|
|
1640
|
+
else
|
|
1641
|
+
this.elements = elements;
|
|
1642
|
+
this.elements.forEach(el => {
|
|
1643
|
+
el.addEventListener('click', this.clickHandler);
|
|
1644
|
+
});
|
|
1645
|
+
}
|
|
1646
|
+
ngOnInit() {
|
|
1647
|
+
this._closeSubscription = this.modalService.close$
|
|
1648
|
+
.subscribe(() => {
|
|
1649
|
+
this.viewContainer.clear();
|
|
1650
|
+
});
|
|
1651
|
+
}
|
|
1652
|
+
ngOnDestroy() {
|
|
1653
|
+
var _a;
|
|
1654
|
+
(_a = this._closeSubscription) === null || _a === void 0 ? void 0 : _a.unsubscribe();
|
|
1655
|
+
this.elements.forEach(el => el.removeEventListener('click', this.clickHandler));
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
ModalOpenOnClickDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ModalOpenOnClickDirective, deps: [{ token: i0.TemplateRef }, { token: i0.ViewContainerRef }, { token: ModalService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
1659
|
+
ModalOpenOnClickDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "12.0.0", version: "13.2.6", type: ModalOpenOnClickDirective, selector: "[sfcModalOpenOnClick]", inputs: { modalOpenOnClick: ["sfcModalOpenOnClick", "modalOpenOnClick"] }, ngImport: i0 });
|
|
1660
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ModalOpenOnClickDirective, decorators: [{
|
|
1661
|
+
type: Directive,
|
|
1662
|
+
args: [{
|
|
1663
|
+
selector: '[sfcModalOpenOnClick]'
|
|
1664
|
+
}]
|
|
1665
|
+
}], ctorParameters: function () { return [{ type: i0.TemplateRef }, { type: i0.ViewContainerRef }, { type: ModalService }]; }, propDecorators: { modalOpenOnClick: [{
|
|
1666
|
+
type: Input,
|
|
1667
|
+
args: ['sfcModalOpenOnClick']
|
|
1668
|
+
}] } });
|
|
1669
|
+
|
|
1670
|
+
class HamburgerComponent {
|
|
1671
|
+
constructor() {
|
|
1672
|
+
this.open = false;
|
|
1673
|
+
this.onClick = () => this.open = !this.open;
|
|
1674
|
+
}
|
|
1675
|
+
}
|
|
1676
|
+
HamburgerComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HamburgerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1677
|
+
HamburgerComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: HamburgerComponent, selector: "sfc-hamburger", inputs: { open: "open" }, host: { listeners: { "click": "onClick()" }, properties: { "class.open": "this.open" } }, ngImport: i0, template: "<div class=\"container\">\r\n <div class=\"line half start\"></div>\r\n <div class=\"line\"></div>\r\n <div class=\"line half end\"></div>\r\n</div>", styles: [".container{width:1em;height:1em;display:flex;flex-direction:column;justify-content:space-between;cursor:pointer;transition:transform .33s ease-out}:host(.open) .container{transform:rotate(-45deg)}.container .line{border-radius:.31em;width:100%;height:.25em}:host-context(.sfc-default-theme) .container .line{background-color:#545e61}:host-context(.sfc-dark-theme) .container .line{background-color:#ccd1d9}.container .line.half{width:50%}.container .line.start{transition:transform .33s cubic-bezier(.54,-.81,.57,.57);transform-origin:right}:host(.open) .container .line.start{transform:rotate(-90deg) translate(.1875em)}.container .line.end{align-self:flex-end;transition:transform .33s cubic-bezier(.54,-.81,.57,.57);transform-origin:left}:host(.open) .container .line.end{transform:rotate(-90deg) translate(-.1875em)}.container:hover .line{background-color:#2bbbad!important}\n"] });
|
|
1678
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: HamburgerComponent, decorators: [{
|
|
1679
|
+
type: Component,
|
|
1680
|
+
args: [{ selector: 'sfc-hamburger', template: "<div class=\"container\">\r\n <div class=\"line half start\"></div>\r\n <div class=\"line\"></div>\r\n <div class=\"line half end\"></div>\r\n</div>", styles: [".container{width:1em;height:1em;display:flex;flex-direction:column;justify-content:space-between;cursor:pointer;transition:transform .33s ease-out}:host(.open) .container{transform:rotate(-45deg)}.container .line{border-radius:.31em;width:100%;height:.25em}:host-context(.sfc-default-theme) .container .line{background-color:#545e61}:host-context(.sfc-dark-theme) .container .line{background-color:#ccd1d9}.container .line.half{width:50%}.container .line.start{transition:transform .33s cubic-bezier(.54,-.81,.57,.57);transform-origin:right}:host(.open) .container .line.start{transform:rotate(-90deg) translate(.1875em)}.container .line.end{align-self:flex-end;transition:transform .33s cubic-bezier(.54,-.81,.57,.57);transform-origin:left}:host(.open) .container .line.end{transform:rotate(-90deg) translate(-.1875em)}.container:hover .line{background-color:#2bbbad!important}\n"] }]
|
|
1681
|
+
}], propDecorators: { open: [{
|
|
1682
|
+
type: Input
|
|
1683
|
+
}, {
|
|
1684
|
+
type: HostBinding,
|
|
1685
|
+
args: ['class.' + UIClass.Open]
|
|
1686
|
+
}], onClick: [{
|
|
1687
|
+
type: HostListener,
|
|
1688
|
+
args: ['click']
|
|
1689
|
+
}] } });
|
|
1690
|
+
|
|
1691
|
+
class DotsComponent {
|
|
1692
|
+
constructor() {
|
|
1693
|
+
this.open = false;
|
|
1694
|
+
this.direction = Direction.Horizontal;
|
|
1695
|
+
this.onClick = () => this.open = !this.open;
|
|
1696
|
+
}
|
|
1697
|
+
}
|
|
1698
|
+
DotsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DotsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1699
|
+
DotsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: DotsComponent, selector: "sfc-dots", inputs: { open: "open", direction: "direction" }, host: { listeners: { "click": "onClick()" }, properties: { "class.open": "this.open", "class": "this.direction" } }, ngImport: i0, template: "<div class=\"container\">\r\n <div class=\"dots-container\">\r\n <div class=\"dot\"></div>\r\n <div class=\"dot\"></div>\r\n <div class=\"dot\"></div>\r\n </div>\r\n</div>", styles: [":host{display:inline-flex;transform:rotate(90deg);transition:all .3s cubic-bezier(.175,.885,.32,1.275);cursor:pointer}:host.open{transform:rotate(0)}:host.vertical{transform:rotate(0)}:host.vertical.open{transform:rotate(90deg)}:host .container{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;flex:1;margin:.25em}:host .container .dots-container{display:flex;flex-flow:column,wrap;justify-content:center;align-items:center;position:relative}:host .container .dots-container .dot{width:.3125em;height:.3125em;transition:background .3s ease;margin:.06em;border-radius:50%;display:block}:host-context(.sfc-default-theme) :host .container .dots-container .dot{background:#545e61}:host-context(.sfc-dark-theme) :host .container .dots-container .dot{background:#ccd1d9}:host .container:hover,:host .container.open,:host .container:focus{outline:none}:host-context(.sfc-default-theme) :host .container:hover .dots-container .dot,:host-context(.sfc-default-theme) :host .container.open .dots-container .dot,:host-context(.sfc-default-theme) :host .container:focus .dots-container .dot{background:#2bbbad}:host-context(.sfc-dark-theme) :host .container:hover .dots-container .dot,:host-context(.sfc-dark-theme) :host .container.open .dots-container .dot,:host-context(.sfc-dark-theme) :host .container:focus .dots-container .dot{background:#2bbbad}\n"] });
|
|
1700
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: DotsComponent, decorators: [{
|
|
1701
|
+
type: Component,
|
|
1702
|
+
args: [{ selector: 'sfc-dots', template: "<div class=\"container\">\r\n <div class=\"dots-container\">\r\n <div class=\"dot\"></div>\r\n <div class=\"dot\"></div>\r\n <div class=\"dot\"></div>\r\n </div>\r\n</div>", styles: [":host{display:inline-flex;transform:rotate(90deg);transition:all .3s cubic-bezier(.175,.885,.32,1.275);cursor:pointer}:host.open{transform:rotate(0)}:host.vertical{transform:rotate(0)}:host.vertical.open{transform:rotate(90deg)}:host .container{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;flex:1;margin:.25em}:host .container .dots-container{display:flex;flex-flow:column,wrap;justify-content:center;align-items:center;position:relative}:host .container .dots-container .dot{width:.3125em;height:.3125em;transition:background .3s ease;margin:.06em;border-radius:50%;display:block}:host-context(.sfc-default-theme) :host .container .dots-container .dot{background:#545e61}:host-context(.sfc-dark-theme) :host .container .dots-container .dot{background:#ccd1d9}:host .container:hover,:host .container.open,:host .container:focus{outline:none}:host-context(.sfc-default-theme) :host .container:hover .dots-container .dot,:host-context(.sfc-default-theme) :host .container.open .dots-container .dot,:host-context(.sfc-default-theme) :host .container:focus .dots-container .dot{background:#2bbbad}:host-context(.sfc-dark-theme) :host .container:hover .dots-container .dot,:host-context(.sfc-dark-theme) :host .container.open .dots-container .dot,:host-context(.sfc-dark-theme) :host .container:focus .dots-container .dot{background:#2bbbad}\n"] }]
|
|
1703
|
+
}], propDecorators: { open: [{
|
|
1704
|
+
type: Input
|
|
1705
|
+
}, {
|
|
1706
|
+
type: HostBinding,
|
|
1707
|
+
args: ['class.' + UIClass.Open]
|
|
1708
|
+
}], direction: [{
|
|
1709
|
+
type: Input
|
|
1710
|
+
}, {
|
|
1711
|
+
type: HostBinding,
|
|
1712
|
+
args: ['class']
|
|
1713
|
+
}], onClick: [{
|
|
1714
|
+
type: HostListener,
|
|
1715
|
+
args: ['click']
|
|
1716
|
+
}] } });
|
|
1717
|
+
|
|
1718
|
+
class ToggleSwitcherComponent {
|
|
1719
|
+
constructor() {
|
|
1720
|
+
this.active = false;
|
|
1721
|
+
this.onClick = () => this.active = !this.active;
|
|
1722
|
+
this.leftModel = { label: 'Left' };
|
|
1723
|
+
this.rightModel = { label: 'Right' };
|
|
1724
|
+
}
|
|
1725
|
+
}
|
|
1726
|
+
ToggleSwitcherComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ToggleSwitcherComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1727
|
+
ToggleSwitcherComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: ToggleSwitcherComponent, selector: "sfc-toggle-switcher", inputs: { active: "active", leftModel: "leftModel", rightModel: "rightModel" }, host: { listeners: { "click": "onClick()" }, properties: { "class.active": "this.active" } }, ngImport: i0, template: "<div class=\"container\">\r\n <div class=\"toggle\"></div>\r\n <div class=\"names\">\r\n <p class=\"left\">\r\n <i *ngIf=\"leftModel.icon\" class=\"{{leftModel.icon}}\"></i>\r\n <span>{{leftModel.label}}</span>\r\n </p>\r\n <p class=\"right\">\r\n <i *ngIf=\"rightModel.icon\" class=\"{{rightModel.icon}}\"></i>\r\n <span>{{rightModel.label}}</span>\r\n </p>\r\n </div>\r\n</div>", styles: [":host .container,:host .toggle{height:100%;border-radius:100px}:host .container{width:100%;background-color:#e6e9ed;color:#545e61;border-radius:100px;position:relative;cursor:pointer}:host .container .toggle{position:absolute;width:50%;background-color:#fff;box-shadow:0 .125em 1em #0003;transition:transform .3s cubic-bezier(.25,.46,.45,.94)}:host .container .names{font-size:90%;font-weight:bolder;width:100%;height:100%;position:relative;display:flex;justify-content:space-around;align-items:center;-webkit-user-select:none;user-select:none;overflow:hidden}:host .container .names p{font-size:90%;text-align:center;margin:0;padding:.5em 1em}:host .container .names p.right{opacity:.5}:host .container .names p i{margin-right:.25em}:host.active .container{background-color:#e6e9ed}:host.active .container .toggle{transform:translate(100%);background-color:#fff}:host.active .container .names{color:#545e61}:host.active .container .names .left{opacity:.5}:host.active .container .names .right{opacity:1}\n"], directives: [{ type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }] });
|
|
1728
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: ToggleSwitcherComponent, decorators: [{
|
|
1729
|
+
type: Component,
|
|
1730
|
+
args: [{ selector: 'sfc-toggle-switcher', template: "<div class=\"container\">\r\n <div class=\"toggle\"></div>\r\n <div class=\"names\">\r\n <p class=\"left\">\r\n <i *ngIf=\"leftModel.icon\" class=\"{{leftModel.icon}}\"></i>\r\n <span>{{leftModel.label}}</span>\r\n </p>\r\n <p class=\"right\">\r\n <i *ngIf=\"rightModel.icon\" class=\"{{rightModel.icon}}\"></i>\r\n <span>{{rightModel.label}}</span>\r\n </p>\r\n </div>\r\n</div>", styles: [":host .container,:host .toggle{height:100%;border-radius:100px}:host .container{width:100%;background-color:#e6e9ed;color:#545e61;border-radius:100px;position:relative;cursor:pointer}:host .container .toggle{position:absolute;width:50%;background-color:#fff;box-shadow:0 .125em 1em #0003;transition:transform .3s cubic-bezier(.25,.46,.45,.94)}:host .container .names{font-size:90%;font-weight:bolder;width:100%;height:100%;position:relative;display:flex;justify-content:space-around;align-items:center;-webkit-user-select:none;user-select:none;overflow:hidden}:host .container .names p{font-size:90%;text-align:center;margin:0;padding:.5em 1em}:host .container .names p.right{opacity:.5}:host .container .names p i{margin-right:.25em}:host.active .container{background-color:#e6e9ed}:host.active .container .toggle{transform:translate(100%);background-color:#fff}:host.active .container .names{color:#545e61}:host.active .container .names .left{opacity:.5}:host.active .container .names .right{opacity:1}\n"] }]
|
|
1731
|
+
}], ctorParameters: function () { return []; }, propDecorators: { active: [{
|
|
1732
|
+
type: Input
|
|
1733
|
+
}, {
|
|
1734
|
+
type: HostBinding,
|
|
1735
|
+
args: ['class.' + UIClass.Active]
|
|
1736
|
+
}], leftModel: [{
|
|
1737
|
+
type: Input
|
|
1738
|
+
}], rightModel: [{
|
|
1739
|
+
type: Input
|
|
1740
|
+
}], onClick: [{
|
|
1741
|
+
type: HostListener,
|
|
1742
|
+
args: ['click']
|
|
1743
|
+
}] } });
|
|
1744
|
+
|
|
1745
|
+
class CheckmarkComponent {
|
|
1746
|
+
constructor() {
|
|
1747
|
+
this.active = false;
|
|
1748
|
+
this.icon = 'fa fa-check';
|
|
1749
|
+
this.onClick = () => this.active = !this.active;
|
|
1750
|
+
}
|
|
1751
|
+
}
|
|
1752
|
+
CheckmarkComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: CheckmarkComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1753
|
+
CheckmarkComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "13.2.6", type: CheckmarkComponent, selector: "sfc-checkmark", inputs: { active: "active", icon: "icon" }, host: { listeners: { "click": "onClick()" }, properties: { "class.active": "this.active" } }, ngImport: i0, template: "<div class=\"container\">\r\n <span class=\"check\">\r\n <i class=\"{{icon}}\"></i>\r\n </span>\r\n</div>", styles: [":host{display:inline-block}:host .check{border-radius:50%;border:.18em solid;background:#fff;border-color:#ccd1d9;width:1em;height:1em;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:border-color .3s ease}:host .check i{font-size:.8em;transition:opacity .3s ease;color:transparent;-webkit-text-stroke:1px #0003}:host-context(.sfc-default-theme) :host .check i{opacity:.5}:host-context(.sfc-dark-theme) :host .check i{opacity:.8}:host .check:hover{border-color:#2bbbad}:host .check:hover i{-webkit-text-stroke:initial;color:#2bbbad}:host-context(.sfc-default-theme) :host .check:hover i{opacity:.8}:host-context(.sfc-dark-theme) :host .check:hover i{opacity:1}:host.active .check{border-color:#2bbbad;background:#2bbbad}:host.active .check i{opacity:1;transform:scale(0);color:#fff;-webkit-text-stroke:0;animation:icon .3s cubic-bezier(1,.008,.565,1.65) .1s 1 forwards}@keyframes icon{0%{opacity:0;transform:scale(.3)}to{opacity:1;transform:scale(1)}}\n"] });
|
|
1754
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: CheckmarkComponent, decorators: [{
|
|
1755
|
+
type: Component,
|
|
1756
|
+
args: [{ selector: 'sfc-checkmark', template: "<div class=\"container\">\r\n <span class=\"check\">\r\n <i class=\"{{icon}}\"></i>\r\n </span>\r\n</div>", styles: [":host{display:inline-block}:host .check{border-radius:50%;border:.18em solid;background:#fff;border-color:#ccd1d9;width:1em;height:1em;cursor:pointer;display:flex;align-items:center;justify-content:center;transition:border-color .3s ease}:host .check i{font-size:.8em;transition:opacity .3s ease;color:transparent;-webkit-text-stroke:1px #0003}:host-context(.sfc-default-theme) :host .check i{opacity:.5}:host-context(.sfc-dark-theme) :host .check i{opacity:.8}:host .check:hover{border-color:#2bbbad}:host .check:hover i{-webkit-text-stroke:initial;color:#2bbbad}:host-context(.sfc-default-theme) :host .check:hover i{opacity:.8}:host-context(.sfc-dark-theme) :host .check:hover i{opacity:1}:host.active .check{border-color:#2bbbad;background:#2bbbad}:host.active .check i{opacity:1;transform:scale(0);color:#fff;-webkit-text-stroke:0;animation:icon .3s cubic-bezier(1,.008,.565,1.65) .1s 1 forwards}@keyframes icon{0%{opacity:0;transform:scale(.3)}to{opacity:1;transform:scale(1)}}\n"] }]
|
|
1757
|
+
}], propDecorators: { active: [{
|
|
1758
|
+
type: Input
|
|
1759
|
+
}, {
|
|
1760
|
+
type: HostBinding,
|
|
1761
|
+
args: ['class.' + UIClass.Active]
|
|
1762
|
+
}], icon: [{
|
|
1763
|
+
type: Input
|
|
1764
|
+
}], onClick: [{
|
|
1765
|
+
type: HostListener,
|
|
1766
|
+
args: ['click']
|
|
1767
|
+
}] } });
|
|
1768
|
+
|
|
1769
|
+
class NgxSfcCommonModule {
|
|
1770
|
+
}
|
|
1771
|
+
NgxSfcCommonModule.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgxSfcCommonModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
1772
|
+
NgxSfcCommonModule.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgxSfcCommonModule, declarations: [
|
|
1773
|
+
// directives
|
|
1774
|
+
ClickOutsideDirective,
|
|
1775
|
+
ShowHideElementDirective,
|
|
1776
|
+
ThrowElementOnHoverDirective,
|
|
1777
|
+
TemplateReferenceDirective,
|
|
1778
|
+
MouseDownDirective,
|
|
1779
|
+
ComponentSizeDirective,
|
|
1780
|
+
// components
|
|
1781
|
+
ButtonComponent,
|
|
1782
|
+
TooltipComponent,
|
|
1783
|
+
DelimeterComponent,
|
|
1784
|
+
// loaders
|
|
1785
|
+
BounceLoaderComponent,
|
|
1786
|
+
CircleLoaderComponent,
|
|
1787
|
+
// modal
|
|
1788
|
+
ModalComponent,
|
|
1789
|
+
ModalOpenOnClickDirective,
|
|
1790
|
+
DefaultModalHeaderComponent,
|
|
1791
|
+
DefaultModalFooterComponent,
|
|
1792
|
+
// hamburger
|
|
1793
|
+
HamburgerComponent,
|
|
1794
|
+
// dots
|
|
1795
|
+
DotsComponent,
|
|
1796
|
+
//toggle
|
|
1797
|
+
ToggleSwitcherComponent,
|
|
1798
|
+
CheckmarkComponent
|
|
1799
|
+
], imports: [CommonModule,
|
|
1800
|
+
BrowserAnimationsModule], exports: [
|
|
1801
|
+
// directives
|
|
1802
|
+
ClickOutsideDirective,
|
|
1803
|
+
ShowHideElementDirective,
|
|
1804
|
+
ThrowElementOnHoverDirective,
|
|
1805
|
+
TemplateReferenceDirective,
|
|
1806
|
+
MouseDownDirective,
|
|
1807
|
+
ComponentSizeDirective,
|
|
1808
|
+
// components
|
|
1809
|
+
ButtonComponent,
|
|
1810
|
+
TooltipComponent,
|
|
1811
|
+
DelimeterComponent,
|
|
1812
|
+
// loaders
|
|
1813
|
+
BounceLoaderComponent,
|
|
1814
|
+
CircleLoaderComponent,
|
|
1815
|
+
// modal
|
|
1816
|
+
ModalComponent,
|
|
1817
|
+
ModalOpenOnClickDirective,
|
|
1818
|
+
DefaultModalHeaderComponent,
|
|
1819
|
+
DefaultModalFooterComponent,
|
|
1820
|
+
// hamburger
|
|
1821
|
+
HamburgerComponent,
|
|
1822
|
+
// dots
|
|
1823
|
+
DotsComponent,
|
|
1824
|
+
//toggle
|
|
1825
|
+
ToggleSwitcherComponent,
|
|
1826
|
+
CheckmarkComponent
|
|
1827
|
+
] });
|
|
1828
|
+
NgxSfcCommonModule.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgxSfcCommonModule, providers: [DOCUMENT_PROVIDERS, WINDOW_PROVIDERS], imports: [[
|
|
1829
|
+
CommonModule,
|
|
1830
|
+
BrowserAnimationsModule
|
|
1831
|
+
]] });
|
|
1832
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.2.6", ngImport: i0, type: NgxSfcCommonModule, decorators: [{
|
|
1833
|
+
type: NgModule,
|
|
1834
|
+
args: [{
|
|
1835
|
+
declarations: [
|
|
1836
|
+
// directives
|
|
1837
|
+
ClickOutsideDirective,
|
|
1838
|
+
ShowHideElementDirective,
|
|
1839
|
+
ThrowElementOnHoverDirective,
|
|
1840
|
+
TemplateReferenceDirective,
|
|
1841
|
+
MouseDownDirective,
|
|
1842
|
+
ComponentSizeDirective,
|
|
1843
|
+
// components
|
|
1844
|
+
ButtonComponent,
|
|
1845
|
+
TooltipComponent,
|
|
1846
|
+
DelimeterComponent,
|
|
1847
|
+
// loaders
|
|
1848
|
+
BounceLoaderComponent,
|
|
1849
|
+
CircleLoaderComponent,
|
|
1850
|
+
// modal
|
|
1851
|
+
ModalComponent,
|
|
1852
|
+
ModalOpenOnClickDirective,
|
|
1853
|
+
DefaultModalHeaderComponent,
|
|
1854
|
+
DefaultModalFooterComponent,
|
|
1855
|
+
// hamburger
|
|
1856
|
+
HamburgerComponent,
|
|
1857
|
+
// dots
|
|
1858
|
+
DotsComponent,
|
|
1859
|
+
//toggle
|
|
1860
|
+
ToggleSwitcherComponent,
|
|
1861
|
+
CheckmarkComponent
|
|
1862
|
+
],
|
|
1863
|
+
imports: [
|
|
1864
|
+
CommonModule,
|
|
1865
|
+
BrowserAnimationsModule
|
|
1866
|
+
],
|
|
1867
|
+
exports: [
|
|
1868
|
+
// directives
|
|
1869
|
+
ClickOutsideDirective,
|
|
1870
|
+
ShowHideElementDirective,
|
|
1871
|
+
ThrowElementOnHoverDirective,
|
|
1872
|
+
TemplateReferenceDirective,
|
|
1873
|
+
MouseDownDirective,
|
|
1874
|
+
ComponentSizeDirective,
|
|
1875
|
+
// components
|
|
1876
|
+
ButtonComponent,
|
|
1877
|
+
TooltipComponent,
|
|
1878
|
+
DelimeterComponent,
|
|
1879
|
+
// loaders
|
|
1880
|
+
BounceLoaderComponent,
|
|
1881
|
+
CircleLoaderComponent,
|
|
1882
|
+
// modal
|
|
1883
|
+
ModalComponent,
|
|
1884
|
+
ModalOpenOnClickDirective,
|
|
1885
|
+
DefaultModalHeaderComponent,
|
|
1886
|
+
DefaultModalFooterComponent,
|
|
1887
|
+
// hamburger
|
|
1888
|
+
HamburgerComponent,
|
|
1889
|
+
// dots
|
|
1890
|
+
DotsComponent,
|
|
1891
|
+
//toggle
|
|
1892
|
+
ToggleSwitcherComponent,
|
|
1893
|
+
CheckmarkComponent
|
|
1894
|
+
],
|
|
1895
|
+
providers: [DOCUMENT_PROVIDERS, WINDOW_PROVIDERS]
|
|
1896
|
+
}]
|
|
1897
|
+
}] });
|
|
1898
|
+
|
|
1899
|
+
/*
|
|
1900
|
+
* Public API Surface of ngx-sfc-common
|
|
1901
|
+
*/
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* Generated bundle index. Do not edit.
|
|
1905
|
+
*/
|
|
1906
|
+
|
|
1907
|
+
export { BounceLoaderComponent, BrowserDocumentRef, BrowserWindowRef, ButtonComponent, ButtonType, CheckmarkComponent, CircleLoaderComponent, CircleLoaderType, ClickOutsideDirective, CommonConstants, ComponentSize, ComponentSizeDirective, DOCUMENT, DOCUMENT_PROVIDERS, DateTimeConstants, DefaultModalFooterComponent, DefaultModalHeaderComponent, DelimeterComponent, Direction, DocumentRef, DotsComponent, HamburgerComponent, LoaderService, MediaLimits, ModalComponent, ModalOpenOnClickDirective, ModalService, ModalTemplate, MouseDownDirective, NgxSfcCommonModule, Position, ResizeService, ShowHideElementDirective, SortingDirection, TemplateReferenceDirective, ThrowElementOnHoverDirective, ToggleSwitcherComponent, TooltipComponent, TooltipType, UIClass, UIConstants, WINDOW, WINDOW_PROVIDERS, WindowRef, addClasses, addItem, addPropertyToObject, all, any, browserDocumentProvider, browserWindowProvider, contains, distinct, documentFactory, documentProvider, firstItem, firstOrDefault, getCollectionOrEmpty, getCssLikeValue, getFileExtension, getFirstDayOfMonth, getFirstDayOfMonthByYearAndMonth, getFirstDayOfYear, getLastDayOfMonth, getLastDayOfMonthByYearAndMonth, getLastDayOfYear, getNextMonth, getNextYear, getPreviousMonth, getPreviousYear, getValueFromCssLikeValue, getWeeksNumberInMonth, hasItem, hasItemBy, hasObjectItem, isAsyncData, isDateGreat, isDateGreatOrEqual, isDateTimeGreat, isDateTimeGreatOrEqual, isDefined, isEqualDates, isImage, isNullOrEmptyString, isObject, lastItem, max, mergeDeep, nameof, parseFileSize, readAsDataURL, remove, removeClasses, removeItem, removePropertyFromObject, setDay, setHours, setMinutes, setYear, skip, sortBy, sortByPath, sum, trim, updateItem, where, windowFactory, windowProvider };
|
|
1908
|
+
//# sourceMappingURL=ngx-sfc-common.mjs.map
|