@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];
|
|
@@ -1766,23 +1784,68 @@ class CalendarComponent {
|
|
|
1766
1784
|
displayMode: 'inline',
|
|
1767
1785
|
showHeader: false,
|
|
1768
1786
|
showFooter: true,
|
|
1769
|
-
showButton: true
|
|
1770
1787
|
};
|
|
1771
1788
|
this.position = 'bottom';
|
|
1772
|
-
this.
|
|
1773
|
-
this.
|
|
1789
|
+
this._dateSelected = new Date(); // todo only change it when setted to a new value, add dateSelectedChange
|
|
1790
|
+
this.dateSelectedChange = new EventEmitter();
|
|
1791
|
+
this.typeDate = 'datetime-local'; // todo check why it is broken
|
|
1774
1792
|
this.noMargin = false;
|
|
1793
|
+
this.disabled = false;
|
|
1775
1794
|
this.selected = new EventEmitter();
|
|
1776
1795
|
this.changeData = new EventEmitter();
|
|
1777
1796
|
this.open = false;
|
|
1778
1797
|
this.startLabel = '';
|
|
1779
1798
|
this.endLabel = '';
|
|
1799
|
+
// ControlValueAccessor methods
|
|
1800
|
+
this.onChange = () => { };
|
|
1801
|
+
this.onTouch = () => { };
|
|
1780
1802
|
}
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1803
|
+
set dateSelected(dateSelected) {
|
|
1804
|
+
if (this.disabled) {
|
|
1805
|
+
return;
|
|
1806
|
+
}
|
|
1807
|
+
this._dateSelected = dateSelected;
|
|
1808
|
+
this.setCalendarDate();
|
|
1809
|
+
}
|
|
1810
|
+
get dateSelected() {
|
|
1811
|
+
return this._dateSelected;
|
|
1812
|
+
}
|
|
1813
|
+
ngOnInit() {
|
|
1814
|
+
this.setCalendarLabel();
|
|
1815
|
+
this.setCalendarDate();
|
|
1816
|
+
}
|
|
1817
|
+
ngOnChanges(changes) {
|
|
1818
|
+
if (changes.label || changes.type) {
|
|
1819
|
+
this.setCalendarLabel();
|
|
1820
|
+
}
|
|
1821
|
+
if (changes.typeDate) {
|
|
1822
|
+
this.typeDateChange();
|
|
1823
|
+
}
|
|
1824
|
+
}
|
|
1825
|
+
writeValue(date) {
|
|
1826
|
+
this.dateSelected = date;
|
|
1827
|
+
}
|
|
1828
|
+
registerOnChange(fn) {
|
|
1829
|
+
this.onChange = fn;
|
|
1830
|
+
}
|
|
1831
|
+
registerOnTouched(fn) {
|
|
1832
|
+
this.onTouch = fn;
|
|
1833
|
+
}
|
|
1834
|
+
setDisabledState(isDisabled) {
|
|
1835
|
+
this.disabled = isDisabled;
|
|
1836
|
+
}
|
|
1837
|
+
onChangeDate(selectedDates) {
|
|
1838
|
+
if (this.disabled) {
|
|
1839
|
+
return;
|
|
1840
|
+
}
|
|
1841
|
+
this.currentDate = new Date(new Date(selectedDates.startDate).setHours(0, 0, 0, 0));
|
|
1842
|
+
this.setDateSelected();
|
|
1843
|
+
}
|
|
1844
|
+
setDateSelected() {
|
|
1845
|
+
const dateData = this.getDateData();
|
|
1846
|
+
this.dateSelected = typeof this.dateSelected === 'string' ? dateData.toString() : dateData;
|
|
1847
|
+
this.onChange(this.dateSelected);
|
|
1848
|
+
this.dateSelectedChange.emit(this.dateSelected);
|
|
1786
1849
|
this.triggerChange({
|
|
1787
1850
|
startDate: this.dateSelected,
|
|
1788
1851
|
endDate: this.dateSelected
|
|
@@ -1800,8 +1863,28 @@ class CalendarComponent {
|
|
|
1800
1863
|
else {
|
|
1801
1864
|
this.open = !this.open;
|
|
1802
1865
|
}
|
|
1866
|
+
this.onTouch();
|
|
1803
1867
|
}
|
|
1804
|
-
|
|
1868
|
+
setCalendarDate() {
|
|
1869
|
+
let selectedDate = this.dateSelected;
|
|
1870
|
+
if (typeof selectedDate === 'string') {
|
|
1871
|
+
selectedDate = new Date(selectedDate);
|
|
1872
|
+
}
|
|
1873
|
+
this.currentHours = selectedDate.getHours() < 10 ? '0' + selectedDate.getHours() : selectedDate.getHours();
|
|
1874
|
+
this.currentMinutes = selectedDate.getMinutes() < 10 ? '0' + selectedDate.getMinutes() : selectedDate.getMinutes();
|
|
1875
|
+
this.currentDate = new Date(selectedDate.setHours(0, 0, 0, 0));
|
|
1876
|
+
if (this.typeDate === 'date') {
|
|
1877
|
+
this.currentHours = '00';
|
|
1878
|
+
this.currentMinutes = '00';
|
|
1879
|
+
}
|
|
1880
|
+
}
|
|
1881
|
+
typeDateChange() {
|
|
1882
|
+
if (this.typeDate === 'date') {
|
|
1883
|
+
this.currentHours = '00';
|
|
1884
|
+
this.currentMinutes = '00';
|
|
1885
|
+
}
|
|
1886
|
+
}
|
|
1887
|
+
setCalendarLabel() {
|
|
1805
1888
|
if (this.type === 'edit' && this.label) {
|
|
1806
1889
|
const splitLabel = this.label.split('{x}');
|
|
1807
1890
|
if (splitLabel.length > 1) {
|
|
@@ -1812,17 +1895,6 @@ class CalendarComponent {
|
|
|
1812
1895
|
this.startLabel = this.label;
|
|
1813
1896
|
}
|
|
1814
1897
|
}
|
|
1815
|
-
this.currentHours =
|
|
1816
|
-
new Date(this.dateSelected).getHours() < 10 ? '0' + new Date(this.dateSelected).getHours() : new Date(this.dateSelected).getHours();
|
|
1817
|
-
this.currentMinutes =
|
|
1818
|
-
new Date(this.dateSelected).getMinutes() < 10
|
|
1819
|
-
? '0' + new Date(this.dateSelected).getMinutes()
|
|
1820
|
-
: new Date(this.dateSelected).getMinutes();
|
|
1821
|
-
this.currentDate = new Date(this.dateSelected).setHours(0, 0, 0, 0);
|
|
1822
|
-
if (this.typeDate === 'date') {
|
|
1823
|
-
this.currentHours = '00';
|
|
1824
|
-
this.currentMinutes = '00';
|
|
1825
|
-
}
|
|
1826
1898
|
}
|
|
1827
1899
|
verifKeyup(events) {
|
|
1828
1900
|
events.target.value = events.target.value.replace(/\D+/g, '');
|
|
@@ -1830,26 +1902,12 @@ class CalendarComponent {
|
|
|
1830
1902
|
verifHours(events) {
|
|
1831
1903
|
const value = parseInt(events.target.value, 0);
|
|
1832
1904
|
events.target.value = this.currentHours = value < 24 ? (value < 10 ? '0' + value : value) : 23;
|
|
1833
|
-
|
|
1834
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1835
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1836
|
-
this.dateSelected = dateData;
|
|
1837
|
-
this.triggerChange({
|
|
1838
|
-
startDate: dateData,
|
|
1839
|
-
endDate: dateData
|
|
1840
|
-
});
|
|
1905
|
+
this.setDateSelected();
|
|
1841
1906
|
}
|
|
1842
1907
|
verifMinutes(events) {
|
|
1843
1908
|
const value = parseInt(events.target.value, 0);
|
|
1844
1909
|
events.target.value = this.currentMinutes = value < 60 ? (value < 10 ? '0' + value : value) : 59;
|
|
1845
|
-
|
|
1846
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1847
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1848
|
-
this.dateSelected = dateData;
|
|
1849
|
-
this.triggerChange({
|
|
1850
|
-
startDate: dateData,
|
|
1851
|
-
endDate: dateData
|
|
1852
|
-
});
|
|
1910
|
+
this.setDateSelected();
|
|
1853
1911
|
}
|
|
1854
1912
|
addHours(target) {
|
|
1855
1913
|
target.value = this.currentHours =
|
|
@@ -1860,14 +1918,7 @@ class CalendarComponent {
|
|
|
1860
1918
|
: parseInt(target.value, 0) < 10
|
|
1861
1919
|
? '0' + parseInt(target.value, 0)
|
|
1862
1920
|
: parseInt(target.value, 0);
|
|
1863
|
-
|
|
1864
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1865
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1866
|
-
this.dateSelected = dateData;
|
|
1867
|
-
this.triggerChange({
|
|
1868
|
-
startDate: dateData,
|
|
1869
|
-
endDate: dateData
|
|
1870
|
-
});
|
|
1921
|
+
this.setDateSelected();
|
|
1871
1922
|
}
|
|
1872
1923
|
removeHours(target) {
|
|
1873
1924
|
target.value = this.currentHours =
|
|
@@ -1878,14 +1929,7 @@ class CalendarComponent {
|
|
|
1878
1929
|
: parseInt(target.value, 0) < 10
|
|
1879
1930
|
? '0' + parseInt(target.value, 0)
|
|
1880
1931
|
: parseInt(target.value, 0);
|
|
1881
|
-
|
|
1882
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1883
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1884
|
-
this.dateSelected = dateData;
|
|
1885
|
-
this.triggerChange({
|
|
1886
|
-
startDate: dateData,
|
|
1887
|
-
endDate: dateData
|
|
1888
|
-
});
|
|
1932
|
+
this.setDateSelected();
|
|
1889
1933
|
}
|
|
1890
1934
|
addMinutes(target) {
|
|
1891
1935
|
target.value = this.currentMinutes =
|
|
@@ -1896,14 +1940,7 @@ class CalendarComponent {
|
|
|
1896
1940
|
: parseInt(target.value, 0) < 10
|
|
1897
1941
|
? '0' + parseInt(target.value, 0)
|
|
1898
1942
|
: parseInt(target.value, 0);
|
|
1899
|
-
|
|
1900
|
-
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1901
|
-
parseInt(this.currentMinutes, 0) * 60000);
|
|
1902
|
-
this.dateSelected = dateData;
|
|
1903
|
-
this.triggerChange({
|
|
1904
|
-
startDate: dateData,
|
|
1905
|
-
endDate: dateData
|
|
1906
|
-
});
|
|
1943
|
+
this.setDateSelected();
|
|
1907
1944
|
}
|
|
1908
1945
|
removeMinutes(target) {
|
|
1909
1946
|
target.value = this.currentMinutes =
|
|
@@ -1914,21 +1951,31 @@ class CalendarComponent {
|
|
|
1914
1951
|
: parseInt(target.value, 0) < 10
|
|
1915
1952
|
? '0' + parseInt(target.value, 0)
|
|
1916
1953
|
: parseInt(target.value, 0);
|
|
1917
|
-
|
|
1954
|
+
this.setDateSelected();
|
|
1955
|
+
}
|
|
1956
|
+
getDateData() {
|
|
1957
|
+
return new Date(new Date(new Date(this.currentDate).setHours(0, 0, 0, 0)).getTime() +
|
|
1918
1958
|
parseInt(this.currentHours, 0) * 60 * 60 * 1000 +
|
|
1919
1959
|
parseInt(this.currentMinutes, 0) * 60000);
|
|
1920
|
-
this.dateSelected = dateData;
|
|
1921
|
-
this.triggerChange({
|
|
1922
|
-
startDate: dateData,
|
|
1923
|
-
endDate: dateData
|
|
1924
|
-
});
|
|
1925
1960
|
}
|
|
1926
1961
|
}
|
|
1927
1962
|
CalendarComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalendarComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1928
|
-
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"
|
|
1963
|
+
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: [
|
|
1964
|
+
{
|
|
1965
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1966
|
+
useExisting: CalendarComponent,
|
|
1967
|
+
multi: true
|
|
1968
|
+
}
|
|
1969
|
+
], 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" }] });
|
|
1929
1970
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: CalendarComponent, decorators: [{
|
|
1930
1971
|
type: Component,
|
|
1931
|
-
args: [{ selector: 'wac-calendar',
|
|
1972
|
+
args: [{ selector: 'wac-calendar', providers: [
|
|
1973
|
+
{
|
|
1974
|
+
provide: NG_VALUE_ACCESSOR,
|
|
1975
|
+
useExisting: CalendarComponent,
|
|
1976
|
+
multi: true
|
|
1977
|
+
}
|
|
1978
|
+
], 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" }]
|
|
1932
1979
|
}], ctorParameters: function () { return []; }, propDecorators: { label: [{
|
|
1933
1980
|
type: Input
|
|
1934
1981
|
}], type: [{
|
|
@@ -1939,10 +1986,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
1939
1986
|
type: Input
|
|
1940
1987
|
}], dateSelected: [{
|
|
1941
1988
|
type: Input
|
|
1989
|
+
}], dateSelectedChange: [{
|
|
1990
|
+
type: Output
|
|
1942
1991
|
}], typeDate: [{
|
|
1943
1992
|
type: Input
|
|
1944
1993
|
}], noMargin: [{
|
|
1945
1994
|
type: Input
|
|
1995
|
+
}], disabled: [{
|
|
1996
|
+
type: Input
|
|
1946
1997
|
}], selected: [{
|
|
1947
1998
|
type: Output
|
|
1948
1999
|
}], changeData: [{
|
|
@@ -4566,6 +4617,7 @@ class SelectTestComponent extends SelectDirective {
|
|
|
4566
4617
|
this._openPanel = false;
|
|
4567
4618
|
this.openPanelChange = new EventEmitter();
|
|
4568
4619
|
this.enableSearch = false;
|
|
4620
|
+
this.tabIndex = -1;
|
|
4569
4621
|
this.isDestroyed$ = new Subject();
|
|
4570
4622
|
this.isKeyBoardAction = false;
|
|
4571
4623
|
this.skipIfTriggeredByKeyboardAction = () => {
|
|
@@ -4628,16 +4680,37 @@ class SelectTestComponent extends SelectDirective {
|
|
|
4628
4680
|
this.openPanelChange.emit(this.openPanel);
|
|
4629
4681
|
}
|
|
4630
4682
|
onKeydown(event) {
|
|
4683
|
+
const keyCode = event.keyCode;
|
|
4684
|
+
if (event.keyCode === TAB) {
|
|
4685
|
+
// go to the next element with tabindex
|
|
4686
|
+
if (this.openPanel) {
|
|
4687
|
+
this.openPanel = false;
|
|
4688
|
+
}
|
|
4689
|
+
return;
|
|
4690
|
+
}
|
|
4631
4691
|
if (this.disabled) {
|
|
4632
4692
|
return;
|
|
4633
4693
|
}
|
|
4634
|
-
event.preventDefault(); // prevents the page from scrolling
|
|
4635
4694
|
const actionTriggered = this.openPanel ? this._handleOpenKeydown(event) : this._handleClosedKeydown(event);
|
|
4636
4695
|
if (actionTriggered) {
|
|
4637
4696
|
return;
|
|
4638
4697
|
}
|
|
4639
4698
|
this.isKeyBoardAction = true;
|
|
4640
|
-
super.
|
|
4699
|
+
super.onKeydown(event);
|
|
4700
|
+
}
|
|
4701
|
+
handleKeyboardActionWithSearch(event) {
|
|
4702
|
+
const keyCode = event.keyCode;
|
|
4703
|
+
if (keyCode === DOWN_ARROW) {
|
|
4704
|
+
this.isKeyBoardAction = true;
|
|
4705
|
+
this.valueChangeService.selectNextOption();
|
|
4706
|
+
return true;
|
|
4707
|
+
}
|
|
4708
|
+
if (keyCode === UP_ARROW) {
|
|
4709
|
+
this.isKeyBoardAction = true;
|
|
4710
|
+
this.valueChangeService.selectPreviousOption();
|
|
4711
|
+
return true;
|
|
4712
|
+
}
|
|
4713
|
+
return false;
|
|
4641
4714
|
}
|
|
4642
4715
|
/** Handles keyboard events while the select is closed. */
|
|
4643
4716
|
_handleClosedKeydown(event) {
|
|
@@ -4662,10 +4735,14 @@ class SelectTestComponent extends SelectDirective {
|
|
|
4662
4735
|
keyCode === UP_ARROW ||
|
|
4663
4736
|
keyCode === LEFT_ARROW ||
|
|
4664
4737
|
keyCode === RIGHT_ARROW;
|
|
4665
|
-
const isEscapeKey = keyCode === ESCAPE || keyCode === ENTER || keyCode === SPACE;
|
|
4738
|
+
const isEscapeKey = keyCode === ESCAPE || keyCode === ENTER || keyCode === SPACE || keyCode === TAB;
|
|
4666
4739
|
if ((isArrowKey && event.altKey) || isEscapeKey) {
|
|
4667
4740
|
// Close the select on ALT + arrow key to match the native <select>
|
|
4668
4741
|
this.openPanel = false;
|
|
4742
|
+
if (this.customSearchTrigger && keyCode !== TAB) {
|
|
4743
|
+
// 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.
|
|
4744
|
+
this.selectHeader.nativeElement.focus();
|
|
4745
|
+
}
|
|
4669
4746
|
return true;
|
|
4670
4747
|
}
|
|
4671
4748
|
return false;
|
|
@@ -4682,13 +4759,13 @@ SelectTestComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", vers
|
|
|
4682
4759
|
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: [
|
|
4683
4760
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
|
|
4684
4761
|
ValueChangeService
|
|
4685
|
-
], 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 });
|
|
4762
|
+
], 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 });
|
|
4686
4763
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectTestComponent, decorators: [{
|
|
4687
4764
|
type: Component,
|
|
4688
4765
|
args: [{ selector: 'wac-select-test', providers: [
|
|
4689
4766
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectTestComponent, multi: true },
|
|
4690
4767
|
ValueChangeService
|
|
4691
|
-
], 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>" }]
|
|
4768
|
+
], 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>" }]
|
|
4692
4769
|
}], ctorParameters: function () { return [{ type: ValueChangeService }]; }, propDecorators: { role: [{
|
|
4693
4770
|
type: HostBinding,
|
|
4694
4771
|
args: ['attr.role']
|
|
@@ -4698,6 +4775,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
4698
4775
|
}], label: [{
|
|
4699
4776
|
type: ContentChild,
|
|
4700
4777
|
args: [LabelComponent]
|
|
4778
|
+
}], selectHeader: [{
|
|
4779
|
+
type: ViewChild,
|
|
4780
|
+
args: ['selectHeader']
|
|
4701
4781
|
}], required: [{
|
|
4702
4782
|
type: Input
|
|
4703
4783
|
}], keepPanelOpen: [{
|