@wizishop/angular-components 14.4.61 → 14.4.63
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/selects/option/option-selection-handler.interface.mjs +1 -1
- package/esm2020/lib/components/selects/option/option.component.mjs +5 -3
- package/esm2020/lib/components/selects/option/select-option.directive.mjs +6 -1
- package/esm2020/lib/components/selects/option-call-to-action/option-call-to-action.component.mjs +1 -1
- package/esm2020/lib/components/selects/select/select.component.mjs +3 -3
- package/esm2020/lib/components/selects/select/select.directive.mjs +12 -2
- package/esm2020/lib/components/selects/select/value-change.service.mjs +52 -11
- package/esm2020/lib/services/history.service.mjs +1 -4
- package/esm2020/lib/utils/array.mjs +2 -0
- package/fesm2015/wizishop-angular-components.mjs +74 -18
- package/fesm2015/wizishop-angular-components.mjs.map +1 -1
- package/fesm2020/wizishop-angular-components.mjs +73 -18
- package/fesm2020/wizishop-angular-components.mjs.map +1 -1
- package/lib/components/selects/option/option-selection-handler.interface.d.ts +1 -0
- package/lib/components/selects/option/option.component.d.ts +1 -0
- package/lib/components/selects/option/select-option.directive.d.ts +2 -0
- package/lib/components/selects/select/select.directive.d.ts +8 -5
- package/lib/components/selects/select/value-change.service.d.ts +15 -5
- package/lib/utils/array.d.ts +1 -0
- package/package.json +1 -1
- package/wizishop-angular-components-14.4.63.tgz +0 -0
- package/wizishop-angular-components-14.4.61.tgz +0 -0
|
@@ -14,16 +14,13 @@ export class HistoryService {
|
|
|
14
14
|
return;
|
|
15
15
|
}
|
|
16
16
|
this.history.push(event.url.split('?')[0]);
|
|
17
|
-
console.log('history', this.history);
|
|
18
17
|
}
|
|
19
18
|
});
|
|
20
19
|
}
|
|
21
20
|
back(link) {
|
|
22
|
-
console.log('back', this.history);
|
|
23
21
|
this.history.pop();
|
|
24
22
|
if (this.history.length > 0) {
|
|
25
23
|
const lastlink = this.history[this.history.length - 1];
|
|
26
|
-
console.log('lastlink', lastlink);
|
|
27
24
|
this.router.navigate(lastlink.split('/'));
|
|
28
25
|
}
|
|
29
26
|
else {
|
|
@@ -53,4 +50,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
53
50
|
providedIn: 'root'
|
|
54
51
|
}]
|
|
55
52
|
}], ctorParameters: function () { return [{ type: i1.Router }]; } });
|
|
56
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
53
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaGlzdG9yeS5zZXJ2aWNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvYW5ndWxhci1jb21wb25lbnRzL3NyYy9saWIvc2VydmljZXMvaGlzdG9yeS5zZXJ2aWNlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxVQUFVLEVBQUUsTUFBTSxlQUFlLENBQUM7QUFDM0MsT0FBTyxFQUFFLGVBQWUsRUFBVSxNQUFNLGlCQUFpQixDQUFDOzs7QUFLMUQsTUFBTSxPQUFPLGNBQWM7SUFHekIsWUFBb0IsTUFBYztRQUFkLFdBQU0sR0FBTixNQUFNLENBQVE7UUFGMUIsWUFBTyxHQUFhLEVBQUUsQ0FBQztJQUVNLENBQUM7SUFFdEMsZUFBZTtRQUNiLElBQUksQ0FBQyxNQUFNLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FBQyxDQUFDLEtBQUssRUFBRSxFQUFFO1lBQ3JDLElBQUksS0FBSyxZQUFZLGVBQWUsRUFBRTtnQkFDcEMsSUFBSSxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sR0FBRyxDQUFDLElBQUksSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLE1BQU0sR0FBRyxDQUFDLENBQUMsS0FBSyxLQUFLLENBQUMsR0FBRyxDQU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5zcGxpdCgnPycpWzBdKVxuICAgICAgfVxuICAgIH0pXG4gIH1cblxuICBiYWNrKGxpbms6IHN0cmluZ1tdKSB7XG4gICAgdGhpcy5oaXN0b3J5LnBvcCgpO1xuICAgIGlmICh0aGlzLmhpc3RvcnkubGVuZ3RoID4gMCkge1xuICAgICAgY29uc3QgbGFzdGxpbmsgPSB0aGlzLmhpc3RvcnlbdGhpcy5oaXN0b3J5Lmxlbmd0aCAtIDFdO1xuICAgICAgdGhpcy5yb3V0ZXIubmF2aWdhdGUobGFzdGxpbmsuc3BsaXQoJy8nKSk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMucmVkaXJlY3QobGluayk7XG4gICAgfVxuICB9XG5cbiAgcmVkaXJlY3QobGluazogc3RyaW5nW10pIHtcbiAgICBpZiAobGlua1swXS5pbmRleE9mKCdodHRwJykgIT09IC0xKSB7XG4gICAgICB0aGlzLnJlZGlyZWN0VG9FeHRlcm5hbExpbmsobGluayk7XG4gICAgfSBlbHNlIHtcbiAgICAgIHRoaXMucmVkaXJlY3RUb0ludGVybmFsTGluayhsaW5rKTtcbiAgICB9XG4gIH1cblxuICByZWRpcmVjdFRvRXh0ZXJuYWxMaW5rKGxpbms6IHN0cmluZ1tdKSB7XG4gICAgd2luZG93LmxvY2F0aW9uLmhyZWYgPSBsaW5rWzBdO1xuICB9XG5cbiAgcmVkaXJlY3RUb0ludGVybmFsTGluayhsaW5rOiBzdHJpbmdbXSkge1xuICAgIHRoaXMucm91dGVyLm5hdmlnYXRlKGxpbmspO1xuICB9XG59XG4iXX0=
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export const compareArrays = (a, b) => a.length === b.length && a.every((element, index) => element === b[index]);
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXJyYXkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy9hbmd1bGFyLWNvbXBvbmVudHMvc3JjL2xpYi91dGlscy9hcnJheS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsTUFBTSxhQUFhLEdBQUcsQ0FBUSxDQUFVLEVBQUUsQ0FBVSxFQUFFLEVBQUUsQ0FDN0QsQ0FBQyxDQUFDLE1BQU0sS0FBSyxDQUFDLENBQUMsTUFBTSxJQUFJLENBQUMsQ0FBQyxLQUFLLENBQUMsQ0FBQyxPQUFPLEVBQUUsS0FBSyxFQUFFLEVBQUUsQ0FBQyxPQUFPLEtBQUssQ0FBQyxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgY29tcGFyZUFycmF5cyA9IDxUSXRlbT4oYTogVEl0ZW1bXSwgYjogVEl0ZW1bXSkgPT5cbiAgYS5sZW5ndGggPT09IGIubGVuZ3RoICYmIGEuZXZlcnkoKGVsZW1lbnQsIGluZGV4KSA9PiBlbGVtZW50ID09PSBiW2luZGV4XSk7XG4iXX0=
|
|
@@ -356,6 +356,7 @@ class SelectOptionDirective {
|
|
|
356
356
|
this.selected = false;
|
|
357
357
|
this.onClickEventPreventDefault = true;
|
|
358
358
|
this.selectedChange = new EventEmitter();
|
|
359
|
+
this.multiple = false;
|
|
359
360
|
}
|
|
360
361
|
onClick(event) {
|
|
361
362
|
this.onSelectOption();
|
|
@@ -401,6 +402,10 @@ class SelectOptionDirective {
|
|
|
401
402
|
this.disabledByParent = isDisabled;
|
|
402
403
|
this.changeDetectorRef.markForCheck();
|
|
403
404
|
}
|
|
405
|
+
setMultiple(multiple) {
|
|
406
|
+
this.multiple = multiple;
|
|
407
|
+
this.changeDetectorRef.markForCheck();
|
|
408
|
+
}
|
|
404
409
|
}
|
|
405
410
|
SelectOptionDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectOptionDirective, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Directive });
|
|
406
411
|
SelectOptionDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: SelectOptionDirective, selector: "[wacOption]", inputs: { disabled: "disabled", value: "value", selected: "selected", onClickEventPreventDefault: "onClickEventPreventDefault" }, outputs: { selectedChange: "selectedChange" }, host: { listeners: { "click": "onClick($event)" }, properties: { "class.wac-option-selected": "this.isOptionSelected", "class.wac-option-disabled": "this.isOptionDisabled", "style.cursor": "this.cursor" } }, providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: SelectOptionDirective }], exportAs: ["wacOption"], ngImport: i0 });
|
|
@@ -435,11 +440,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
435
440
|
type: Output
|
|
436
441
|
}] } });
|
|
437
442
|
|
|
443
|
+
const compareArrays = (a, b) => a.length === b.length && a.every((element, index) => element === b[index]);
|
|
444
|
+
|
|
438
445
|
class ValueChangeService {
|
|
439
446
|
constructor(changeDetectorRef) {
|
|
440
447
|
this.changeDetectorRef = changeDetectorRef;
|
|
441
448
|
this.valueChange$ = new Subject();
|
|
442
|
-
this.
|
|
449
|
+
this.multiple = false;
|
|
450
|
+
this.indexSelectedOption = null; // todo update to array
|
|
443
451
|
this.resetListeners$ = new Subject();
|
|
444
452
|
this.indexOfMatchedOption = (option, index, letter) => {
|
|
445
453
|
const textOption = option.getContentRef().nativeElement.textContent.trim().toLowerCase();
|
|
@@ -471,6 +479,7 @@ class ValueChangeService {
|
|
|
471
479
|
this.optionChildren = optionChildren;
|
|
472
480
|
this._value = value;
|
|
473
481
|
this.indexSelectedOption = null;
|
|
482
|
+
this.handleMultipleSelection();
|
|
474
483
|
this.handleInitialSelectedOption();
|
|
475
484
|
this.handleSelectedOptionsEvent();
|
|
476
485
|
}
|
|
@@ -489,6 +498,7 @@ class ValueChangeService {
|
|
|
489
498
|
(_a = this.optionChildren) === null || _a === void 0 ? void 0 : _a.forEach((option) => option.setDisabledState(isDisabled));
|
|
490
499
|
}
|
|
491
500
|
selectNextOption() {
|
|
501
|
+
// TODO : Handle multiple selection
|
|
492
502
|
if (this.indexSelectedOption + 1 >= this.optionChildren.length) {
|
|
493
503
|
return;
|
|
494
504
|
}
|
|
@@ -501,6 +511,7 @@ class ValueChangeService {
|
|
|
501
511
|
this.value = this.optionChildren.get(this.indexSelectedOption).value;
|
|
502
512
|
}
|
|
503
513
|
selectPreviousOption() {
|
|
514
|
+
// TODO : Handle multiple selection
|
|
504
515
|
if (!this.indexSelectedOption) {
|
|
505
516
|
this.indexSelectedOption = null;
|
|
506
517
|
this.assignValue(null);
|
|
@@ -510,6 +521,7 @@ class ValueChangeService {
|
|
|
510
521
|
this.value = this.optionChildren.get(this.indexSelectedOption).value;
|
|
511
522
|
}
|
|
512
523
|
searchOptionByFirstLetter(letter) {
|
|
524
|
+
// TODO : Handle multiple selectiong
|
|
513
525
|
const matchedOptionsIndex = this.optionChildren
|
|
514
526
|
.map((option, index) => this.indexOfMatchedOption(option, index, letter))
|
|
515
527
|
.filter(this.isNotNull);
|
|
@@ -523,11 +535,20 @@ class ValueChangeService {
|
|
|
523
535
|
this.indexSelectedOption = isNaN(validOptionIndex) ? matchedOptionsIndex[0] : validOptionIndex;
|
|
524
536
|
this.value = this.optionChildren.get(this.indexSelectedOption).value;
|
|
525
537
|
}
|
|
538
|
+
setMultiple(value) {
|
|
539
|
+
this.multiple = value;
|
|
540
|
+
}
|
|
541
|
+
handleMultipleSelection() {
|
|
542
|
+
if (this.multiple) {
|
|
543
|
+
setTimeout(() => {
|
|
544
|
+
this.optionChildren.forEach((option) => option.setMultiple(true));
|
|
545
|
+
}, 0);
|
|
546
|
+
}
|
|
547
|
+
}
|
|
526
548
|
handleInitialSelectedOption() {
|
|
527
549
|
setTimeout(() => {
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
this.value = selectedOption.value;
|
|
550
|
+
if (this.mustUpdateValueWithInitialSelectedOptionValues()) { // initial option value selected win against initial value or ngModel value
|
|
551
|
+
this.value = this.multiple ? this.getSelectedOptionsValues() : this.getSelectedOptionsValues()[0];
|
|
531
552
|
}
|
|
532
553
|
if (this.disabled) {
|
|
533
554
|
this.optionChildren.forEach((option) => option.setDisabledState(true));
|
|
@@ -535,9 +556,18 @@ class ValueChangeService {
|
|
|
535
556
|
this.handleValueChange();
|
|
536
557
|
}, 0);
|
|
537
558
|
}
|
|
559
|
+
mustUpdateValueWithInitialSelectedOptionValues() {
|
|
560
|
+
if (!this.getSelectedOptionComponents().length) {
|
|
561
|
+
return false;
|
|
562
|
+
}
|
|
563
|
+
if (this.multiple && Array.isArray(this.value)) {
|
|
564
|
+
return !compareArrays(this.value, this.getSelectedOptionsValues());
|
|
565
|
+
}
|
|
566
|
+
return this.value !== this.getSelectedOptionsValues()[0];
|
|
567
|
+
}
|
|
538
568
|
handleSelectedOptionsEvent() {
|
|
539
569
|
this.optionSelectedChangeListeners().subscribe((value) => {
|
|
540
|
-
this.value = value;
|
|
570
|
+
this.value = this.multiple ? this.getSelectedOptionsValues() : value;
|
|
541
571
|
});
|
|
542
572
|
}
|
|
543
573
|
updateSelectPlaceholder() {
|
|
@@ -545,11 +575,20 @@ class ValueChangeService {
|
|
|
545
575
|
this.selectedOptionContent = null;
|
|
546
576
|
return;
|
|
547
577
|
}
|
|
548
|
-
|
|
549
|
-
|
|
578
|
+
this.selectedOptionContent = this.getSelectedOptionsContent();
|
|
579
|
+
}
|
|
580
|
+
getSelectedOptionsContent() {
|
|
581
|
+
var _a;
|
|
582
|
+
if (this.multiple) {
|
|
583
|
+
return this.getSelectedOptionComponents().reduce((acc, option) => (acc ? acc + ', ' : '') + option.getContentRef().nativeElement.textContent.trim(), ''); // todo improve for multiple
|
|
584
|
+
}
|
|
585
|
+
return (_a = this.getSelectedOptionComponents()[0]) === null || _a === void 0 ? void 0 : _a.getContentRef().nativeElement.innerHTML;
|
|
586
|
+
}
|
|
587
|
+
getSelectedOptionComponents() {
|
|
588
|
+
return this.optionChildren.filter((option) => option.selected);
|
|
550
589
|
}
|
|
551
|
-
|
|
552
|
-
return this.
|
|
590
|
+
getSelectedOptionsValues() {
|
|
591
|
+
return this.getSelectedOptionComponents().map((option) => option.value);
|
|
553
592
|
}
|
|
554
593
|
optionSelectedChangeListeners() {
|
|
555
594
|
const selectedChange$ = this.optionChildren.map((option) => {
|
|
@@ -559,12 +598,21 @@ class ValueChangeService {
|
|
|
559
598
|
}
|
|
560
599
|
changeSelectedOption() {
|
|
561
600
|
this.optionChildren.forEach((optionComponent, index) => {
|
|
562
|
-
optionComponent.setSelected(optionComponent.value
|
|
601
|
+
optionComponent.setSelected(this.isSelectedValue(optionComponent.value));
|
|
563
602
|
if (optionComponent.selected) {
|
|
564
603
|
this.indexSelectedOption = index;
|
|
565
604
|
}
|
|
566
605
|
});
|
|
567
606
|
}
|
|
607
|
+
/**
|
|
608
|
+
* May not work with objects values
|
|
609
|
+
*/
|
|
610
|
+
isSelectedValue(value2) {
|
|
611
|
+
if (Array.isArray(this.value)) {
|
|
612
|
+
return this.value.includes(value2);
|
|
613
|
+
}
|
|
614
|
+
return this.value === value2;
|
|
615
|
+
}
|
|
568
616
|
ngOnDestroy() {
|
|
569
617
|
this.resetListeners$.next();
|
|
570
618
|
this.resetListeners$.complete();
|
|
@@ -580,6 +628,7 @@ class SelectDirective {
|
|
|
580
628
|
constructor(valueChangeService) {
|
|
581
629
|
this.valueChangeService = valueChangeService;
|
|
582
630
|
this.valueChange = new EventEmitter();
|
|
631
|
+
this._multiple = false;
|
|
583
632
|
this._disabled = false;
|
|
584
633
|
this.tabIndex = 0;
|
|
585
634
|
this.isDestroyed$ = new Subject();
|
|
@@ -613,6 +662,13 @@ class SelectDirective {
|
|
|
613
662
|
get value() {
|
|
614
663
|
return this._value;
|
|
615
664
|
}
|
|
665
|
+
get multiple() {
|
|
666
|
+
return this._multiple;
|
|
667
|
+
}
|
|
668
|
+
set multiple(value) {
|
|
669
|
+
this._multiple = value;
|
|
670
|
+
this.valueChangeService.setMultiple(value);
|
|
671
|
+
}
|
|
616
672
|
set disabled(disabled) {
|
|
617
673
|
this._disabled = disabled;
|
|
618
674
|
this.valueChangeService.setDisabledState(disabled);
|
|
@@ -686,7 +742,7 @@ class SelectDirective {
|
|
|
686
742
|
}
|
|
687
743
|
}
|
|
688
744
|
SelectDirective.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectDirective, deps: [{ token: ValueChangeService }], target: i0.ɵɵFactoryTarget.Directive });
|
|
689
|
-
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", "class.wac-select-disabled": "this.isSelectDisabled" } }, providers: [
|
|
745
|
+
SelectDirective.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "14.0.7", type: SelectDirective, selector: "[wacSelect]", inputs: { value: "value", multiple: "multiple", disabled: "disabled", tabIndex: "tabIndex" }, outputs: { valueChange: "valueChange" }, host: { listeners: { "keydown": "onKeydown($event)" }, properties: { "attr.tabindex": "this.tabindex", "class.wac-select-disabled": "this.isSelectDisabled" } }, providers: [
|
|
690
746
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectDirective, multi: true },
|
|
691
747
|
ValueChangeService
|
|
692
748
|
], queries: [{ propertyName: "optionChildren", predicate: OPTION_SELECTION_HANDLER, descendants: true }], exportAs: ["wacSelect"], ngImport: i0 });
|
|
@@ -716,6 +772,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImpor
|
|
|
716
772
|
type: Input
|
|
717
773
|
}], valueChange: [{
|
|
718
774
|
type: Output
|
|
775
|
+
}], multiple: [{
|
|
776
|
+
type: Input
|
|
719
777
|
}], disabled: [{
|
|
720
778
|
type: Input
|
|
721
779
|
}], tabIndex: [{
|
|
@@ -2589,16 +2647,13 @@ class HistoryService {
|
|
|
2589
2647
|
return;
|
|
2590
2648
|
}
|
|
2591
2649
|
this.history.push(event.url.split('?')[0]);
|
|
2592
|
-
console.log('history', this.history);
|
|
2593
2650
|
}
|
|
2594
2651
|
});
|
|
2595
2652
|
}
|
|
2596
2653
|
back(link) {
|
|
2597
|
-
console.log('back', this.history);
|
|
2598
2654
|
this.history.pop();
|
|
2599
2655
|
if (this.history.length > 0) {
|
|
2600
2656
|
const lastlink = this.history[this.history.length - 1];
|
|
2601
|
-
console.log('lastlink', lastlink);
|
|
2602
2657
|
this.router.navigate(lastlink.split('/'));
|
|
2603
2658
|
}
|
|
2604
2659
|
else {
|
|
@@ -4714,16 +4769,17 @@ class OptionComponent extends SelectOptionDirective {
|
|
|
4714
4769
|
super(contentRef, changeDetectorRef);
|
|
4715
4770
|
this.contentRef = contentRef;
|
|
4716
4771
|
this.changeDetectorRef = changeDetectorRef;
|
|
4772
|
+
this.checkBoxId = `wac-option-${crypto.randomUUID()}`;
|
|
4717
4773
|
}
|
|
4718
4774
|
getContentRef() {
|
|
4719
4775
|
return this.contentOption;
|
|
4720
4776
|
}
|
|
4721
4777
|
}
|
|
4722
4778
|
OptionComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionComponent, deps: [{ token: i0.ElementRef }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
4723
|
-
OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: OptionComponent, selector: "wac-option", providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: OptionComponent }], viewQueries: [{ propertyName: "contentOption", first: true, predicate: ["contentWrapper"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n [ngClass]=\"{ 'disabled': disabled }\"\n class=\"wac-option\"\n
|
|
4779
|
+
OptionComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: OptionComponent, selector: "wac-option", providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: OptionComponent }], viewQueries: [{ propertyName: "contentOption", first: true, predicate: ["contentWrapper"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div\n [ngClass]=\"{ 'disabled': disabled }\"\n class=\"wac-option\"\n >\n <div [ngClass]=\"{ 'selected': !disabled && selected, 'disabled': disabled }\" #contentWrapper>\n <wac-checkbox *ngIf=\"multiple\" [id]=\"checkBoxId\" [value]=\"selected\"></wac-checkbox>\n <ng-content></ng-content>\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: "component", type: CheckboxComponent, selector: "wac-checkbox", inputs: ["label", "value", "type", "alone", "checked", "hasInput", "inputPlaceholder", "id", "name", "whiteSpace", "disabled"], outputs: ["valueChange"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
4724
4780
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: OptionComponent, decorators: [{
|
|
4725
4781
|
type: Component,
|
|
4726
|
-
args: [{ selector: 'wac-option', encapsulation: ViewEncapsulation.None, providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: OptionComponent }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [ngClass]=\"{ 'disabled': disabled }\"\n class=\"wac-option\"\n
|
|
4782
|
+
args: [{ selector: 'wac-option', encapsulation: ViewEncapsulation.None, providers: [{ provide: OPTION_SELECTION_HANDLER, useExisting: OptionComponent }], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n [ngClass]=\"{ 'disabled': disabled }\"\n class=\"wac-option\"\n >\n <div [ngClass]=\"{ 'selected': !disabled && selected, 'disabled': disabled }\" #contentWrapper>\n <wac-checkbox *ngIf=\"multiple\" [id]=\"checkBoxId\" [value]=\"selected\"></wac-checkbox>\n <ng-content></ng-content>\n </div>\n</div>" }]
|
|
4727
4783
|
}], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { contentOption: [{
|
|
4728
4784
|
type: ViewChild,
|
|
4729
4785
|
args: ['contentWrapper']
|
|
@@ -4915,13 +4971,13 @@ SelectComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version:
|
|
|
4915
4971
|
SelectComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "14.0.7", type: SelectComponent, selector: "wac-select", inputs: { required: "required", keepPanelOpen: "keepPanelOpen", openPanel: "openPanel", enableSearch: "enableSearch" }, outputs: { openPanelChange: "openPanelChange" }, host: { properties: { "attr.role": "this.role" } }, providers: [
|
|
4916
4972
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true },
|
|
4917
4973
|
ValueChangeService
|
|
4918
|
-
], 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__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n
|
|
4974
|
+
], 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__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n<div\n class=\"wac-select\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div #selectHeader class=\"wac-select__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__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__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select__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__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$2.TranslatePipe, name: "translate" }], changeDetection: i0.ChangeDetectionStrategy.Default, encapsulation: i0.ViewEncapsulation.None });
|
|
4919
4975
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "14.0.7", ngImport: i0, type: SelectComponent, decorators: [{
|
|
4920
4976
|
type: Component,
|
|
4921
4977
|
args: [{ selector: 'wac-select', providers: [
|
|
4922
4978
|
{ provide: NG_VALUE_ACCESSOR, useExisting: SelectComponent, multi: true },
|
|
4923
4979
|
ValueChangeService
|
|
4924
|
-
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.
|
|
4980
|
+
], encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.Default, template: "<p *ngIf=\"!!label\" class=\"wac-select__label\">\n <ng-content select=\"wac-label, .wac-label\" ></ng-content>\n</p>\n\n<div\n class=\"wac-select\"\n wzAutoHide\n (clickOutside)=\"onClosePanel()\"\n [triggerElement]=\"'wac-select__header__selection'\"\n [zIndexToggle]=\"openPanel\"\n >\n\n <div #selectHeader class=\"wac-select__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__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__header__chevron\"><i class=\"fas fa-chevron-down\"></i></span>\n\n </div>\n\n\n <div class=\"wac-select__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__content__empty\">\n <span>{{'wac.datatable.noresult' | translate}}</span>\n </div>\n\n </div>\n</div>" }]
|
|
4925
4981
|
}], ctorParameters: function () { return [{ type: ValueChangeService }]; }, propDecorators: { role: [{
|
|
4926
4982
|
type: HostBinding,
|
|
4927
4983
|
args: ['attr.role']
|