@piserve-tech/drop-down 1.2.108 → 1.2.110
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/README.md +39 -39
- package/assets/images/down_arrow.svg +7 -0
- package/assets/images/edit.svg +8 -0
- package/assets/images/view.svg +8 -0
- package/ng-package.json +7 -0
- package/package.json +16 -29
- package/src/lib/dropdown.component.html +236 -0
- package/src/lib/dropdown.component.scss +374 -0
- package/src/lib/dropdown.component.spec.ts +21 -0
- package/src/lib/dropdown.component.ts +226 -0
- package/{lib/dropdown.model.d.ts → src/lib/dropdown.model.ts} +7 -6
- package/src/lib/dropdown.module.ts +20 -0
- package/src/lib/dropdown.service.spec.ts +16 -0
- package/src/lib/dropdown.service.ts +9 -0
- package/{public-api.d.ts → src/public-api.ts} +7 -3
- package/tsconfig.lib.json +14 -0
- package/tsconfig.lib.prod.json +10 -0
- package/tsconfig.spec.json +14 -0
- package/esm2022/lib/dropdown.component.mjs +0 -211
- package/esm2022/lib/dropdown.model.mjs +0 -2
- package/esm2022/lib/dropdown.module.mjs +0 -28
- package/esm2022/lib/dropdown.service.mjs +0 -14
- package/esm2022/piserve-tech-drop-down.mjs +0 -5
- package/esm2022/public-api.mjs +0 -7
- package/fesm2022/piserve-tech-drop-down.mjs +0 -259
- package/fesm2022/piserve-tech-drop-down.mjs.map +0 -1
- package/index.d.ts +0 -5
- package/lib/dropdown.component.d.ts +0 -56
- package/lib/dropdown.module.d.ts +0 -9
- package/lib/dropdown.service.d.ts +0 -6
|
@@ -1,259 +0,0 @@
|
|
|
1
|
-
import * as i0 from '@angular/core';
|
|
2
|
-
import { Injectable, EventEmitter, Component, ViewEncapsulation, ChangeDetectionStrategy, Input, Output, ViewChild, HostListener, NgModule } from '@angular/core';
|
|
3
|
-
import { v4 } from 'uuid';
|
|
4
|
-
import * as i1 from '@angular/forms';
|
|
5
|
-
import { FormsModule } from '@angular/forms';
|
|
6
|
-
import * as i2 from '@angular/common';
|
|
7
|
-
import { CommonModule } from '@angular/common';
|
|
8
|
-
|
|
9
|
-
class DropdownService {
|
|
10
|
-
constructor() { }
|
|
11
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
12
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownService, providedIn: 'root' }); }
|
|
13
|
-
}
|
|
14
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownService, decorators: [{
|
|
15
|
-
type: Injectable,
|
|
16
|
-
args: [{
|
|
17
|
-
providedIn: 'root'
|
|
18
|
-
}]
|
|
19
|
-
}], ctorParameters: function () { return []; } });
|
|
20
|
-
|
|
21
|
-
class DropdownComponent {
|
|
22
|
-
set items(value) {
|
|
23
|
-
this._items = value || [];
|
|
24
|
-
this.originalItems = this._items.slice();
|
|
25
|
-
this._filteredItems = this._items.slice(); // use a separate variable for rendering
|
|
26
|
-
this.cdr.markForCheck();
|
|
27
|
-
}
|
|
28
|
-
get items() {
|
|
29
|
-
return this._items;
|
|
30
|
-
}
|
|
31
|
-
constructor(cdr) {
|
|
32
|
-
this.cdr = cdr;
|
|
33
|
-
this.selectedItems = [];
|
|
34
|
-
this.placeholder = "";
|
|
35
|
-
this.selectedValues = "";
|
|
36
|
-
this.customButtons = [];
|
|
37
|
-
this.showBorder = true;
|
|
38
|
-
this.disable = false;
|
|
39
|
-
this.buttonClick = new EventEmitter();
|
|
40
|
-
this.selectedItemsChange = new EventEmitter();
|
|
41
|
-
this.onDropdownScroll = new EventEmitter();
|
|
42
|
-
this.onCreateNew = new EventEmitter();
|
|
43
|
-
this.onSearch = new EventEmitter();
|
|
44
|
-
//subLabel
|
|
45
|
-
this.showSubLabel = false;
|
|
46
|
-
this.dropdownId = v4();
|
|
47
|
-
this.dropdownOpened = false;
|
|
48
|
-
this.selectedItemName = "";
|
|
49
|
-
this.selectedItemImage = "";
|
|
50
|
-
this.originalItems = [];
|
|
51
|
-
this.searchTerm = "";
|
|
52
|
-
this.initialized = false;
|
|
53
|
-
this.searchText = "";
|
|
54
|
-
this._filteredItems = [];
|
|
55
|
-
this._items = [];
|
|
56
|
-
}
|
|
57
|
-
ngOnInit() { }
|
|
58
|
-
ngOnChanges(changes) {
|
|
59
|
-
if (changes["selectedItems"]) {
|
|
60
|
-
const item = changes["selectedItems"]["currentValue"];
|
|
61
|
-
this.selectedItems = item;
|
|
62
|
-
this.selectedItemName = this.selectedItems[0]?.label;
|
|
63
|
-
this.selectedItemImage = this.selectedItems[0]?.image;
|
|
64
|
-
}
|
|
65
|
-
if (changes["items"]) {
|
|
66
|
-
this.initialize();
|
|
67
|
-
this.originalItems = this.items.slice();
|
|
68
|
-
this.cdr.markForCheck();
|
|
69
|
-
}
|
|
70
|
-
if (changes["selectedValues"]) {
|
|
71
|
-
this.selectedItemName = this.selectedValues;
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
initialize() {
|
|
75
|
-
setTimeout(() => {
|
|
76
|
-
if (this.selectedItems && this.selectedItems.length > 0) {
|
|
77
|
-
if (!this.multiple) {
|
|
78
|
-
this.searchText = "";
|
|
79
|
-
this.selectedItemName = this.selectedItems[0]?.label;
|
|
80
|
-
this.selectedItemImage = this.selectedItems[0]?.image;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}, 1000);
|
|
84
|
-
const uniqueItems = this.items.filter((selected, index, self) => index === self.findIndex((t) => t.value === selected.value));
|
|
85
|
-
this.items = uniqueItems;
|
|
86
|
-
}
|
|
87
|
-
openDropdown() {
|
|
88
|
-
this.dropdownOpened = !this.dropdownOpened;
|
|
89
|
-
const inputId = `searchInput-${this.dropdownId}`;
|
|
90
|
-
const inputEl = document.getElementById(inputId);
|
|
91
|
-
setTimeout(() => {
|
|
92
|
-
inputEl?.focus();
|
|
93
|
-
}, 0);
|
|
94
|
-
}
|
|
95
|
-
dropdownScroll(event) {
|
|
96
|
-
if (this.onDropdownScroll.observed) {
|
|
97
|
-
this.onDropdownScroll.emit(event);
|
|
98
|
-
this.cdr.markForCheck();
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
selectItem(item) {
|
|
102
|
-
if (this.multiple) {
|
|
103
|
-
if (!this.selectedItems.includes(item)) {
|
|
104
|
-
this.selectedItems.push(item);
|
|
105
|
-
this.selectedItemsChange.emit(this.selectedItems);
|
|
106
|
-
}
|
|
107
|
-
else {
|
|
108
|
-
this.selectedItems = this.selectedItems.filter((selected) => selected !== item);
|
|
109
|
-
this.selectedItemsChange.emit(this.selectedItems);
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
else {
|
|
113
|
-
this.searchText = "";
|
|
114
|
-
this.selectedItems[0] = item;
|
|
115
|
-
this.selectedItemName = this.selectedItems[0]?.label;
|
|
116
|
-
this.selectedItemImage = this.selectedItems[0]?.image;
|
|
117
|
-
this.dropdownOpened = false;
|
|
118
|
-
this.selectedItemsChange.emit(this.selectedItems);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
unselectItem(item) {
|
|
122
|
-
this.selectedItems = this.selectedItems.filter((selected) => selected !== item);
|
|
123
|
-
this.selectedItemsChange.emit(this.selectedItems);
|
|
124
|
-
}
|
|
125
|
-
unselectAll() {
|
|
126
|
-
this.selectedItems = [];
|
|
127
|
-
this.selectedItemName = "";
|
|
128
|
-
this.selectedItemImage = "";
|
|
129
|
-
this.selectedItemsChange.emit(this.selectedItems);
|
|
130
|
-
this.cdr.markForCheck();
|
|
131
|
-
}
|
|
132
|
-
onDocumentClick(event) {
|
|
133
|
-
const isClickInsideDropdown = this.dropdown.nativeElement.contains(event.target);
|
|
134
|
-
if (!isClickInsideDropdown) {
|
|
135
|
-
this.dropdownOpened = false;
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
createNew() {
|
|
139
|
-
this.onCreateNew.emit();
|
|
140
|
-
this.dropdownOpened = false;
|
|
141
|
-
}
|
|
142
|
-
search(event) {
|
|
143
|
-
const keyCode = event.keyCode;
|
|
144
|
-
this.dropdownOpened = true;
|
|
145
|
-
this.searchTerm = event.target.value.toLowerCase();
|
|
146
|
-
if (!this.onSearch.observed) {
|
|
147
|
-
if (this.searchTerm.trim() === "") {
|
|
148
|
-
if (!this.multiple) {
|
|
149
|
-
this.unselectAll();
|
|
150
|
-
}
|
|
151
|
-
this._filteredItems = this.originalItems.slice();
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
const lowerCaseSearchTerm = this.searchTerm.toLowerCase();
|
|
155
|
-
this._filteredItems = this.originalItems.filter((item) => item.label.toLowerCase().includes(lowerCaseSearchTerm) ||
|
|
156
|
-
(item.value &&
|
|
157
|
-
item.value.toLowerCase().includes(lowerCaseSearchTerm)));
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
else {
|
|
161
|
-
this.onSearch.emit(this.searchTerm);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
handleButtonClick(action) {
|
|
165
|
-
action();
|
|
166
|
-
this.buttonClick.emit();
|
|
167
|
-
}
|
|
168
|
-
highlightMatch(text) {
|
|
169
|
-
const search = this.searchText?.trim() || this.searchTerm?.trim();
|
|
170
|
-
if (!search || !text)
|
|
171
|
-
return text;
|
|
172
|
-
const index = text.toLowerCase().indexOf(search.toLowerCase());
|
|
173
|
-
if (index === -1)
|
|
174
|
-
return text;
|
|
175
|
-
const before = text.substring(0, index);
|
|
176
|
-
const match = text.substring(index, index + search.length);
|
|
177
|
-
const after = text.substring(index + search.length);
|
|
178
|
-
return `${before}<span class="highlight-text">${match}</span>${after}`;
|
|
179
|
-
}
|
|
180
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
181
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: DropdownComponent, selector: "lib-dropdown", inputs: { multiple: "multiple", selectedItems: "selectedItems", placeholder: "placeholder", showCreateNew: "showCreateNew", selectedValues: "selectedValues", customButtons: "customButtons", showBorder: "showBorder", disable: "disable", showSubLabel: "showSubLabel", items: "items" }, outputs: { buttonClick: "buttonClick", selectedItemsChange: "selectedItemsChange", onDropdownScroll: "onDropdownScroll", onCreateNew: "onCreateNew", onSearch: "onSearch" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, viewQueries: [{ propertyName: "dropdownitems", first: true, predicate: ["dropdownItems"], descendants: true }, { propertyName: "dropdown", first: true, predicate: ["dropdown"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div\n #dropdown\n class=\"dropdown\"\n [ngClass]=\"{\n opened: showBorder && dropdownOpened,\n closed: showBorder && !dropdownOpened,\n 'dropdown-disabled': disable\n }\"\n>\n <div\n class=\"dropdown-field\"\n id=\"division\"\n [ngClass]=\"{\n opened: showBorder && dropdownOpened,\n closed: showBorder && !dropdownOpened,\n }\"\n (click)=\"openDropdown()\"\n >\n <!-- <div *ngIf=\"selectedValues !== '' && !selectedItemName\" class=\"selected\">\n {{ selectedValues }}\n </div> -->\n <div class=\"flexSection\">\n <div class=\"dataSection\" *ngIf=\"!selectedItem && multiple\">\n <div class=\"selected selectedList\">\n <ng-container *ngFor=\"let selectedItem of selectedItems\">\n <div class=\"selected-item\">\n <img\n *ngIf=\"selectedItem?.image\"\n class=\"multiSelected-icon-size\"\n [src]=\"selectedItem?.image\"\n alt=\"image\"\n />\n <span>{{ selectedItem.label }}</span>\n <span (click)=\"unselectItem(selectedItem)\" class=\"close-icon\"\n >×</span\n >\n </div>\n </ng-container>\n\n <div class=\"input-field\">\n <input\n [id]=\"'searchInput-' + dropdownId\"\n class=\"dropdown_text inline-input\"\n [(ngModel)]=\"searchText\"\n [placeholder]=\"placeholder\"\n (input)=\"search($event)\"\n />\n </div>\n </div>\n </div>\n <div class=\"dataSection single-input\" *ngIf=\"!multiple\">\n <div class=\"input-field\">\n <div class=\"input-with-icon\">\n <img\n *ngIf=\"selectedItemImage\"\n class=\"selected-icon-size\"\n [src]=\"selectedItemImage\"\n alt=\"image\"\n />\n <input\n [id]=\"'searchInput-' + dropdownId\"\n class=\"dropdown_text inline-input\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"selectedItemName\"\n (input)=\"search($event)\"\n />\n </div>\n </div>\n </div>\n <div class=\"iconSection\">\n <div class=\"dropdown-icons-container\">\n <div>\n <span\n (click)=\"unselectAll()\"\n *ngIf=\"selectedItems.length > 0 && multiple\"\n class=\"deselect\"\n >×\n </span>\n </div>\n <div\n class=\"dropdown-down-arrow\"\n [ngClass]=\"{ opened: dropdownOpened, closed: !dropdownOpened }\"\n >\n <svg\n width=\"1em\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"down-arrow-img\"\n >\n <g id=\"Down Arrow\">\n <g id=\"Group\">\n <path\n id=\"Path\"\n d=\"M6 9.13741L12 15.229L18 9.13741\"\n stroke=\"#8E9AA0\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </g>\n </g>\n </svg>\n </div>\n <div\n class=\"dropdown-up-arrow\"\n [ngClass]=\"{ opened: dropdownOpened, closed: !dropdownOpened }\"\n >\n <svg\n width=\"1em\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"up-arrow-img\"\n >\n <path\n d=\"M18 15.229L12 9.1374L6 15.229\"\n stroke=\"#8E9AA0\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n #dropdownItems\n class=\"dropdown-items\"\n *ngIf=\"dropdownOpened\"\n (scroll)=\"dropdownScroll($event)\"\n >\n <div (click)=\"createNew()\">\n <a class=\"create_button\" *ngIf=\"showCreateNew\">Create new</a>\n </div>\n <ng-container *ngIf=\"items.length > 0; else noDataAvailable\">\n <ng-container *ngIf=\"multiple; else singleSelection\">\n <a\n [ngClass]=\"{\n compact: !item?.image && !item?.subLabel,\n expanded: item?.image || item?.subLabel\n }\"\n class=\"items d-block\"\n *ngFor=\"let item of _filteredItems\"\n (click)=\"selectItem(item)\"\n >\n <div class=\"dropdown-item\">\n <div class=\"item-details\">\n <div class=\"content-wrapper\">\n <img\n *ngIf=\"item?.image\"\n [src]=\"item?.image\"\n alt=\"Item Image\"\n class=\"item-image icon-size\"\n />\n <div class=\"text-content\">\n <div\n class=\"item-label\"\n [innerHTML]=\"highlightMatch(item.label)\"\n ></div>\n <div *ngIf=\"showSubLabel\" class=\"item-sublabel\">\n {{ item?.subLabel }}\n </div>\n </div>\n </div>\n <div\n class=\"dropdown_buttons\"\n [class.empty]=\"customButtons.length === 0\"\n >\n <button\n *ngFor=\"let button of customButtons\"\n (click)=\"handleButtonClick(button.action)\"\n >\n <i [class]=\"button.icon\" [style.color]=\"button.color\"></i>\n </button>\n </div>\n </div>\n </div>\n </a>\n </ng-container>\n\n <ng-template #singleSelection>\n <a\n class=\"items d-block\"\n [ngClass]=\"{\n compact: !item?.image && !item?.subLabel,\n expanded: item?.image || item?.subLabel\n }\"\n *ngFor=\"let item of _filteredItems\"\n (click)=\"selectItem(item)\"\n >\n <div class=\"dropdown-item\">\n <div class=\"item-details\">\n <div class=\"content-wrapper\">\n <img\n *ngIf=\"item?.image\"\n [src]=\"item?.image\"\n alt=\"Item Image\"\n class=\"item-image icon-size\"\n />\n <div class=\"text-content\">\n <div\n class=\"item-label\"\n [innerHTML]=\"highlightMatch(item.label)\"\n ></div>\n <div *ngIf=\"showSubLabel\" class=\"item-sublabel\">\n {{ item?.subLabel }}\n </div>\n </div>\n </div>\n <div\n class=\"dropdown_buttons\"\n [class.empty]=\"customButtons.length === 0\"\n >\n <button\n *ngFor=\"let button of customButtons\"\n (click)=\"handleButtonClick(button.action)\"\n >\n <i [class]=\"button.icon\" [style.color]=\"button.color\"></i>\n </button>\n </div>\n </div>\n </div>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- \"No data available\" message if the drop down is empty -->\n <ng-template #noDataAvailable>\n <div class=\"items\">No data available</div>\n </ng-template>\n </div>\n</div>\n", styles: [".dropdown{background:#fff;border-radius:6px}.dropdown .dropdown-field{background:#fff;border-radius:6px;position:relative;cursor:pointer}.dropdown .dropdown-field .selected.selectedList{display:flex;flex-wrap:wrap;max-height:80px;overflow-y:auto;overflow-x:hidden}.dropdown .dropdown-field .selected .selected-item{background:#e3e3da;display:inline;margin:5px;padding:2px;border-radius:5px;font-size:small}.dropdown .dropdown-field .selected .remaining-items{margin:5px;padding:2px;font-size:smaller;display:block}.dropdown .dropdown-field .input-field .dropdown_text{width:100%;border:none;padding:2px;margin-left:3px;margin-right:3px;outline:none;box-sizing:border-box;font-style:normal}@media (max-width: 576px){.dropdown .dropdown-field .input-field .dropdown_text{width:53%;margin-left:3px;padding-left:2px}}@media (max-width: 420px){.dropdown .dropdown-field .input-field .dropdown_text{width:53%;margin-left:3px;padding-left:2px}}@media only screen and (min-width: 576px){.dropdown .dropdown-field .input-field .dropdown_text{height:25px}}@media only screen and (min-width: 992px){.dropdown .dropdown-field .input-field .dropdown_text{height:30px}}@media only screen and (min-width: 1200px){.dropdown .dropdown-field .input-field .dropdown_text{height:35px}}.dropdown .dropdown-field.closed{border:1px solid #d8d8d8}.dropdown .dropdown-field.opened{border-bottom:1px solid #d8d8d8}.dropdown .dropdown-items{overflow-y:auto;overflow-x:auto;position:absolute!important;top:100%;left:0;width:100%;background:#fff;z-index:9999999;border:solid 1px #dbdbdb;box-shadow:0 4px 4px -5px #00000040;transition:transform .3s ease-out;scroll-behavior:smooth;cursor:pointer}@media only screen and (min-width: 276px){.dropdown .dropdown-items{max-height:150px;padding:3px}}@media only screen and (min-width: 576px){.dropdown .dropdown-items{max-height:150px;padding:3px}}@media only screen and (min-width: 992px){.dropdown .dropdown-items{max-height:150px;padding:5px}}@media only screen and (min-width: 1441px){.dropdown .dropdown-items{max-height:200px;padding:7px}}.dropdown .dropdown-items .create_button{text-decoration:none;cursor:pointer}@media only screen and (min-width: 576px){.dropdown .dropdown-items .create_button{padding-left:8px}}@media only screen and (min-width: 992px){.dropdown .dropdown-items .create_button{padding-left:8px}}@media only screen and (min-width: 1200px){.dropdown .dropdown-items .create_button{padding-left:8px}}.dropdown .dropdown-items .items{text-decoration:none;color:inherit;position:relative;cursor:pointer}@media only screen and (min-width: 576px){.dropdown .dropdown-items .items{padding-left:8px;font-size:small}}@media only screen and (min-width: 992px){.dropdown .dropdown-items .items{padding-left:8px}}@media only screen and (min-width: 1200px){.dropdown .dropdown-items .items{padding-left:8px;font-size:small}}.dropdown .dropdown-items .items:hover{background:#ebedef;border-radius:6px}.dropdown .dropdown-items .items:hover button{visibility:visible}.dropdown .dropdown-items .items .dropdown_buttons{display:inline}.dropdown .dropdown-items .items button{border:0;background:transparent;visibility:hidden}.dropdown.opened{border:1px #d8d8d8 solid}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#b2b2b2;border-radius:6px}.space{width:10px}.icon-size{width:30px;height:30px;margin-right:7px}.smallSpace{width:3px}.selected-icon-size{width:25px;height:20px;margin-left:10px}@media (max-width: 576px){.selected-icon-size{width:21px;height:15px;margin-right:7px;margin-bottom:1px}}.multiSelected-icon-size{width:25px;height:20px;margin-left:1px;margin-bottom:1px;margin-right:3px}.flexSection{display:flex;justify-content:space-between}.dropdown-down-arrow,.dropdown-up-arrow,.deselect{width:20px;height:20px;display:flex;align-items:center;justify-content:center;cursor:pointer}.dropdown-down-arrow{cursor:pointer}.dropdown-down-arrow.opened{display:none}.dropdown-down-arrow.closed{display:block}.dropdown-up-arrow{cursor:pointer}.dropdown-up-arrow.closed{display:none}.close-icon{margin-left:8px;margin-right:5px}.iconSection{display:flex;flex-direction:row-reverse;padding:1px;position:relative;justify-content:center;align-items:center}.dropdown-icons-container{display:flex;gap:10px}.item-details{display:flex;align-items:center;justify-content:space-between}.content-wrapper{display:flex;align-items:center;gap:8px;flex:1}.text-content{display:flex;flex-direction:column}.item-label{font-size:14px;font-weight:400;line-height:1.3}.item-sublabel{font-size:11px;color:#666;line-height:1.2}.dropdown_buttons{display:flex;gap:4px}.dropdown_buttons.empty:after{content:\"\";display:inline-block;width:4px;height:1px}.compact{line-height:32px}.expanded{line-height:41px}.input-field{width:100%}.input-with-icon{display:flex;align-items:center;gap:8px;width:100%}.selected-icon-size{width:20px;height:20px;flex-shrink:0}.dropdown_text.inline-input{flex:1;border:none;outline:none;padding:0;background:transparent;font-family:inherit;font-size:inherit;color:inherit}.single-input{width:80%;white-space:nowrap}.item-label{font-size:14px;line-height:1.4;color:#333}.highlight-text{font-weight:600;background-repeat:no-repeat;background-size:100% .3em;background-position:0 88%;padding:.1em .05em;border-radius:2px;color:#1a1a1a;transition:all .2s ease-in-out}.dropdown.dropdown-disabled .dropdown-field .input-field .dropdown_text,.dropdown.dropdown-disabled .dropdown-field{background:#e9ecef!important;pointer-events:none}\n"], dependencies: [{ kind: "directive", type: i1.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: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
|
182
|
-
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownComponent, decorators: [{
|
|
184
|
-
type: Component,
|
|
185
|
-
args: [{ selector: "lib-dropdown", encapsulation: ViewEncapsulation.None, changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n #dropdown\n class=\"dropdown\"\n [ngClass]=\"{\n opened: showBorder && dropdownOpened,\n closed: showBorder && !dropdownOpened,\n 'dropdown-disabled': disable\n }\"\n>\n <div\n class=\"dropdown-field\"\n id=\"division\"\n [ngClass]=\"{\n opened: showBorder && dropdownOpened,\n closed: showBorder && !dropdownOpened,\n }\"\n (click)=\"openDropdown()\"\n >\n <!-- <div *ngIf=\"selectedValues !== '' && !selectedItemName\" class=\"selected\">\n {{ selectedValues }}\n </div> -->\n <div class=\"flexSection\">\n <div class=\"dataSection\" *ngIf=\"!selectedItem && multiple\">\n <div class=\"selected selectedList\">\n <ng-container *ngFor=\"let selectedItem of selectedItems\">\n <div class=\"selected-item\">\n <img\n *ngIf=\"selectedItem?.image\"\n class=\"multiSelected-icon-size\"\n [src]=\"selectedItem?.image\"\n alt=\"image\"\n />\n <span>{{ selectedItem.label }}</span>\n <span (click)=\"unselectItem(selectedItem)\" class=\"close-icon\"\n >×</span\n >\n </div>\n </ng-container>\n\n <div class=\"input-field\">\n <input\n [id]=\"'searchInput-' + dropdownId\"\n class=\"dropdown_text inline-input\"\n [(ngModel)]=\"searchText\"\n [placeholder]=\"placeholder\"\n (input)=\"search($event)\"\n />\n </div>\n </div>\n </div>\n <div class=\"dataSection single-input\" *ngIf=\"!multiple\">\n <div class=\"input-field\">\n <div class=\"input-with-icon\">\n <img\n *ngIf=\"selectedItemImage\"\n class=\"selected-icon-size\"\n [src]=\"selectedItemImage\"\n alt=\"image\"\n />\n <input\n [id]=\"'searchInput-' + dropdownId\"\n class=\"dropdown_text inline-input\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"selectedItemName\"\n (input)=\"search($event)\"\n />\n </div>\n </div>\n </div>\n <div class=\"iconSection\">\n <div class=\"dropdown-icons-container\">\n <div>\n <span\n (click)=\"unselectAll()\"\n *ngIf=\"selectedItems.length > 0 && multiple\"\n class=\"deselect\"\n >×\n </span>\n </div>\n <div\n class=\"dropdown-down-arrow\"\n [ngClass]=\"{ opened: dropdownOpened, closed: !dropdownOpened }\"\n >\n <svg\n width=\"1em\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"down-arrow-img\"\n >\n <g id=\"Down Arrow\">\n <g id=\"Group\">\n <path\n id=\"Path\"\n d=\"M6 9.13741L12 15.229L18 9.13741\"\n stroke=\"#8E9AA0\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </g>\n </g>\n </svg>\n </div>\n <div\n class=\"dropdown-up-arrow\"\n [ngClass]=\"{ opened: dropdownOpened, closed: !dropdownOpened }\"\n >\n <svg\n width=\"1em\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"up-arrow-img\"\n >\n <path\n d=\"M18 15.229L12 9.1374L6 15.229\"\n stroke=\"#8E9AA0\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n #dropdownItems\n class=\"dropdown-items\"\n *ngIf=\"dropdownOpened\"\n (scroll)=\"dropdownScroll($event)\"\n >\n <div (click)=\"createNew()\">\n <a class=\"create_button\" *ngIf=\"showCreateNew\">Create new</a>\n </div>\n <ng-container *ngIf=\"items.length > 0; else noDataAvailable\">\n <ng-container *ngIf=\"multiple; else singleSelection\">\n <a\n [ngClass]=\"{\n compact: !item?.image && !item?.subLabel,\n expanded: item?.image || item?.subLabel\n }\"\n class=\"items d-block\"\n *ngFor=\"let item of _filteredItems\"\n (click)=\"selectItem(item)\"\n >\n <div class=\"dropdown-item\">\n <div class=\"item-details\">\n <div class=\"content-wrapper\">\n <img\n *ngIf=\"item?.image\"\n [src]=\"item?.image\"\n alt=\"Item Image\"\n class=\"item-image icon-size\"\n />\n <div class=\"text-content\">\n <div\n class=\"item-label\"\n [innerHTML]=\"highlightMatch(item.label)\"\n ></div>\n <div *ngIf=\"showSubLabel\" class=\"item-sublabel\">\n {{ item?.subLabel }}\n </div>\n </div>\n </div>\n <div\n class=\"dropdown_buttons\"\n [class.empty]=\"customButtons.length === 0\"\n >\n <button\n *ngFor=\"let button of customButtons\"\n (click)=\"handleButtonClick(button.action)\"\n >\n <i [class]=\"button.icon\" [style.color]=\"button.color\"></i>\n </button>\n </div>\n </div>\n </div>\n </a>\n </ng-container>\n\n <ng-template #singleSelection>\n <a\n class=\"items d-block\"\n [ngClass]=\"{\n compact: !item?.image && !item?.subLabel,\n expanded: item?.image || item?.subLabel\n }\"\n *ngFor=\"let item of _filteredItems\"\n (click)=\"selectItem(item)\"\n >\n <div class=\"dropdown-item\">\n <div class=\"item-details\">\n <div class=\"content-wrapper\">\n <img\n *ngIf=\"item?.image\"\n [src]=\"item?.image\"\n alt=\"Item Image\"\n class=\"item-image icon-size\"\n />\n <div class=\"text-content\">\n <div\n class=\"item-label\"\n [innerHTML]=\"highlightMatch(item.label)\"\n ></div>\n <div *ngIf=\"showSubLabel\" class=\"item-sublabel\">\n {{ item?.subLabel }}\n </div>\n </div>\n </div>\n <div\n class=\"dropdown_buttons\"\n [class.empty]=\"customButtons.length === 0\"\n >\n <button\n *ngFor=\"let button of customButtons\"\n (click)=\"handleButtonClick(button.action)\"\n >\n <i [class]=\"button.icon\" [style.color]=\"button.color\"></i>\n </button>\n </div>\n </div>\n </div>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- \"No data available\" message if the drop down is empty -->\n <ng-template #noDataAvailable>\n <div class=\"items\">No data available</div>\n </ng-template>\n </div>\n</div>\n", styles: [".dropdown{background:#fff;border-radius:6px}.dropdown .dropdown-field{background:#fff;border-radius:6px;position:relative;cursor:pointer}.dropdown .dropdown-field .selected.selectedList{display:flex;flex-wrap:wrap;max-height:80px;overflow-y:auto;overflow-x:hidden}.dropdown .dropdown-field .selected .selected-item{background:#e3e3da;display:inline;margin:5px;padding:2px;border-radius:5px;font-size:small}.dropdown .dropdown-field .selected .remaining-items{margin:5px;padding:2px;font-size:smaller;display:block}.dropdown .dropdown-field .input-field .dropdown_text{width:100%;border:none;padding:2px;margin-left:3px;margin-right:3px;outline:none;box-sizing:border-box;font-style:normal}@media (max-width: 576px){.dropdown .dropdown-field .input-field .dropdown_text{width:53%;margin-left:3px;padding-left:2px}}@media (max-width: 420px){.dropdown .dropdown-field .input-field .dropdown_text{width:53%;margin-left:3px;padding-left:2px}}@media only screen and (min-width: 576px){.dropdown .dropdown-field .input-field .dropdown_text{height:25px}}@media only screen and (min-width: 992px){.dropdown .dropdown-field .input-field .dropdown_text{height:30px}}@media only screen and (min-width: 1200px){.dropdown .dropdown-field .input-field .dropdown_text{height:35px}}.dropdown .dropdown-field.closed{border:1px solid #d8d8d8}.dropdown .dropdown-field.opened{border-bottom:1px solid #d8d8d8}.dropdown .dropdown-items{overflow-y:auto;overflow-x:auto;position:absolute!important;top:100%;left:0;width:100%;background:#fff;z-index:9999999;border:solid 1px #dbdbdb;box-shadow:0 4px 4px -5px #00000040;transition:transform .3s ease-out;scroll-behavior:smooth;cursor:pointer}@media only screen and (min-width: 276px){.dropdown .dropdown-items{max-height:150px;padding:3px}}@media only screen and (min-width: 576px){.dropdown .dropdown-items{max-height:150px;padding:3px}}@media only screen and (min-width: 992px){.dropdown .dropdown-items{max-height:150px;padding:5px}}@media only screen and (min-width: 1441px){.dropdown .dropdown-items{max-height:200px;padding:7px}}.dropdown .dropdown-items .create_button{text-decoration:none;cursor:pointer}@media only screen and (min-width: 576px){.dropdown .dropdown-items .create_button{padding-left:8px}}@media only screen and (min-width: 992px){.dropdown .dropdown-items .create_button{padding-left:8px}}@media only screen and (min-width: 1200px){.dropdown .dropdown-items .create_button{padding-left:8px}}.dropdown .dropdown-items .items{text-decoration:none;color:inherit;position:relative;cursor:pointer}@media only screen and (min-width: 576px){.dropdown .dropdown-items .items{padding-left:8px;font-size:small}}@media only screen and (min-width: 992px){.dropdown .dropdown-items .items{padding-left:8px}}@media only screen and (min-width: 1200px){.dropdown .dropdown-items .items{padding-left:8px;font-size:small}}.dropdown .dropdown-items .items:hover{background:#ebedef;border-radius:6px}.dropdown .dropdown-items .items:hover button{visibility:visible}.dropdown .dropdown-items .items .dropdown_buttons{display:inline}.dropdown .dropdown-items .items button{border:0;background:transparent;visibility:hidden}.dropdown.opened{border:1px #d8d8d8 solid}::-webkit-scrollbar{width:6px;height:6px}::-webkit-scrollbar-track{background-color:transparent}::-webkit-scrollbar-thumb{background-color:#b2b2b2;border-radius:6px}.space{width:10px}.icon-size{width:30px;height:30px;margin-right:7px}.smallSpace{width:3px}.selected-icon-size{width:25px;height:20px;margin-left:10px}@media (max-width: 576px){.selected-icon-size{width:21px;height:15px;margin-right:7px;margin-bottom:1px}}.multiSelected-icon-size{width:25px;height:20px;margin-left:1px;margin-bottom:1px;margin-right:3px}.flexSection{display:flex;justify-content:space-between}.dropdown-down-arrow,.dropdown-up-arrow,.deselect{width:20px;height:20px;display:flex;align-items:center;justify-content:center;cursor:pointer}.dropdown-down-arrow{cursor:pointer}.dropdown-down-arrow.opened{display:none}.dropdown-down-arrow.closed{display:block}.dropdown-up-arrow{cursor:pointer}.dropdown-up-arrow.closed{display:none}.close-icon{margin-left:8px;margin-right:5px}.iconSection{display:flex;flex-direction:row-reverse;padding:1px;position:relative;justify-content:center;align-items:center}.dropdown-icons-container{display:flex;gap:10px}.item-details{display:flex;align-items:center;justify-content:space-between}.content-wrapper{display:flex;align-items:center;gap:8px;flex:1}.text-content{display:flex;flex-direction:column}.item-label{font-size:14px;font-weight:400;line-height:1.3}.item-sublabel{font-size:11px;color:#666;line-height:1.2}.dropdown_buttons{display:flex;gap:4px}.dropdown_buttons.empty:after{content:\"\";display:inline-block;width:4px;height:1px}.compact{line-height:32px}.expanded{line-height:41px}.input-field{width:100%}.input-with-icon{display:flex;align-items:center;gap:8px;width:100%}.selected-icon-size{width:20px;height:20px;flex-shrink:0}.dropdown_text.inline-input{flex:1;border:none;outline:none;padding:0;background:transparent;font-family:inherit;font-size:inherit;color:inherit}.single-input{width:80%;white-space:nowrap}.item-label{font-size:14px;line-height:1.4;color:#333}.highlight-text{font-weight:600;background-repeat:no-repeat;background-size:100% .3em;background-position:0 88%;padding:.1em .05em;border-radius:2px;color:#1a1a1a;transition:all .2s ease-in-out}.dropdown.dropdown-disabled .dropdown-field .input-field .dropdown_text,.dropdown.dropdown-disabled .dropdown-field{background:#e9ecef!important;pointer-events:none}\n"] }]
|
|
186
|
-
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { multiple: [{
|
|
187
|
-
type: Input
|
|
188
|
-
}], selectedItems: [{
|
|
189
|
-
type: Input
|
|
190
|
-
}], placeholder: [{
|
|
191
|
-
type: Input
|
|
192
|
-
}], showCreateNew: [{
|
|
193
|
-
type: Input
|
|
194
|
-
}], selectedValues: [{
|
|
195
|
-
type: Input
|
|
196
|
-
}], customButtons: [{
|
|
197
|
-
type: Input
|
|
198
|
-
}], showBorder: [{
|
|
199
|
-
type: Input
|
|
200
|
-
}], disable: [{
|
|
201
|
-
type: Input
|
|
202
|
-
}], buttonClick: [{
|
|
203
|
-
type: Output
|
|
204
|
-
}], selectedItemsChange: [{
|
|
205
|
-
type: Output
|
|
206
|
-
}], onDropdownScroll: [{
|
|
207
|
-
type: Output
|
|
208
|
-
}], onCreateNew: [{
|
|
209
|
-
type: Output
|
|
210
|
-
}], onSearch: [{
|
|
211
|
-
type: Output
|
|
212
|
-
}], showSubLabel: [{
|
|
213
|
-
type: Input
|
|
214
|
-
}], items: [{
|
|
215
|
-
type: Input
|
|
216
|
-
}], dropdownitems: [{
|
|
217
|
-
type: ViewChild,
|
|
218
|
-
args: ["dropdownItems"]
|
|
219
|
-
}], dropdown: [{
|
|
220
|
-
type: ViewChild,
|
|
221
|
-
args: ["dropdown"]
|
|
222
|
-
}], onDocumentClick: [{
|
|
223
|
-
type: HostListener,
|
|
224
|
-
args: ["document:click", ["$event"]]
|
|
225
|
-
}] } });
|
|
226
|
-
|
|
227
|
-
class DropdownModule {
|
|
228
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
229
|
-
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: DropdownModule, declarations: [DropdownComponent], imports: [FormsModule,
|
|
230
|
-
CommonModule], exports: [DropdownComponent] }); }
|
|
231
|
-
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownModule, imports: [FormsModule,
|
|
232
|
-
CommonModule] }); }
|
|
233
|
-
}
|
|
234
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: DropdownModule, decorators: [{
|
|
235
|
-
type: NgModule,
|
|
236
|
-
args: [{
|
|
237
|
-
declarations: [
|
|
238
|
-
DropdownComponent
|
|
239
|
-
],
|
|
240
|
-
imports: [
|
|
241
|
-
FormsModule,
|
|
242
|
-
CommonModule,
|
|
243
|
-
],
|
|
244
|
-
exports: [
|
|
245
|
-
DropdownComponent
|
|
246
|
-
]
|
|
247
|
-
}]
|
|
248
|
-
}] });
|
|
249
|
-
|
|
250
|
-
/*
|
|
251
|
-
* Public API Surface of dropdown
|
|
252
|
-
*/
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Generated bundle index. Do not edit.
|
|
256
|
-
*/
|
|
257
|
-
|
|
258
|
-
export { DropdownComponent, DropdownModule, DropdownService };
|
|
259
|
-
//# sourceMappingURL=piserve-tech-drop-down.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"piserve-tech-drop-down.mjs","sources":["../../../projects/dropdown/src/lib/dropdown.service.ts","../../../projects/dropdown/src/lib/dropdown.component.ts","../../../projects/dropdown/src/lib/dropdown.component.html","../../../projects/dropdown/src/lib/dropdown.module.ts","../../../projects/dropdown/src/public-api.ts","../../../projects/dropdown/src/piserve-tech-drop-down.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class DropdownService {\n\n constructor() { }\n}\n","import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n HostListener,\n Input,\n OnInit,\n Output,\n SimpleChanges,\n ViewChild,\n ViewEncapsulation,\n} from \"@angular/core\";\nimport { DropdownItem } from \"./dropdown.model\";\nimport { v4 as uuidv4 } from 'uuid';\n\n@Component({\n selector: \"lib-dropdown\",\n templateUrl: \"./dropdown.component.html\",\n styleUrls: [\"./dropdown.component.scss\"],\n encapsulation: ViewEncapsulation.None,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class DropdownComponent implements OnInit {\n @Input() multiple!: boolean;\n @Input() selectedItems: any[] = [];\n @Input() placeholder: String = \"\";\n @Input() showCreateNew!: boolean;\n @Input() selectedValues: string = \"\";\n @Input() customButtons: {\n label: string;\n icon: string;\n color: string;\n action: () => void;\n }[] = [];\n @Input() showBorder: boolean = true;\n @Input() disable: boolean = false;\n @Output() buttonClick: EventEmitter<Event> = new EventEmitter<Event>();\n @Output() selectedItemsChange: EventEmitter<any[]> = new EventEmitter<\n any[]\n >();\n @Output() onDropdownScroll: EventEmitter<Event> = new EventEmitter<Event>();\n @Output() onCreateNew: EventEmitter<Event> = new EventEmitter<Event>();\n @Output() onSearch: EventEmitter<string> = new EventEmitter<string>();\n //subLabel\n @Input() showSubLabel: boolean = false;\n dropdownId = uuidv4();\n dropdownOpened: boolean = false;\n selectedItem: any;\n selectedItemName: string = \"\";\n selectedItemImage: string = \"\";\n originalItems: DropdownItem[] = [];\n searchTerm: string = \"\";\n initialized: boolean = false;\n searchText: string = \"\";\n _filteredItems: DropdownItem[] = [];\n\n private _items: DropdownItem[] = [];\n\n @Input()\n set items(value: DropdownItem[]) {\n this._items = value || [];\n this.originalItems = this._items.slice();\n this._filteredItems = this._items.slice(); // use a separate variable for rendering\n this.cdr.markForCheck();\n }\n get items(): DropdownItem[] {\n return this._items;\n }\n\n constructor(private cdr: ChangeDetectorRef) {}\n\n ngOnInit(): void {}\n\n\n\n ngOnChanges(changes: SimpleChanges) {\n if (changes[\"selectedItems\"]) {\n const item = changes[\"selectedItems\"][\"currentValue\"];\n this.selectedItems = item;\n this.selectedItemName = this.selectedItems[0]?.label;\n this.selectedItemImage = this.selectedItems[0]?.image;\n }\n if (changes[\"items\"]) {\n this.initialize();\n this.originalItems = this.items.slice();\n this.cdr.markForCheck();\n }\n if (changes[\"selectedValues\"]) {\n this.selectedItemName = this.selectedValues;\n }\n }\n\n initialize() {\n setTimeout(() => {\n if (this.selectedItems && this.selectedItems.length > 0) {\n if (!this.multiple) {\n this.searchText = \"\";\n this.selectedItemName = this.selectedItems[0]?.label;\n this.selectedItemImage = this.selectedItems[0]?.image;\n }\n }\n }, 1000);\n const uniqueItems = this.items.filter(\n (selected, index, self) =>\n index === self.findIndex((t) => t.value === selected.value)\n );\n\n this.items = uniqueItems;\n }\n\n openDropdown() {\n this.dropdownOpened = !this.dropdownOpened;\n const inputId = `searchInput-${this.dropdownId}`;\n const inputEl = document.getElementById(inputId);\n setTimeout(() => {\n inputEl?.focus();\n }, 0);\n \n }\n\n @ViewChild(\"dropdownItems\") dropdownitems!: ElementRef<any>;\n dropdownScroll(event: any): void {\n if (this.onDropdownScroll.observed) {\n this.onDropdownScroll.emit(event);\n this.cdr.markForCheck();\n }\n }\n\n selectItem(item: any) {\n if (this.multiple) {\n if (!this.selectedItems.includes(item)) {\n this.selectedItems.push(item);\n this.selectedItemsChange.emit(this.selectedItems);\n } else {\n this.selectedItems = this.selectedItems.filter(\n (selected: any) => selected !== item\n );\n this.selectedItemsChange.emit(this.selectedItems);\n }\n } else {\n this.searchText = \"\";\n this.selectedItems[0] = item;\n this.selectedItemName = this.selectedItems[0]?.label;\n this.selectedItemImage = this.selectedItems[0]?.image;\n this.dropdownOpened = false;\n this.selectedItemsChange.emit(this.selectedItems);\n }\n }\n\n unselectItem(item: any): void {\n this.selectedItems = this.selectedItems.filter(\n (selected: any) => selected !== item\n );\n this.selectedItemsChange.emit(this.selectedItems);\n }\n\n unselectAll() {\n this.selectedItems = [];\n this.selectedItemName = \"\";\n this.selectedItemImage = \"\";\n this.selectedItemsChange.emit(this.selectedItems);\n this.cdr.markForCheck();\n }\n\n @ViewChild(\"dropdown\") dropdown!: ElementRef;\n @HostListener(\"document:click\", [\"$event\"])\n onDocumentClick(event: Event): void {\n const isClickInsideDropdown = this.dropdown.nativeElement.contains(\n event.target\n );\n\n if (!isClickInsideDropdown) {\n this.dropdownOpened = false;\n }\n }\n\n createNew() {\n this.onCreateNew.emit();\n this.dropdownOpened = false;\n }\n\n search(event: any): void {\n const keyCode = event.keyCode;\n this.dropdownOpened = true;\n this.searchTerm = event.target.value.toLowerCase();\n if (!this.onSearch.observed) {\n if (this.searchTerm.trim() === \"\") {\n if (!this.multiple) {\n this.unselectAll();\n }\n this._filteredItems = this.originalItems.slice();\n } else {\n const lowerCaseSearchTerm = this.searchTerm.toLowerCase();\n this._filteredItems = this.originalItems.filter(\n (item) =>\n item.label.toLowerCase().includes(lowerCaseSearchTerm) ||\n (item.value &&\n item.value.toLowerCase().includes(lowerCaseSearchTerm))\n );\n }\n } else {\n this.onSearch.emit(this.searchTerm);\n }\n }\n\n handleButtonClick(action: () => void): void {\n action();\n this.buttonClick.emit();\n }\n\n highlightMatch(text: string): string {\n const search = this.searchText?.trim() || this.searchTerm?.trim();\n if (!search || !text) return text;\n\n const index = text.toLowerCase().indexOf(search.toLowerCase());\n if (index === -1) return text;\n\n const before = text.substring(0, index);\n const match = text.substring(index, index + search.length);\n const after = text.substring(index + search.length);\n\n return `${before}<span class=\"highlight-text\">${match}</span>${after}`;\n }\n}\n","<div\n #dropdown\n class=\"dropdown\"\n [ngClass]=\"{\n opened: showBorder && dropdownOpened,\n closed: showBorder && !dropdownOpened,\n 'dropdown-disabled': disable\n }\"\n>\n <div\n class=\"dropdown-field\"\n id=\"division\"\n [ngClass]=\"{\n opened: showBorder && dropdownOpened,\n closed: showBorder && !dropdownOpened,\n }\"\n (click)=\"openDropdown()\"\n >\n <!-- <div *ngIf=\"selectedValues !== '' && !selectedItemName\" class=\"selected\">\n {{ selectedValues }}\n </div> -->\n <div class=\"flexSection\">\n <div class=\"dataSection\" *ngIf=\"!selectedItem && multiple\">\n <div class=\"selected selectedList\">\n <ng-container *ngFor=\"let selectedItem of selectedItems\">\n <div class=\"selected-item\">\n <img\n *ngIf=\"selectedItem?.image\"\n class=\"multiSelected-icon-size\"\n [src]=\"selectedItem?.image\"\n alt=\"image\"\n />\n <span>{{ selectedItem.label }}</span>\n <span (click)=\"unselectItem(selectedItem)\" class=\"close-icon\"\n >×</span\n >\n </div>\n </ng-container>\n\n <div class=\"input-field\">\n <input\n [id]=\"'searchInput-' + dropdownId\"\n class=\"dropdown_text inline-input\"\n [(ngModel)]=\"searchText\"\n [placeholder]=\"placeholder\"\n (input)=\"search($event)\"\n />\n </div>\n </div>\n </div>\n <div class=\"dataSection single-input\" *ngIf=\"!multiple\">\n <div class=\"input-field\">\n <div class=\"input-with-icon\">\n <img\n *ngIf=\"selectedItemImage\"\n class=\"selected-icon-size\"\n [src]=\"selectedItemImage\"\n alt=\"image\"\n />\n <input\n [id]=\"'searchInput-' + dropdownId\"\n class=\"dropdown_text inline-input\"\n [placeholder]=\"placeholder\"\n [(ngModel)]=\"selectedItemName\"\n (input)=\"search($event)\"\n />\n </div>\n </div>\n </div>\n <div class=\"iconSection\">\n <div class=\"dropdown-icons-container\">\n <div>\n <span\n (click)=\"unselectAll()\"\n *ngIf=\"selectedItems.length > 0 && multiple\"\n class=\"deselect\"\n >×\n </span>\n </div>\n <div\n class=\"dropdown-down-arrow\"\n [ngClass]=\"{ opened: dropdownOpened, closed: !dropdownOpened }\"\n >\n <svg\n width=\"1em\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"down-arrow-img\"\n >\n <g id=\"Down Arrow\">\n <g id=\"Group\">\n <path\n id=\"Path\"\n d=\"M6 9.13741L12 15.229L18 9.13741\"\n stroke=\"#8E9AA0\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </g>\n </g>\n </svg>\n </div>\n <div\n class=\"dropdown-up-arrow\"\n [ngClass]=\"{ opened: dropdownOpened, closed: !dropdownOpened }\"\n >\n <svg\n width=\"1em\"\n viewBox=\"0 0 24 25\"\n fill=\"none\"\n xmlns=\"http://www.w3.org/2000/svg\"\n class=\"up-arrow-img\"\n >\n <path\n d=\"M18 15.229L12 9.1374L6 15.229\"\n stroke=\"#8E9AA0\"\n stroke-width=\"1.5\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n />\n </svg>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div\n #dropdownItems\n class=\"dropdown-items\"\n *ngIf=\"dropdownOpened\"\n (scroll)=\"dropdownScroll($event)\"\n >\n <div (click)=\"createNew()\">\n <a class=\"create_button\" *ngIf=\"showCreateNew\">Create new</a>\n </div>\n <ng-container *ngIf=\"items.length > 0; else noDataAvailable\">\n <ng-container *ngIf=\"multiple; else singleSelection\">\n <a\n [ngClass]=\"{\n compact: !item?.image && !item?.subLabel,\n expanded: item?.image || item?.subLabel\n }\"\n class=\"items d-block\"\n *ngFor=\"let item of _filteredItems\"\n (click)=\"selectItem(item)\"\n >\n <div class=\"dropdown-item\">\n <div class=\"item-details\">\n <div class=\"content-wrapper\">\n <img\n *ngIf=\"item?.image\"\n [src]=\"item?.image\"\n alt=\"Item Image\"\n class=\"item-image icon-size\"\n />\n <div class=\"text-content\">\n <div\n class=\"item-label\"\n [innerHTML]=\"highlightMatch(item.label)\"\n ></div>\n <div *ngIf=\"showSubLabel\" class=\"item-sublabel\">\n {{ item?.subLabel }}\n </div>\n </div>\n </div>\n <div\n class=\"dropdown_buttons\"\n [class.empty]=\"customButtons.length === 0\"\n >\n <button\n *ngFor=\"let button of customButtons\"\n (click)=\"handleButtonClick(button.action)\"\n >\n <i [class]=\"button.icon\" [style.color]=\"button.color\"></i>\n </button>\n </div>\n </div>\n </div>\n </a>\n </ng-container>\n\n <ng-template #singleSelection>\n <a\n class=\"items d-block\"\n [ngClass]=\"{\n compact: !item?.image && !item?.subLabel,\n expanded: item?.image || item?.subLabel\n }\"\n *ngFor=\"let item of _filteredItems\"\n (click)=\"selectItem(item)\"\n >\n <div class=\"dropdown-item\">\n <div class=\"item-details\">\n <div class=\"content-wrapper\">\n <img\n *ngIf=\"item?.image\"\n [src]=\"item?.image\"\n alt=\"Item Image\"\n class=\"item-image icon-size\"\n />\n <div class=\"text-content\">\n <div\n class=\"item-label\"\n [innerHTML]=\"highlightMatch(item.label)\"\n ></div>\n <div *ngIf=\"showSubLabel\" class=\"item-sublabel\">\n {{ item?.subLabel }}\n </div>\n </div>\n </div>\n <div\n class=\"dropdown_buttons\"\n [class.empty]=\"customButtons.length === 0\"\n >\n <button\n *ngFor=\"let button of customButtons\"\n (click)=\"handleButtonClick(button.action)\"\n >\n <i [class]=\"button.icon\" [style.color]=\"button.color\"></i>\n </button>\n </div>\n </div>\n </div>\n </a>\n </ng-template>\n </ng-container>\n\n <!-- \"No data available\" message if the drop down is empty -->\n <ng-template #noDataAvailable>\n <div class=\"items\">No data available</div>\n </ng-template>\n </div>\n</div>\n","import { NgModule } from '@angular/core';\nimport { DropdownComponent } from './dropdown.component';\nimport { FormsModule } from '@angular/forms';\nimport { CommonModule } from '@angular/common';\n\n\n\n@NgModule({\n declarations: [\n DropdownComponent\n ],\n imports: [\n FormsModule,\n CommonModule,\n ],\n exports: [\n DropdownComponent\n ]\n})\nexport class DropdownModule { }\n","/*\n * Public API Surface of dropdown\n */\n\nexport * from './lib/dropdown.service';\nexport * from './lib/dropdown.component';\nexport * from './lib/dropdown.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["uuidv4"],"mappings":";;;;;;;;MAKa,eAAe,CAAA;AAE1B,IAAA,WAAA,GAAA,GAAiB;+GAFN,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;AAAf,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,cAFd,MAAM,EAAA,CAAA,CAAA,EAAA;;4FAEP,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;MCoBY,iBAAiB,CAAA;IAoC5B,IACI,KAAK,CAAC,KAAqB,EAAA;AAC7B,QAAA,IAAI,CAAC,MAAM,GAAG,KAAK,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;QACzC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;AAC1C,QAAA,IAAI,CAAC,GAAG,CAAC,YAAY,EAAE,CAAC;KACzB;AACD,IAAA,IAAI,KAAK,GAAA;QACP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,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,SAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,YAPvB,WAAW;YACX,YAAY,CAAA,EAAA,CAAA,CAAA,EAAA;;4FAMH,cAAc,EAAA,UAAA,EAAA,CAAA;kBAZ1B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE;wBACZ,iBAAiB;AAClB,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,WAAW;wBACX,YAAY;AACb,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,iBAAiB;AAClB,qBAAA;AACF,iBAAA,CAAA;;;AClBD;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectorRef, ElementRef, EventEmitter, OnInit, SimpleChanges } from "@angular/core";
|
|
2
|
-
import { DropdownItem } from "./dropdown.model";
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class DropdownComponent implements OnInit {
|
|
5
|
-
private cdr;
|
|
6
|
-
multiple: boolean;
|
|
7
|
-
selectedItems: any[];
|
|
8
|
-
placeholder: String;
|
|
9
|
-
showCreateNew: boolean;
|
|
10
|
-
selectedValues: string;
|
|
11
|
-
customButtons: {
|
|
12
|
-
label: string;
|
|
13
|
-
icon: string;
|
|
14
|
-
color: string;
|
|
15
|
-
action: () => void;
|
|
16
|
-
}[];
|
|
17
|
-
showBorder: boolean;
|
|
18
|
-
disable: boolean;
|
|
19
|
-
buttonClick: EventEmitter<Event>;
|
|
20
|
-
selectedItemsChange: EventEmitter<any[]>;
|
|
21
|
-
onDropdownScroll: EventEmitter<Event>;
|
|
22
|
-
onCreateNew: EventEmitter<Event>;
|
|
23
|
-
onSearch: EventEmitter<string>;
|
|
24
|
-
showSubLabel: boolean;
|
|
25
|
-
dropdownId: string;
|
|
26
|
-
dropdownOpened: boolean;
|
|
27
|
-
selectedItem: any;
|
|
28
|
-
selectedItemName: string;
|
|
29
|
-
selectedItemImage: string;
|
|
30
|
-
originalItems: DropdownItem[];
|
|
31
|
-
searchTerm: string;
|
|
32
|
-
initialized: boolean;
|
|
33
|
-
searchText: string;
|
|
34
|
-
_filteredItems: DropdownItem[];
|
|
35
|
-
private _items;
|
|
36
|
-
set items(value: DropdownItem[]);
|
|
37
|
-
get items(): DropdownItem[];
|
|
38
|
-
constructor(cdr: ChangeDetectorRef);
|
|
39
|
-
ngOnInit(): void;
|
|
40
|
-
ngOnChanges(changes: SimpleChanges): void;
|
|
41
|
-
initialize(): void;
|
|
42
|
-
openDropdown(): void;
|
|
43
|
-
dropdownitems: ElementRef<any>;
|
|
44
|
-
dropdownScroll(event: any): void;
|
|
45
|
-
selectItem(item: any): void;
|
|
46
|
-
unselectItem(item: any): void;
|
|
47
|
-
unselectAll(): void;
|
|
48
|
-
dropdown: ElementRef;
|
|
49
|
-
onDocumentClick(event: Event): void;
|
|
50
|
-
createNew(): void;
|
|
51
|
-
search(event: any): void;
|
|
52
|
-
handleButtonClick(action: () => void): void;
|
|
53
|
-
highlightMatch(text: string): string;
|
|
54
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownComponent, never>;
|
|
55
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownComponent, "lib-dropdown", never, { "multiple": { "alias": "multiple"; "required": false; }; "selectedItems": { "alias": "selectedItems"; "required": false; }; "placeholder": { "alias": "placeholder"; "required": false; }; "showCreateNew": { "alias": "showCreateNew"; "required": false; }; "selectedValues": { "alias": "selectedValues"; "required": false; }; "customButtons": { "alias": "customButtons"; "required": false; }; "showBorder": { "alias": "showBorder"; "required": false; }; "disable": { "alias": "disable"; "required": false; }; "showSubLabel": { "alias": "showSubLabel"; "required": false; }; "items": { "alias": "items"; "required": false; }; }, { "buttonClick": "buttonClick"; "selectedItemsChange": "selectedItemsChange"; "onDropdownScroll": "onDropdownScroll"; "onCreateNew": "onCreateNew"; "onSearch": "onSearch"; }, never, never, false, never>;
|
|
56
|
-
}
|
package/lib/dropdown.module.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as i0 from "@angular/core";
|
|
2
|
-
import * as i1 from "./dropdown.component";
|
|
3
|
-
import * as i2 from "@angular/forms";
|
|
4
|
-
import * as i3 from "@angular/common";
|
|
5
|
-
export declare class DropdownModule {
|
|
6
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownModule, never>;
|
|
7
|
-
static ɵmod: i0.ɵɵNgModuleDeclaration<DropdownModule, [typeof i1.DropdownComponent], [typeof i2.FormsModule, typeof i3.CommonModule], [typeof i1.DropdownComponent]>;
|
|
8
|
-
static ɵinj: i0.ɵɵInjectorDeclaration<DropdownModule>;
|
|
9
|
-
}
|