@wizishop/angular-components 14.3.15 → 14.3.17
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/esm2020/lib/components/calendar/calendar.component.mjs +103 -69
- package/esm2020/lib/components/selects/option/select-option.directive.mjs +14 -4
- package/esm2020/lib/components/selects/select-test/select.component.mjs +37 -8
- package/esm2020/lib/components/selects/select-test/select.directive.mjs +18 -6
- package/esm2020/lib/components/selects/select-test/value-change.service.mjs +4 -8
- package/fesm2015/wizishop-angular-components.mjs +167 -87
- package/fesm2015/wizishop-angular-components.mjs.map +1 -1
- package/fesm2020/wizishop-angular-components.mjs +167 -87
- package/fesm2020/wizishop-angular-components.mjs.map +1 -1
- package/lib/components/calendar/calendar.component.d.ts +28 -10
- package/lib/components/selects/option/select-option.directive.d.ts +3 -1
- package/lib/components/selects/select-test/select.component.d.ts +4 -1
- package/lib/components/selects/select-test/select.directive.d.ts +3 -1
- package/package.json +1 -1
- package/wizishop-angular-components-14.3.17.tgz +0 -0
- package/wizishop-angular-components-14.3.15.tgz +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as i1$2 from '@wizishop/ng-wizi-bulma';
|
|
2
2
|
import { NwbAllModule, NwbFilterGroup } from '@wizishop/ng-wizi-bulma';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostListener, Injectable, InjectionToken, ContentChildren, NgModule, Inject, Pipe, Attribute, Optional, ViewChild, ChangeDetectionStrategy,
|
|
4
|
+
import { Component, ViewEncapsulation, Input, EventEmitter, Directive, Output, HostListener, Injectable, InjectionToken, HostBinding, ContentChildren, NgModule, Inject, Pipe, Attribute, Optional, ViewChild, ChangeDetectionStrategy, ContentChild } from '@angular/core';
|
|
5
5
|
import * as i1 from '@angular/common';
|
|
6
6
|
import { CommonModule, DOCUMENT } from '@angular/common';
|
|
7
7
|
import * as i2 from '@angular/forms';
|
|
@@ -11,7 +11,7 @@ import { PerfectScrollbarModule } from 'ngx-perfect-scrollbar';
|
|
|
11
11
|
import { Subject, merge, takeUntil as takeUntil$1, startWith, fromEvent, ReplaySubject, interval, map as map$1 } from 'rxjs';
|
|
12
12
|
import { takeUntil, debounceTime, distinctUntilChanged, tap, map, takeWhile, filter } from 'rxjs/operators';
|
|
13
13
|
import * as i1$1 from '@angular/cdk/overlay';
|
|
14
|
-
import { DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, A, Z, ZERO, NINE, ENTER, SPACE, hasModifierKey, ESCAPE } from '@angular/cdk/keycodes';
|
|
14
|
+
import { TAB, DOWN_ARROW, UP_ARROW, LEFT_ARROW, RIGHT_ARROW, A, Z, ZERO, NINE, ENTER, SPACE, hasModifierKey, ESCAPE } from '@angular/cdk/keycodes';
|
|
15
15
|
import { CdkTableModule } from '@angular/cdk/table';
|
|
16
16
|
import { trigger, transition, style, animate, state } from '@angular/animations';
|
|
17
17
|
import { TagInputModule } from 'ngx-chips';
|
|
@@ -350,6 +350,7 @@ const OPTION_SELECTION_HANDLER = new InjectionToken('OPTION_SELECTION_HANDLER');
|
|
|
350
350
|
class SelectOptionDirective {
|
|
351
351
|
constructor(contentRef) {
|
|
352
352
|
this.contentRef = contentRef;
|
|
353
|
+
this.cursor = 'pointer';
|
|
353
354
|
this.disabled = false;
|
|
354
355
|
this.selected = false;
|
|
355
356
|
this.selectedChange = new EventEmitter();
|
|
@@ -357,6 +358,9 @@ class SelectOptionDirective {
|
|
|
357
358
|
onClick() {
|
|
358
359
|
this.onSelectOption();
|
|
359
360
|
}
|
|
361
|
+
get isOptionSelected() {
|
|
362
|
+
return this.selected;
|
|
363
|
+
}
|
|
360
364
|
onSelectOption() {
|
|
361
365
|
if (this.disabled) {
|
|
362
366
|
return;
|
|
@@ -382,16 +386,22 @@ class SelectOptionDirective {
|
|
|
382
386
|
}
|
|
383
387
|
}
|
|
384
388
|
SelectOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectOptionDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
385
|
-
SelectOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: SelectOptionDirective, selector: "[
|
|
389
|
+
SelectOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: SelectOptionDirective, selector: "[wacOption]", inputs: { disabled: "disabled", value: "value", selected: "selected" }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "click": "onClick()" }, properties: { "class.wac-option-selected": "this.isOptionSelected", "style.cursor": "this.cursor" } }, providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: SelectOptionDirective }], ngImport: i0 });
|
|
386
390
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectOptionDirective, decorators: [{
|
|
387
391
|
type: Directive,
|
|
388
392
|
args: [{
|
|
389
|
-
selector: '[
|
|
393
|
+
selector: '[wacOption]',
|
|
390
394
|
providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: SelectOptionDirective }]
|
|
391
395
|
}]
|
|
392
396
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { onClick: [{
|
|
393
397
|
type: HostListener,
|
|
394
398
|
args: ['click']
|
|
399
|
+
}], isOptionSelected: [{
|
|
400
|
+
type: HostBinding,
|
|
401
|
+
args: ['class.wac-option-selected']
|
|
402
|
+
}], cursor: [{
|
|
403
|
+
type: HostBinding,
|
|
404
|
+
args: ['style.cursor']
|
|
395
405
|
}], disabled: [{
|
|
396
406
|
type: Input
|
|
397
407
|
}], value: [{
|
|
@@ -502,8 +512,8 @@ class ValueChangeService {
|
|
|
502
512
|
this.value = selectedOption.value;
|
|
503
513
|
}
|
|
504
514
|
handleSelectedOptionsEvent() {
|
|
505
|
-
this.optionSelectedChangeListeners().subscribe((
|
|
506
|
-
this.value =
|
|
515
|
+
this.optionSelectedChangeListeners().subscribe((value) => {
|
|
516
|
+
this.value = value;
|
|
507
517
|
});
|
|
508
518
|
}
|
|
509
519
|
updateSelectPlaceholder() {
|
|
@@ -519,11 +529,7 @@ class ValueChangeService {
|
|
|
519
529
|
}
|
|
520
530
|
optionSelectedChangeListeners() {
|
|
521
531
|
const selectedChange$ = this.optionChildren.map((option) => {
|
|
522
|
-
return option.selectedChange.pipe(map((
|
|
523
|
-
return {
|
|
524
|
-
value
|
|
525
|
-
};
|
|
526
|
-
}));
|
|
532
|
+
return option.selectedChange.pipe(map((selected) => option.getValue()));
|
|
527
533
|
});
|
|
528
534
|
return merge(...selectedChange$).pipe(takeUntil(this.resetListeners$));
|
|
529
535
|
}
|
|
@@ -551,13 +557,20 @@ class SelectDirective {
|
|
|
551
557
|
this.valueChangeService = valueChangeService;
|
|
552
558
|
this.valueChange = new EventEmitter();
|
|
553
559
|
this.disabled = false;
|
|
560
|
+
this.tabIndex = 0;
|
|
554
561
|
this.isDestroyed$ = new Subject();
|
|
555
562
|
// ControlValueAccessor methods
|
|
556
563
|
this.onChange = () => { };
|
|
557
564
|
this.onTouch = () => { };
|
|
558
565
|
}
|
|
566
|
+
get tabindex() {
|
|
567
|
+
return this.tabIndex;
|
|
568
|
+
}
|
|
559
569
|
/** Handles all keydown events on the select. */
|
|
560
570
|
onKeydown(event) {
|
|
571
|
+
if (event.keyCode === TAB) {
|
|
572
|
+
return;
|
|
573
|
+
}
|
|
561
574
|
if (this.disabled) {
|
|
562
575
|
return;
|
|
563
576
|
}
|
|
@@ -600,8 +613,8 @@ class SelectDirective {
|
|
|
600
613
|
keyCode === LEFT_ARROW ||
|
|
601
614
|
keyCode === RIGHT_ARROW;
|
|
602
615
|
const isTyping = (keyCode >= A && keyCode <= Z) || (keyCode >= ZERO && keyCode <= NINE);
|
|
603
|
-
event.preventDefault(); // prevents the page from scrolling
|
|
604
616
|
if (isArrowKey) {
|
|
617
|
+
event.preventDefault(); // prevents the page from scrolling
|
|
605
618
|
// select the next option on arrow key down
|
|
606
619
|
if (keyCode === DOWN_ARROW || keyCode === RIGHT_ARROW) {
|
|
607
620
|
this.valueChangeService.selectNextOption();
|
|
@@ -633,7 +646,7 @@ class SelectDirective {
|
|
|
633
646
|
}
|
|
634
647
|
}
|
|
635
648
|
SelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectDirective, deps: [{ token: ValueChangeService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
636
|
-
SelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: SelectDirective, selector: "[wacSelect]", inputs: { value: "value", disabled: "disabled" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown": "onKeydown($event)" } }, providers: [
|
|
649
|
+
SelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: SelectDirective, selector: "[wacSelect]", inputs: { value: "value", disabled: "disabled", tabIndex: "tabIndex" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.tabindex": "this.tabindex" } }, providers: [
|
|
637
650
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectDirective, multi: true },
|
|
638
651
|
ValueChangeService
|
|
639
652
|
], queries: [{ propertyName: "optionChildren", predicate: OPTION_SELECTION_HANDLER, descendants: true }], ngImport: i0 });
|
|
@@ -646,7 +659,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
646
659
|
ValueChangeService
|
|
647
660
|
]
|
|
648
661
|
}]
|
|
649
|
-
}], ctorParameters: function () { return [{ type: ValueChangeService }]; }, propDecorators: {
|
|
662
|
+
}], ctorParameters: function () { return [{ type: ValueChangeService }]; }, propDecorators: { tabindex: [{
|
|
663
|
+
type: HostBinding,
|
|
664
|
+
args: ['attr.tabindex']
|
|
665
|
+
}], onKeydown: [{
|
|
650
666
|
type: HostListener,
|
|
651
667
|
args: ['keydown', ['$event']]
|
|
652
668
|
}], optionChildren: [{
|
|
@@ -658,6 +674,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
658
674
|
type: Output
|
|
659
675
|
}], disabled: [{
|
|
660
676
|
type: Input
|
|
677
|
+
}], tabIndex: [{
|
|
678
|
+
type: Input
|
|
661
679
|
}] } });
|
|
662
680
|
|
|
663
681
|
const directives$2 = [DebounceKeyupDirective, AbstractDebounceDirective, AutoHideDirective, ZindexToggleDirective, VarDirective, KeypressEnterDirective, SelectOptionDirective, SelectDirective];
|
|
@@ -1759,23 +1777,68 @@ class CalendarComponent {
|
|
|
1759
1777
|
displayMode: 'inline',
|
|
1760
1778
|
showHeader: false,
|
|
1761
1779
|
showFooter: true,
|
|
1762
|
-
showButton: true
|
|
1763
1780
|
};
|
|
1764
1781
|
this.position = 'bottom';
|
|
1765
|
-
this.
|
|
1766
|
-
this.
|
|
1782
|
+
this._dateSelected = new Date(); // todo only change it when setted to a new value, add dateSelectedChange
|
|
1783
|
+
this.dateSelectedChange = new EventEmitter();
|
|
1784
|
+
this.typeDate = 'datetime-local'; // todo check why it is broken
|
|
1767
1785
|
this.noMargin = false;
|
|
1786
|
+
this.disabled = false;
|
|
1768
1787
|
this.selected = new EventEmitter();
|
|
1769
1788
|
this.changeData = new EventEmitter();
|
|
1770
1789
|
this.open = false;
|
|
1771
1790
|
this.startLabel = '';
|
|
1772
1791
|
this.endLabel = '';
|
|
1792
|
+
// ControlValueAccessor methods
|
|
1793
|
+
this.onChange = () => { };
|
|
1794
|
+
this.onTouch = () => { };
|
|
1773
1795
|
}
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1796
|
+
set dateSelected(dateSelected) {
|
|
1797
|
+
if (this.disabled) {
|
|
1798
|
+
return;
|
|
1799
|
+
}
|
|
1800
|
+
this._dateSelected = dateSelected;
|
|
1801
|
+
this.setCalendarDate();
|
|
1802
|
+
}
|
|
1803
|
+
get dateSelected() {
|
|
1804
|
+
return this._dateSelected;
|
|
1805
|
+
}
|
|
1806
|
+
ngOnInit() {
|
|
1807
|
+
this.setCalendarLabel();
|
|
1808
|
+
this.setCalendarDate();
|
|
1809
|
+
}
|
|
1810
|
+
ngOnChanges(changes) {
|
|
1811
|
+
if (changes.label || changes.type) {
|
|
1812
|
+
this.setCalendarLabel();
|
|
1813
|
+
}
|
|
1814
|
+
if (changes.typeDate) {
|
|
1815
|
+
this.typeDateChange();
|
|
1816
|
+
}
|
|
1817
|
+
}
|
|
1818
|
+
writeValue(date) {
|
|
1819
|
+
this.dateSelected = date;
|
|
1820
|
+
}
|
|
1821
|
+
registerOnChange(fn) {
|
|
1822
|
+
this.onChange = fn;
|
|
1823
|
+
}
|
|
1824
|
+
registerOnTouched(fn) {
|
|
1825
|
+
this.onTouch = fn;
|
|
1826
|
+
}
|
|
1827
|
+
setDisabledState(isDisabled) {
|
|
1828
|
+
this.disabled = isDisabled;
|
|
1829
|
+
}
|
|
1830
|
+
onChangeDate(selectedDates) {
|
|
1831
|
+
if (this.disabled) {
|
|
1832
|
+
return;
|
|
1833
|
+
}
|
|
1834
|
+
this.currentDate = new Date(new Date(selectedDates.startDate).setHours(0, 0, 0, 0));
|
|
1835
|
+
this.setDateSelected();
|
|
1836
|
+
}
|
|
1837
|
+
setDateSelected() {
|
|
1838
|
+
const dateData = this.getDateData();
|
|
1839
|
+
this.dateSelected = typeof this.dateSelected === 'string' ? dateData.toString() : dateData;
|
|
1840
|
+
this.onChange(this.dateSelected);
|
|
1841
|
+
this.dateSelectedChange.emit(this.dateSelected);
|
|
1779
1842
|
this.triggerChange({
|
|
1780
1843
|
startDate: this.dateSelected,
|
|
1781
1844
|
endDate: this.dateSelected
|
|
@@ -1793,8 +1856,28 @@ class CalendarComponent {
|
|
|
1793
1856
|
else {
|
|
1794
1857
|
this.open = !this.open;
|
|
1795
1858
|
}
|
|
1859
|
+
this.onTouch();
|
|
1796
1860
|
}
|
|
1797
|
-
|
|
1861
|
+
setCalendarDate() {
|
|
1862
|
+
let selectedDate = this.dateSelected;
|
|
1863
|
+
if (typeof selectedDate === 'string') {
|
|
1864
|
+
selectedDate = new Date(selectedDate);
|
|
1865
|
+
}
|
|
1866
|
+
this.currentHours = selectedDate.getHours() < 10 ? '0' + selectedDate.getHours() : selectedDate.getHours();
|
|
1867
|
+
this.currentMinutes = selectedDate.getMinutes() < 10 ? '0' + selectedDate.getMinutes() : selectedDate.getMinutes();
|
|
1868
|
+
this.currentDate = new Date(selectedDate.setHours(0, 0, 0, 0));
|
|
1869
|
+
if (this.typeDate === 'date') {
|
|
1870
|
+
this.currentHours = '00';
|
|
1871
|
+
this.currentMinutes = '00';
|
|
1872
|
+
}
|
|
1873
|
+
}
|
|
1874
|
+
typeDateChange() {
|
|
1875
|
+
if (this.typeDate === 'date') {
|
|
1876
|
+
this.currentHours = '00';
|
|
1877
|
+
this.currentMinutes = '00';
|
|
1878
|
+
}
|
|
1879
|
+
}
|
|
1880
|
+
setCalendarLabel() {
|
|
1798
1881
|
if (this.type === 'edit' && this.label) {
|
|
1799
1882
|
const splitLabel = this.label.split('{x}');
|
|
1800
1883
|
if (splitLabel.length > 1) {
|
|
@@ -1805,17 +1888,6 @@ class CalendarComponent {
|
|
|
1805
1888
|
this.startLabel = this.label;
|
|
1806
1889
|
}
|
|
1807
1890
|
}
|
|
1808
|
-
this.currentHours =
|
|
1809
|
-
new Date(this.dateSelected).getHours() < 10 ? '0' + new Date(this.dateSelected).getHours() : new Date(this.dateSelected).getHours();
|
|
1810
|
-
this.currentMinutes =
|
|
1811
|
-
new Date(this.dateSelected).getMinutes() < 10
|
|
1812
|
-
? '0' + new Date(this.dateSelected).getMinutes()
|
|
1813
|
-
: new Date(this.dateSelected).getMinutes();
|
|
1814
|
-
this.currentDate = new Date(this.dateSelected).setHours(0, 0, 0, 0);
|
|
1815
|
-
if (this.typeDate === 'date') {
|
|
1816
|
-
this.currentHours = '00';
|
|
1817
|
-
this.currentMinutes = '00';
|
|
1818
|
-
}
|
|
1819
1891
|
}
|
|
1820
1892
|
verifKeyup(events) {
|
|
1821
1893
|
events.target.value = events.target.value.replace(/\D+/g, '');
|
|
@@ -1823,26 +1895,12 @@ class CalendarComponent {
|
|
|
1823
1895
|
verifHours(events) {
|
|
1824
1896
|
const value = parseInt(events.target.value, 0);
|
|
1825
1897
|
events.target.value = this.currentHours = value < 24 ? (value < 10 ? '0' + value : value) : 23;
|
|
1826
|
-
|
|
1827
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1828
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1829
|
-
this.dateSelected = dateData;
|
|
1830
|
-
this.triggerChange({
|
|
1831
|
-
startDate: dateData,
|
|
1832
|
-
endDate: dateData
|
|
1833
|
-
});
|
|
1898
|
+
this.setDateSelected();
|
|
1834
1899
|
}
|
|
1835
1900
|
verifMinutes(events) {
|
|
1836
1901
|
const value = parseInt(events.target.value, 0);
|
|
1837
1902
|
events.target.value = this.currentMinutes = value < 60 ? (value < 10 ? '0' + value : value) : 59;
|
|
1838
|
-
|
|
1839
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1840
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1841
|
-
this.dateSelected = dateData;
|
|
1842
|
-
this.triggerChange({
|
|
1843
|
-
startDate: dateData,
|
|
1844
|
-
endDate: dateData
|
|
1845
|
-
});
|
|
1903
|
+
this.setDateSelected();
|
|
1846
1904
|
}
|
|
1847
1905
|
addHours(target) {
|
|
1848
1906
|
target.value = this.currentHours =
|
|
@@ -1853,14 +1911,7 @@ class CalendarComponent {
|
|
|
1853
1911
|
: parseInt(target.value, 0) < 10
|
|
1854
1912
|
? '0' + parseInt(target.value, 0)
|
|
1855
1913
|
: parseInt(target.value, 0);
|
|
1856
|
-
|
|
1857
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1858
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1859
|
-
this.dateSelected = dateData;
|
|
1860
|
-
this.triggerChange({
|
|
1861
|
-
startDate: dateData,
|
|
1862
|
-
endDate: dateData
|
|
1863
|
-
});
|
|
1914
|
+
this.setDateSelected();
|
|
1864
1915
|
}
|
|
1865
1916
|
removeHours(target) {
|
|
1866
1917
|
target.value = this.currentHours =
|
|
@@ -1871,14 +1922,7 @@ class CalendarComponent {
|
|
|
1871
1922
|
: parseInt(target.value, 0) < 10
|
|
1872
1923
|
? '0' + parseInt(target.value, 0)
|
|
1873
1924
|
: parseInt(target.value, 0);
|
|
1874
|
-
|
|
1875
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1876
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1877
|
-
this.dateSelected = dateData;
|
|
1878
|
-
this.triggerChange({
|
|
1879
|
-
startDate: dateData,
|
|
1880
|
-
endDate: dateData
|
|
1881
|
-
});
|
|
1925
|
+
this.setDateSelected();
|
|
1882
1926
|
}
|
|
1883
1927
|
addMinutes(target) {
|
|
1884
1928
|
target.value = this.currentMinutes =
|
|
@@ -1889,14 +1933,7 @@ class CalendarComponent {
|
|
|
1889
1933
|
: parseInt(target.value, 0) < 10
|
|
1890
1934
|
? '0' + parseInt(target.value, 0)
|
|
1891
1935
|
: parseInt(target.value, 0);
|
|
1892
|
-
|
|
1893
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1894
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1895
|
-
this.dateSelected = dateData;
|
|
1896
|
-
this.triggerChange({
|
|
1897
|
-
startDate: dateData,
|
|
1898
|
-
endDate: dateData
|
|
1899
|
-
});
|
|
1936
|
+
this.setDateSelected();
|
|
1900
1937
|
}
|
|
1901
1938
|
removeMinutes(target) {
|
|
1902
1939
|
target.value = this.currentMinutes =
|
|
@@ -1907,21 +1944,31 @@ class CalendarComponent {
|
|
|
1907
1944
|
: parseInt(target.value, 0) < 10
|
|
1908
1945
|
? '0' + parseInt(target.value, 0)
|
|
1909
1946
|
: parseInt(target.value, 0);
|
|
1910
|
-
|
|
1947
|
+
this.setDateSelected();
|
|
1948
|
+
}
|
|
1949
|
+
getDateData() {
|
|
1950
|
+
return new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
|
|
1911
1951
|
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1912
1952
|
parseInt(this.currentMinutes, 0) * 60000);
|
|
1913
|
-
this.dateSelected = dateData;
|
|
1914
|
-
this.triggerChange({
|
|
1915
|
-
startDate: dateData,
|
|
1916
|
-
endDate: dateData
|
|
1917
|
-
});
|
|
1918
1953
|
}
|
|
1919
1954
|
}
|
|
1920
1955
|
CalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1921
|
-
CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CalendarComponent, selector: "wac-calendar", inputs: { label: "label", type: "type", options: "options", position: "position", dateSelected: "dateSelected", typeDate: "typeDate", noMargin: "noMargin"
|
|
1956
|
+
CalendarComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: CalendarComponent, selector: "wac-calendar", inputs: { label: "label", type: "type", options: "options", position: "position", dateSelected: "dateSelected", typeDate: "typeDate", noMargin: "noMargin", disabled: "disabled" }, outputs: { dateSelectedChange: "dateSelectedChange", selected: "selected", changeData: "changeData" }, providers: [
|
|
1957
|
+
{
|
|
1958
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1959
|
+
useExisting: CalendarComponent,
|
|
1960
|
+
multi: true
|
|
1961
|
+
}
|
|
1962
|
+
], usesOnChanges: true, ngImport: i0, template: "<div\n class=\"wac-calendar\"\n [ngClass]=\"{\n 'wac-calendar--input': type === 'input',\n 'wac-calendar--edit': type === 'edit',\n 'wac-calendar--select': type === 'select',\n 'wac-calendar--no-margin': noMargin,\n 'wac-calendar--open': open\n }\"\n [zIndexToggle]=\"open\"\n>\n <p class=\"wac-calendar__label\" *ngIf=\"label && (type === 'input' || type === 'select')\" (click)=\"openCalendar()\">{{ label }}</p>\n <p class=\"wac-calendar__startLabel\" *ngIf=\"type === 'edit'\">{{ startLabel }}</p>\n <div class=\"wac-calendar__autoHide\" wzAutoHide (clickOutside)=\"openCalendar('close')\">\n <div class=\"wac-calendar__wrapper\">\n <div class=\"wac-calendar__wrapper__input\" *ngIf=\"type === 'input'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__input__icon\">\n <i class=\"far fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__input__date\">\n {{ dateSelected | date: 'dd/MM/yyyy' }}\n </div>\n <div class=\"wac-calendar__wrapper__input__time\">\n {{ dateSelected | date: 'HH:mm' }}\n </div>\n </div>\n <div class=\"wac-calendar__wrapper__editInPlace\" *ngIf=\"type === 'edit'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__editInPlace__icon\">\n <i class=\"fal fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__editInPlace__date\">\n {{ dateSelected | date: 'dd/MM/yyyy HH:mm' }}\n </div>\n </div>\n <div class=\"wac-calendar__wrapper__select\" *ngIf=\"type === 'select'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__select__icon\">\n <i class=\"fal fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__select__date\">\n {{ dateSelected | date: 'dd/MM/yyyy HH:mm' }}\n </div>\n </div>\n </div>\n <div\n class=\"wac-calendar__absolute\"\n [ngClass]=\"{\n top: position === 'top',\n bottom: position === 'bottom',\n left: position === 'left',\n right: position === 'right',\n 'right-top': position === 'right-top',\n 'right-bottom': position === 'right-bottom',\n 'left-top': position === 'left-top',\n 'left-bottom': position === 'left-bottom',\n 'with-time': typeDate === 'datetime-local' || typeDate === 'datetime'\n }\"\n >\n <nwb-date-picker #datePicker (change)=\"onChangeDate($event)\" [options]=\"options\">\n <input [nwbDatepickerStart]=\"datePicker\" type=\"date\" [value]=\"dateSelected.toString()\" />\n </nwb-date-picker>\n <div class=\"wac-calendar__absolute__time\" *ngIf=\"typeDate === 'datetime-local' || typeDate === 'datetime'\">\n <div class=\"wac-calendar__absolute__time__wrapper\">\n <div class=\"wac-calendar__absolute__time__wrapper__hours\">\n <div class=\"wac-calendar__absolute__time__wrapper__hours__left\">\n <button class=\"wac-calendar__absolute__time__wrapper__hours__btn\" (click)=\"addHours(hours)\">\n <i class=\"fas fa-plus\"></i>\n </button>\n <button class=\"wac-calendar__absolute__time__wrapper__hours__btn\" (click)=\"removeHours(hours)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__hours__right\">\n <input #hours type=\"text\" [value]=\"currentHours\" (keyup)=\"verifKeyup($event)\" (blur)=\"verifHours($event)\" />\n </div>\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__minutes\">\n <div class=\"wac-calendar__absolute__time__wrapper__minutes__left\">\n <input #minutes type=\"text\" [value]=\"currentMinutes\" (keyup)=\"verifKeyup($event)\" (blur)=\"verifMinutes($event)\" />\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__minutes__right\">\n <button class=\"wac-calendar__absolute__time__wrapper__minutes__btn\" (click)=\"addMinutes(minutes)\">\n <i class=\"fas fa-plus\"></i>\n </button>\n <button class=\"wac-calendar__absolute__time__wrapper__minutes__btn\" (click)=\"removeMinutes(minutes)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <p class=\"wac-calendar__endLabel\" *ngIf=\"type === 'edit'\">{{ endLabel }}</p>\n</div>\n", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i1$2.NwbDatePickerComponent, selector: "nwb-date-picker", inputs: ["options"], outputs: ["change", "clear"] }, { kind: "directive", type: i1$2.NwbDatePickerInputStartDirective, selector: "input[nwbDatepickerStart]", inputs: ["nwbDatepickerStart"] }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "directive", type: ZindexToggleDirective, selector: "[zIndexToggle]", inputs: ["zIndexToggle"], outputs: ["onEventChange"] }, { kind: "pipe", type: i1.DatePipe, name: "date" }] });
|
|
1922
1963
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
1923
1964
|
type: Component,
|
|
1924
|
-
args: [{ selector: 'wac-calendar',
|
|
1965
|
+
args: [{ selector: 'wac-calendar', providers: [
|
|
1966
|
+
{
|
|
1967
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1968
|
+
useExisting: CalendarComponent,
|
|
1969
|
+
multi: true
|
|
1970
|
+
}
|
|
1971
|
+
], template: "<div\n class=\"wac-calendar\"\n [ngClass]=\"{\n 'wac-calendar--input': type === 'input',\n 'wac-calendar--edit': type === 'edit',\n 'wac-calendar--select': type === 'select',\n 'wac-calendar--no-margin': noMargin,\n 'wac-calendar--open': open\n }\"\n [zIndexToggle]=\"open\"\n>\n <p class=\"wac-calendar__label\" *ngIf=\"label && (type === 'input' || type === 'select')\" (click)=\"openCalendar()\">{{ label }}</p>\n <p class=\"wac-calendar__startLabel\" *ngIf=\"type === 'edit'\">{{ startLabel }}</p>\n <div class=\"wac-calendar__autoHide\" wzAutoHide (clickOutside)=\"openCalendar('close')\">\n <div class=\"wac-calendar__wrapper\">\n <div class=\"wac-calendar__wrapper__input\" *ngIf=\"type === 'input'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__input__icon\">\n <i class=\"far fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__input__date\">\n {{ dateSelected | date: 'dd/MM/yyyy' }}\n </div>\n <div class=\"wac-calendar__wrapper__input__time\">\n {{ dateSelected | date: 'HH:mm' }}\n </div>\n </div>\n <div class=\"wac-calendar__wrapper__editInPlace\" *ngIf=\"type === 'edit'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__editInPlace__icon\">\n <i class=\"fal fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__editInPlace__date\">\n {{ dateSelected | date: 'dd/MM/yyyy HH:mm' }}\n </div>\n </div>\n <div class=\"wac-calendar__wrapper__select\" *ngIf=\"type === 'select'\" (click)=\"openCalendar()\">\n <div class=\"wac-calendar__wrapper__select__icon\">\n <i class=\"fal fa-calendar-alt\"></i>\n </div>\n <div class=\"wac-calendar__wrapper__select__date\">\n {{ dateSelected | date: 'dd/MM/yyyy HH:mm' }}\n </div>\n </div>\n </div>\n <div\n class=\"wac-calendar__absolute\"\n [ngClass]=\"{\n top: position === 'top',\n bottom: position === 'bottom',\n left: position === 'left',\n right: position === 'right',\n 'right-top': position === 'right-top',\n 'right-bottom': position === 'right-bottom',\n 'left-top': position === 'left-top',\n 'left-bottom': position === 'left-bottom',\n 'with-time': typeDate === 'datetime-local' || typeDate === 'datetime'\n }\"\n >\n <nwb-date-picker #datePicker (change)=\"onChangeDate($event)\" [options]=\"options\">\n <input [nwbDatepickerStart]=\"datePicker\" type=\"date\" [value]=\"dateSelected.toString()\" />\n </nwb-date-picker>\n <div class=\"wac-calendar__absolute__time\" *ngIf=\"typeDate === 'datetime-local' || typeDate === 'datetime'\">\n <div class=\"wac-calendar__absolute__time__wrapper\">\n <div class=\"wac-calendar__absolute__time__wrapper__hours\">\n <div class=\"wac-calendar__absolute__time__wrapper__hours__left\">\n <button class=\"wac-calendar__absolute__time__wrapper__hours__btn\" (click)=\"addHours(hours)\">\n <i class=\"fas fa-plus\"></i>\n </button>\n <button class=\"wac-calendar__absolute__time__wrapper__hours__btn\" (click)=\"removeHours(hours)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__hours__right\">\n <input #hours type=\"text\" [value]=\"currentHours\" (keyup)=\"verifKeyup($event)\" (blur)=\"verifHours($event)\" />\n </div>\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__minutes\">\n <div class=\"wac-calendar__absolute__time__wrapper__minutes__left\">\n <input #minutes type=\"text\" [value]=\"currentMinutes\" (keyup)=\"verifKeyup($event)\" (blur)=\"verifMinutes($event)\" />\n </div>\n <div class=\"wac-calendar__absolute__time__wrapper__minutes__right\">\n <button class=\"wac-calendar__absolute__time__wrapper__minutes__btn\" (click)=\"addMinutes(minutes)\">\n <i class=\"fas fa-plus\"></i>\n </button>\n <button class=\"wac-calendar__absolute__time__wrapper__minutes__btn\" (click)=\"removeMinutes(minutes)\">\n <i class=\"fas fa-minus\"></i>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n </div>\n <p class=\"wac-calendar__endLabel\" *ngIf=\"type === 'edit'\">{{ endLabel }}</p>\n</div>\n" }]
|
|
1925
1972
|
}], ctorParameters: function () { return []; }, propDecorators: { label: [{
|
|
1926
1973
|
type: Input
|
|
1927
1974
|
}], type: [{
|
|
@@ -1932,10 +1979,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
1932
1979
|
type: Input
|
|
1933
1980
|
}], dateSelected: [{
|
|
1934
1981
|
type: Input
|
|
1982
|
+
}], dateSelectedChange: [{
|
|
1983
|
+
type: Output
|
|
1935
1984
|
}], typeDate: [{
|
|
1936
1985
|
type: Input
|
|
1937
1986
|
}], noMargin: [{
|
|
1938
1987
|
type: Input
|
|
1988
|
+
}], disabled: [{
|
|
1989
|
+
type: Input
|
|
1939
1990
|
}], selected: [{
|
|
1940
1991
|
type: Output
|
|
1941
1992
|
}], changeData: [{
|
|
@@ -4553,6 +4604,7 @@ class SelectTestComponent extends SelectDirective {
|
|
|
4553
4604
|
this._openPanel = false;
|
|
4554
4605
|
this.openPanelChange = new EventEmitter();
|
|
4555
4606
|
this.enableSearch = false;
|
|
4607
|
+
this.tabIndex = -1;
|
|
4556
4608
|
this.isDestroyed$ = new Subject();
|
|
4557
4609
|
this.isKeyBoardAction = false;
|
|
4558
4610
|
this.skipIfTriggeredByKeyboardAction = () => {
|
|
@@ -4613,16 +4665,37 @@ class SelectTestComponent extends SelectDirective {
|
|
|
4613
4665
|
this.openPanelChange.emit(this.openPanel);
|
|
4614
4666
|
}
|
|
4615
4667
|
onKeydown(event) {
|
|
4668
|
+
const keyCode = event.keyCode;
|
|
4669
|
+
if (event.keyCode === TAB) {
|
|
4670
|
+
// go to the next element with tabindex
|
|
4671
|
+
if (this.openPanel) {
|
|
4672
|
+
this.openPanel = false;
|
|
4673
|
+
}
|
|
4674
|
+
return;
|
|
4675
|
+
}
|
|
4616
4676
|
if (this.disabled) {
|
|
4617
4677
|
return;
|
|
4618
4678
|
}
|
|
4619
|
-
event.preventDefault(); // prevents the page from scrolling
|
|
4620
4679
|
const actionTriggered = this.openPanel ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);
|
|
4621
4680
|
if (actionTriggered) {
|
|
4622
4681
|
return;
|
|
4623
4682
|
}
|
|
4624
4683
|
this.isKeyBoardAction = true;
|
|
4625
|
-
super.
|
|
4684
|
+
super.onKeydown(event);
|
|
4685
|
+
}
|
|
4686
|
+
handleKeyboardActionWithSearch(event) {
|
|
4687
|
+
const keyCode = event.keyCode;
|
|
4688
|
+
if (keyCode === DOWN_ARROW) {
|
|
4689
|
+
this.isKeyBoardAction = true;
|
|
4690
|
+
this.valueChangeService.selectNextOption();
|
|
4691
|
+
return true;
|
|
4692
|
+
}
|
|
4693
|
+
if (keyCode === UP_ARROW) {
|
|
4694
|
+
this.isKeyBoardAction = true;
|
|
4695
|
+
this.valueChangeService.selectPreviousOption();
|
|
4696
|
+
return true;
|
|
4697
|
+
}
|
|
4698
|
+
return false;
|
|
4626
4699
|
}
|
|
4627
4700
|
/** Handles keyboard events while the select is closed. */
|
|
4628
4701
|
_handleClosedKeydown(event) {
|
|
@@ -4647,10 +4720,14 @@ class SelectTestComponent extends SelectDirective {
|
|
|
4647
4720
|
keyCode === UP_ARROW ||
|
|
4648
4721
|
keyCode === LEFT_ARROW ||
|
|
4649
4722
|
keyCode === RIGHT_ARROW;
|
|
4650
|
-
const isEscapeKey = keyCode === ESCAPE || keyCode === ENTER || keyCode === SPACE;
|
|
4723
|
+
const isEscapeKey = keyCode === ESCAPE || keyCode === ENTER || keyCode === SPACE || keyCode === TAB;
|
|
4651
4724
|
if ((isArrowKey && event.altKey) || isEscapeKey) {
|
|
4652
4725
|
// Close the select on ALT + arrow key to match the native <select>
|
|
4653
4726
|
this.openPanel = false;
|
|
4727
|
+
if (this.customSearchTrigger && keyCode !== TAB) {
|
|
4728
|
+
// If a escape key is used with the search, the focus on the select is loosed. And we can not interact with the select anymore.
|
|
4729
|
+
this.selectHeader.nativeElement.focus();
|
|
4730
|
+
}
|
|
4654
4731
|
return true;
|
|
4655
4732
|
}
|
|
4656
4733
|
return false;
|
|
@@ -4667,13 +4744,13 @@ SelectTestComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", vers
|
|
|
4667
4744
|
SelectTestComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: SelectTestComponent, selector: "wac-select-test", inputs: { required: "required", keepPanelOpen: "keepPanelOpen", openPanel: "openPanel", enableSearch: "enableSearch" }, outputs: { openPanelChange: "openPanelChange" }, host: { properties: { "attr.role": "this.role" } }, providers: [
|
|
4668
4745
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
|
|
4669
4746
|
ValueChangeService
|
|
4670
|
-
], queries: [{ propertyName: "customSearchTrigger", first: true, predicate: SelectSearchTriggerComponent, descendants: true }, { propertyName: "label", first: true, predicate: LabelComponent, descendants: true }], usesInheritance: true, ngImport: i0, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n\n<div\n class=\"wac-select-test\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select-test__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div class=\"wac-select-test__header\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && onTogglePanel()\" tabindex=\"0\">\n\n <ng-container [ngTemplateOutlet]=\"openPanel ? openPanelTrigger : closePanelTrigger\" >\n\n <ng-template #closePanelTrigger>\n <ng-container [ngTemplateOutlet]=\"defaultTrigger\"></ng-container>\n </ng-template>\n\n <ng-template #openPanelTrigger>\n <ng-content *ngIf=\"!!customSearchTrigger; else defaultTrigger\" select=\"wac-select-search-trigger\" ></ng-content>\n </ng-template>\n\n <ng-template #defaultTrigger>\n <ng-content *ngIf=\"!selectedOptionContent\" select=\"wac-placeholder,[role=placeholder]\"></ng-content>\n <div\n class=\"wac-select-test__header__selection wac-option__placeholder\"\n *ngIf=\"!!selectedOptionContent\"\n [innerHtml]=\"selectedOptionContent\">\n </div>\n </ng-template>\n\n </ng-container>\n\n <span class=\"wac-select-test__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select-test__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openPanel, open: openPanel }\">\n\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <ng-content\n select=\"wac-option-call-to-action, wac-option, option, .option, [selectOption]\">\n </ng-content>\n </perfect-scrollbar>\n\n <div *ngIf=\"!optionChildren?.length\" class=\"wac-select-test__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "directive", type: ZindexToggleDirective, selector: "[zIndexToggle]", inputs: ["zIndexToggle"], outputs: ["onEventChange"] }, { kind: "component", type: i4$1.PerfectScrollbarComponent, selector: "perfect-scrollbar", inputs: ["disabled", "usePSClass", "autoPropagation", "scrollIndicators", "config"], outputs: ["psScrollY", "psScrollX", "psScrollUp", "psScrollDown", "psScrollLeft", "psScrollRight", "psYReachEnd", "psYReachStart", "psXReachEnd", "psXReachStart"], exportAs: ["ngxPerfectScrollbar"] }, { kind: "pipe", type: i1$3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4747
|
+
], queries: [{ propertyName: "customSearchTrigger", first: true, predicate: SelectSearchTriggerComponent, descendants: true }, { propertyName: "label", first: true, predicate: LabelComponent, descendants: true }], viewQueries: [{ propertyName: "selectHeader", first: true, predicate: ["selectHeader"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n\n<div\n class=\"wac-select-test\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select-test__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div #selectHeader class=\"wac-select-test__header\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && onTogglePanel()\" tabindex=\"0\">\n\n <ng-container [ngTemplateOutlet]=\"openPanel ? openPanelTrigger : closePanelTrigger\" >\n\n <ng-template #closePanelTrigger>\n <ng-container [ngTemplateOutlet]=\"defaultTrigger\"></ng-container>\n </ng-template>\n\n <ng-template #openPanelTrigger>\n <ng-content *ngIf=\"!!customSearchTrigger; else defaultTrigger\" select=\"wac-select-search-trigger\" ></ng-content>\n </ng-template>\n\n <ng-template #defaultTrigger>\n <ng-content *ngIf=\"!selectedOptionContent\" select=\"wac-placeholder,[role=placeholder]\"></ng-content>\n <div\n class=\"wac-select-test__header__selection wac-option__placeholder\"\n *ngIf=\"!!selectedOptionContent\"\n [innerHtml]=\"selectedOptionContent\">\n </div>\n </ng-template>\n\n </ng-container>\n\n <span class=\"wac-select-test__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select-test__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openPanel, open: openPanel }\">\n\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <ng-content\n select=\"wac-option-call-to-action, wac-option, option, .option, [selectOption]\">\n </ng-content>\n </perfect-scrollbar>\n\n <div *ngIf=\"!optionChildren?.length\" class=\"wac-select-test__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "directive", type: AutoHideDirective, selector: "[wzAutoHide]", inputs: ["triggerElement", "forceOn"], outputs: ["clickOutside"] }, { kind: "directive", type: ZindexToggleDirective, selector: "[zIndexToggle]", inputs: ["zIndexToggle"], outputs: ["onEventChange"] }, { kind: "component", type: i4$1.PerfectScrollbarComponent, selector: "perfect-scrollbar", inputs: ["disabled", "usePSClass", "autoPropagation", "scrollIndicators", "config"], outputs: ["psScrollY", "psScrollX", "psScrollUp", "psScrollDown", "psScrollLeft", "psScrollRight", "psYReachEnd", "psYReachStart", "psXReachEnd", "psXReachStart"], exportAs: ["ngxPerfectScrollbar"] }, { kind: "pipe", type: i1$3.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4671
4748
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectTestComponent, decorators: [{
|
|
4672
4749
|
type: Component,
|
|
4673
4750
|
args: [{ selector: 'wac-select-test', providers: [
|
|
4674
4751
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
|
|
4675
4752
|
ValueChangeService
|
|
4676
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n\n<div\n class=\"wac-select-test\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select-test__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div class=\"wac-select-test__header\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && onTogglePanel()\" tabindex=\"0\">\n\n <ng-container [ngTemplateOutlet]=\"openPanel ? openPanelTrigger : closePanelTrigger\" >\n\n <ng-template #closePanelTrigger>\n <ng-container [ngTemplateOutlet]=\"defaultTrigger\"></ng-container>\n </ng-template>\n\n <ng-template #openPanelTrigger>\n <ng-content *ngIf=\"!!customSearchTrigger; else defaultTrigger\" select=\"wac-select-search-trigger\" ></ng-content>\n </ng-template>\n\n <ng-template #defaultTrigger>\n <ng-content *ngIf=\"!selectedOptionContent\" select=\"wac-placeholder,[role=placeholder]\"></ng-content>\n <div\n class=\"wac-select-test__header__selection wac-option__placeholder\"\n *ngIf=\"!!selectedOptionContent\"\n [innerHtml]=\"selectedOptionContent\">\n </div>\n </ng-template>\n\n </ng-container>\n\n <span class=\"wac-select-test__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select-test__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openPanel, open: openPanel }\">\n\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <ng-content\n select=\"wac-option-call-to-action, wac-option, option, .option, [selectOption]\">\n </ng-content>\n </perfect-scrollbar>\n\n <div *ngIf=\"!optionChildren?.length\" class=\"wac-select-test__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>" }]
|
|
4753
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<p *ngIf=\"!!label\" class=\"wac-select-test__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n\n<div\n class=\"wac-select-test\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select-test__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div #selectHeader class=\"wac-select-test__header\" [ngClass]=\"{ 'select-disabled' : disabled }\" (click)=\"!disabled && onTogglePanel()\" tabindex=\"0\">\n\n <ng-container [ngTemplateOutlet]=\"openPanel ? openPanelTrigger : closePanelTrigger\" >\n\n <ng-template #closePanelTrigger>\n <ng-container [ngTemplateOutlet]=\"defaultTrigger\"></ng-container>\n </ng-template>\n\n <ng-template #openPanelTrigger>\n <ng-content *ngIf=\"!!customSearchTrigger; else defaultTrigger\" select=\"wac-select-search-trigger\" ></ng-content>\n </ng-template>\n\n <ng-template #defaultTrigger>\n <ng-content *ngIf=\"!selectedOptionContent\" select=\"wac-placeholder,[role=placeholder]\"></ng-content>\n <div\n class=\"wac-select-test__header__selection wac-option__placeholder\"\n *ngIf=\"!!selectedOptionContent\"\n [innerHtml]=\"selectedOptionContent\">\n </div>\n </ng-template>\n\n </ng-container>\n\n <span class=\"wac-select-test__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select-test__content\" *ngIf=\"!disabled\" [ngClass]=\"{ hidden: !openPanel, open: openPanel }\">\n\n <perfect-scrollbar [config]=\"{ suppressScrollX: true }\">\n <ng-content\n select=\"wac-option-call-to-action, wac-option, option, .option, [selectOption]\">\n </ng-content>\n </perfect-scrollbar>\n\n <div *ngIf=\"!optionChildren?.length\" class=\"wac-select-test__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>" }]
|
|
4677
4754
|
}], ctorParameters: function () { return [{ type: ValueChangeService }]; }, propDecorators: { role: [{
|
|
4678
4755
|
type: HostBinding,
|
|
4679
4756
|
args: ['attr.role']
|
|
@@ -4683,6 +4760,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
4683
4760
|
}], label: [{
|
|
4684
4761
|
type: ContentChild,
|
|
4685
4762
|
args: [LabelComponent]
|
|
4763
|
+
}], selectHeader: [{
|
|
4764
|
+
type: ViewChild,
|
|
4765
|
+
args: ['selectHeader']
|
|
4686
4766
|
}], required: [{
|
|
4687
4767
|
type: Input
|
|
4688
4768
|
}], keepPanelOpen: [{
|