@piserve-tech/drop-down 1.2.110 → 1.2.112

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,236 +0,0 @@
1
- <div
2
- #dropdown
3
- class="dropdown"
4
- [ngClass]="{
5
- opened: showBorder && dropdownOpened,
6
- closed: showBorder && !dropdownOpened,
7
- 'dropdown-disabled': disable
8
- }"
9
- >
10
- <div
11
- class="dropdown-field"
12
- id="division"
13
- [ngClass]="{
14
- opened: showBorder && dropdownOpened,
15
- closed: showBorder && !dropdownOpened,
16
- }"
17
- (click)="openDropdown()"
18
- >
19
- <!-- <div *ngIf="selectedValues !== '' && !selectedItemName" class="selected">
20
- {{ selectedValues }}
21
- </div> -->
22
- <div class="flexSection">
23
- <div class="dataSection" *ngIf="!selectedItem && multiple">
24
- <div class="selected selectedList">
25
- <ng-container *ngFor="let selectedItem of selectedItems">
26
- <div class="selected-item">
27
- <img
28
- *ngIf="selectedItem?.image"
29
- class="multiSelected-icon-size"
30
- [src]="selectedItem?.image"
31
- alt="image"
32
- />
33
- <span>{{ selectedItem.label }}</span>
34
- <span (click)="unselectItem(selectedItem)" class="close-icon"
35
- >&times;</span
36
- >
37
- </div>
38
- </ng-container>
39
-
40
- <div class="input-field">
41
- <input
42
- [id]="'searchInput-' + dropdownId"
43
- class="dropdown_text inline-input"
44
- [(ngModel)]="searchText"
45
- [placeholder]="placeholder"
46
- (input)="search($event)"
47
- />
48
- </div>
49
- </div>
50
- </div>
51
- <div class="dataSection single-input" *ngIf="!multiple">
52
- <div class="input-field">
53
- <div class="input-with-icon">
54
- <img
55
- *ngIf="selectedItemImage"
56
- class="selected-icon-size"
57
- [src]="selectedItemImage"
58
- alt="image"
59
- />
60
- <input
61
- [id]="'searchInput-' + dropdownId"
62
- class="dropdown_text inline-input"
63
- [placeholder]="placeholder"
64
- [(ngModel)]="selectedItemName"
65
- (input)="search($event)"
66
- />
67
- </div>
68
- </div>
69
- </div>
70
- <div class="iconSection">
71
- <div class="dropdown-icons-container">
72
- <div>
73
- <span
74
- (click)="unselectAll()"
75
- *ngIf="selectedItems.length > 0 && multiple"
76
- class="deselect"
77
- >&times;
78
- </span>
79
- </div>
80
- <div
81
- class="dropdown-down-arrow"
82
- [ngClass]="{ opened: dropdownOpened, closed: !dropdownOpened }"
83
- >
84
- <svg
85
- width="1em"
86
- viewBox="0 0 24 25"
87
- fill="none"
88
- xmlns="http://www.w3.org/2000/svg"
89
- class="down-arrow-img"
90
- >
91
- <g id="Down Arrow">
92
- <g id="Group">
93
- <path
94
- id="Path"
95
- d="M6 9.13741L12 15.229L18 9.13741"
96
- stroke="#8E9AA0"
97
- stroke-width="1.5"
98
- stroke-linecap="round"
99
- stroke-linejoin="round"
100
- />
101
- </g>
102
- </g>
103
- </svg>
104
- </div>
105
- <div
106
- class="dropdown-up-arrow"
107
- [ngClass]="{ opened: dropdownOpened, closed: !dropdownOpened }"
108
- >
109
- <svg
110
- width="1em"
111
- viewBox="0 0 24 25"
112
- fill="none"
113
- xmlns="http://www.w3.org/2000/svg"
114
- class="up-arrow-img"
115
- >
116
- <path
117
- d="M18 15.229L12 9.1374L6 15.229"
118
- stroke="#8E9AA0"
119
- stroke-width="1.5"
120
- stroke-linecap="round"
121
- stroke-linejoin="round"
122
- />
123
- </svg>
124
- </div>
125
- </div>
126
- </div>
127
- </div>
128
- </div>
129
-
130
- <div
131
- #dropdownItems
132
- class="dropdown-items"
133
- *ngIf="dropdownOpened"
134
- (scroll)="dropdownScroll($event)"
135
- >
136
- <div (click)="createNew()">
137
- <a class="create_button" *ngIf="showCreateNew">Create new</a>
138
- </div>
139
- <ng-container *ngIf="items.length > 0; else noDataAvailable">
140
- <ng-container *ngIf="multiple; else singleSelection">
141
- <a
142
- [ngClass]="{
143
- compact: !item?.image && !item?.subLabel,
144
- expanded: item?.image || item?.subLabel
145
- }"
146
- class="items d-block"
147
- *ngFor="let item of _filteredItems"
148
- (click)="selectItem(item)"
149
- >
150
- <div class="dropdown-item">
151
- <div class="item-details">
152
- <div class="content-wrapper">
153
- <img
154
- *ngIf="item?.image"
155
- [src]="item?.image"
156
- alt="Item Image"
157
- class="item-image icon-size"
158
- />
159
- <div class="text-content">
160
- <div
161
- class="item-label"
162
- [innerHTML]="highlightMatch(item.label)"
163
- ></div>
164
- <div *ngIf="showSubLabel" class="item-sublabel">
165
- {{ item?.subLabel }}
166
- </div>
167
- </div>
168
- </div>
169
- <div
170
- class="dropdown_buttons"
171
- [class.empty]="customButtons.length === 0"
172
- >
173
- <button
174
- *ngFor="let button of customButtons"
175
- (click)="handleButtonClick(button.action)"
176
- >
177
- <i [class]="button.icon" [style.color]="button.color"></i>
178
- </button>
179
- </div>
180
- </div>
181
- </div>
182
- </a>
183
- </ng-container>
184
-
185
- <ng-template #singleSelection>
186
- <a
187
- class="items d-block"
188
- [ngClass]="{
189
- compact: !item?.image && !item?.subLabel,
190
- expanded: item?.image || item?.subLabel
191
- }"
192
- *ngFor="let item of _filteredItems"
193
- (click)="selectItem(item)"
194
- >
195
- <div class="dropdown-item">
196
- <div class="item-details">
197
- <div class="content-wrapper">
198
- <img
199
- *ngIf="item?.image"
200
- [src]="item?.image"
201
- alt="Item Image"
202
- class="item-image icon-size"
203
- />
204
- <div class="text-content">
205
- <div
206
- class="item-label"
207
- [innerHTML]="highlightMatch(item.label)"
208
- ></div>
209
- <div *ngIf="showSubLabel" class="item-sublabel">
210
- {{ item?.subLabel }}
211
- </div>
212
- </div>
213
- </div>
214
- <div
215
- class="dropdown_buttons"
216
- [class.empty]="customButtons.length === 0"
217
- >
218
- <button
219
- *ngFor="let button of customButtons"
220
- (click)="handleButtonClick(button.action)"
221
- >
222
- <i [class]="button.icon" [style.color]="button.color"></i>
223
- </button>
224
- </div>
225
- </div>
226
- </div>
227
- </a>
228
- </ng-template>
229
- </ng-container>
230
-
231
- <!-- "No data available" message if the drop down is empty -->
232
- <ng-template #noDataAvailable>
233
- <div class="items">No data available</div>
234
- </ng-template>
235
- </div>
236
- </div>
@@ -1,374 +0,0 @@
1
- .dropdown {
2
- background: white;
3
- border-radius: 6px;
4
- .dropdown-field {
5
- background: white;
6
- border-radius: 6px;
7
- position: relative;
8
- cursor: pointer;
9
- .selected {
10
- &.selectedList {
11
- display: flex;
12
- flex-wrap: wrap;
13
- max-height: 80px;
14
- overflow-y: auto;
15
- overflow-x: hidden;
16
- }
17
- .selected-item {
18
- background: #e3e3da;
19
- display: inline;
20
- margin: 5px;
21
- padding: 2px;
22
- border-radius: 5px;
23
- font-size: small;
24
- }
25
- .remaining-items {
26
- margin: 5px;
27
- padding: 2px;
28
- font-size: smaller;
29
- display: block;
30
- }
31
- }
32
- .input-field {
33
- .dropdown_text {
34
- width: 100%;
35
- border: none;
36
- padding: 2px;
37
- margin-left: 3px;
38
- margin-right: 3px;
39
- outline: none;
40
- box-sizing: border-box;
41
- font-style: normal;
42
- @media (max-width: 576px) {
43
- width: 53%;
44
- margin-left: 3px;
45
- padding-left: 2px;
46
- }
47
- @media (max-width: 420px) {
48
- width: 53%;
49
- margin-left: 3px;
50
- padding-left: 2px;
51
- }
52
- @media only screen and (min-width: 576px) {
53
- height: 25px;
54
- }
55
- @media only screen and (min-width: 992px) {
56
- height: 30px;
57
- }
58
- @media only screen and (min-width: 1200px) {
59
- height: 35px;
60
- }
61
- }
62
- }
63
- &.closed {
64
- border: 1px solid #d8d8d8;
65
- }
66
- &.opened {
67
- border-bottom: 1px solid #d8d8d8;
68
- }
69
- }
70
- .dropdown-items {
71
- overflow-y: auto;
72
- overflow-x: auto;
73
- position: absolute !important;
74
- top: 100%;
75
- left: 0;
76
- width: 100%;
77
- background: white;
78
- z-index: 9999999;
79
- border: solid 1px #dbdbdb;
80
- box-shadow: 0px 4px 4px -5px #00000040;
81
- transition: transform 0.3s ease-out;
82
- scroll-behavior: smooth;
83
- cursor: pointer;
84
- @media only screen and (min-width: 276px) {
85
- max-height: 150px;
86
- padding: 3px;
87
- }
88
- @media only screen and (min-width: 576px) {
89
- max-height: 150px;
90
- padding: 3px;
91
- }
92
- @media only screen and (min-width: 992px) {
93
- max-height: 150px;
94
- padding: 5px;
95
- }
96
- @media only screen and (min-width: 1441px) {
97
- max-height: 200px;
98
- padding: 7px;
99
- }
100
- .create_button {
101
- text-decoration: none;
102
- cursor: pointer;
103
- @media only screen and (min-width: 576px) {
104
- padding-left: 8px;
105
- }
106
- @media only screen and (min-width: 992px) {
107
- padding-left: 8px;
108
- }
109
- @media only screen and (min-width: 1200px) {
110
- padding-left: 8px;
111
- }
112
- }
113
- .items {
114
- text-decoration: none;
115
- color: inherit;
116
- // line-height: 41px;
117
- position: relative;
118
- cursor: pointer;
119
- @media only screen and (min-width: 576px) {
120
- padding-left: 8px;
121
- font-size: small;
122
- }
123
- @media only screen and (min-width: 992px) {
124
- padding-left: 8px;
125
- }
126
- @media only screen and (min-width: 1200px) {
127
- padding-left: 8px;
128
- font-size: small;
129
- }
130
- &:hover {
131
- background: #ebedef;
132
- border-radius: 6px;
133
- }
134
- &:hover button {
135
- visibility: visible;
136
- }
137
- .dropdown_buttons {
138
- display: inline;
139
- }
140
- button {
141
- border: 0;
142
- background: transparent;
143
- visibility: hidden;
144
- }
145
- }
146
- }
147
- &.opened {
148
- border: 1px #d8d8d8 solid;
149
- }
150
- }
151
-
152
- ::-webkit-scrollbar {
153
- width: 6px;
154
- height: 6px;
155
- }
156
-
157
- ::-webkit-scrollbar-track {
158
- background-color: transparent;
159
- }
160
-
161
- ::-webkit-scrollbar-thumb {
162
- background-color: #b2b2b2;
163
- border-radius: 6px;
164
- }
165
-
166
- .space {
167
- width: 10px;
168
- }
169
-
170
- .item-details {
171
- display: flex;
172
- align-items: center;
173
- justify-content: space-between;
174
- }
175
-
176
- .icon-size {
177
- width: 30px;
178
- height: 30px;
179
- margin-right: 7px;
180
- }
181
- .smallSpace {
182
- width: 3px;
183
- }
184
-
185
- .selected-icon-size {
186
- width: 25px;
187
- height: 20px;
188
- margin-left: 10px;
189
- @media (max-width: 576px) {
190
- width: 21px;
191
- height: 15px;
192
- margin-right: 7px;
193
- margin-bottom: 1px;
194
- }
195
- }
196
-
197
- .multiSelected-icon-size {
198
- width: 25px;
199
- height: 20px;
200
- margin-left: 1px;
201
- margin-bottom: 1px;
202
- margin-right: 3px;
203
- }
204
-
205
- .flexSection {
206
- display: flex;
207
- justify-content: space-between;
208
- }
209
-
210
- .dropdown-down-arrow,
211
- .dropdown-up-arrow {
212
- width: 20px;
213
- height: 20px;
214
- display: flex;
215
- align-items: center;
216
- justify-content: center;
217
- cursor: pointer;
218
- }
219
-
220
- .deselect {
221
- width: 20px;
222
- height: 20px;
223
- display: flex;
224
- align-items: center;
225
- justify-content: center;
226
- cursor: pointer;
227
- }
228
-
229
- .dropdown-down-arrow {
230
- cursor: pointer;
231
- &.opened {
232
- display: none;
233
- }
234
- &.closed {
235
- display: block;
236
- }
237
- }
238
- .dropdown-up-arrow {
239
- cursor: pointer;
240
- &.closed {
241
- display: none;
242
- }
243
- }
244
- .close-icon {
245
- margin-left: 8px;
246
- margin-right: 5px;
247
- }
248
-
249
- .iconSection {
250
- display: flex;
251
- flex-direction: row-reverse;
252
- padding: 1px;
253
- position: relative;
254
- justify-content: center;
255
- align-items: center;
256
- }
257
- .dropdown-icons-container {
258
- display: flex;
259
- gap: 10px;
260
- }
261
-
262
- .item-details {
263
- display: flex;
264
- align-items: center;
265
- justify-content: space-between;
266
- }
267
-
268
- .content-wrapper {
269
- display: flex;
270
- align-items: center;
271
- gap: 8px;
272
- flex: 1;
273
- }
274
-
275
- .text-content {
276
- display: flex;
277
- flex-direction: column;
278
- }
279
-
280
- .item-label {
281
- font-size: 14px;
282
- font-weight: 400;
283
- line-height: 1.3;
284
- }
285
-
286
- .item-sublabel {
287
- font-size: 11px;
288
- color: #666;
289
- line-height: 1.2;
290
- }
291
-
292
- .dropdown_buttons {
293
- display: flex;
294
- gap: 4px;
295
- }
296
-
297
- .dropdown_buttons.empty::after {
298
- content: "";
299
- display: inline-block;
300
- width: 4px;
301
- height: 1px;
302
- }
303
-
304
- .compact {
305
- line-height: 32px;
306
- }
307
-
308
- .expanded {
309
- line-height: 41px;
310
- }
311
-
312
- .input-field {
313
- width: 100%;
314
- }
315
-
316
- .input-with-icon {
317
- display: flex;
318
- align-items: center;
319
- gap: 8px;
320
- width: 100%;
321
- }
322
-
323
- .selected-icon-size {
324
- width: 20px;
325
- height: 20px;
326
- flex-shrink: 0;
327
- }
328
-
329
- .dropdown_text.inline-input {
330
- flex: 1;
331
- border: none;
332
- outline: none;
333
- padding: 0;
334
- background: transparent;
335
- font-family: inherit;
336
- font-size: inherit;
337
- color: inherit;
338
- }
339
- .single-input {
340
- width: 80%;
341
- white-space: nowrap;
342
- }
343
-
344
- .item-label {
345
- font-size: 14px;
346
- line-height: 1.4;
347
- color: #333;
348
- }
349
-
350
- .highlight-text {
351
- font-weight: 600;
352
- background-repeat: no-repeat;
353
- background-size: 100% 0.3em;
354
- background-position: 0 88%;
355
- padding: 0.1em 0.05em;
356
- border-radius: 2px;
357
- color: #1a1a1a;
358
- transition: all 0.2s ease-in-out;
359
- }
360
-
361
-
362
- .dropdown .dropdown-field .input-field .dropdown_text {
363
- background: #ffff !important;
364
- }
365
-
366
- .dropdown.dropdown-disabled .dropdown-field .input-field .dropdown_text {
367
- background: #e9ecef !important;
368
- pointer-events: none;
369
- }
370
-
371
- .dropdown.dropdown-disabled .dropdown-field {
372
- background: #e9ecef !important;
373
- pointer-events: none;
374
- }
@@ -1,21 +0,0 @@
1
- import { ComponentFixture, TestBed } from '@angular/core/testing';
2
-
3
- import { DropdownComponent } from './dropdown.component';
4
-
5
- describe('DropdownComponent', () => {
6
- let component: DropdownComponent;
7
- let fixture: ComponentFixture<DropdownComponent>;
8
-
9
- beforeEach(() => {
10
- TestBed.configureTestingModule({
11
- declarations: [DropdownComponent]
12
- });
13
- fixture = TestBed.createComponent(DropdownComponent);
14
- component = fixture.componentInstance;
15
- fixture.detectChanges();
16
- });
17
-
18
- it('should create', () => {
19
- expect(component).toBeTruthy();
20
- });
21
- });