@kms-ngx-ui/presentational 0.0.4 → 0.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bundles/kms-ngx-ui-presentational.umd.js +848 -64
- package/bundles/kms-ngx-ui-presentational.umd.js.map +1 -1
- package/esm2015/kms-ngx-ui-presentational.js +36 -30
- package/esm2015/lib/directives/directives.module.js +29 -0
- package/esm2015/lib/directives/mousewheel.directive.js +46 -0
- package/esm2015/lib/directives/sum-of-height.directive.js +71 -0
- package/esm2015/lib/directives/swipe.directive.js +159 -0
- package/esm2015/lib/directives/swipe.model.js +5 -0
- package/esm2015/lib/directives/tooltip.directive.js +124 -0
- package/esm2015/lib/kms-ngx-ui-presentational.module.js +31 -21
- package/esm2015/lib/models/image-snippet.model.js +18 -0
- package/esm2015/lib/ui/checkbox/checkbox.component.js +1 -1
- package/esm2015/lib/ui/color-input/color-input.component.js +1 -1
- package/esm2015/lib/ui/dropdown-from-data/dropdown-from-data.component.js +145 -0
- package/esm2015/lib/ui/flyout/flyout.component.js +1 -1
- package/esm2015/lib/ui/image-slider/image-slider.component.js +177 -0
- package/esm2015/lib/ui/radiobutton/radiobutton.component.js +1 -1
- package/esm2015/lib/ui/time-input/time-input.component.js +1 -1
- package/esm2015/lib/ui/tooltip/tooltip.component.js +1 -1
- package/esm2015/public-api.js +2 -1
- package/fesm2015/kms-ngx-ui-presentational.js +779 -37
- package/fesm2015/kms-ngx-ui-presentational.js.map +1 -1
- package/kms-ngx-ui-presentational.d.ts +36 -30
- package/kms-ngx-ui-presentational.metadata.json +1 -1
- package/lib/directives/directives.module.d.ts +5 -0
- package/lib/directives/mousewheel.directive.d.ts +12 -0
- package/lib/directives/sum-of-height.directive.d.ts +28 -0
- package/lib/directives/swipe.directive.d.ts +42 -0
- package/lib/directives/swipe.model.d.ts +49 -0
- package/lib/directives/tooltip.directive.d.ts +26 -0
- package/lib/models/image-snippet.model.d.ts +15 -0
- package/lib/ui/dropdown-from-data/dropdown-from-data.component.d.ts +51 -0
- package/lib/ui/image-slider/image-slider.component.d.ts +59 -0
- package/package.json +2 -1
- package/public-api.d.ts +1 -0
- package/src/lib/ui/back-to-top/back-to-top.component.scss +46 -46
- package/src/lib/ui/button-with-confirm-dialog/button-with-confirm-dialog.component.scss +3 -0
- package/src/lib/ui/checkbox/checkbox.component.scss +48 -56
- package/src/lib/ui/color-input/color-input.component.scss +39 -38
- package/src/lib/ui/file-input/file-input.component.scss +3 -0
- package/src/lib/ui/flyout/flyout.component.scss +35 -34
- package/src/lib/ui/generic-dialog/generic-dialog.component.scss +59 -59
- package/src/lib/ui/icon/icon.component.scss +148 -148
- package/src/lib/ui/image-slider/image-slider.component.scss +220 -0
- package/src/lib/ui/kms-accordion-item/kms-accordion-item.component.scss +95 -95
- package/src/lib/ui/radiobutton/radiobutton.component.scss +32 -30
- package/src/lib/ui/time-input/time-input.component.scss +11 -10
- package/src/lib/ui/tooltip/tooltip.component.scss +26 -26
- package/src/lib/ui/tooltip-icon/tooltip-icon.component.scss +2 -2
- package/src/styles/styles.scss +31 -23
- package/bundles/kms-ngx-ui-presentational.umd.min.js +0 -38
- package/bundles/kms-ngx-ui-presentational.umd.min.js.map +0 -1
|
@@ -1,15 +1,35 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/material/checkbox'), require('@angular/material/radio'), require('@angular/animations'), require('@angular/platform-browser'), require('rxjs'), require('@angular/material/dialog'), require('subsink'), require('@angular/google-maps'), require('@angular/material/button'), require('@angular/material/expansion')) :
|
|
3
|
-
typeof define === 'function' && define.amd ? define('@kms-ngx-ui/presentational', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/material/checkbox', '@angular/material/radio', '@angular/animations', '@angular/platform-browser', 'rxjs', '@angular/material/dialog', 'subsink', '@angular/google-maps', '@angular/material/button', '@angular/material/expansion'], factory) :
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global[
|
|
5
|
-
}(this, (function (exports, i0, common, forms, checkbox, radio, animations, platformBrowser, rxjs, dialog, subsink, googleMaps, button, expansion) { 'use strict';
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/forms'), require('@angular/material/checkbox'), require('@angular/material/radio'), require('@angular/animations'), require('@angular/platform-browser'), require('rxjs'), require('@angular/material/dialog'), require('subsink'), require('@angular/google-maps'), require('@angular/material/button'), require('@angular/material/expansion'), require('@angular/material/select'), require('enum-values/src/enumValues'), require('@angular/cdk/drag-drop')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define('@kms-ngx-ui/presentational', ['exports', '@angular/core', '@angular/common', '@angular/forms', '@angular/material/checkbox', '@angular/material/radio', '@angular/animations', '@angular/platform-browser', 'rxjs', '@angular/material/dialog', 'subsink', '@angular/google-maps', '@angular/material/button', '@angular/material/expansion', '@angular/material/select', 'enum-values/src/enumValues', '@angular/cdk/drag-drop'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global["kms-ngx-ui"] = global["kms-ngx-ui"] || {}, global["kms-ngx-ui"].presentational = {}), global.ng.core, global.ng.common, global.ng.forms, global.ng.material.checkbox, global.ng.material.radio, global.ng.animations, global.ng.platformBrowser, global.rxjs, global.ng.material.dialog, global.subsink, global.ng.googleMaps, global.ng.material.button, global.ng.material.expansion, global.ng.material.select, global.enumValues, global.ng.cdk.dragDrop));
|
|
5
|
+
})(this, (function (exports, i0, common, forms, checkbox, radio, animations, platformBrowser, rxjs, dialog, subsink, googleMaps, button, expansion, select, enumValues, dragDrop) { 'use strict';
|
|
6
|
+
|
|
7
|
+
function _interopNamespace(e) {
|
|
8
|
+
if (e && e.__esModule) return e;
|
|
9
|
+
var n = Object.create(null);
|
|
10
|
+
if (e) {
|
|
11
|
+
Object.keys(e).forEach(function (k) {
|
|
12
|
+
if (k !== 'default') {
|
|
13
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
14
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return e[k]; }
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
n["default"] = e;
|
|
22
|
+
return Object.freeze(n);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
var i0__namespace = /*#__PURE__*/_interopNamespace(i0);
|
|
6
26
|
|
|
7
27
|
var KmsUiPresentationalService = /** @class */ (function () {
|
|
8
28
|
function KmsUiPresentationalService() {
|
|
9
29
|
}
|
|
10
30
|
return KmsUiPresentationalService;
|
|
11
31
|
}());
|
|
12
|
-
KmsUiPresentationalService.ɵprov =
|
|
32
|
+
KmsUiPresentationalService.ɵprov = i0__namespace.ɵɵdefineInjectable({ factory: function KmsUiPresentationalService_Factory() { return new KmsUiPresentationalService(); }, token: KmsUiPresentationalService, providedIn: "root" });
|
|
13
33
|
KmsUiPresentationalService.decorators = [
|
|
14
34
|
{ type: i0.Injectable, args: [{
|
|
15
35
|
providedIn: 'root'
|
|
@@ -178,7 +198,7 @@
|
|
|
178
198
|
function step(op) {
|
|
179
199
|
if (f)
|
|
180
200
|
throw new TypeError("Generator is already executing.");
|
|
181
|
-
while (_)
|
|
201
|
+
while (g && (g = 0, op[0] && (_ = 0)), _)
|
|
182
202
|
try {
|
|
183
203
|
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
|
|
184
204
|
return t;
|
|
@@ -461,7 +481,7 @@
|
|
|
461
481
|
multi: true,
|
|
462
482
|
},
|
|
463
483
|
],
|
|
464
|
-
styles: ["
|
|
484
|
+
styles: [""]
|
|
465
485
|
},] }
|
|
466
486
|
];
|
|
467
487
|
CheckboxComponent.ctorParameters = function () { return []; };
|
|
@@ -679,7 +699,7 @@
|
|
|
679
699
|
multi: true,
|
|
680
700
|
},
|
|
681
701
|
],
|
|
682
|
-
styles: ["
|
|
702
|
+
styles: [""]
|
|
683
703
|
},] }
|
|
684
704
|
];
|
|
685
705
|
ColorInputComponent.ctorParameters = function () { return [
|
|
@@ -749,7 +769,7 @@
|
|
|
749
769
|
multi: true,
|
|
750
770
|
},
|
|
751
771
|
],
|
|
752
|
-
styles: ["
|
|
772
|
+
styles: [""]
|
|
753
773
|
},] }
|
|
754
774
|
];
|
|
755
775
|
RadioButtonComponent.ctorParameters = function () { return []; };
|
|
@@ -836,7 +856,7 @@
|
|
|
836
856
|
multi: true,
|
|
837
857
|
},
|
|
838
858
|
],
|
|
839
|
-
styles: ["
|
|
859
|
+
styles: [""]
|
|
840
860
|
},] }
|
|
841
861
|
];
|
|
842
862
|
TimeInputComponent.ctorParameters = function () { return [
|
|
@@ -924,6 +944,7 @@
|
|
|
924
944
|
/*!
|
|
925
945
|
* @copyright FLYACTS GmbH 2019
|
|
926
946
|
*/
|
|
947
|
+
exports.IconSize = void 0;
|
|
927
948
|
(function (IconSize) {
|
|
928
949
|
IconSize["FULLSIZE"] = "size-full";
|
|
929
950
|
IconSize["TINY"] = "size-16";
|
|
@@ -1258,7 +1279,7 @@
|
|
|
1258
1279
|
}),
|
|
1259
1280
|
]),
|
|
1260
1281
|
],
|
|
1261
|
-
styles: ["
|
|
1282
|
+
styles: [""]
|
|
1262
1283
|
},] }
|
|
1263
1284
|
];
|
|
1264
1285
|
FlyoutComponent.propDecorators = {
|
|
@@ -2012,6 +2033,7 @@
|
|
|
2012
2033
|
};
|
|
2013
2034
|
|
|
2014
2035
|
// TODO change values after cleaned up database
|
|
2036
|
+
exports.SalutationEnum = void 0;
|
|
2015
2037
|
(function (SalutationEnum) {
|
|
2016
2038
|
SalutationEnum["NOT_SPECIFIED"] = "Keine Anrede";
|
|
2017
2039
|
SalutationEnum["MALE"] = "Herr";
|
|
@@ -2077,7 +2099,7 @@
|
|
|
2077
2099
|
{ type: i0.Component, args: [{
|
|
2078
2100
|
selector: 'kms-tooltip-element',
|
|
2079
2101
|
template: "<ng-content></ng-content>",
|
|
2080
|
-
styles: ["[kmsTooltip]{position:relative}"]
|
|
2102
|
+
styles: ["[kmsTooltip]{position:relative}\n"]
|
|
2081
2103
|
},] }
|
|
2082
2104
|
];
|
|
2083
2105
|
TooltipComponent.propDecorators = {
|
|
@@ -2320,6 +2342,755 @@
|
|
|
2320
2342
|
onConfirmClosed: [{ type: i0.Output }]
|
|
2321
2343
|
};
|
|
2322
2344
|
|
|
2345
|
+
/**
|
|
2346
|
+
* Dropdown from data component {@link https://leaseplan-dev.rentoffice.de/styleguide#ui-elements}
|
|
2347
|
+
*/
|
|
2348
|
+
var DropdownFromDataComponent = /** @class */ (function (_super) {
|
|
2349
|
+
__extends(DropdownFromDataComponent, _super);
|
|
2350
|
+
function DropdownFromDataComponent(formBuilder, renderer) {
|
|
2351
|
+
var _this = _super.call(this, formBuilder, renderer) || this;
|
|
2352
|
+
_this.formBuilder = formBuilder;
|
|
2353
|
+
_this.renderer = renderer;
|
|
2354
|
+
// options for the dropdown have a null value at the beginning of the array
|
|
2355
|
+
_this.hasNullOption = false;
|
|
2356
|
+
_this.placeholder = '';
|
|
2357
|
+
_this.label = '';
|
|
2358
|
+
_this.required = false;
|
|
2359
|
+
_this.useEnumIndexAsValue = false;
|
|
2360
|
+
_this.keys = [];
|
|
2361
|
+
_this.values = [];
|
|
2362
|
+
_this.Object = Object;
|
|
2363
|
+
return _this;
|
|
2364
|
+
}
|
|
2365
|
+
/**
|
|
2366
|
+
* Hook used to sync changes on set Label and Type
|
|
2367
|
+
* @param changes
|
|
2368
|
+
*/
|
|
2369
|
+
DropdownFromDataComponent.prototype.ngOnChanges = function (changes) {
|
|
2370
|
+
if (changes.optionsPlainArray) {
|
|
2371
|
+
this.keys = this.optionsPlainArray;
|
|
2372
|
+
this.values = this.optionsPlainArray;
|
|
2373
|
+
}
|
|
2374
|
+
this.setKeyValues();
|
|
2375
|
+
};
|
|
2376
|
+
DropdownFromDataComponent.prototype.ngOnInit = function () {
|
|
2377
|
+
var _this = this;
|
|
2378
|
+
this.form = this.formBuilder.group({
|
|
2379
|
+
dropdownData: [],
|
|
2380
|
+
});
|
|
2381
|
+
this.formInitialized = true;
|
|
2382
|
+
this.form.valueChanges.subscribe(function (value) {
|
|
2383
|
+
_this.internalValue = value.dropdownData;
|
|
2384
|
+
_this.onChange(value.dropdownData);
|
|
2385
|
+
});
|
|
2386
|
+
_super.prototype.ngOnInit.call(this);
|
|
2387
|
+
};
|
|
2388
|
+
/**
|
|
2389
|
+
* transofrms the data values to the correct format for be used by the template
|
|
2390
|
+
* @param value
|
|
2391
|
+
*/
|
|
2392
|
+
DropdownFromDataComponent.prototype.setKeyValues = function () {
|
|
2393
|
+
var _this = this;
|
|
2394
|
+
if (this.optionsObjArray && this.mapKey && this.mapValue) {
|
|
2395
|
+
this.keys = this.optionsObjArray.map(function (obj) { return obj["" + _this.mapKey]; });
|
|
2396
|
+
this.values = this.optionsObjArray.map(function (obj) { return obj["" + _this.mapValue]; });
|
|
2397
|
+
}
|
|
2398
|
+
else if (this.optionsObjArray && this.mapKey) {
|
|
2399
|
+
this.keys = this.optionsObjArray.map(function (obj) { return obj["" + _this.mapKey]; });
|
|
2400
|
+
this.values = this.optionsObjArray.map(function (obj) { return obj["" + _this.mapKey]; });
|
|
2401
|
+
}
|
|
2402
|
+
if (this.optionsEnum) {
|
|
2403
|
+
this.keys = enumValues.EnumValues.getNames(this.optionsEnum);
|
|
2404
|
+
if (this.optionsPlainArray) {
|
|
2405
|
+
this.values = this.optionsPlainArray;
|
|
2406
|
+
}
|
|
2407
|
+
else {
|
|
2408
|
+
var values = enumValues.EnumValues.getValues(this.optionsEnum);
|
|
2409
|
+
// var who defines if enum is componed just with keys or keyValues. E.g enum KeyEnum { VALUE1, VALUE2 } or enum KeyValueEnum { VALUE4 = 'V4', VALUE5 = 'V5' }
|
|
2410
|
+
var keyValueEnum = false;
|
|
2411
|
+
for (var i = 0; i < this.keys.length; i++) {
|
|
2412
|
+
if (i !== values[i]) {
|
|
2413
|
+
keyValueEnum = true;
|
|
2414
|
+
}
|
|
2415
|
+
}
|
|
2416
|
+
if (keyValueEnum || this.useEnumIndexAsValue) {
|
|
2417
|
+
this.values = values;
|
|
2418
|
+
}
|
|
2419
|
+
else {
|
|
2420
|
+
this.values = enumValues.EnumValues.getNames(this.optionsEnum);
|
|
2421
|
+
}
|
|
2422
|
+
}
|
|
2423
|
+
}
|
|
2424
|
+
if (this.hasNullOption === true)
|
|
2425
|
+
this.keys.unshift(null);
|
|
2426
|
+
if (this.hasNullOption === true)
|
|
2427
|
+
this.values.unshift(null);
|
|
2428
|
+
};
|
|
2429
|
+
/**
|
|
2430
|
+
* set the value of the dropdown based if translation is set
|
|
2431
|
+
* @param key
|
|
2432
|
+
*/
|
|
2433
|
+
DropdownFromDataComponent.prototype.setDisplayKey = function (key) {
|
|
2434
|
+
/*
|
|
2435
|
+
if (this.translation && key !== null) {
|
|
2436
|
+
if (this.translation.isPrefix) {
|
|
2437
|
+
return this.translationService.instant(this.translation.path + '.' + key);
|
|
2438
|
+
} else if (this.translation.useKey) {
|
|
2439
|
+
return this.translationService.instant(this.translation.path, { key: key });
|
|
2440
|
+
} else if (!this.translation?.useKey && !this.translation?.isPrefix) {
|
|
2441
|
+
return this.translationService.instant(this.translation.path);
|
|
2442
|
+
}
|
|
2443
|
+
} else if (key == null) {
|
|
2444
|
+
return '';
|
|
2445
|
+
} else if (!this.translation) {
|
|
2446
|
+
return key;
|
|
2447
|
+
}
|
|
2448
|
+
*/
|
|
2449
|
+
return key;
|
|
2450
|
+
};
|
|
2451
|
+
DropdownFromDataComponent.prototype.valueChanged = function (value) {
|
|
2452
|
+
this.form.patchValue({
|
|
2453
|
+
dropdownData: value,
|
|
2454
|
+
});
|
|
2455
|
+
this.onSelectItemEmitter.emit(value);
|
|
2456
|
+
};
|
|
2457
|
+
return DropdownFromDataComponent;
|
|
2458
|
+
}(FormControlParentComponent));
|
|
2459
|
+
DropdownFromDataComponent.decorators = [
|
|
2460
|
+
{ type: i0.Component, args: [{
|
|
2461
|
+
selector: 'kms-dropdown-from-data',
|
|
2462
|
+
template: "<form [formGroup]=\"form\">\n <mat-form-field [attr.required]=\"required\" [floatLabel]=\"placeholder ? 'always' : 'auto'\">\n <mat-label>{{ label }}</mat-label>\n <mat-select\n placeholder=\"{{ placeholder }}\"\n disableOptionCentering\n [(value)]=\"value\"\n (selectionChange)=\"valueChanged($event?.value)\"\n #child\n [disabled]=\"disabled\"\n >\n <mat-option *ngFor=\"let key of keys; let i = index\" [value]=\"values[i]\">\n <span>{{ setDisplayKey(key) }}</span>\n </mat-option>\n </mat-select>\n </mat-form-field>\n</form>\n",
|
|
2463
|
+
providers: [
|
|
2464
|
+
{
|
|
2465
|
+
provide: forms.NG_VALUE_ACCESSOR,
|
|
2466
|
+
useExisting: i0.forwardRef(function () { return DropdownFromDataComponent; }),
|
|
2467
|
+
multi: true,
|
|
2468
|
+
},
|
|
2469
|
+
]
|
|
2470
|
+
},] }
|
|
2471
|
+
];
|
|
2472
|
+
DropdownFromDataComponent.ctorParameters = function () { return [
|
|
2473
|
+
{ type: forms.FormBuilder },
|
|
2474
|
+
{ type: i0.Renderer2 }
|
|
2475
|
+
]; };
|
|
2476
|
+
DropdownFromDataComponent.propDecorators = {
|
|
2477
|
+
optionsEnum: [{ type: i0.Input }],
|
|
2478
|
+
optionsPlainArray: [{ type: i0.Input }],
|
|
2479
|
+
optionsObjArray: [{ type: i0.Input }],
|
|
2480
|
+
mapKey: [{ type: i0.Input }],
|
|
2481
|
+
mapValue: [{ type: i0.Input }],
|
|
2482
|
+
hasNullOption: [{ type: i0.Input }],
|
|
2483
|
+
translation: [{ type: i0.Input }],
|
|
2484
|
+
placeholder: [{ type: i0.Input }],
|
|
2485
|
+
label: [{ type: i0.Input }],
|
|
2486
|
+
required: [{ type: i0.Input }],
|
|
2487
|
+
useEnumIndexAsValue: [{ type: i0.Input }]
|
|
2488
|
+
};
|
|
2489
|
+
|
|
2490
|
+
/*!
|
|
2491
|
+
* @copyright FLYACTS GmbH 2019
|
|
2492
|
+
*/
|
|
2493
|
+
var ImageSliderComponent = /** @class */ (function () {
|
|
2494
|
+
function ImageSliderComponent(sanitizer) {
|
|
2495
|
+
this.sanitizer = sanitizer;
|
|
2496
|
+
this.editMode = false;
|
|
2497
|
+
this.orderChanged = new i0.EventEmitter();
|
|
2498
|
+
this.deleteImageEvent = new i0.EventEmitter();
|
|
2499
|
+
/**
|
|
2500
|
+
* Optional: Define Swipe behaviour configuration.
|
|
2501
|
+
* Default is 10% for the threshold definition until a swipe triggers next/previous slide.
|
|
2502
|
+
*/
|
|
2503
|
+
this.swipeConfig = {
|
|
2504
|
+
swipeThreshold: 5,
|
|
2505
|
+
swipeThresholdType: '%',
|
|
2506
|
+
swipeLocalPosition: true,
|
|
2507
|
+
};
|
|
2508
|
+
this.selectedSlide = 0;
|
|
2509
|
+
this.isLastClickedInSliderImage = false;
|
|
2510
|
+
this.config = {
|
|
2511
|
+
initialSlide: 0,
|
|
2512
|
+
slidesPerView: 3,
|
|
2513
|
+
navigation: {
|
|
2514
|
+
nextEl: '.swiper-button-next',
|
|
2515
|
+
prevEl: '.swiper-button-prev',
|
|
2516
|
+
},
|
|
2517
|
+
watchOverflow: true,
|
|
2518
|
+
autoHeight: true,
|
|
2519
|
+
allowTouchMove: false,
|
|
2520
|
+
spaceBetween: 30,
|
|
2521
|
+
on: {
|
|
2522
|
+
slideChange: function () {
|
|
2523
|
+
// do something
|
|
2524
|
+
},
|
|
2525
|
+
slideChangeTransitionEnd: function () {
|
|
2526
|
+
// do something
|
|
2527
|
+
},
|
|
2528
|
+
},
|
|
2529
|
+
};
|
|
2530
|
+
}
|
|
2531
|
+
ImageSliderComponent.prototype.ngOnInit = function () {
|
|
2532
|
+
if (this.slides) {
|
|
2533
|
+
// TODO use Pipe safeStyle
|
|
2534
|
+
this.selectedSlideImage = this.sanitizer.bypassSecurityTrustStyle('url(' + this.slides[0] + ')');
|
|
2535
|
+
}
|
|
2536
|
+
};
|
|
2537
|
+
// !TODO
|
|
2538
|
+
ImageSliderComponent.prototype.onKeydownHandler = function (event) {
|
|
2539
|
+
if (event.key === 'ArrowRight') {
|
|
2540
|
+
this.nextSlide();
|
|
2541
|
+
}
|
|
2542
|
+
if (event.key === 'ArrowLeft') {
|
|
2543
|
+
this.previousSlide();
|
|
2544
|
+
}
|
|
2545
|
+
};
|
|
2546
|
+
/**
|
|
2547
|
+
* Slide follows the finger or mouse according to it´s move delta.
|
|
2548
|
+
* @param event SwipeMoveEvent
|
|
2549
|
+
*/
|
|
2550
|
+
ImageSliderComponent.prototype.handleMoveEvent = function (event) {
|
|
2551
|
+
// certain move threshold needs to be reached
|
|
2552
|
+
if (!event.thresholdWasReached) {
|
|
2553
|
+
return;
|
|
2554
|
+
}
|
|
2555
|
+
this.config.direction = event.direction === 1 ? 'horizontal' : 'vertical';
|
|
2556
|
+
};
|
|
2557
|
+
/**
|
|
2558
|
+
* Mouse up or slide container was left.
|
|
2559
|
+
* @param event SwipeReleaseEvent
|
|
2560
|
+
*/
|
|
2561
|
+
ImageSliderComponent.prototype.handleReleaseEvent = function (event) {
|
|
2562
|
+
if (!event.thresholdWasReached) {
|
|
2563
|
+
return;
|
|
2564
|
+
}
|
|
2565
|
+
// Just do if user clicked to slide on image and not on arrow or other element
|
|
2566
|
+
if (!this.isLastClickedInSliderImage) {
|
|
2567
|
+
return;
|
|
2568
|
+
}
|
|
2569
|
+
if (event.direction === 1) {
|
|
2570
|
+
this.previousSlide();
|
|
2571
|
+
}
|
|
2572
|
+
else {
|
|
2573
|
+
this.nextSlide();
|
|
2574
|
+
}
|
|
2575
|
+
};
|
|
2576
|
+
ImageSliderComponent.prototype.lastClicked = function () {
|
|
2577
|
+
this.isLastClickedInSliderImage = true;
|
|
2578
|
+
};
|
|
2579
|
+
ImageSliderComponent.prototype.noLastClicked = function () {
|
|
2580
|
+
this.isLastClickedInSliderImage = false;
|
|
2581
|
+
};
|
|
2582
|
+
ImageSliderComponent.prototype.scrollLeft = function () {
|
|
2583
|
+
this.previousSlide();
|
|
2584
|
+
};
|
|
2585
|
+
ImageSliderComponent.prototype.scrollRight = function () {
|
|
2586
|
+
this.nextSlide();
|
|
2587
|
+
};
|
|
2588
|
+
ImageSliderComponent.prototype.nextSlide = function () {
|
|
2589
|
+
if (this.slides && this.selectedSlide < this.slides.length - 1) {
|
|
2590
|
+
if (this.usefulSwiper) {
|
|
2591
|
+
this.usefulSwiper.swiper.slideNext();
|
|
2592
|
+
}
|
|
2593
|
+
this.openSlide(this.selectedSlide + 1);
|
|
2594
|
+
}
|
|
2595
|
+
this.isLastClickedInSliderImage = false;
|
|
2596
|
+
};
|
|
2597
|
+
ImageSliderComponent.prototype.previousSlide = function () {
|
|
2598
|
+
if (this.selectedSlide > 0) {
|
|
2599
|
+
if (this.usefulSwiper) {
|
|
2600
|
+
this.usefulSwiper.swiper.slidePrev();
|
|
2601
|
+
}
|
|
2602
|
+
this.openSlide(this.selectedSlide - 1);
|
|
2603
|
+
}
|
|
2604
|
+
this.isLastClickedInSliderImage = false;
|
|
2605
|
+
};
|
|
2606
|
+
ImageSliderComponent.prototype.slideTo = function (index) {
|
|
2607
|
+
if (this.usefulSwiper) {
|
|
2608
|
+
this.usefulSwiper.swiper.slideTo(index);
|
|
2609
|
+
}
|
|
2610
|
+
};
|
|
2611
|
+
ImageSliderComponent.prototype.openSlide = function (number) {
|
|
2612
|
+
if (this.slides && number < this.slides.length && number >= 0) {
|
|
2613
|
+
this.selectedSlide = number;
|
|
2614
|
+
// TODO use Pipe safeStyle
|
|
2615
|
+
this.selectedSlideImage = this.sanitizer.bypassSecurityTrustStyle('url(' + this.slides[number] || ')');
|
|
2616
|
+
}
|
|
2617
|
+
};
|
|
2618
|
+
ImageSliderComponent.prototype.ngOnChanges = function (_changes) {
|
|
2619
|
+
if (_changes.slides) {
|
|
2620
|
+
if (this.slides) {
|
|
2621
|
+
// TODO use Pipe safeStyle
|
|
2622
|
+
this.selectedSlideImage = this.sanitizer.bypassSecurityTrustStyle('url(' + this.slides[0] + ')');
|
|
2623
|
+
}
|
|
2624
|
+
}
|
|
2625
|
+
};
|
|
2626
|
+
/**
|
|
2627
|
+
* Re-order slides and notify parent component
|
|
2628
|
+
*/
|
|
2629
|
+
ImageSliderComponent.prototype.drop = function (event) {
|
|
2630
|
+
if (this.slides && this.imagesTOSave) {
|
|
2631
|
+
dragDrop.moveItemInArray(this.slides, event.previousIndex, event.currentIndex);
|
|
2632
|
+
dragDrop.moveItemInArray(this.imagesTOSave, event.previousIndex, event.currentIndex);
|
|
2633
|
+
this.orderChanged.emit(this.imagesTOSave);
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
/**
|
|
2637
|
+
* Send image index to parent to perform delete
|
|
2638
|
+
*/
|
|
2639
|
+
ImageSliderComponent.prototype.deleteImage = function (index) {
|
|
2640
|
+
this.deleteImageEvent.emit(index);
|
|
2641
|
+
};
|
|
2642
|
+
return ImageSliderComponent;
|
|
2643
|
+
}());
|
|
2644
|
+
ImageSliderComponent.decorators = [
|
|
2645
|
+
{ type: i0.Component, args: [{
|
|
2646
|
+
selector: 'kms-image-slider',
|
|
2647
|
+
template: "<div class=\"all-wrapper\">\r\n <!--(swiperight)=\"previousSlide()\" (swipeleft)=\"nextSlide()\"-->\r\n <div \r\n class=\"swiper-bigImage\"\r\n [style.backgroundImage]=\"selectedSlideImage\"\r\n [swipeDirective]=\"swipeConfig\"\r\n (moveEvent)=\"handleMoveEvent($event)\"\r\n (releaseEvent)=\"handleReleaseEvent($event)\"\r\n (mouseup)=\"lastClicked()\"\r\n (mouseout)=\"noLastClicked()\" >\r\n </div>\r\n\r\n <ng-content select=\"[description]\"></ng-content>\r\n\r\n <div class=\"swiper-holder\">\r\n <!--\r\n (mouseWheelUp)=\"scrollLeft($event)\"\r\n (mouseWheelDown)=\"scrollRight($event)\"\r\n -->\r\n\r\n <swiper [config]=\"config\" #usefulSwiper>\r\n <div class=\"swiper-wrapper\" \r\n cdkDropList (cdkDropListDropped)=\"drop($event)\" \r\n cdkDropListOrientation=\"horizontal\"> \r\n <div class=\"swiper-slide\" \r\n *ngFor=\"let slide of slides; let index = index\" \r\n cdkDrag [cdkDragDisabled]=\"!editMode\">\r\n <button mat-menu-item *ngIf=\"editMode\" (click)=\"deleteImage(index)\"> \r\n <kms-icon icon=\"trash\"></kms-icon>\r\n </button>\r\n <div class=\"img\" (click)=\"openSlide(index)\"\r\n [style.backgroundImage]=\"sanitizer.bypassSecurityTrustStyle('url(' + slide + ')')\"\r\n [ngClass]=\"{'active': index === selectedSlide}\">\r\n </div>\r\n \r\n <div class=\"default-image\">{{\"common.defaultImage\" | translate}} </div>\r\n </div>\r\n </div>\r\n </swiper>\r\n\r\n <div class=\"swiper-button-next\" *ngIf=\"slides?.length > 3\"></div>\r\n <div class=\"swiper-button-prev\" *ngIf=\"slides?.length > 3\"></div>\r\n\r\n <div class=\"swiper-button-next2\" *ngIf=\"slides?.length > 1\" (click)=\"nextSlide()\">\r\n <kms-icon icon=\"chevron-right\" [iconClass]=\"{'color-disabled': selectedSlide == slides?.length - 1, 'color-primary': true}\"></kms-icon>\r\n </div>\r\n <div class=\"swiper-button-prev2\" *ngIf=\"slides?.length > 1\" (click)=\"previousSlide()\">\r\n <kms-icon icon=\"chevron-left\" [iconClass]=\"{'color-disabled': selectedSlide == 0, 'color-primary': true}\"></kms-icon>\r\n </div>\r\n\r\n </div>\r\n\r\n <ng-content></ng-content>\r\n</div>",
|
|
2648
|
+
styles: [""]
|
|
2649
|
+
},] }
|
|
2650
|
+
];
|
|
2651
|
+
ImageSliderComponent.ctorParameters = function () { return [
|
|
2652
|
+
{ type: platformBrowser.DomSanitizer }
|
|
2653
|
+
]; };
|
|
2654
|
+
ImageSliderComponent.propDecorators = {
|
|
2655
|
+
slides: [{ type: i0.Input }],
|
|
2656
|
+
editMode: [{ type: i0.Input }],
|
|
2657
|
+
imagesTOSave: [{ type: i0.Input }],
|
|
2658
|
+
orderChanged: [{ type: i0.Output }],
|
|
2659
|
+
deleteImageEvent: [{ type: i0.Output }],
|
|
2660
|
+
swipeConfig: [{ type: i0.Input }],
|
|
2661
|
+
usefulSwiper: [{ type: i0.ViewChild, args: ['usefulSwiper',] }],
|
|
2662
|
+
onKeydownHandler: [{ type: i0.HostListener, args: ['document:keydown', ['$event'],] }]
|
|
2663
|
+
};
|
|
2664
|
+
|
|
2665
|
+
/*!
|
|
2666
|
+
* @copyright FLYACTS GmbH 2019
|
|
2667
|
+
*/
|
|
2668
|
+
var MouseWheelDirective = /** @class */ (function () {
|
|
2669
|
+
function MouseWheelDirective() {
|
|
2670
|
+
this.mouseWheelUp = new i0.EventEmitter();
|
|
2671
|
+
this.mouseWheelDown = new i0.EventEmitter();
|
|
2672
|
+
}
|
|
2673
|
+
MouseWheelDirective.prototype.onMouseWheelChrome = function (event) {
|
|
2674
|
+
this.mouseWheelFunc(event);
|
|
2675
|
+
};
|
|
2676
|
+
MouseWheelDirective.prototype.onMouseWheelFirefox = function (event) {
|
|
2677
|
+
this.mouseWheelFunc(event);
|
|
2678
|
+
};
|
|
2679
|
+
MouseWheelDirective.prototype.onMouseWheelIE = function (event) {
|
|
2680
|
+
this.mouseWheelFunc(event);
|
|
2681
|
+
};
|
|
2682
|
+
MouseWheelDirective.prototype.mouseWheelFunc = function (event) {
|
|
2683
|
+
event = window.event || event; // old IE support
|
|
2684
|
+
var delta = Math.max(-1, Math.min(1, (event.wheelDelta || -event.detail)));
|
|
2685
|
+
if (delta > 0) {
|
|
2686
|
+
this.mouseWheelUp.emit(event);
|
|
2687
|
+
}
|
|
2688
|
+
else if (delta < 0) {
|
|
2689
|
+
this.mouseWheelDown.emit(event);
|
|
2690
|
+
}
|
|
2691
|
+
// for IE
|
|
2692
|
+
event.returnValue = false;
|
|
2693
|
+
// for Chrome and Firefox
|
|
2694
|
+
if (event.preventDefault) {
|
|
2695
|
+
event.preventDefault();
|
|
2696
|
+
}
|
|
2697
|
+
};
|
|
2698
|
+
return MouseWheelDirective;
|
|
2699
|
+
}());
|
|
2700
|
+
MouseWheelDirective.decorators = [
|
|
2701
|
+
{ type: i0.Directive, args: [{ selector: '[mouseWheel]' },] }
|
|
2702
|
+
];
|
|
2703
|
+
MouseWheelDirective.propDecorators = {
|
|
2704
|
+
mouseWheelUp: [{ type: i0.Output }],
|
|
2705
|
+
mouseWheelDown: [{ type: i0.Output }],
|
|
2706
|
+
onMouseWheelChrome: [{ type: i0.HostListener, args: ['mousewheel', ['$event'],] }],
|
|
2707
|
+
onMouseWheelFirefox: [{ type: i0.HostListener, args: ['DOMMouseScroll', ['$event'],] }],
|
|
2708
|
+
onMouseWheelIE: [{ type: i0.HostListener, args: ['onmousewheel', ['$event'],] }]
|
|
2709
|
+
};
|
|
2710
|
+
|
|
2711
|
+
/*!
|
|
2712
|
+
* @copyright FLYACTS GmbH 2019
|
|
2713
|
+
*/
|
|
2714
|
+
/**
|
|
2715
|
+
* Directive to calc the height of all inner elements
|
|
2716
|
+
*/
|
|
2717
|
+
var GetMaxHeightDirective = /** @class */ (function () {
|
|
2718
|
+
function GetMaxHeightDirective(el) {
|
|
2719
|
+
this.el = el;
|
|
2720
|
+
/**
|
|
2721
|
+
* CSS class name of the child items (markup elements) that should be checked for their height.
|
|
2722
|
+
* This is mandatory.
|
|
2723
|
+
*/
|
|
2724
|
+
this.cssClassName = '';
|
|
2725
|
+
/**
|
|
2726
|
+
* Event that will pass the height of the tallest child inside the container.
|
|
2727
|
+
* Useful to calculate the target height of containers with different content (like accordion) for animations.
|
|
2728
|
+
*/
|
|
2729
|
+
this.maxHeightChanged = new i0.EventEmitter();
|
|
2730
|
+
/**
|
|
2731
|
+
* Event that will pass the complete sum of all height values from each child.
|
|
2732
|
+
* Useful to calculate the full target height of a container (like dropdown) for animations.
|
|
2733
|
+
*/
|
|
2734
|
+
this.sumOfHeight = new i0.EventEmitter();
|
|
2735
|
+
}
|
|
2736
|
+
GetMaxHeightDirective.prototype.ngAfterContentChecked = function () {
|
|
2737
|
+
this.checkHeightOfChildren(this.el.nativeElement, this.cssClassName);
|
|
2738
|
+
};
|
|
2739
|
+
GetMaxHeightDirective.prototype.checkHeightOfChildren = function (parent, cssClassName) {
|
|
2740
|
+
if (!parent) {
|
|
2741
|
+
return;
|
|
2742
|
+
}
|
|
2743
|
+
// find all the child elements with the selected class name
|
|
2744
|
+
var children = parent.getElementsByClassName(cssClassName);
|
|
2745
|
+
// failsafe
|
|
2746
|
+
if (!children) {
|
|
2747
|
+
return;
|
|
2748
|
+
}
|
|
2749
|
+
// get all the child elements heights
|
|
2750
|
+
var itemHeights = Array.from(children).map(function (x) { return x.getBoundingClientRect().height; });
|
|
2751
|
+
// failsafe
|
|
2752
|
+
if (itemHeights.length === 0) {
|
|
2753
|
+
return;
|
|
2754
|
+
}
|
|
2755
|
+
// find out the tallest element
|
|
2756
|
+
var maxHeight = itemHeights.reduce(function (prev, curr) {
|
|
2757
|
+
return curr > prev ? curr : prev;
|
|
2758
|
+
}, 0);
|
|
2759
|
+
// get sum of heights
|
|
2760
|
+
var sumOfHeight = itemHeights.reduce(function (pv, cv) { return pv + cv; }, 0);
|
|
2761
|
+
// inform
|
|
2762
|
+
this.maxHeightChanged.emit(maxHeight);
|
|
2763
|
+
this.sumOfHeight.emit(sumOfHeight);
|
|
2764
|
+
};
|
|
2765
|
+
return GetMaxHeightDirective;
|
|
2766
|
+
}());
|
|
2767
|
+
GetMaxHeightDirective.decorators = [
|
|
2768
|
+
{ type: i0.Directive, args: [{
|
|
2769
|
+
selector: '[getMaxHeight]',
|
|
2770
|
+
},] }
|
|
2771
|
+
];
|
|
2772
|
+
GetMaxHeightDirective.ctorParameters = function () { return [
|
|
2773
|
+
{ type: i0.ElementRef }
|
|
2774
|
+
]; };
|
|
2775
|
+
GetMaxHeightDirective.propDecorators = {
|
|
2776
|
+
cssClassName: [{ type: i0.Input, args: ['getMaxHeight',] }],
|
|
2777
|
+
maxHeightChanged: [{ type: i0.Output }],
|
|
2778
|
+
sumOfHeight: [{ type: i0.Output }]
|
|
2779
|
+
};
|
|
2780
|
+
|
|
2781
|
+
/*!
|
|
2782
|
+
* @copyright FLYACTS GmbH 2019
|
|
2783
|
+
*/
|
|
2784
|
+
var SwipeDirective = /** @class */ (function () {
|
|
2785
|
+
function SwipeDirective() {
|
|
2786
|
+
/**
|
|
2787
|
+
* Output Event that is emitted during swipe process (mouse move or touch move event).
|
|
2788
|
+
* Can be used for calculation purposes.
|
|
2789
|
+
*/
|
|
2790
|
+
this.moveEvent = new i0.EventEmitter();
|
|
2791
|
+
/**
|
|
2792
|
+
* Output Event that is emitted when swipe process end (mouse up or touch end event).
|
|
2793
|
+
* Can be used for calculation purposes.
|
|
2794
|
+
*/
|
|
2795
|
+
this.releaseEvent = new i0.EventEmitter();
|
|
2796
|
+
this._startPosition = -1;
|
|
2797
|
+
this._lastPosX = 0;
|
|
2798
|
+
this._thresholdWasReached = false;
|
|
2799
|
+
this._timeStart = 0;
|
|
2800
|
+
}
|
|
2801
|
+
Object.defineProperty(SwipeDirective.prototype, "config", {
|
|
2802
|
+
/**
|
|
2803
|
+
* Needed config that defines swipe behaviour.
|
|
2804
|
+
* @param options SwipeOptions
|
|
2805
|
+
*/
|
|
2806
|
+
set: function (options) {
|
|
2807
|
+
if (options) {
|
|
2808
|
+
this._swipeOptions = options;
|
|
2809
|
+
}
|
|
2810
|
+
},
|
|
2811
|
+
enumerable: false,
|
|
2812
|
+
configurable: true
|
|
2813
|
+
});
|
|
2814
|
+
SwipeDirective.prototype.onMouseDown = function (event) {
|
|
2815
|
+
this.calculateStartPosition(event);
|
|
2816
|
+
};
|
|
2817
|
+
SwipeDirective.prototype.onMove = function (event) {
|
|
2818
|
+
this.move(event);
|
|
2819
|
+
};
|
|
2820
|
+
SwipeDirective.prototype.onRelease = function (event) {
|
|
2821
|
+
this.release(event);
|
|
2822
|
+
this.reset();
|
|
2823
|
+
};
|
|
2824
|
+
// ** PRIVATE ** //
|
|
2825
|
+
/**
|
|
2826
|
+
* Function checks if the current moving delta is inside the defined threshold.
|
|
2827
|
+
* Sets the flag to true if the threshold was reached once.
|
|
2828
|
+
*/
|
|
2829
|
+
SwipeDirective.prototype.checkThreshold = function (moveEvent) {
|
|
2830
|
+
var percentage = this._swipeOptions && this._swipeOptions.swipeThresholdType === '%';
|
|
2831
|
+
if (!percentage && this._swipeOptions && moveEvent.swipeDistanceTotal < this._swipeOptions.swipeThreshold) {
|
|
2832
|
+
return;
|
|
2833
|
+
}
|
|
2834
|
+
else if (percentage &&
|
|
2835
|
+
this._swipeOptions &&
|
|
2836
|
+
moveEvent.swipeDistancePercentage < this._swipeOptions.swipeThreshold / 100) {
|
|
2837
|
+
return;
|
|
2838
|
+
}
|
|
2839
|
+
else {
|
|
2840
|
+
this._thresholdWasReached = true;
|
|
2841
|
+
}
|
|
2842
|
+
};
|
|
2843
|
+
SwipeDirective.prototype.calculateStartPosition = function (event) {
|
|
2844
|
+
// detect if touch or click
|
|
2845
|
+
this._isMobile = event.type === 'touchstart';
|
|
2846
|
+
// save start position
|
|
2847
|
+
if (this._swipeOptions && this._swipeOptions.swipeLocalPosition) {
|
|
2848
|
+
if (this._isMobile) {
|
|
2849
|
+
var touch = event.touches[0];
|
|
2850
|
+
this._startPosition = this._swipeOptions.swipeLocalPosition ? touch.clientX : touch.pageX;
|
|
2851
|
+
}
|
|
2852
|
+
else {
|
|
2853
|
+
this._startPosition = this._swipeOptions.swipeLocalPosition ? event.offsetX : event.pageX;
|
|
2854
|
+
}
|
|
2855
|
+
}
|
|
2856
|
+
this._lastPosX = this._startPosition;
|
|
2857
|
+
this._timeStart = event.timeStamp;
|
|
2858
|
+
this._thresholdWasReached = false;
|
|
2859
|
+
};
|
|
2860
|
+
SwipeDirective.prototype.move = function (event) {
|
|
2861
|
+
// failsafe
|
|
2862
|
+
if (typeof event === 'undefined') {
|
|
2863
|
+
return;
|
|
2864
|
+
}
|
|
2865
|
+
var posX = 0;
|
|
2866
|
+
if (this._swipeOptions) {
|
|
2867
|
+
if (this._isMobile && event.type === 'touchmove') {
|
|
2868
|
+
var touch = event.touches[0];
|
|
2869
|
+
posX = this._swipeOptions.swipeLocalPosition ? touch.clientX : touch.pageX;
|
|
2870
|
+
}
|
|
2871
|
+
else {
|
|
2872
|
+
posX = this._swipeOptions.swipeLocalPosition ? event.offsetX : event.pageX;
|
|
2873
|
+
}
|
|
2874
|
+
}
|
|
2875
|
+
var offsetPerFrame = posX - this._lastPosX;
|
|
2876
|
+
var swipeDistanceTotal = Math.abs(posX - this._startPosition);
|
|
2877
|
+
var swipeDistancePercentage = Math.abs(swipeDistanceTotal / event.target.clientWidth);
|
|
2878
|
+
var timeDuration = Math.abs(event.timeStamp - this._timeStart);
|
|
2879
|
+
var direction;
|
|
2880
|
+
var speed = 1 - swipeDistanceTotal / timeDuration;
|
|
2881
|
+
speed = Math.max(0.1, speed);
|
|
2882
|
+
if (posX - this._startPosition > 0) {
|
|
2883
|
+
direction = 1; // a.k.a LTR
|
|
2884
|
+
}
|
|
2885
|
+
else {
|
|
2886
|
+
direction = -1; // a.k.a RTL
|
|
2887
|
+
}
|
|
2888
|
+
this._moveEventData = {
|
|
2889
|
+
position: posX,
|
|
2890
|
+
offsetPerFrame: offsetPerFrame,
|
|
2891
|
+
swipeDistanceTotal: swipeDistanceTotal,
|
|
2892
|
+
swipeDistancePercentage: swipeDistancePercentage,
|
|
2893
|
+
direction: direction,
|
|
2894
|
+
speed: speed,
|
|
2895
|
+
thresholdWasReached: this._thresholdWasReached,
|
|
2896
|
+
};
|
|
2897
|
+
this.checkThreshold(this._moveEventData);
|
|
2898
|
+
// update move delta
|
|
2899
|
+
this._lastPosX = posX;
|
|
2900
|
+
// inform
|
|
2901
|
+
this.moveEvent.emit(this._moveEventData);
|
|
2902
|
+
};
|
|
2903
|
+
SwipeDirective.prototype.release = function (event) {
|
|
2904
|
+
// case: just a click/touch
|
|
2905
|
+
if (!this._moveEventData) {
|
|
2906
|
+
return;
|
|
2907
|
+
}
|
|
2908
|
+
var releaseEventData = {
|
|
2909
|
+
thresholdWasReached: this._thresholdWasReached,
|
|
2910
|
+
direction: this._moveEventData.direction,
|
|
2911
|
+
speed: this._moveEventData.speed,
|
|
2912
|
+
easingType: this.getEasingCurve(this._moveEventData.speed),
|
|
2913
|
+
target: event.currentTarget,
|
|
2914
|
+
};
|
|
2915
|
+
// inform
|
|
2916
|
+
this.releaseEvent.emit(releaseEventData);
|
|
2917
|
+
};
|
|
2918
|
+
SwipeDirective.prototype.getEasingCurve = function (speed) {
|
|
2919
|
+
return speed > 0.5 ? 'ease-in' : 'ease-out';
|
|
2920
|
+
};
|
|
2921
|
+
SwipeDirective.prototype.reset = function () {
|
|
2922
|
+
this._startPosition = -1;
|
|
2923
|
+
this._thresholdWasReached = false;
|
|
2924
|
+
if (this._moveEventData) {
|
|
2925
|
+
this._moveEventData = undefined;
|
|
2926
|
+
}
|
|
2927
|
+
};
|
|
2928
|
+
return SwipeDirective;
|
|
2929
|
+
}());
|
|
2930
|
+
SwipeDirective.decorators = [
|
|
2931
|
+
{ type: i0.Directive, args: [{
|
|
2932
|
+
selector: '[swipeDirective]',
|
|
2933
|
+
},] }
|
|
2934
|
+
];
|
|
2935
|
+
SwipeDirective.propDecorators = {
|
|
2936
|
+
moveEvent: [{ type: i0.Output }],
|
|
2937
|
+
releaseEvent: [{ type: i0.Output }],
|
|
2938
|
+
config: [{ type: i0.Input, args: ['swipeDirective',] }],
|
|
2939
|
+
onMouseDown: [{ type: i0.HostListener, args: ['mousedown', ['$event'],] }, { type: i0.HostListener, args: ['touchstart', ['$event'],] }],
|
|
2940
|
+
onMove: [{ type: i0.HostListener, args: ['mousemove', ['$event'],] }, { type: i0.HostListener, args: ['touchmove', ['$event'],] }],
|
|
2941
|
+
onRelease: [{ type: i0.HostListener, args: ['mouseup', ['$event'],] }, { type: i0.HostListener, args: ['mouseleave', ['$event'],] }, { type: i0.HostListener, args: ['touchend', ['$event'],] }]
|
|
2942
|
+
};
|
|
2943
|
+
|
|
2944
|
+
var TooltipDirective = /** @class */ (function () {
|
|
2945
|
+
function TooltipDirective(el, renderer) {
|
|
2946
|
+
this.el = el;
|
|
2947
|
+
this.renderer = renderer;
|
|
2948
|
+
this.tooltipTitle = "";
|
|
2949
|
+
this.tooltipText = "";
|
|
2950
|
+
this.tooltipLinkText = "";
|
|
2951
|
+
this.tooltipLinkUrl = "";
|
|
2952
|
+
this.tooltipPlacement = "bottom";
|
|
2953
|
+
this.tooltipDelay = 1000;
|
|
2954
|
+
this.tooltipPlaceIntoHost = false;
|
|
2955
|
+
this.tooltipOnlyonclick = false;
|
|
2956
|
+
this.offset = 0;
|
|
2957
|
+
}
|
|
2958
|
+
TooltipDirective.prototype.onMouseEnter = function () {
|
|
2959
|
+
if (!this.tooltipOnlyonclick) {
|
|
2960
|
+
this.show();
|
|
2961
|
+
}
|
|
2962
|
+
};
|
|
2963
|
+
TooltipDirective.prototype.onClick = function () {
|
|
2964
|
+
if (this.tooltipOnlyonclick) {
|
|
2965
|
+
this.show();
|
|
2966
|
+
}
|
|
2967
|
+
};
|
|
2968
|
+
TooltipDirective.prototype.onMouseLeave = function () {
|
|
2969
|
+
if (this.tooltipElem) {
|
|
2970
|
+
this.hide();
|
|
2971
|
+
}
|
|
2972
|
+
};
|
|
2973
|
+
TooltipDirective.prototype.show = function () {
|
|
2974
|
+
if (!this.tooltipElem) {
|
|
2975
|
+
this.create();
|
|
2976
|
+
this.setPosition();
|
|
2977
|
+
}
|
|
2978
|
+
this.renderer.addClass(this.tooltipElem, 'tooltip-show');
|
|
2979
|
+
};
|
|
2980
|
+
TooltipDirective.prototype.hide = function () {
|
|
2981
|
+
this.renderer.removeClass(this.tooltipElem, 'tooltip-show');
|
|
2982
|
+
window.setTimeout(function () {
|
|
2983
|
+
}, this.tooltipDelay);
|
|
2984
|
+
};
|
|
2985
|
+
TooltipDirective.prototype.create = function () {
|
|
2986
|
+
this.tooltipElem = this.renderer.createElement('kms-tooltip-element');
|
|
2987
|
+
this.tooltipTitleElem = this.renderer.createElement('b');
|
|
2988
|
+
this.renderer.appendChild(this.tooltipTitleElem, this.renderer.createText(this.tooltipTitle));
|
|
2989
|
+
this.renderer.appendChild(this.tooltipElem, this.tooltipTitleElem);
|
|
2990
|
+
this.tooltipTextElem = this.renderer.createElement('div');
|
|
2991
|
+
this.renderer.appendChild(this.tooltipTextElem, this.renderer.createText(this.tooltipText));
|
|
2992
|
+
this.renderer.appendChild(this.tooltipElem, this.tooltipTextElem);
|
|
2993
|
+
this.tooltipLinkElem = this.renderer.createElement('a');
|
|
2994
|
+
this.renderer.setAttribute(this.tooltipLinkElem, 'href', this.tooltipLinkUrl);
|
|
2995
|
+
this.renderer.appendChild(this.tooltipLinkElem, this.renderer.createText(this.tooltipLinkText));
|
|
2996
|
+
this.renderer.appendChild(this.tooltipElem, this.tooltipLinkElem);
|
|
2997
|
+
if (this.tooltipPlaceIntoHost) {
|
|
2998
|
+
this.renderer.appendChild(this.el.nativeElement, this.tooltipElem);
|
|
2999
|
+
}
|
|
3000
|
+
else {
|
|
3001
|
+
this.renderer.appendChild(document.body, this.tooltipElem);
|
|
3002
|
+
}
|
|
3003
|
+
this.renderer.addClass(this.tooltipElem, 'tooltip');
|
|
3004
|
+
this.renderer.addClass(this.tooltipElem, "tooltip-" + this.tooltipPlacement);
|
|
3005
|
+
this.renderer.setStyle(this.tooltipElem, '-webkit-transition', "opacity " + this.tooltipDelay + "ms");
|
|
3006
|
+
this.renderer.setStyle(this.tooltipElem, '-moz-transition', "opacity " + this.tooltipDelay + "ms");
|
|
3007
|
+
this.renderer.setStyle(this.tooltipElem, '-o-transition', "opacity " + this.tooltipDelay + "ms");
|
|
3008
|
+
this.renderer.setStyle(this.tooltipElem, 'transition', "opacity " + this.tooltipDelay + "ms");
|
|
3009
|
+
};
|
|
3010
|
+
TooltipDirective.prototype.setPosition = function () {
|
|
3011
|
+
if (this.tooltipElem) {
|
|
3012
|
+
var hostPos = this.el.nativeElement.getBoundingClientRect();
|
|
3013
|
+
var tooltipPos = this.tooltipElem.getBoundingClientRect();
|
|
3014
|
+
var top = void 0, left = void 0;
|
|
3015
|
+
if (this.tooltipPlaceIntoHost) {
|
|
3016
|
+
left = 0;
|
|
3017
|
+
top = hostPos.height;
|
|
3018
|
+
}
|
|
3019
|
+
else {
|
|
3020
|
+
var scrollPos = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop || 0;
|
|
3021
|
+
if (this.tooltipPlacement === 'top') {
|
|
3022
|
+
top = hostPos.top - tooltipPos.height - this.offset;
|
|
3023
|
+
left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
|
|
3024
|
+
}
|
|
3025
|
+
if (!this.tooltipPlacement || this.tooltipPlacement === 'bottom') {
|
|
3026
|
+
top = hostPos.bottom + this.offset;
|
|
3027
|
+
left = hostPos.left + (hostPos.width - tooltipPos.width) / 2;
|
|
3028
|
+
}
|
|
3029
|
+
if (this.tooltipPlacement === 'left') {
|
|
3030
|
+
top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
|
|
3031
|
+
left = hostPos.left - tooltipPos.width - this.offset;
|
|
3032
|
+
}
|
|
3033
|
+
if (this.tooltipPlacement === 'right') {
|
|
3034
|
+
top = hostPos.top + (hostPos.height - tooltipPos.height) / 2;
|
|
3035
|
+
left = hostPos.right + this.offset;
|
|
3036
|
+
}
|
|
3037
|
+
top += scrollPos;
|
|
3038
|
+
}
|
|
3039
|
+
this.renderer.setStyle(this.tooltipElem, 'top', top + "px");
|
|
3040
|
+
this.renderer.setStyle(this.tooltipElem, 'left', left + "px");
|
|
3041
|
+
}
|
|
3042
|
+
};
|
|
3043
|
+
return TooltipDirective;
|
|
3044
|
+
}());
|
|
3045
|
+
TooltipDirective.decorators = [
|
|
3046
|
+
{ type: i0.Directive, args: [{
|
|
3047
|
+
selector: '[kmsTooltip]'
|
|
3048
|
+
},] }
|
|
3049
|
+
];
|
|
3050
|
+
TooltipDirective.ctorParameters = function () { return [
|
|
3051
|
+
{ type: i0.ElementRef },
|
|
3052
|
+
{ type: i0.Renderer2 }
|
|
3053
|
+
]; };
|
|
3054
|
+
TooltipDirective.propDecorators = {
|
|
3055
|
+
tooltipTitle: [{ type: i0.Input, args: ['tooltipTitle',] }],
|
|
3056
|
+
tooltipText: [{ type: i0.Input, args: ['tooltipText',] }],
|
|
3057
|
+
tooltipLinkText: [{ type: i0.Input, args: ['tooltipLinkText',] }],
|
|
3058
|
+
tooltipLinkUrl: [{ type: i0.Input, args: ['tooltipLinkUrl',] }],
|
|
3059
|
+
tooltipPlacement: [{ type: i0.Input, args: ['tooltipPlacement',] }],
|
|
3060
|
+
tooltipDelay: [{ type: i0.Input, args: ['tooltipDelay',] }],
|
|
3061
|
+
tooltipPlaceIntoHost: [{ type: i0.Input, args: ['tooltipPlaceIntoHost',] }],
|
|
3062
|
+
tooltipOnlyonclick: [{ type: i0.Input, args: ['tooltipOnlyonclick',] }],
|
|
3063
|
+
onMouseEnter: [{ type: i0.HostListener, args: ['mouseenter',] }],
|
|
3064
|
+
onClick: [{ type: i0.HostListener, args: ['click',] }],
|
|
3065
|
+
onMouseLeave: [{ type: i0.HostListener, args: ['mouseleave',] }]
|
|
3066
|
+
};
|
|
3067
|
+
|
|
3068
|
+
/**
|
|
3069
|
+
* @copyright KMS GmbH
|
|
3070
|
+
*/
|
|
3071
|
+
var DirectivesModule = /** @class */ (function () {
|
|
3072
|
+
function DirectivesModule() {
|
|
3073
|
+
}
|
|
3074
|
+
return DirectivesModule;
|
|
3075
|
+
}());
|
|
3076
|
+
DirectivesModule.decorators = [
|
|
3077
|
+
{ type: i0.NgModule, args: [{
|
|
3078
|
+
declarations: [
|
|
3079
|
+
SwipeDirective,
|
|
3080
|
+
MouseWheelDirective,
|
|
3081
|
+
GetMaxHeightDirective,
|
|
3082
|
+
TooltipDirective,
|
|
3083
|
+
],
|
|
3084
|
+
imports: [common.CommonModule],
|
|
3085
|
+
exports: [
|
|
3086
|
+
SwipeDirective,
|
|
3087
|
+
MouseWheelDirective,
|
|
3088
|
+
GetMaxHeightDirective,
|
|
3089
|
+
TooltipDirective,
|
|
3090
|
+
],
|
|
3091
|
+
},] }
|
|
3092
|
+
];
|
|
3093
|
+
|
|
2323
3094
|
var KmsUiPresentationalModule = /** @class */ (function () {
|
|
2324
3095
|
function KmsUiPresentationalModule() {
|
|
2325
3096
|
}
|
|
@@ -2328,28 +3099,30 @@
|
|
|
2328
3099
|
KmsUiPresentationalModule.decorators = [
|
|
2329
3100
|
{ type: i0.NgModule, args: [{
|
|
2330
3101
|
declarations: [
|
|
2331
|
-
KmsUiPresentationalComponent,
|
|
2332
3102
|
ActionsParentComponent,
|
|
3103
|
+
BackToTopComponent,
|
|
3104
|
+
ButtonWithConfirmDialogComponent,
|
|
2333
3105
|
CheckboxComponent,
|
|
2334
3106
|
ColorInputComponent,
|
|
2335
|
-
|
|
2336
|
-
|
|
2337
|
-
|
|
3107
|
+
DropdownFromDataComponent,
|
|
3108
|
+
EnumRadiogroupComponent,
|
|
3109
|
+
EnumRadiogroupComponent,
|
|
2338
3110
|
FileInputComponent,
|
|
2339
|
-
LoaderComponent,
|
|
2340
3111
|
FlyoutComponent,
|
|
3112
|
+
GenericDialogComponent,
|
|
2341
3113
|
IconComponent,
|
|
2342
|
-
|
|
3114
|
+
ImageSliderComponent,
|
|
2343
3115
|
KMSAccordionItemComponent,
|
|
2344
|
-
|
|
3116
|
+
KmsUiPresentationalComponent,
|
|
3117
|
+
LoaderComponent,
|
|
2345
3118
|
MapComponent,
|
|
3119
|
+
RadioButtonComponent,
|
|
2346
3120
|
SalutationDropdownComponent,
|
|
2347
3121
|
SalutationRadiogroupComponent,
|
|
3122
|
+
TimeInputComponent,
|
|
2348
3123
|
TooltipComponent,
|
|
2349
3124
|
TooltipIconComponent,
|
|
2350
|
-
|
|
2351
|
-
GenericDialogComponent,
|
|
2352
|
-
ButtonWithConfirmDialogComponent,
|
|
3125
|
+
YesNoRadiogroupComponent
|
|
2353
3126
|
],
|
|
2354
3127
|
imports: [
|
|
2355
3128
|
common.CommonModule,
|
|
@@ -2362,30 +3135,34 @@
|
|
|
2362
3135
|
CustomPipesModule,
|
|
2363
3136
|
googleMaps.GoogleMapsModule,
|
|
2364
3137
|
expansion.MatExpansionModule,
|
|
3138
|
+
select.MatSelectModule,
|
|
3139
|
+
DirectivesModule
|
|
2365
3140
|
],
|
|
2366
3141
|
exports: [
|
|
2367
|
-
KmsUiPresentationalComponent,
|
|
2368
3142
|
ActionsParentComponent,
|
|
3143
|
+
BackToTopComponent,
|
|
3144
|
+
ButtonWithConfirmDialogComponent,
|
|
2369
3145
|
CheckboxComponent,
|
|
2370
3146
|
ColorInputComponent,
|
|
2371
|
-
|
|
2372
|
-
|
|
2373
|
-
|
|
3147
|
+
DropdownFromDataComponent,
|
|
3148
|
+
EnumRadiogroupComponent,
|
|
3149
|
+
EnumRadiogroupComponent,
|
|
2374
3150
|
FileInputComponent,
|
|
2375
|
-
LoaderComponent,
|
|
2376
3151
|
FlyoutComponent,
|
|
3152
|
+
GenericDialogComponent,
|
|
2377
3153
|
IconComponent,
|
|
2378
|
-
|
|
3154
|
+
ImageSliderComponent,
|
|
2379
3155
|
KMSAccordionItemComponent,
|
|
2380
|
-
|
|
3156
|
+
KmsUiPresentationalComponent,
|
|
3157
|
+
LoaderComponent,
|
|
2381
3158
|
MapComponent,
|
|
3159
|
+
RadioButtonComponent,
|
|
2382
3160
|
SalutationDropdownComponent,
|
|
2383
3161
|
SalutationRadiogroupComponent,
|
|
3162
|
+
TimeInputComponent,
|
|
2384
3163
|
TooltipComponent,
|
|
2385
3164
|
TooltipIconComponent,
|
|
2386
|
-
|
|
2387
|
-
GenericDialogComponent,
|
|
2388
|
-
ButtonWithConfirmDialogComponent
|
|
3165
|
+
YesNoRadiogroupComponent
|
|
2389
3166
|
]
|
|
2390
3167
|
},] }
|
|
2391
3168
|
];
|
|
@@ -2399,43 +3176,50 @@
|
|
|
2399
3176
|
*/
|
|
2400
3177
|
|
|
2401
3178
|
exports.CustomPipesModule = CustomPipesModule;
|
|
3179
|
+
exports.DirectivesModule = DirectivesModule;
|
|
2402
3180
|
exports.GenericDialogComponent = GenericDialogComponent;
|
|
2403
3181
|
exports.KmsUiPresentationalComponent = KmsUiPresentationalComponent;
|
|
2404
3182
|
exports.KmsUiPresentationalModule = KmsUiPresentationalModule;
|
|
2405
3183
|
exports.KmsUiPresentationalService = KmsUiPresentationalService;
|
|
2406
|
-
exports
|
|
2407
|
-
exports
|
|
2408
|
-
exports
|
|
2409
|
-
exports
|
|
2410
|
-
exports
|
|
2411
|
-
exports
|
|
2412
|
-
exports
|
|
2413
|
-
exports
|
|
2414
|
-
exports
|
|
2415
|
-
exports
|
|
2416
|
-
exports
|
|
2417
|
-
exports
|
|
2418
|
-
exports
|
|
2419
|
-
exports
|
|
2420
|
-
exports
|
|
2421
|
-
exports
|
|
2422
|
-
exports
|
|
2423
|
-
exports
|
|
2424
|
-
exports
|
|
2425
|
-
exports
|
|
2426
|
-
exports
|
|
2427
|
-
exports
|
|
2428
|
-
exports
|
|
2429
|
-
exports
|
|
2430
|
-
exports
|
|
2431
|
-
exports
|
|
2432
|
-
exports
|
|
2433
|
-
exports
|
|
2434
|
-
exports
|
|
2435
|
-
exports
|
|
2436
|
-
exports
|
|
3184
|
+
exports["ɵa"] = ActionsParentComponent;
|
|
3185
|
+
exports["ɵb"] = BackToTopComponent;
|
|
3186
|
+
exports["ɵba"] = SafeHtmlPipe;
|
|
3187
|
+
exports["ɵbb"] = SafeStylePipe;
|
|
3188
|
+
exports["ɵbc"] = SafeUrlPipe;
|
|
3189
|
+
exports["ɵbd"] = EncodeUriPipe;
|
|
3190
|
+
exports["ɵbe"] = DecodeUriPipe;
|
|
3191
|
+
exports["ɵbf"] = TypeofPipe;
|
|
3192
|
+
exports["ɵbg"] = TrimPipe;
|
|
3193
|
+
exports["ɵbh"] = ToNumberPipe;
|
|
3194
|
+
exports["ɵbi"] = SwipeDirective;
|
|
3195
|
+
exports["ɵbj"] = MouseWheelDirective;
|
|
3196
|
+
exports["ɵbk"] = GetMaxHeightDirective;
|
|
3197
|
+
exports["ɵbl"] = TooltipDirective;
|
|
3198
|
+
exports["ɵc"] = ButtonWithConfirmDialogComponent;
|
|
3199
|
+
exports["ɵd"] = CheckboxComponent;
|
|
3200
|
+
exports["ɵe"] = ColorInputComponent;
|
|
3201
|
+
exports["ɵf"] = FormControlParentComponent;
|
|
3202
|
+
exports["ɵg"] = FormParentComponent;
|
|
3203
|
+
exports["ɵh"] = DropdownFromDataComponent;
|
|
3204
|
+
exports["ɵi"] = EnumRadiogroupComponent;
|
|
3205
|
+
exports["ɵj"] = FileInputComponent;
|
|
3206
|
+
exports["ɵk"] = FlyoutComponent;
|
|
3207
|
+
exports["ɵm"] = IconComponent;
|
|
3208
|
+
exports["ɵn"] = ImageSliderComponent;
|
|
3209
|
+
exports["ɵo"] = KMSAccordionItemComponent;
|
|
3210
|
+
exports["ɵp"] = LoaderComponent;
|
|
3211
|
+
exports["ɵq"] = MapComponent;
|
|
3212
|
+
exports["ɵr"] = ViewportService;
|
|
3213
|
+
exports["ɵs"] = RadioButtonComponent;
|
|
3214
|
+
exports["ɵt"] = SalutationDropdownComponent;
|
|
3215
|
+
exports["ɵu"] = SalutationRadiogroupComponent;
|
|
3216
|
+
exports["ɵv"] = TimeInputComponent;
|
|
3217
|
+
exports["ɵw"] = TooltipComponent;
|
|
3218
|
+
exports["ɵx"] = TooltipIconComponent;
|
|
3219
|
+
exports["ɵy"] = YesNoRadiogroupComponent;
|
|
3220
|
+
exports["ɵz"] = IntegerCurrency;
|
|
2437
3221
|
|
|
2438
3222
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
2439
3223
|
|
|
2440
|
-
}))
|
|
3224
|
+
}));
|
|
2441
3225
|
//# sourceMappingURL=kms-ngx-ui-presentational.umd.js.map
|