@natec/mef-dev-ui-kit 20.1.242 → 20.1.243

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.
@@ -1,21 +1,19 @@
1
1
  import * as i0 from '@angular/core';
2
- import { Input, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ContentChild, Host, NgModule, Injectable, ChangeDetectionStrategy, Pipe, forwardRef, HostListener, ViewChild, Directive, ContentChildren, Optional, TemplateRef, InjectionToken, inject, ViewContainerRef, DOCUMENT, NgZone, ElementRef, Renderer2, booleanAttribute, ChangeDetectorRef, HostAttributeToken, numberAttribute, QueryList, Injector, SkipSelf, signal, ViewChildren, ApplicationRef, afterNextRender, input, computed, EnvironmentInjector, HOST_TAG_NAME, contentChildren, viewChildren } from '@angular/core';
2
+ import { Input, ViewEncapsulation, Component, EventEmitter, Output, HostBinding, ContentChild, Host, NgModule, Injectable, ChangeDetectionStrategy, ViewChild, forwardRef, HostListener, Directive, ContentChildren, Optional, TemplateRef, InjectionToken, inject, ViewContainerRef, DOCUMENT, NgZone, ElementRef, Renderer2, booleanAttribute, ChangeDetectorRef, HostAttributeToken, numberAttribute, QueryList, Injector, SkipSelf, signal, ViewChildren, ApplicationRef, afterNextRender, input, computed, EnvironmentInjector, HOST_TAG_NAME, contentChildren, viewChildren } from '@angular/core';
3
3
  import { trigger, state, transition, style, animate } from '@angular/animations';
4
4
  import * as i1 from '@angular/common';
5
5
  import { CommonModule, NgTemplateOutlet, NgClass } from '@angular/common';
6
6
  import { Subject, of, fromEvent, merge, Subscription, EMPTY, defer, timer, Observable, filter as filter$1, map as map$1, startWith as startWith$1, switchMap as switchMap$1, takeUntil as takeUntil$1, take as take$1, BehaviorSubject } from 'rxjs';
7
- import * as i3 from '@angular/cdk/overlay';
8
- import { CdkConnectedOverlay, OverlayModule, createBlockScrollStrategy, createGlobalPositionStrategy, createRepositionScrollStrategy, createOverlayRef, OverlayConfig, createFlexibleConnectedPositionStrategy, ViewportRuler, ScrollDispatcher, Overlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
9
- import * as i2 from '@angular/forms';
10
- import { NG_VALUE_ACCESSOR, FormsModule, NgControl, Validators, NG_VALIDATORS, NgForm, FormGroupDirective } from '@angular/forms';
11
- import { TAB, DOWN_ARROW, ENTER, hasModifierKey, SPACE, ESCAPE, UP_ARROW, RIGHT_ARROW, LEFT_ARROW, A, BACKSPACE, DELETE } from '@angular/cdk/keycodes';
7
+ import { FormsModule, NG_VALUE_ACCESSOR, NgControl, Validators, NG_VALIDATORS, NgForm, FormGroupDirective } from '@angular/forms';
12
8
  import { auditTime, startWith, map, filter, take, switchMap, takeUntil, debounceTime, skip, skipWhile, tap, delay } from 'rxjs/operators';
13
9
  import * as i1$1 from '@angular/cdk/bidi';
14
10
  import { Directionality, BidiModule } from '@angular/cdk/bidi';
15
11
  import { CdkAccordionItem, CdkAccordion } from '@angular/cdk/accordion';
16
12
  import { _IdGenerator, FocusMonitor, FocusKeyManager, isFakeTouchstartFromScreenReader, isFakeMousedownFromScreenReader, ActiveDescendantKeyManager, CdkMonitorFocus, removeAriaReferencedId, addAriaReferencedId } from '@angular/cdk/a11y';
13
+ import { ENTER, hasModifierKey, SPACE, ESCAPE, UP_ARROW, DOWN_ARROW, RIGHT_ARROW, LEFT_ARROW, A, TAB, BACKSPACE, DELETE } from '@angular/cdk/keycodes';
17
14
  import { UniqueSelectionDispatcher, SelectionModel } from '@angular/cdk/collections';
18
15
  import { TemplatePortal, CdkPortalOutlet, PortalModule, DomPortalOutlet, CdkPortal } from '@angular/cdk/portal';
16
+ import { createBlockScrollStrategy, createGlobalPositionStrategy, OverlayModule, createRepositionScrollStrategy, createOverlayRef, OverlayConfig, createFlexibleConnectedPositionStrategy, ViewportRuler, ScrollDispatcher, Overlay, CdkOverlayOrigin, CdkConnectedOverlay } from '@angular/cdk/overlay';
19
17
  import { CdkDialogContainer, Dialog, DialogConfig, DialogModule } from '@angular/cdk/dialog';
20
18
  import { coerceNumberProperty, coerceArray } from '@angular/cdk/coercion';
21
19
  import * as i1$2 from '@angular/cdk/scrolling';
@@ -551,936 +549,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImpor
551
549
  args: ["card_title"]
552
550
  }] } });
553
551
 
554
- function toBoolean(value) {
555
- return value === '' || (value && value !== 'false');
556
- }
557
-
558
- /* tslint:disable:no-any */
559
- class OptionPipe {
560
- // TODO: enable type checking for this method
561
- transform(options, value) {
562
- if (value.searchText) {
563
- let _options = options.filter(option => option.Label &&
564
- option.Label.toLowerCase().indexOf(value.searchText.toLowerCase()) !==
565
- -1);
566
- if (value.tags) {
567
- _options = options.filter(option => option.Label &&
568
- option.Label.toLowerCase() === value.searchText.toLowerCase());
569
- }
570
- if (_options.length) {
571
- return _options;
572
- }
573
- else {
574
- return [
575
- {
576
- Value: value.value,
577
- _value: value.value,
578
- Disabled: value.disabled,
579
- _disabled: value.disabled,
580
- Label: value.notFoundContent,
581
- _label: value.notFoundContent
582
- }
583
- ];
584
- }
585
- }
586
- else {
587
- return options;
588
- }
589
- }
590
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: OptionPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
591
- static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: OptionPipe, isStandalone: false, name: "OptionPipe" });
592
- }
593
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: OptionPipe, decorators: [{
594
- type: Pipe,
595
- args: [{
596
- name: "OptionPipe",
597
- standalone: false
598
- }]
599
- }] });
600
-
601
- /**
602
- * complex but work well
603
- * TODO: rebuild latter
604
- */
605
- /**
606
- * Example of usage:
607
- * <example-url>https://platform.mef.dev/ui_kit_demo/view/controls/select</example-url>
608
- */
609
- class MefDevSelectComponent {
610
- _elementRef;
611
- _renderer;
612
- cDRef;
613
- _allowClear = false;
614
- _disabled = false;
615
- _isTags = false;
616
- _isMultiple = false;
617
- _keepUnListOptions = false;
618
- _showSearch = false;
619
- _el;
620
- _isOpen = false;
621
- _prefixCls = "pg-select";
622
- _classList = [];
623
- _dropDownClassMap;
624
- _dropDownPrefixCls = `${this._prefixCls}-dropdown`;
625
- _selectionClassMap;
626
- _selectionPrefixCls = `${this._prefixCls}-selection`;
627
- _size;
628
- _value;
629
- _placeholder = "";
630
- _notFoundContent = "No Content";
631
- _searchText = "";
632
- _triggerWidth = 0;
633
- _selectedOption;
634
- _operatingMultipleOption;
635
- _selectedOptions = new Set();
636
- _options = [];
637
- _cacheOptions = [];
638
- _filterOptions = [];
639
- _tagsOptions = [];
640
- _activeFilterOption;
641
- _isMultiInit = false;
642
- _dropDownPosition = "bottom";
643
- _composing = false;
644
- _mode;
645
- // ngModel Access
646
- onChange = () => null;
647
- onTouched = () => null;
648
- searchInputElementRef;
649
- trigger;
650
- dropdownUl;
651
- SearchChange = new EventEmitter();
652
- change = new EventEmitter();
653
- OpenChange = new EventEmitter();
654
- ScrollToBottom = new EventEmitter();
655
- Filter = true;
656
- MaxMultiple = Infinity;
657
- FirstDefault = false;
658
- _cdkOverlay;
659
- set AllowClear(value) {
660
- this._allowClear = toBoolean(value);
661
- }
662
- get AllowClear() {
663
- return this._allowClear;
664
- }
665
- set KeepUnListOptions(value) {
666
- this._keepUnListOptions = toBoolean(value);
667
- }
668
- get KeepUnListOptions() {
669
- return this._keepUnListOptions;
670
- }
671
- set Mode(value) {
672
- this._mode = value;
673
- if (this._mode === "multiple") {
674
- this.Multiple = true;
675
- }
676
- else if (this._mode === "tags") {
677
- this.Tags = true;
678
- }
679
- else if (this._mode === "combobox") {
680
- this.ShowSearch = true;
681
- }
682
- }
683
- set Multiple(value) {
684
- this._isMultiple = toBoolean(value);
685
- if (this._isMultiple) {
686
- this.ShowSearch = true;
687
- }
688
- }
689
- get Multiple() {
690
- return this._isMultiple;
691
- }
692
- set PlaceHolder(value) {
693
- this._placeholder = value;
694
- }
695
- get PlaceHolder() {
696
- return this._placeholder;
697
- }
698
- set NotFoundContent(value) {
699
- this._notFoundContent = value;
700
- }
701
- get NotFoundContent() {
702
- return this._notFoundContent;
703
- }
704
- set Size(value) {
705
- // @ts-ignore
706
- this._size = { large: "lg", small: "sm" }[value];
707
- this.setClassMap();
708
- }
709
- get Size() {
710
- return this._size;
711
- }
712
- set ShowSearch(value) {
713
- this._showSearch = toBoolean(value);
714
- }
715
- get ShowSearch() {
716
- return this._showSearch;
717
- }
718
- set Tags(value) {
719
- const isTags = toBoolean(value);
720
- this._isTags = isTags;
721
- this.Multiple = isTags;
722
- }
723
- get Tags() {
724
- return this._isTags;
725
- }
726
- set Disabled(value) {
727
- this._disabled = toBoolean(value);
728
- this.closeDropDown();
729
- this.setClassMap();
730
- }
731
- get Disabled() {
732
- return this._disabled;
733
- }
734
- set Open(value) {
735
- const isOpen = toBoolean(value);
736
- if (this._isOpen === isOpen) {
737
- return;
738
- }
739
- if (isOpen) {
740
- this.scrollToActive();
741
- this._setTriggerWidth();
742
- }
743
- this._isOpen = isOpen;
744
- this.OpenChange.emit(this._isOpen);
745
- this.setClassMap();
746
- if (this._isOpen) {
747
- setTimeout(() => {
748
- this.checkDropDownScroll();
749
- });
750
- }
751
- }
752
- get Open() {
753
- return this._isOpen;
754
- }
755
- /** new -option insert or new tags insert */
756
- // @ts-ignore
757
- addOption = option => {
758
- this._options.push(option);
759
- if (!this._isTags) {
760
- if (option.Value) {
761
- this.updateSelectedOption(this._value);
762
- }
763
- else {
764
- this.forceUpdateSelectedOption(this._value);
765
- }
766
- }
767
- };
768
- /** -option remove or tags remove */
769
- removeOption(option) {
770
- this._options.splice(this._options.indexOf(option), 1);
771
- if (!this._isTags) {
772
- this.forceUpdateSelectedOption(this._value);
773
- }
774
- }
775
- /** dropdown position changed */
776
- onPositionChange(position) {
777
- this._dropDownPosition = position.connectionPair.originY;
778
- }
779
- compositionStart() {
780
- this._composing = true;
781
- }
782
- compositionEnd() {
783
- this._composing = false;
784
- }
785
- /** clear single selected option */
786
- clearSelect($event) {
787
- if ($event) {
788
- $event.preventDefault();
789
- $event.stopPropagation();
790
- } // @ts-ignore
791
- this._selectedOption = null; // @ts-ignore
792
- this.Value = null; // @ts-ignore
793
- this.onChange(null);
794
- }
795
- /** click dropdown option by user */
796
- clickOption(option, $event) {
797
- if (!option) {
798
- return;
799
- }
800
- this.chooseOption(option, true, $event);
801
- this.clearSearchText();
802
- if (!this._isMultiple) {
803
- this.Open = false;
804
- }
805
- }
806
- /** choose option */
807
- chooseOption(option, isUserClick = false, $event) {
808
- if ($event) {
809
- $event.preventDefault();
810
- $event.stopPropagation();
811
- }
812
- this._activeFilterOption = option;
813
- if (option && !option.Disabled) {
814
- if (!this.Multiple) {
815
- this._selectedOption = option;
816
- this._value = option.Value;
817
- if (isUserClick) {
818
- this.change.next(this._value);
819
- this.onChange(option.Value);
820
- }
821
- }
822
- else {
823
- if (isUserClick) {
824
- this.isInSet(this._selectedOptions, option)
825
- ? this.unSelectMultipleOption(option)
826
- : this.selectMultipleOption(option);
827
- }
828
- }
829
- }
830
- }
831
- updateWidth(element, text) {
832
- if (text) {
833
- /** wait for scroll width change */ // @ts-ignore
834
- setTimeout(_ => {
835
- this._renderer.setStyle(element, "width", `${element.scrollWidth}px`);
836
- });
837
- }
838
- else {
839
- this._renderer.removeStyle(element, "width");
840
- }
841
- }
842
- /** determine if option in set */
843
- isInSet(set, option) {
844
- return Array.from(set).find((data) => data.Value === option.Value);
845
- }
846
- /** cancel select multiple option */ // @ts-ignore
847
- unSelectMultipleOption = (option, $event, emitChange = true) => {
848
- this._operatingMultipleOption = option;
849
- this._selectedOptions.delete(option);
850
- if (emitChange) {
851
- this.emitMultipleOptions();
852
- }
853
- // 对Tag进行特殊处理
854
- if (this._isTags &&
855
- this._options.indexOf(option) !== -1 &&
856
- this._tagsOptions.indexOf(option) !== -1) {
857
- this.removeOption(option);
858
- this._tagsOptions.splice(this._tagsOptions.indexOf(option), 1);
859
- }
860
- if ($event) {
861
- $event.preventDefault();
862
- $event.stopPropagation();
863
- }
864
- };
865
- /** select multiple option */
866
- selectMultipleOption(option, $event) {
867
- /** if tags do push to tag option */
868
- if (this._isTags &&
869
- this._options.indexOf(option) === -1 &&
870
- this._tagsOptions.indexOf(option) === -1) {
871
- this.addOption(option);
872
- this._tagsOptions.push(option);
873
- }
874
- this._operatingMultipleOption = option;
875
- if (this._selectedOptions.size < this.MaxMultiple) {
876
- this._selectedOptions.add(option);
877
- }
878
- this.emitMultipleOptions();
879
- if ($event) {
880
- $event.preventDefault();
881
- $event.stopPropagation();
882
- }
883
- }
884
- /** emit multiple options */
885
- emitMultipleOptions() {
886
- if (this._isMultiInit) {
887
- return;
888
- }
889
- const arrayOptions = Array.from(this._selectedOptions);
890
- this._value = arrayOptions.map(item => item.Value);
891
- this.onChange(this._value);
892
- }
893
- /** update selected option when add remove option etc */
894
- updateSelectedOption(currentModelValue, triggerByNgModel = false) {
895
- if (currentModelValue == null) {
896
- return;
897
- }
898
- if (this.Multiple) {
899
- const selectedOptions = this._options.filter(item => {
900
- return item != null && currentModelValue.indexOf(item.Value) !== -1;
901
- });
902
- if ((this.KeepUnListOptions || this.Tags) && !triggerByNgModel) {
903
- const _selectedOptions = Array.from(this._selectedOptions);
904
- selectedOptions.forEach(option => {
905
- const _exist = _selectedOptions.some(item => item._value == option._value);
906
- if (!_exist) {
907
- this._selectedOptions.add(option);
908
- }
909
- });
910
- }
911
- else {
912
- this._selectedOptions = new Set();
913
- selectedOptions.forEach(option => {
914
- this._selectedOptions.add(option);
915
- });
916
- }
917
- }
918
- else {
919
- const selectedOption = this._options.filter(item => {
920
- return item != null && item.Value == currentModelValue;
921
- });
922
- this.chooseOption(selectedOption[0]);
923
- }
924
- }
925
- forceUpdateSelectedOption(value) {
926
- /** trigger dirty check */ // @ts-ignore
927
- setTimeout(_ => {
928
- this.updateSelectedOption(value);
929
- });
930
- }
931
- get Value() {
932
- return this._value;
933
- }
934
- set Value(value) {
935
- this._updateValue(value);
936
- }
937
- clearAllSelectedOption(emitChange = true) {
938
- this._selectedOptions.forEach(item => {
939
- this.unSelectMultipleOption(item, null, emitChange);
940
- });
941
- }
942
- handleKeyEnterEvent(event) {
943
- /** when composing end */
944
- if (!this._composing && this._isOpen) {
945
- event.preventDefault();
946
- event.stopPropagation();
947
- this.updateFilterOption(false);
948
- this.clickOption(this._activeFilterOption);
949
- }
950
- }
951
- handleKeyBackspaceEvent(event) {
952
- if (!this._searchText && !this._composing && this._isMultiple) {
953
- event.preventDefault();
954
- const lastOption = Array.from(this._selectedOptions).pop();
955
- this.unSelectMultipleOption(lastOption);
956
- }
957
- }
958
- handleKeyDownEvent($event) {
959
- if (this._isOpen) {
960
- $event.preventDefault();
961
- $event.stopPropagation();
962
- this._activeFilterOption = this.nextOption(this._activeFilterOption, this._filterOptions.filter(w => !w.Disabled));
963
- this.scrollToActive();
964
- }
965
- }
966
- handleKeyUpEvent($event) {
967
- if (this._isOpen) {
968
- $event.preventDefault();
969
- $event.stopPropagation();
970
- this._activeFilterOption = this.preOption(this._activeFilterOption, this._filterOptions.filter(w => !w.Disabled));
971
- this.scrollToActive();
972
- }
973
- }
974
- preOption(option, options) {
975
- return options[options.indexOf(option) - 1] || options[options.length - 1];
976
- }
977
- nextOption(option, options) {
978
- return options[options.indexOf(option) + 1] || options[0];
979
- }
980
- clearSearchText() {
981
- this._searchText = "";
982
- this.updateFilterOption();
983
- }
984
- updateFilterOption(updateActiveFilter = true) {
985
- if (this.Filter) {
986
- this._filterOptions = new OptionPipe().transform(this._options, {
987
- searchText: this._searchText,
988
- tags: this._isTags,
989
- notFoundContent: this._isTags
990
- ? this._searchText
991
- : this._notFoundContent,
992
- disabled: !this._isTags,
993
- value: this._isTags ? this._searchText : "disabled"
994
- });
995
- }
996
- else {
997
- this._filterOptions = this._options;
998
- }
999
- /** TODO: cause pre & next key selection not work */
1000
- if (updateActiveFilter && !this._selectedOption) {
1001
- this._activeFilterOption = this._filterOptions[0];
1002
- }
1003
- }
1004
- onSearchChange(searchValue) {
1005
- this.SearchChange.emit(searchValue);
1006
- }
1007
- onClick(e) {
1008
- e.preventDefault();
1009
- if (!this._disabled) {
1010
- this.Open = !this.Open;
1011
- if (this.ShowSearch) {
1012
- /** wait for search display */ // @ts-ignore
1013
- setTimeout(_ => {
1014
- this.searchInputElementRef.nativeElement.focus();
1015
- });
1016
- }
1017
- }
1018
- }
1019
- onKeyDown(e) {
1020
- const keyCode = e.keyCode;
1021
- if (keyCode === TAB && this.Open) {
1022
- this.Open = false;
1023
- return;
1024
- }
1025
- if ((keyCode !== DOWN_ARROW && keyCode !== ENTER) || this.Open) {
1026
- return;
1027
- }
1028
- e.preventDefault();
1029
- if (!this._disabled) {
1030
- this.Open = true;
1031
- if (this.ShowSearch) {
1032
- /** wait for search display */ // @ts-ignore
1033
- setTimeout(_ => {
1034
- this.searchInputElementRef.nativeElement.focus();
1035
- });
1036
- }
1037
- }
1038
- }
1039
- closeDropDown() {
1040
- if (!this.Open) {
1041
- return;
1042
- }
1043
- this.onTouched();
1044
- if (this.Multiple) {
1045
- this._renderer.removeStyle(this.searchInputElementRef.nativeElement, "width");
1046
- }
1047
- this.clearSearchText();
1048
- this.Open = false;
1049
- }
1050
- setClassMap() {
1051
- this._classList.forEach(_className => {
1052
- this._renderer.removeClass(this._el, _className);
1053
- }); // @ts-ignore
1054
- this._classList = [
1055
- this._prefixCls,
1056
- this._mode === "combobox" && `${this._prefixCls}-combobox`,
1057
- !this._disabled && `${this._prefixCls}-enabled`,
1058
- this._disabled && `${this._prefixCls}-disabled`,
1059
- this._isOpen && `${this._prefixCls}-open`,
1060
- this._showSearch && `${this._prefixCls}-show-search`,
1061
- this._size && `${this._prefixCls}-${this._size}`
1062
- ].filter(item => {
1063
- return !!item;
1064
- });
1065
- this._classList.forEach(_className => {
1066
- this._renderer.addClass(this._el, _className);
1067
- });
1068
- this._selectionClassMap = {
1069
- [this._selectionPrefixCls]: true,
1070
- [`${this._selectionPrefixCls}--single`]: !this.Multiple,
1071
- [`${this._selectionPrefixCls}--multiple`]: this.Multiple
1072
- };
1073
- }
1074
- setDropDownClassMap() {
1075
- this._dropDownClassMap = {
1076
- [this._dropDownPrefixCls]: true,
1077
- ["component-select"]: this._mode === "combobox",
1078
- [`${this._dropDownPrefixCls}--single`]: !this.Multiple,
1079
- [`${this._dropDownPrefixCls}--multiple`]: this.Multiple,
1080
- [`${this._dropDownPrefixCls}-placement-bottomLeft`]: this._dropDownPosition === "bottom",
1081
- [`${this._dropDownPrefixCls}-placement-topLeft`]: this._dropDownPosition === "top"
1082
- };
1083
- }
1084
- scrollToActive() {
1085
- /** wait for dropdown display */ // @ts-ignore
1086
- setTimeout(_ => {
1087
- if (this._activeFilterOption && this._activeFilterOption.Value) {
1088
- const index = this._filterOptions.findIndex(option => option.Value === this._activeFilterOption.Value);
1089
- try {
1090
- const scrollPane = this.dropdownUl.nativeElement.children[index];
1091
- // TODO: scrollIntoViewIfNeeded is not a standard API, why doing so?
1092
- /* tslint:disable-next-line:no-any */
1093
- scrollPane.scrollIntoViewIfNeeded(false);
1094
- }
1095
- catch (e) { }
1096
- }
1097
- });
1098
- }
1099
- flushComponentState() {
1100
- this.updateFilterOption();
1101
- if (!this.Multiple) {
1102
- this.updateSelectedOption(this._value);
1103
- }
1104
- else {
1105
- if (this._value) {
1106
- this.updateSelectedOption(this._value);
1107
- }
1108
- }
1109
- }
1110
- _setTriggerWidth() {
1111
- this._triggerWidth = this._getTriggerRect().width;
1112
- /** should remove after after https://github.com/angular/material2/pull/8765 merged **/
1113
- if (this._cdkOverlay && this._cdkOverlay.overlayRef) {
1114
- this._cdkOverlay.overlayRef.updateSize({
1115
- width: this._triggerWidth
1116
- });
1117
- }
1118
- }
1119
- _getTriggerRect() {
1120
- return this.trigger.nativeElement.getBoundingClientRect();
1121
- }
1122
- writeValue(value) {
1123
- this._updateValue(value, false);
1124
- }
1125
- registerOnChange(fn) {
1126
- this.onChange = fn;
1127
- }
1128
- registerOnTouched(fn) {
1129
- this.onTouched = fn;
1130
- }
1131
- setDisabledState(isDisabled) {
1132
- this.Disabled = isDisabled;
1133
- }
1134
- dropDownScroll(ul) {
1135
- if (ul && ul.scrollHeight - ul.scrollTop === ul.clientHeight) {
1136
- this.ScrollToBottom.emit(true);
1137
- }
1138
- }
1139
- checkDropDownScroll() {
1140
- if (this.dropdownUl &&
1141
- this.dropdownUl.nativeElement.scrollHeight ===
1142
- this.dropdownUl.nativeElement.clientHeight) {
1143
- this.ScrollToBottom.emit(true);
1144
- }
1145
- }
1146
- constructor(_elementRef, _renderer, cDRef) {
1147
- this._elementRef = _elementRef;
1148
- this._renderer = _renderer;
1149
- this.cDRef = cDRef;
1150
- this._el = this._elementRef.nativeElement;
1151
- }
1152
- ngAfterContentInit() {
1153
- if (this._value != null) {
1154
- this.flushComponentState();
1155
- }
1156
- }
1157
- ngOnInit() {
1158
- this.updateFilterOption();
1159
- this.setClassMap();
1160
- this.setDropDownClassMap();
1161
- }
1162
- ngAfterContentChecked() {
1163
- if (this._cacheOptions !== this._options) {
1164
- /** update filter option after every content check cycle */
1165
- this.updateFilterOption();
1166
- this._cacheOptions = this._options;
1167
- }
1168
- else {
1169
- this.updateFilterOption(false);
1170
- }
1171
- if (this.FirstDefault) {
1172
- if (!this._value && this._options) {
1173
- if (this._options[0] !== undefined && this._options[0].Value) {
1174
- this.chooseOption(this._options[0], false);
1175
- setTimeout(() => {
1176
- this.onChange(this._options[0].Value);
1177
- });
1178
- }
1179
- }
1180
- }
1181
- }
1182
- _updateValue(value, emitChange = true) {
1183
- if (this._value === value) {
1184
- return;
1185
- }
1186
- if (value == null && this.Multiple) {
1187
- this._value = [];
1188
- }
1189
- else {
1190
- this._value = value;
1191
- }
1192
- if (!this.Multiple) {
1193
- if (value == null) { // @ts-ignore
1194
- this._selectedOption = null;
1195
- }
1196
- else {
1197
- this.updateSelectedOption(value);
1198
- }
1199
- }
1200
- else {
1201
- if (value) {
1202
- if (value.length === 0) {
1203
- this.clearAllSelectedOption(emitChange);
1204
- }
1205
- else {
1206
- this.updateSelectedOption(value, true);
1207
- }
1208
- }
1209
- else if (value == null) {
1210
- this.clearAllSelectedOption(emitChange);
1211
- }
1212
- }
1213
- }
1214
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevSelectComponent, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
1215
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: MefDevSelectComponent, isStandalone: false, selector: "mefdev-select", inputs: { Filter: "Filter", MaxMultiple: "MaxMultiple", FirstDefault: "FirstDefault", AllowClear: "AllowClear", KeepUnListOptions: "KeepUnListOptions", Mode: "Mode", Multiple: "Multiple", PlaceHolder: "PlaceHolder", NotFoundContent: "NotFoundContent", Size: "Size", ShowSearch: "ShowSearch", Tags: "Tags", Disabled: "Disabled", Open: "Open" }, outputs: { SearchChange: "SearchChange", change: "change", OpenChange: "OpenChange", ScrollToBottom: "ScrollToBottom" }, host: { listeners: { "click": "onClick($event)", "keydown": "onKeyDown($event)" } }, providers: [
1216
- {
1217
- provide: NG_VALUE_ACCESSOR,
1218
- useExisting: forwardRef(() => MefDevSelectComponent),
1219
- multi: true
1220
- }
1221
- ], viewQueries: [{ propertyName: "searchInputElementRef", first: true, predicate: ["searchInput"], descendants: true }, { propertyName: "trigger", first: true, predicate: ["trigger"], descendants: true }, { propertyName: "dropdownUl", first: true, predicate: ["dropdownUl"], descendants: true }, { propertyName: "_cdkOverlay", first: true, predicate: CdkConnectedOverlay, descendants: true }], ngImport: i0, template: "<div tabindex=\"0\" #trigger cdkOverlayOrigin #origin=\"cdkOverlayOrigin\" [ngClass]=\"_selectionClassMap\"\r\n (keydown.Enter)=\"handleKeyEnterEvent($event)\" (keydown.Backspace)=\"handleKeyBackspaceEvent($event)\"\r\n (keydown.ArrowUp)=\"handleKeyUpEvent($event)\" (keydown.ArrowDown)=\"handleKeyDownEvent($event)\">\r\n\r\n <!-- \u0423\u0432\u0435\u0441\u044C \u0441\u0435\u043B\u0435\u043A\u0442-->\r\n <div class=\"pg-select-selection__rendered\" *ngIf=\"!ShowSearch\">\r\n <div class=\"pg-select-selection__placeholder\">\r\n <ng-template [ngIf]=\"!_selectedOption\">\r\n {{ PlaceHolder }}\r\n </ng-template>\r\n </div>\r\n <div class=\"pg-select-selection-selected-value\">\r\n {{ _selectedOption?.Label }}\r\n </div>\r\n </div>\r\n <!--C\u043F\u0438\u0441\u043E\u043A options-->\r\n <div class=\"pg-select-selection__rendered\" *ngIf=\"ShowSearch\">\r\n <div [hidden]=\"_searchText||(!Open&&_selectedOption)||_selectedOptions.size\"\r\n class=\"pg-select-selection__placeholder\">\r\n <ng-template [ngIf]=\"(!_composing)&&_selectedOption\">\r\n {{ _selectedOption.Label }}\r\n </ng-template>\r\n <ng-template [ngIf]=\"(!_composing)&&(!_selectedOption)\">\r\n {{ PlaceHolder }}\r\n </ng-template>\r\n </div>\r\n\r\n\r\n <!--\u041C\u0443\u043B\u044C\u0442\u0438\u0441\u0435\u043B\u0435\u043A\u0442-->\r\n <ul *ngIf=\"Multiple\"> \r\n <li *ngFor=\"let option of _selectedOptions\" [@tagAnimation] [attr.title]=\"option?.Label || option?.Value\"\r\n class=\"pg-select-selection__choice\" style=\"-webkit-user-select: none;\">\r\n <span class=\"pg-select-selection__choice__remove\" (click)=\"unSelectMultipleOption(option,$event)\"></span>\r\n <div class=\"pg-select-selection__choice__content\">{{ option?.Label }}</div>\r\n </li>\r\n <li class=\"pg-select-search pg-select-search--inline\">\r\n <div class=\"pg-select-search__field__wrap\">\r\n <input class=\"pg-select-search__field\" (compositionstart)=\"compositionStart()\"\r\n (compositionend)=\"compositionEnd();updateWidth(searchInput,_searchText);\" [(ngModel)]=\"_searchText\"\r\n (ngModelChange)=\"updateFilterOption();onSearchChange($event);\"\r\n (keydown)=\"updateWidth(searchInput,_searchText)\" (input)=\"updateWidth(searchInput,_searchText)\"\r\n (blur)=\"onTouched()\" #searchInput>\r\n <span class=\"pg-select-search__field__mirror\"></span></div>\r\n </li>\r\n </ul>\r\n <div *ngIf=\"!Multiple\" class=\"pg-select-selection-selected-value\" [hidden]=\"!(_selectedOption?.Label)||Open\">\r\n {{ _selectedOption?.Label }}\r\n </div>\r\n <div *ngIf=\"!Multiple\" [hidden]=\"!Open\" class=\"pg-select-search pg-select-search--inline\">\r\n <div class=\"pg-select-search__field__wrap\">\r\n <input class=\"pg-select-search__field\" (blur)=\"onTouched()\" (compositionstart)=\"compositionStart()\"\r\n (compositionend)=\"compositionEnd()\" [(ngModel)]=\"_searchText\"\r\n (ngModelChange)=\"updateFilterOption();onSearchChange($event);\" #searchInput>\r\n <span class=\"pg-select-search__field__mirror\"></span>\r\n </div>\r\n </div>\r\n </div>\r\n <span (click)=\"onTouched();clearSelect($event)\" class=\"pg-select-selection__clear\" style=\"-webkit-user-select: none;\"\r\n *ngIf=\"_selectedOption?.Label&&AllowClear&&!Multiple\">\r\n </span>\r\n <span class=\"pg-select-arrow\"><b></b></span>\r\n</div>\r\n<ng-template cdkConnectedOverlay cdkConnectedOverlayHasBackdrop [cdkConnectedOverlayOrigin]=\"origin\" cdkConnectedOverlayBackdropClass=\"backdrop\"\r\n (backdropClick)=\"closeDropDown()\" (detach)=\"closeDropDown();\" (positionChange)=\"onPositionChange($event)\"\r\n [cdkConnectedOverlayWidth]=\"_triggerWidth\" [cdkConnectedOverlayOpen]=\"_isOpen\">\r\n <div [ngClass]=\"_dropDownClassMap\" [@dropDownAnimation]=\"_dropDownPosition\">\r\n <div style=\"overflow: auto;\">\r\n <ul class=\"pg-select-dropdown-menu pg-select-dropdown-menu-vertical pg-select-dropdown-menu-root\" #dropdownUl\r\n (scroll)=\"dropDownScroll(dropdownUl)\">\r\n <li *ngFor=\"let option of _filterOptions\" [class.pg-select-dropdown-menu-item-disabled]=\"option.Disabled\"\r\n [class.pg-select-dropdown-menu-item-active]=\"option.Value == _activeFilterOption?.Value\"\r\n [class.pg-select-dropdown-menu-item-selected]=\"(option.Value==(_selectedOption?.Value))||(isInSet(_selectedOptions,option))\"\r\n class=\"pg-select-dropdown-menu-item\" (click)=\"clickOption(option,$event)\">\r\n <ng-template *ngIf=\"option.OptionTemplate\" [ngTemplateOutlet]=\"option.OptionTemplate\">\r\n </ng-template>\r\n <ng-template [ngIf]=\"!option.OptionTemplate\">\r\n {{ option.Label }}\r\n </ng-template>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</ng-template>", dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { 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: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i3.CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: i3.CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], animations: [trigger('dropDownAnimation', [
1222
- state('bottom', style({
1223
- opacity: 1,
1224
- transform: 'scaleY(1)',
1225
- transformOrigin: '0% 0%'
1226
- })),
1227
- transition('void => bottom', [
1228
- style({
1229
- opacity: 0,
1230
- transform: 'scaleY(0)',
1231
- transformOrigin: '0% 0%'
1232
- }),
1233
- animate('150ms cubic-bezier(0.25, 0.8, 0.25, 1)')
1234
- ]),
1235
- state('top', style({
1236
- opacity: 1,
1237
- transform: 'scaleY(1)',
1238
- transformOrigin: '0% 100%'
1239
- })),
1240
- transition('void => top', [
1241
- style({
1242
- opacity: 0,
1243
- transform: 'scaleY(0)',
1244
- transformOrigin: '0% 100%'
1245
- }),
1246
- animate('150ms cubic-bezier(0.25, 0.8, 0.25, 1)')
1247
- ]),
1248
- transition('* => void', [
1249
- animate('250ms 100ms linear', style({ opacity: 0 }))
1250
- ])
1251
- ]),
1252
- trigger('tagAnimation', [
1253
- state('*', style({ opacity: 1, transform: 'scale(1)' })),
1254
- transition('void => *', [
1255
- style({ opacity: 0, transform: 'scale(0)' }),
1256
- animate('150ms linear')
1257
- ]),
1258
- state('void', style({ opacity: 0, transform: 'scale(0)' })),
1259
- transition('* => void', [
1260
- style({ opacity: 1, transform: 'scale(1)' }),
1261
- animate('150ms linear')
1262
- ])
1263
- ])], encapsulation: i0.ViewEncapsulation.None });
1264
- }
1265
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevSelectComponent, decorators: [{
1266
- type: Component,
1267
- args: [{ selector: "mefdev-select", encapsulation: ViewEncapsulation.None, providers: [
1268
- {
1269
- provide: NG_VALUE_ACCESSOR,
1270
- useExisting: forwardRef(() => MefDevSelectComponent),
1271
- multi: true
1272
- }
1273
- ], animations: [trigger('dropDownAnimation', [
1274
- state('bottom', style({
1275
- opacity: 1,
1276
- transform: 'scaleY(1)',
1277
- transformOrigin: '0% 0%'
1278
- })),
1279
- transition('void => bottom', [
1280
- style({
1281
- opacity: 0,
1282
- transform: 'scaleY(0)',
1283
- transformOrigin: '0% 0%'
1284
- }),
1285
- animate('150ms cubic-bezier(0.25, 0.8, 0.25, 1)')
1286
- ]),
1287
- state('top', style({
1288
- opacity: 1,
1289
- transform: 'scaleY(1)',
1290
- transformOrigin: '0% 100%'
1291
- })),
1292
- transition('void => top', [
1293
- style({
1294
- opacity: 0,
1295
- transform: 'scaleY(0)',
1296
- transformOrigin: '0% 100%'
1297
- }),
1298
- animate('150ms cubic-bezier(0.25, 0.8, 0.25, 1)')
1299
- ]),
1300
- transition('* => void', [
1301
- animate('250ms 100ms linear', style({ opacity: 0 }))
1302
- ])
1303
- ]),
1304
- trigger('tagAnimation', [
1305
- state('*', style({ opacity: 1, transform: 'scale(1)' })),
1306
- transition('void => *', [
1307
- style({ opacity: 0, transform: 'scale(0)' }),
1308
- animate('150ms linear')
1309
- ]),
1310
- state('void', style({ opacity: 0, transform: 'scale(0)' })),
1311
- transition('* => void', [
1312
- style({ opacity: 1, transform: 'scale(1)' }),
1313
- animate('150ms linear')
1314
- ])
1315
- ])], standalone: false, template: "<div tabindex=\"0\" #trigger cdkOverlayOrigin #origin=\"cdkOverlayOrigin\" [ngClass]=\"_selectionClassMap\"\r\n (keydown.Enter)=\"handleKeyEnterEvent($event)\" (keydown.Backspace)=\"handleKeyBackspaceEvent($event)\"\r\n (keydown.ArrowUp)=\"handleKeyUpEvent($event)\" (keydown.ArrowDown)=\"handleKeyDownEvent($event)\">\r\n\r\n <!-- \u0423\u0432\u0435\u0441\u044C \u0441\u0435\u043B\u0435\u043A\u0442-->\r\n <div class=\"pg-select-selection__rendered\" *ngIf=\"!ShowSearch\">\r\n <div class=\"pg-select-selection__placeholder\">\r\n <ng-template [ngIf]=\"!_selectedOption\">\r\n {{ PlaceHolder }}\r\n </ng-template>\r\n </div>\r\n <div class=\"pg-select-selection-selected-value\">\r\n {{ _selectedOption?.Label }}\r\n </div>\r\n </div>\r\n <!--C\u043F\u0438\u0441\u043E\u043A options-->\r\n <div class=\"pg-select-selection__rendered\" *ngIf=\"ShowSearch\">\r\n <div [hidden]=\"_searchText||(!Open&&_selectedOption)||_selectedOptions.size\"\r\n class=\"pg-select-selection__placeholder\">\r\n <ng-template [ngIf]=\"(!_composing)&&_selectedOption\">\r\n {{ _selectedOption.Label }}\r\n </ng-template>\r\n <ng-template [ngIf]=\"(!_composing)&&(!_selectedOption)\">\r\n {{ PlaceHolder }}\r\n </ng-template>\r\n </div>\r\n\r\n\r\n <!--\u041C\u0443\u043B\u044C\u0442\u0438\u0441\u0435\u043B\u0435\u043A\u0442-->\r\n <ul *ngIf=\"Multiple\"> \r\n <li *ngFor=\"let option of _selectedOptions\" [@tagAnimation] [attr.title]=\"option?.Label || option?.Value\"\r\n class=\"pg-select-selection__choice\" style=\"-webkit-user-select: none;\">\r\n <span class=\"pg-select-selection__choice__remove\" (click)=\"unSelectMultipleOption(option,$event)\"></span>\r\n <div class=\"pg-select-selection__choice__content\">{{ option?.Label }}</div>\r\n </li>\r\n <li class=\"pg-select-search pg-select-search--inline\">\r\n <div class=\"pg-select-search__field__wrap\">\r\n <input class=\"pg-select-search__field\" (compositionstart)=\"compositionStart()\"\r\n (compositionend)=\"compositionEnd();updateWidth(searchInput,_searchText);\" [(ngModel)]=\"_searchText\"\r\n (ngModelChange)=\"updateFilterOption();onSearchChange($event);\"\r\n (keydown)=\"updateWidth(searchInput,_searchText)\" (input)=\"updateWidth(searchInput,_searchText)\"\r\n (blur)=\"onTouched()\" #searchInput>\r\n <span class=\"pg-select-search__field__mirror\"></span></div>\r\n </li>\r\n </ul>\r\n <div *ngIf=\"!Multiple\" class=\"pg-select-selection-selected-value\" [hidden]=\"!(_selectedOption?.Label)||Open\">\r\n {{ _selectedOption?.Label }}\r\n </div>\r\n <div *ngIf=\"!Multiple\" [hidden]=\"!Open\" class=\"pg-select-search pg-select-search--inline\">\r\n <div class=\"pg-select-search__field__wrap\">\r\n <input class=\"pg-select-search__field\" (blur)=\"onTouched()\" (compositionstart)=\"compositionStart()\"\r\n (compositionend)=\"compositionEnd()\" [(ngModel)]=\"_searchText\"\r\n (ngModelChange)=\"updateFilterOption();onSearchChange($event);\" #searchInput>\r\n <span class=\"pg-select-search__field__mirror\"></span>\r\n </div>\r\n </div>\r\n </div>\r\n <span (click)=\"onTouched();clearSelect($event)\" class=\"pg-select-selection__clear\" style=\"-webkit-user-select: none;\"\r\n *ngIf=\"_selectedOption?.Label&&AllowClear&&!Multiple\">\r\n </span>\r\n <span class=\"pg-select-arrow\"><b></b></span>\r\n</div>\r\n<ng-template cdkConnectedOverlay cdkConnectedOverlayHasBackdrop [cdkConnectedOverlayOrigin]=\"origin\" cdkConnectedOverlayBackdropClass=\"backdrop\"\r\n (backdropClick)=\"closeDropDown()\" (detach)=\"closeDropDown();\" (positionChange)=\"onPositionChange($event)\"\r\n [cdkConnectedOverlayWidth]=\"_triggerWidth\" [cdkConnectedOverlayOpen]=\"_isOpen\">\r\n <div [ngClass]=\"_dropDownClassMap\" [@dropDownAnimation]=\"_dropDownPosition\">\r\n <div style=\"overflow: auto;\">\r\n <ul class=\"pg-select-dropdown-menu pg-select-dropdown-menu-vertical pg-select-dropdown-menu-root\" #dropdownUl\r\n (scroll)=\"dropDownScroll(dropdownUl)\">\r\n <li *ngFor=\"let option of _filterOptions\" [class.pg-select-dropdown-menu-item-disabled]=\"option.Disabled\"\r\n [class.pg-select-dropdown-menu-item-active]=\"option.Value == _activeFilterOption?.Value\"\r\n [class.pg-select-dropdown-menu-item-selected]=\"(option.Value==(_selectedOption?.Value))||(isInSet(_selectedOptions,option))\"\r\n class=\"pg-select-dropdown-menu-item\" (click)=\"clickOption(option,$event)\">\r\n <ng-template *ngIf=\"option.OptionTemplate\" [ngTemplateOutlet]=\"option.OptionTemplate\">\r\n </ng-template>\r\n <ng-template [ngIf]=\"!option.OptionTemplate\">\r\n {{ option.Label }}\r\n </ng-template>\r\n </li>\r\n </ul>\r\n </div>\r\n </div>\r\n</ng-template>" }]
1316
- }], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Renderer2 }, { type: i0.ChangeDetectorRef }], propDecorators: { searchInputElementRef: [{
1317
- type: ViewChild,
1318
- args: ["searchInput"]
1319
- }], trigger: [{
1320
- type: ViewChild,
1321
- args: ["trigger"]
1322
- }], dropdownUl: [{
1323
- type: ViewChild,
1324
- args: ["dropdownUl"]
1325
- }], SearchChange: [{
1326
- type: Output
1327
- }], change: [{
1328
- type: Output
1329
- }], OpenChange: [{
1330
- type: Output
1331
- }], ScrollToBottom: [{
1332
- type: Output
1333
- }], Filter: [{
1334
- type: Input
1335
- }], MaxMultiple: [{
1336
- type: Input
1337
- }], FirstDefault: [{
1338
- type: Input
1339
- }], _cdkOverlay: [{
1340
- type: ViewChild,
1341
- args: [CdkConnectedOverlay]
1342
- }], AllowClear: [{
1343
- type: Input
1344
- }], KeepUnListOptions: [{
1345
- type: Input
1346
- }], Mode: [{
1347
- type: Input
1348
- }], Multiple: [{
1349
- type: Input
1350
- }], PlaceHolder: [{
1351
- type: Input
1352
- }], NotFoundContent: [{
1353
- type: Input
1354
- }], Size: [{
1355
- type: Input
1356
- }], ShowSearch: [{
1357
- type: Input
1358
- }], Tags: [{
1359
- type: Input
1360
- }], Disabled: [{
1361
- type: Input
1362
- }], Open: [{
1363
- type: Input
1364
- }], onClick: [{
1365
- type: HostListener,
1366
- args: ["click", ["$event"]]
1367
- }], onKeyDown: [{
1368
- type: HostListener,
1369
- args: ["keydown", ["$event"]]
1370
- }] } });
1371
-
1372
- /**
1373
- * @skipTemplateDoc true
1374
- * Component for representing an option in a dropdown list.
1375
- *
1376
- *```
1377
- * <mefdev-select>
1378
- * <mefdev-option Value="1" Label="Option 1"></mefdev-option>
1379
- * <mefdev-option Value="2" Label="Option 2"></mefdev-option>
1380
- * <mefdev-option Value="3" Label="Option 3"></mefdev-option>
1381
- * </mefdev-select>
1382
- *```
1383
- *
1384
- */
1385
- class MefDevOptionComponent {
1386
- _Select;
1387
- _disabled = false;
1388
- _value;
1389
- _label;
1390
- /**
1391
- * Template for the content of the option.
1392
- */
1393
- OptionTemplate;
1394
- /**
1395
- * The value of the option.
1396
- */
1397
- set Value(value) {
1398
- if (this._value === value) {
1399
- return;
1400
- }
1401
- this._value = value;
1402
- }
1403
- get Value() {
1404
- return this._value;
1405
- }
1406
- /**
1407
- * The label of the option.
1408
- */
1409
- set Label(value) {
1410
- if (this._label === value) {
1411
- return;
1412
- }
1413
- this._label = value;
1414
- }
1415
- get Label() {
1416
- return this._label;
1417
- }
1418
- /**
1419
- * Indicates whether the option is disabled.
1420
- */
1421
- set Disabled(value) {
1422
- this._disabled = toBoolean(value);
1423
- }
1424
- get Disabled() {
1425
- return this._disabled;
1426
- }
1427
- constructor(_Select) {
1428
- this._Select = _Select;
1429
- }
1430
- /**
1431
- * Initialization lifecycle hook.
1432
- * Adds the option to the dropdown list.
1433
- */
1434
- ngOnInit() {
1435
- this._Select.addOption(this);
1436
- }
1437
- /**
1438
- * Destruction lifecycle hook.
1439
- * Removes the option from the dropdown list.
1440
- */
1441
- ngOnDestroy() {
1442
- this._Select.removeOption(this);
1443
- }
1444
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevOptionComponent, deps: [{ token: MefDevSelectComponent }], target: i0.ɵɵFactoryTarget.Component });
1445
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.3.6", type: MefDevOptionComponent, isStandalone: false, selector: "mefdev-option", inputs: { Value: "Value", Label: "Label", Disabled: "Disabled" }, queries: [{ propertyName: "OptionTemplate", first: true, predicate: ["OptionTemplate"], descendants: true }], ngImport: i0, template: "<ng-content></ng-content>", encapsulation: i0.ViewEncapsulation.None });
1446
- }
1447
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevOptionComponent, decorators: [{
1448
- type: Component,
1449
- args: [{ selector: "mefdev-option", encapsulation: ViewEncapsulation.None, standalone: false, template: "<ng-content></ng-content>" }]
1450
- }], ctorParameters: () => [{ type: MefDevSelectComponent }], propDecorators: { OptionTemplate: [{
1451
- type: ContentChild,
1452
- args: ["OptionTemplate"]
1453
- }], Value: [{
1454
- type: Input
1455
- }], Label: [{
1456
- type: Input
1457
- }], Disabled: [{
1458
- type: Input
1459
- }] } });
1460
-
1461
- class MefDevSelectModule {
1462
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevSelectModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1463
- static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: MefDevSelectModule, declarations: [OptionPipe, MefDevOptionComponent, MefDevSelectComponent], imports: [CommonModule, FormsModule, OverlayModule], exports: [OptionPipe, MefDevOptionComponent, MefDevSelectComponent] });
1464
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevSelectModule, imports: [CommonModule, FormsModule, OverlayModule] });
1465
- }
1466
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevSelectModule, decorators: [{
1467
- type: NgModule,
1468
- args: [{
1469
- imports: [CommonModule, FormsModule, OverlayModule],
1470
- declarations: [OptionPipe, MefDevOptionComponent, MefDevSelectComponent],
1471
- exports: [OptionPipe, MefDevOptionComponent, MefDevSelectComponent]
1472
- }]
1473
- }] });
1474
-
1475
552
  const mefDevCardComponents = [CardSimpleComponent];
1476
553
  class MefDevCardModule {
1477
554
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevCardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
1478
555
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: MefDevCardModule, declarations: [CardSimpleComponent], imports: [CommonModule,
1479
- MefDevCollapseModule,
1480
- MefDevSelectModule], exports: [CardSimpleComponent] });
556
+ MefDevCollapseModule], exports: [CardSimpleComponent] });
1481
557
  static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevCardModule, imports: [CommonModule,
1482
- MefDevCollapseModule,
1483
- MefDevSelectModule] });
558
+ MefDevCollapseModule] });
1484
559
  }
1485
560
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevCardModule, decorators: [{
1486
561
  type: NgModule,
@@ -1490,7 +565,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImpor
1490
565
  imports: [
1491
566
  CommonModule,
1492
567
  MefDevCollapseModule,
1493
- MefDevSelectModule,
1494
568
  ]
1495
569
  }]
1496
570
  }] });
@@ -1926,20 +1000,17 @@ class MefDevModalModule {
1926
1000
  static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.3.6", ngImport: i0, type: MefDevModalModule, declarations: [FillComponent,
1927
1001
  SlideUpComponent,
1928
1002
  SlideRightComponent,
1929
- RightFilterComponent], imports: [CommonModule,
1930
- MefDevSelectModule], exports: [FillComponent,
1003
+ RightFilterComponent], imports: [CommonModule], exports: [FillComponent,
1931
1004
  SlideUpComponent,
1932
1005
  SlideRightComponent,
1933
1006
  RightFilterComponent] });
1934
- static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevModalModule, imports: [CommonModule,
1935
- MefDevSelectModule] });
1007
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevModalModule, imports: [CommonModule] });
1936
1008
  }
1937
1009
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImport: i0, type: MefDevModalModule, decorators: [{
1938
1010
  type: NgModule,
1939
1011
  args: [{
1940
1012
  imports: [
1941
- CommonModule,
1942
- MefDevSelectModule
1013
+ CommonModule
1943
1014
  ],
1944
1015
  exports: mefDevModalModuleComponents,
1945
1016
  declarations: mefDevModalModuleComponents
@@ -2781,6 +1852,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImpor
2781
1852
  }]
2782
1853
  }] });
2783
1854
 
1855
+ function toBoolean(value) {
1856
+ return value === '' || (value && value !== 'false');
1857
+ }
1858
+
2784
1859
  /**
2785
1860
  * @component
2786
1861
  * @skipTemplateDoc: true
@@ -16315,5 +15390,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.6", ngImpor
16315
15390
  * Generated bundle index. Do not edit.
16316
15391
  */
16317
15392
 
16318
- export { ACCORDION, CARD_CONFIG, CardSimpleComponent, CentralPageComponent, CentralPageRowComponent, CollapseComponent, CollapseSetComponent, DIALOG_DATA, DIALOG_DEFAULT_OPTIONS, DIALOG_SCROLL_STRATEGY, DialogState, EXPANSION_PANEL_DEFAULT_OPTIONS, ErrorStateMatcher, ExpansionPanelActionRow, ExpansionPanelDescription, ExpansionPanelTitle, FillComponent, FilteredFieldContainerComponent, FilteredFieldItemComponent, FilteredFieldService, FiltredItemModel, INK_BAR_POSITIONER, INK_BAR_POSITIONER_FACTORY, InkBar, MDAccordion, MDAutocomplete, MDAutocompleteModule, MDAutocompleteOrigin, MDAutocompleteSelectedEvent, MDAutocompleteTrigger, MDCard, MDCardActions, MDCardAvatar, MDCardContent, MDCardFooter, MDCardHeader, MDCardImage, MDCardLgImage, MDCardMdImage, MDCardModule, MDCardSmImage, MDCardSubtitle, MDCardTitle, MDCardTitleGroup, MDCardXlImage, MDCheckBox, MDCheckBoxModule, MDCheckboxChange, MDChip, MDChipAvatar, MDChipEdit, MDChipEditInput, MDChipGrid, MDChipGridChange, MDChipInput, MDChipListbox, MDChipListboxChange, MDChipOption, MDChipRemove, MDChipRow, MDChipSelectionChange, MDChipSet, MDChipTrailingIcon, MDChipsModule, MDCollapseModule, MDContextMenuTrigger, MDDialog, MDDialogActions, MDDialogClose, MDDialogContainer, MDDialogContent, MDDialogTitle, MDExpansionPanel, MDExpansionPanelContent, MDExpansionPanelHeader, MDGridActionsColumnDirective, MDGridAutoSizeDirective, MDGridCellTemplateDirective, MDGridColumnDirective, MDGridComponent, MDGridEditTemplateDirective, MDGridHeaderTemplateDirective, MDGridIdColumnDirective, MDGridModule, MDGridResetFlexSizingDirective, MDGridToolbarTemplateDirective, MDHeaderCardComponent, MDHeaderCardModule, MDHeaderCardSetComponent, MDMenu, MDMenuContent, MDMenuItem, MDMenuModule, MDMenuTrigger, MDModalModule, MDOption, MDOptionGroup, MDOptionModule, MDOptionSelectionChange, MDPaginatorComponent, MDPaginatorModule, MDPseudoCheckboxModule, MDRadioButton, MDRadioGroup, MDRadioModule, MDSelect, MDSelectModule, MDSelectTrigger, MDStep, MDStepContent, MDStepExecutorModule, MDStepFooter, MDStepHeader, MDStepLabel, MDStepper, MDStepperIcon, MDStepperNext, MDStepperPrevious, MDSwitch, MDSwitchModule, MDTab, MDTabBody, MDTabChangeEvent, MDTabContent, MDTabGroup, MDTabHeader, MDTabLabel, MDTabLabelWrapper, MDTabLink, MDTabNav, MDTabNavPanel, MDTabsModule, MD_AUTOCOMPLETE_DEFAULT_OPTIONS, MD_AUTOCOMPLETE_SCROLL_STRATEGY, MD_AUTOCOMPLETE_VALUE_ACCESSOR, MD_CHIP, MD_CHIPS_DEFAULT_OPTIONS, MD_CHIP_AVATAR, MD_CHIP_EDIT, MD_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR, MD_CHIP_REMOVE, MD_CHIP_TRAILING_ICON, MD_EXPANSION_PANEL, MD_MENU_CONTENT, MD_MENU_DEFAULT_OPTIONS, MD_MENU_PANEL, MD_MENU_SCROLL_STRATEGY, MD_OPTION_PARENT_COMPONENT, MD_RADIO_GROUP, MD_SELECT_TRIGGER, MD_TAB, MD_TAB_LABEL, MENU_PANEL_TOP_PADDING, ManagePageComponent, MefDevCardModule, MefDevCollapseModule, MefDevDialogConfig, MefDevDialogRef, MefDevDropDownMenuModule, MefDevFilteredFieldModule, MefDevModalModule, MefDevOptionComponent, MefDevPageLayoutsModule, MefDevProgressComponent, MefDevProgressModule, MefDevSelectComponent, MefDevSelectModule, MefDevStepExecutorModule, MefDevSwitchComponent, MefDevSwitchModule, MefDevTabBodyComponent, MefDevTabComponent, MefDevTabLabelDirective, MefDevTabSetComponent, MefDevTabsInkBarDirective, MefDevTabsModule, MefDevTabsNavComponent, MefdevDropdownMenuComponent, MefdevExecutorPageComponent, OptionPipe, PaginatedTabHeader, ProgressConfig, PseudoCheckbox, RADIO_GROUP_CONTROL_VALUE_ACCESSOR, RadioChange, RightFilterComponent, STEPPER_INTL_PROVIDER, STEPPER_INTL_PROVIDER_FACTORY, SelectChange, ShowOnDirtyErrorStateMatcher, SlideRightComponent, SlideUpComponent, SortDirection, SortType, StageComponent, StepExecutorComponent, StepperErrorStateMatcher, StepperIntl, TABS_CONFIG, TAB_CONTENT, TAB_GROUP, TabBodyPortal, TabChangeEvent, TablePageComponent, TransitionCheckState, _ErrorStateTracker, _closeDialogVia, _countGroupLabelsBeforeOption, _getOptionScrollPosition, components, getMDAutocompleteMissingPanelError, getMDSelectDynamicMultipleError, getMDSelectNonArrayValueError, getMDSelectNonFunctionValueError, groupRowsByProperty, mefDevCardComponents, mefDevCollapseModuleComponents, sortRows };
15393
+ export { ACCORDION, CARD_CONFIG, CardSimpleComponent, CentralPageComponent, CentralPageRowComponent, CollapseComponent, CollapseSetComponent, DIALOG_DATA, DIALOG_DEFAULT_OPTIONS, DIALOG_SCROLL_STRATEGY, DialogState, EXPANSION_PANEL_DEFAULT_OPTIONS, ErrorStateMatcher, ExpansionPanelActionRow, ExpansionPanelDescription, ExpansionPanelTitle, FillComponent, FilteredFieldContainerComponent, FilteredFieldItemComponent, FilteredFieldService, FiltredItemModel, INK_BAR_POSITIONER, INK_BAR_POSITIONER_FACTORY, InkBar, MDAccordion, MDAutocomplete, MDAutocompleteModule, MDAutocompleteOrigin, MDAutocompleteSelectedEvent, MDAutocompleteTrigger, MDCard, MDCardActions, MDCardAvatar, MDCardContent, MDCardFooter, MDCardHeader, MDCardImage, MDCardLgImage, MDCardMdImage, MDCardModule, MDCardSmImage, MDCardSubtitle, MDCardTitle, MDCardTitleGroup, MDCardXlImage, MDCheckBox, MDCheckBoxModule, MDCheckboxChange, MDChip, MDChipAvatar, MDChipEdit, MDChipEditInput, MDChipGrid, MDChipGridChange, MDChipInput, MDChipListbox, MDChipListboxChange, MDChipOption, MDChipRemove, MDChipRow, MDChipSelectionChange, MDChipSet, MDChipTrailingIcon, MDChipsModule, MDCollapseModule, MDContextMenuTrigger, MDDialog, MDDialogActions, MDDialogClose, MDDialogContainer, MDDialogContent, MDDialogTitle, MDExpansionPanel, MDExpansionPanelContent, MDExpansionPanelHeader, MDGridActionsColumnDirective, MDGridAutoSizeDirective, MDGridCellTemplateDirective, MDGridColumnDirective, MDGridComponent, MDGridEditTemplateDirective, MDGridHeaderTemplateDirective, MDGridIdColumnDirective, MDGridModule, MDGridResetFlexSizingDirective, MDGridToolbarTemplateDirective, MDHeaderCardComponent, MDHeaderCardModule, MDHeaderCardSetComponent, MDMenu, MDMenuContent, MDMenuItem, MDMenuModule, MDMenuTrigger, MDModalModule, MDOption, MDOptionGroup, MDOptionModule, MDOptionSelectionChange, MDPaginatorComponent, MDPaginatorModule, MDPseudoCheckboxModule, MDRadioButton, MDRadioGroup, MDRadioModule, MDSelect, MDSelectModule, MDSelectTrigger, MDStep, MDStepContent, MDStepExecutorModule, MDStepFooter, MDStepHeader, MDStepLabel, MDStepper, MDStepperIcon, MDStepperNext, MDStepperPrevious, MDSwitch, MDSwitchModule, MDTab, MDTabBody, MDTabChangeEvent, MDTabContent, MDTabGroup, MDTabHeader, MDTabLabel, MDTabLabelWrapper, MDTabLink, MDTabNav, MDTabNavPanel, MDTabsModule, MD_AUTOCOMPLETE_DEFAULT_OPTIONS, MD_AUTOCOMPLETE_SCROLL_STRATEGY, MD_AUTOCOMPLETE_VALUE_ACCESSOR, MD_CHIP, MD_CHIPS_DEFAULT_OPTIONS, MD_CHIP_AVATAR, MD_CHIP_EDIT, MD_CHIP_LISTBOX_CONTROL_VALUE_ACCESSOR, MD_CHIP_REMOVE, MD_CHIP_TRAILING_ICON, MD_EXPANSION_PANEL, MD_MENU_CONTENT, MD_MENU_DEFAULT_OPTIONS, MD_MENU_PANEL, MD_MENU_SCROLL_STRATEGY, MD_OPTION_PARENT_COMPONENT, MD_RADIO_GROUP, MD_SELECT_TRIGGER, MD_TAB, MD_TAB_LABEL, MENU_PANEL_TOP_PADDING, ManagePageComponent, MefDevCardModule, MefDevCollapseModule, MefDevDialogConfig, MefDevDialogRef, MefDevDropDownMenuModule, MefDevFilteredFieldModule, MefDevModalModule, MefDevPageLayoutsModule, MefDevProgressComponent, MefDevProgressModule, MefDevStepExecutorModule, MefDevSwitchComponent, MefDevSwitchModule, MefDevTabBodyComponent, MefDevTabComponent, MefDevTabLabelDirective, MefDevTabSetComponent, MefDevTabsInkBarDirective, MefDevTabsModule, MefDevTabsNavComponent, MefdevDropdownMenuComponent, MefdevExecutorPageComponent, PaginatedTabHeader, ProgressConfig, PseudoCheckbox, RADIO_GROUP_CONTROL_VALUE_ACCESSOR, RadioChange, RightFilterComponent, STEPPER_INTL_PROVIDER, STEPPER_INTL_PROVIDER_FACTORY, SelectChange, ShowOnDirtyErrorStateMatcher, SlideRightComponent, SlideUpComponent, SortDirection, SortType, StageComponent, StepExecutorComponent, StepperErrorStateMatcher, StepperIntl, TABS_CONFIG, TAB_CONTENT, TAB_GROUP, TabBodyPortal, TabChangeEvent, TablePageComponent, TransitionCheckState, _ErrorStateTracker, _closeDialogVia, _countGroupLabelsBeforeOption, _getOptionScrollPosition, components, getMDAutocompleteMissingPanelError, getMDSelectDynamicMultipleError, getMDSelectNonArrayValueError, getMDSelectNonFunctionValueError, groupRowsByProperty, mefDevCardComponents, mefDevCollapseModuleComponents, sortRows };
16319
15394
  //# sourceMappingURL=natec-mef-dev-ui-kit.mjs.map