lib-portal-angular 0.0.53 → 0.0.55
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/esm2022/lib/components/custom-switch/custom-switch.component.mjs +2 -2
- package/esm2022/lib/components/multi-select/multi-select.component.mjs +105 -94
- package/fesm2022/lib-portal-angular.mjs +104 -93
- package/fesm2022/lib-portal-angular.mjs.map +1 -1
- package/lib/components/multi-select/multi-select.component.d.ts +14 -7
- package/package.json +1 -1
|
@@ -78,11 +78,11 @@ class CustomSwitchComponent {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomSwitchComponent, deps: [{ token: AuthService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
81
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CustomSwitchComponent, selector: "argenta-custom-switch", inputs: { checked: "checked", label: "label", permissions: "permissions" }, outputs: { switchChange: "switchChange" }, ngImport: i0, template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"form-check form-switch\">\n <input \n class=\"form-check-input\" \n type=\"checkbox\" \n [checked]=\"checked\" \n (change)=\"toggleSwitch()\" \n id=\"flexSwitchCheckDefault\" \n />\n <label class=\"form-check-label\" for=\"flexSwitchCheckDefault\">\n {{ label }}\n </label>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";.form-check{display:flex;align-items:center}.form-check-input{width:
|
|
81
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: CustomSwitchComponent, selector: "argenta-custom-switch", inputs: { checked: "checked", label: "label", permissions: "permissions" }, outputs: { switchChange: "switchChange" }, ngImport: i0, template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"form-check form-switch\">\n <input \n class=\"form-check-input\" \n type=\"checkbox\" \n [checked]=\"checked\" \n (change)=\"toggleSwitch()\" \n id=\"flexSwitchCheckDefault\" \n />\n <label class=\"form-check-label\" for=\"flexSwitchCheckDefault\">\n {{ label }}\n </label>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";.form-check{display:flex;align-items:center}.form-check-input{width:60px;height:34px;margin-right:10px;cursor:pointer;position:relative;appearance:none;background-color:#e5e5e5;border:2px solid #00444C;border-radius:34px;outline:none;transition:background-color .3s,border-color .3s}.form-check-input:focus{outline:none;box-shadow:none}.form-check-input:checked{background-color:#00444c;border-color:#00444c}.form-check-input:before{content:\"\";position:absolute;width:26px;height:26px;background-color:#00444c;border-radius:50%;top:3px;left:3px;transition:transform .3s,background-color .3s}.form-check-input:checked:before{transform:translate(26px);background-color:#fff}.form-check-label{color:#00444c;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:24px;line-height:24px}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
82
82
|
}
|
|
83
83
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: CustomSwitchComponent, decorators: [{
|
|
84
84
|
type: Component,
|
|
85
|
-
args: [{ selector: 'argenta-custom-switch', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"form-check form-switch\">\n <input \n class=\"form-check-input\" \n type=\"checkbox\" \n [checked]=\"checked\" \n (change)=\"toggleSwitch()\" \n id=\"flexSwitchCheckDefault\" \n />\n <label class=\"form-check-label\" for=\"flexSwitchCheckDefault\">\n {{ label }}\n </label>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";.form-check{display:flex;align-items:center}.form-check-input{width:
|
|
85
|
+
args: [{ selector: 'argenta-custom-switch', changeDetection: ChangeDetectionStrategy.OnPush, template: "<ng-container *ngIf=\"hasPermission()\">\n <div class=\"form-check form-switch\">\n <input \n class=\"form-check-input\" \n type=\"checkbox\" \n [checked]=\"checked\" \n (change)=\"toggleSwitch()\" \n id=\"flexSwitchCheckDefault\" \n />\n <label class=\"form-check-label\" for=\"flexSwitchCheckDefault\">\n {{ label }}\n </label>\n </div>\n</ng-container>\n", styles: ["@charset \"UTF-8\";.form-check{display:flex;align-items:center}.form-check-input{width:60px;height:34px;margin-right:10px;cursor:pointer;position:relative;appearance:none;background-color:#e5e5e5;border:2px solid #00444C;border-radius:34px;outline:none;transition:background-color .3s,border-color .3s}.form-check-input:focus{outline:none;box-shadow:none}.form-check-input:checked{background-color:#00444c;border-color:#00444c}.form-check-input:before{content:\"\";position:absolute;width:26px;height:26px;background-color:#00444c;border-radius:50%;top:3px;left:3px;transition:transform .3s,background-color .3s}.form-check-input:checked:before{transform:translate(26px);background-color:#fff}.form-check-label{color:#00444c;font-family:Inter,sans-serif;font-size:16px;font-weight:600;height:24px;line-height:24px}\n"] }]
|
|
86
86
|
}], ctorParameters: function () { return [{ type: AuthService }]; }, propDecorators: { checked: [{
|
|
87
87
|
type: Input
|
|
88
88
|
}], label: [{
|
|
@@ -1106,19 +1106,19 @@ class MultiSelectComponent {
|
|
|
1106
1106
|
this.label = 'Multi Select';
|
|
1107
1107
|
this.data = []; // Accepts an array of generic objects
|
|
1108
1108
|
this.placeholder = 'Select items';
|
|
1109
|
-
this.selected = []; // The selected variable should be an array
|
|
1110
1109
|
this.id = 'multiSelectId';
|
|
1111
1110
|
this.bindLabel = ''; // Generic dynamic label
|
|
1112
1111
|
this.bindValue = ''; // Generic dynamic value
|
|
1113
1112
|
this.closeOnSelect = false; // New property to control dropdown close behavior
|
|
1114
1113
|
this.searchUrl = ''; // URL for backend search
|
|
1114
|
+
this.multiple = true; // New property to control single or multiple selection
|
|
1115
|
+
this.searchParams = {}; // Parâmetros de busca dinâmicos
|
|
1115
1116
|
this.keyupEvent = new EventEmitter();
|
|
1116
|
-
this.
|
|
1117
|
+
this.backupData = []; // Backup of the initial data
|
|
1117
1118
|
this.allItems = []; // Store the combined list
|
|
1118
1119
|
this.items = of([]); // Initialization of the property
|
|
1119
1120
|
this.filteredItems = of([]); // Filtered items
|
|
1120
1121
|
this.searchTerms = new Subject(); // For search debounce
|
|
1121
|
-
this.backendItems = []; // Items found from backend
|
|
1122
1122
|
this.onChangeCallback = () => { };
|
|
1123
1123
|
this.onTouchedCallback = () => { };
|
|
1124
1124
|
this.isCourseEntered = false;
|
|
@@ -1127,11 +1127,61 @@ class MultiSelectComponent {
|
|
|
1127
1127
|
};
|
|
1128
1128
|
}
|
|
1129
1129
|
ngOnInit() {
|
|
1130
|
-
this.
|
|
1131
|
-
this.allItems = [...this.data]; // Initialize allItems with the
|
|
1130
|
+
this.backupData = [...this.data]; // Backup initial data
|
|
1131
|
+
this.allItems = [...this.data]; // Initialize allItems with the initial data
|
|
1132
1132
|
this.items = of(this.allItems);
|
|
1133
|
-
this.
|
|
1134
|
-
|
|
1133
|
+
this.fetchInitialData().subscribe(data => {
|
|
1134
|
+
this.updateData(data);
|
|
1135
|
+
this.filteredItems = this.searchTerms.pipe(debounceTime(700), startWith(''), // Start with an empty search to load the original list
|
|
1136
|
+
switchMap(term => this.search(term)));
|
|
1137
|
+
// Adicionar itens selecionados à lista após buscar dados iniciais
|
|
1138
|
+
this.addSelectedItemsToData();
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
ngOnChanges(changes) {
|
|
1142
|
+
if (changes['selected'] && !changes['selected'].isFirstChange()) {
|
|
1143
|
+
this.addSelectedItemsToData();
|
|
1144
|
+
}
|
|
1145
|
+
}
|
|
1146
|
+
fetchInitialData() {
|
|
1147
|
+
return this.http.get(this.searchUrl).pipe(map((response) => {
|
|
1148
|
+
if (response && response.length > 0) {
|
|
1149
|
+
return response.map((item) => ({
|
|
1150
|
+
[this.bindValue]: item[this.bindValue],
|
|
1151
|
+
[this.bindLabel]: item[this.bindLabel]
|
|
1152
|
+
}));
|
|
1153
|
+
}
|
|
1154
|
+
return [];
|
|
1155
|
+
}), catchError((error) => {
|
|
1156
|
+
console.error('Error fetching initial data from backend:', error);
|
|
1157
|
+
return of([]);
|
|
1158
|
+
}));
|
|
1159
|
+
}
|
|
1160
|
+
updateData(newData) {
|
|
1161
|
+
newData.forEach((item) => {
|
|
1162
|
+
const existsInList = this.allItems.some(listItem => this.compareFn(listItem, item));
|
|
1163
|
+
if (!existsInList) {
|
|
1164
|
+
this.allItems.push(item);
|
|
1165
|
+
}
|
|
1166
|
+
});
|
|
1167
|
+
this.items = of(this.allItems);
|
|
1168
|
+
}
|
|
1169
|
+
addSelectedItemsToData() {
|
|
1170
|
+
if (this.selected) {
|
|
1171
|
+
const selectedItems = this.multiple ? this.selected : [this.selected];
|
|
1172
|
+
selectedItems.forEach((item) => {
|
|
1173
|
+
const existsInList = this.allItems.some(listItem => this.compareFn(listItem, item));
|
|
1174
|
+
if (!existsInList) {
|
|
1175
|
+
const newItem = {
|
|
1176
|
+
[this.bindValue]: item[this.bindValue] || item,
|
|
1177
|
+
[this.bindLabel]: item[this.bindLabel] || item
|
|
1178
|
+
};
|
|
1179
|
+
this.data.push(newItem);
|
|
1180
|
+
this.allItems.push(newItem);
|
|
1181
|
+
}
|
|
1182
|
+
});
|
|
1183
|
+
this.items = of(this.allItems);
|
|
1184
|
+
}
|
|
1135
1185
|
}
|
|
1136
1186
|
onFocus() {
|
|
1137
1187
|
this.isCourseEntered = true;
|
|
@@ -1143,25 +1193,25 @@ class MultiSelectComponent {
|
|
|
1143
1193
|
this.keyupEvent.emit(event);
|
|
1144
1194
|
}
|
|
1145
1195
|
onSelectedChange(event) {
|
|
1146
|
-
const
|
|
1147
|
-
this.
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
const transformedItems = addedFromBackend.map((item) => ({
|
|
1153
|
-
[this.bindValue]: item[this.bindValue],
|
|
1154
|
-
[this.bindLabel]: item[this.bindLabel]
|
|
1155
|
-
}));
|
|
1156
|
-
// Add backend items to the allItems list and update the observable
|
|
1157
|
-
this.originalData = [...this.originalData, ...transformedItems];
|
|
1158
|
-
this.allItems = [...this.originalData];
|
|
1159
|
-
this.items = of(this.allItems); // Update the observable with new data
|
|
1160
|
-
this.backendItems = []; // Clear backend items after processing
|
|
1161
|
-
this.searchTerms.next(''); // Reset the search term to update the list
|
|
1162
|
-
console.log('Added items from backend to the list and reset the dropdown.');
|
|
1196
|
+
const previousSelected = this.selected;
|
|
1197
|
+
if (this.multiple) {
|
|
1198
|
+
this.selected = event;
|
|
1199
|
+
}
|
|
1200
|
+
else {
|
|
1201
|
+
this.selected = event ? event : null;
|
|
1163
1202
|
}
|
|
1164
1203
|
this.onChangeCallback(this.selected);
|
|
1204
|
+
// Verificar se um item foi removido
|
|
1205
|
+
if (previousSelected && Array.isArray(previousSelected) && previousSelected.length > event.length) {
|
|
1206
|
+
const removedItems = previousSelected.filter(item => !event.includes(item));
|
|
1207
|
+
removedItems.forEach(item => {
|
|
1208
|
+
const existsInData = this.data.some(dataItem => this.compareFn(dataItem, item));
|
|
1209
|
+
if (!existsInData) {
|
|
1210
|
+
this.data.push(item);
|
|
1211
|
+
this.allItems.push(item); // Adicionar de volta aos itens disponíveis
|
|
1212
|
+
}
|
|
1213
|
+
});
|
|
1214
|
+
}
|
|
1165
1215
|
}
|
|
1166
1216
|
onInputChange(event) {
|
|
1167
1217
|
const input = event.target.value;
|
|
@@ -1169,41 +1219,52 @@ class MultiSelectComponent {
|
|
|
1169
1219
|
}
|
|
1170
1220
|
search(term) {
|
|
1171
1221
|
if (!term.trim()) {
|
|
1172
|
-
//
|
|
1222
|
+
// Se o termo de busca estiver vazio, retorna a lista completa
|
|
1173
1223
|
return of(this.allItems);
|
|
1174
1224
|
}
|
|
1225
|
+
// Filtra os itens localmente
|
|
1175
1226
|
const filtered = this.allItems.filter((item) => item[this.bindLabel].toLowerCase().includes(term.toLowerCase()));
|
|
1176
1227
|
if (filtered.length > 0) {
|
|
1177
1228
|
console.log('Items filtered locally.');
|
|
1178
1229
|
return of(filtered);
|
|
1179
1230
|
}
|
|
1180
1231
|
else if (this.searchUrl) {
|
|
1181
|
-
|
|
1232
|
+
// Construir os parâmetros de busca dinamicamente
|
|
1233
|
+
const params = new URLSearchParams(this.searchParams);
|
|
1234
|
+
params.append('term', term);
|
|
1235
|
+
return this.http.get(`${this.searchUrl}?${params.toString()}`).pipe(map((response) => {
|
|
1182
1236
|
if (response && response.length > 0) {
|
|
1183
|
-
//
|
|
1237
|
+
// Transforma os itens do backend para o formato esperado pelo componente
|
|
1184
1238
|
const transformedItems = response.map((item) => ({
|
|
1185
1239
|
[this.bindValue]: item[this.bindValue],
|
|
1186
1240
|
[this.bindLabel]: item[this.bindLabel]
|
|
1187
1241
|
}));
|
|
1188
|
-
|
|
1189
|
-
|
|
1242
|
+
// Atualiza os dados com os novos itens buscados
|
|
1243
|
+
this.updateData(transformedItems);
|
|
1244
|
+
return this.allItems;
|
|
1190
1245
|
}
|
|
1191
1246
|
else {
|
|
1192
1247
|
console.log('No items found in the backend search.');
|
|
1193
|
-
return
|
|
1248
|
+
return this.allItems;
|
|
1194
1249
|
}
|
|
1195
1250
|
}), catchError((error) => {
|
|
1196
1251
|
console.error('Error fetching from backend:', error);
|
|
1197
|
-
return of(
|
|
1252
|
+
return of(this.allItems);
|
|
1198
1253
|
}));
|
|
1199
1254
|
}
|
|
1200
1255
|
else {
|
|
1201
1256
|
console.log('No search URL provided and no items found locally.');
|
|
1202
|
-
return of(
|
|
1257
|
+
return of(this.allItems);
|
|
1203
1258
|
}
|
|
1204
1259
|
}
|
|
1205
1260
|
writeValue(value) {
|
|
1206
|
-
this.
|
|
1261
|
+
if (this.multiple) {
|
|
1262
|
+
this.selected = value || [];
|
|
1263
|
+
}
|
|
1264
|
+
else {
|
|
1265
|
+
this.selected = value || null;
|
|
1266
|
+
}
|
|
1267
|
+
this.addSelectedItemsToData();
|
|
1207
1268
|
}
|
|
1208
1269
|
registerOnChange(fn) {
|
|
1209
1270
|
this.onChangeCallback = fn;
|
|
@@ -1232,77 +1293,23 @@ class MultiSelectComponent {
|
|
|
1232
1293
|
}
|
|
1233
1294
|
}
|
|
1234
1295
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectComponent, deps: [{ token: AuthService }, { token: i2.HttpClient }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1235
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiSelectComponent, selector: "argenta-custom-multi-select", inputs: { label: "label", data: "data", placeholder: "placeholder", selected: "selected", id: "id", bindLabel: "bindLabel", bindValue: "bindValue", permissions: "permissions", closeOnSelect: "closeOnSelect", searchUrl: "searchUrl" }, outputs: { keyupEvent: "keyupEvent" }, providers: [
|
|
1296
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: MultiSelectComponent, selector: "argenta-custom-multi-select", inputs: { label: "label", data: "data", placeholder: "placeholder", selected: "selected", id: "id", bindLabel: "bindLabel", bindValue: "bindValue", permissions: "permissions", closeOnSelect: "closeOnSelect", searchUrl: "searchUrl", multiple: "multiple", searchParams: "searchParams" }, outputs: { keyupEvent: "keyupEvent" }, providers: [
|
|
1236
1297
|
{
|
|
1237
1298
|
provide: NG_VALUE_ACCESSOR,
|
|
1238
1299
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
1239
1300
|
multi: true
|
|
1240
1301
|
}
|
|
1241
|
-
], ngImport: i0, template:
|
|
1242
|
-
<div *ngIf="hasPermission()" class="form-group">
|
|
1243
|
-
<label [for]="id" class="form-label">{{ label }}</label>
|
|
1244
|
-
<ng-select
|
|
1245
|
-
[class.course-entry]="isCourseEntered"
|
|
1246
|
-
class="ng-select"
|
|
1247
|
-
[items]="filteredItems | async"
|
|
1248
|
-
[multiple]="true"
|
|
1249
|
-
[closeOnSelect]="closeOnSelect"
|
|
1250
|
-
[hideSelected]="true"
|
|
1251
|
-
[bindLabel]="bindLabel"
|
|
1252
|
-
[bindValue]="bindValue"
|
|
1253
|
-
[(ngModel)]="selected"
|
|
1254
|
-
[compareWith]="compareFn"
|
|
1255
|
-
(change)="onSelectedChange($event)"
|
|
1256
|
-
(keyup)="onKeyUp($event)"
|
|
1257
|
-
(input)="onInputChange($event)"
|
|
1258
|
-
[id]="id"
|
|
1259
|
-
[placeholder]="selected && selected.length === 0 ? placeholder : ''"
|
|
1260
|
-
(focus)="onFocus()"
|
|
1261
|
-
(blur)="onBlur()"
|
|
1262
|
-
>
|
|
1263
|
-
<ng-template ng-option-tmp let-item="item">
|
|
1264
|
-
{{ item[bindLabel] }}
|
|
1265
|
-
</ng-template>
|
|
1266
|
-
</ng-select>
|
|
1267
|
-
</div>
|
|
1268
|
-
`, isInline: true, styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem 2rem .5rem .5rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:none;background-repeat:no-repeat;background-position:right .5rem center}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1302
|
+
], usesOnChanges: true, ngImport: i0, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" class=\"form-label\" style=\"margin-top: 1rem;\">{{ label }}</label>\n <ng-select\n [class.course-entry]=\"isCourseEntered\"\n class=\"ng-select custom-ng-select\"\n [items]=\"filteredItems | async\"\n [multiple]=\"multiple\"\n [closeOnSelect]=\"closeOnSelect\"\n [hideSelected]=\"true\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [(ngModel)]=\"selected\"\n [compareWith]=\"compareFn\"\n (change)=\"onSelectedChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (input)=\"onInputChange($event)\"\n [id]=\"id\"\n [placeholder]=\"selected && (multiple ? selected.length === 0 : !selected) ? placeholder : ''\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\">\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item[bindLabel] }}\n </ng-template>\n </ng-select>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem 2rem .5rem .5rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:none;background-repeat:no-repeat;background-position:right .5rem center}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}.ng-select{display:block;width:100%;font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.ng-select .ng-select-container{display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;padding:.5rem;background-color:#fff;color:#333}.ng-select .ng-select-container .ng-value-container{display:flex;align-items:center;flex-grow:1}.ng-select .ng-select-container .ng-clear{display:none}.ng-select .ng-select-container .ng-input{flex-grow:1;border:none;outline:none}.custom-ng-select.ng-select .ng-select-container .ng-input>input{box-sizing:border-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:.5rem!important;cursor:default;width:100%}.ng-select .ng-dropdown-panel{border:1px solid #ccc;border-radius:4px;background-color:#fff;color:#333;box-shadow:0 2px 4px #0000001a}.ng-select .ng-dropdown-panel .ng-option{padding:8px;cursor:pointer}.ng-select .ng-dropdown-panel .ng-option:hover{background-color:#f1f1f1}.ng-select .ng-dropdown-panel .ng-option.selected{background-color:#007bff;color:#fff}\n"], dependencies: [{ kind: "directive", type: i1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i4.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i4.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: i5.NgSelectComponent, selector: "ng-select", inputs: ["bindLabel", "bindValue", "markFirst", "placeholder", "notFoundText", "typeToSearchText", "addTagText", "loadingText", "clearAllText", "appearance", "dropdownPosition", "appendTo", "loading", "closeOnSelect", "hideSelected", "selectOnTab", "openOnEnter", "maxSelectedItems", "groupBy", "groupValue", "bufferAmount", "virtualScroll", "selectableGroup", "selectableGroupAsModel", "searchFn", "trackByFn", "clearOnBackspace", "labelForId", "inputAttrs", "tabIndex", "readonly", "searchWhileComposing", "minTermLength", "editableSearchTerm", "keyDownFn", "typeahead", "multiple", "addTag", "searchable", "clearable", "isOpen", "items", "compareWith", "clearSearchOnAdd", "deselectOnClick"], outputs: ["blur", "focus", "change", "open", "close", "search", "clear", "add", "remove", "scroll", "scrollToEnd"] }, { kind: "directive", type: i5.NgOptionTemplateDirective, selector: "[ng-option-tmp]" }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1269
1303
|
}
|
|
1270
1304
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: MultiSelectComponent, decorators: [{
|
|
1271
1305
|
type: Component,
|
|
1272
|
-
args: [{ selector: 'argenta-custom-multi-select',
|
|
1273
|
-
<div *ngIf="hasPermission()" class="form-group">
|
|
1274
|
-
<label [for]="id" class="form-label">{{ label }}</label>
|
|
1275
|
-
<ng-select
|
|
1276
|
-
[class.course-entry]="isCourseEntered"
|
|
1277
|
-
class="ng-select"
|
|
1278
|
-
[items]="filteredItems | async"
|
|
1279
|
-
[multiple]="true"
|
|
1280
|
-
[closeOnSelect]="closeOnSelect"
|
|
1281
|
-
[hideSelected]="true"
|
|
1282
|
-
[bindLabel]="bindLabel"
|
|
1283
|
-
[bindValue]="bindValue"
|
|
1284
|
-
[(ngModel)]="selected"
|
|
1285
|
-
[compareWith]="compareFn"
|
|
1286
|
-
(change)="onSelectedChange($event)"
|
|
1287
|
-
(keyup)="onKeyUp($event)"
|
|
1288
|
-
(input)="onInputChange($event)"
|
|
1289
|
-
[id]="id"
|
|
1290
|
-
[placeholder]="selected && selected.length === 0 ? placeholder : ''"
|
|
1291
|
-
(focus)="onFocus()"
|
|
1292
|
-
(blur)="onBlur()"
|
|
1293
|
-
>
|
|
1294
|
-
<ng-template ng-option-tmp let-item="item">
|
|
1295
|
-
{{ item[bindLabel] }}
|
|
1296
|
-
</ng-template>
|
|
1297
|
-
</ng-select>
|
|
1298
|
-
</div>
|
|
1299
|
-
`, providers: [
|
|
1306
|
+
args: [{ selector: 'argenta-custom-multi-select', providers: [
|
|
1300
1307
|
{
|
|
1301
1308
|
provide: NG_VALUE_ACCESSOR,
|
|
1302
1309
|
useExisting: forwardRef(() => MultiSelectComponent),
|
|
1303
1310
|
multi: true
|
|
1304
1311
|
}
|
|
1305
|
-
], changeDetection: ChangeDetectionStrategy.OnPush, styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem 2rem .5rem .5rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:none;background-repeat:no-repeat;background-position:right .5rem center}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}\n"] }]
|
|
1312
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div *ngIf=\"hasPermission()\" class=\"form-group\">\n <label [for]=\"id\" class=\"form-label\" style=\"margin-top: 1rem;\">{{ label }}</label>\n <ng-select\n [class.course-entry]=\"isCourseEntered\"\n class=\"ng-select custom-ng-select\"\n [items]=\"filteredItems | async\"\n [multiple]=\"multiple\"\n [closeOnSelect]=\"closeOnSelect\"\n [hideSelected]=\"true\"\n [bindLabel]=\"bindLabel\"\n [bindValue]=\"bindValue\"\n [(ngModel)]=\"selected\"\n [compareWith]=\"compareFn\"\n (change)=\"onSelectedChange($event)\"\n (keyup)=\"onKeyUp($event)\"\n (input)=\"onInputChange($event)\"\n [id]=\"id\"\n [placeholder]=\"selected && (multiple ? selected.length === 0 : !selected) ? placeholder : ''\"\n (focus)=\"onFocus()\"\n (blur)=\"onBlur()\">\n <ng-template ng-option-tmp let-item=\"item\">\n {{ item[bindLabel] }}\n </ng-template>\n </ng-select>\n</div>\n", styles: ["@charset \"UTF-8\";@import\"https://fonts.googleapis.com/css2?family=Inter:wght@400;700&display=swap\";body{font-family:Inter,sans-serif}.form-group{font-family:Inter,Arial,sans-serif;font-size:1rem}.form-check-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:.9rem}.form-check-label{width:623px;height:19px;top:1608px;left:133px;gap:0px;opacity:0px;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left}.custom-select{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem 2rem .5rem .5rem;appearance:none;-webkit-appearance:none;-moz-appearance:none;background-image:none;background-repeat:no-repeat;background-position:right .5rem center}.custom-input{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem;font-weight:400;border:1px solid #ccc;border-radius:4px;padding:.5rem}.form-label{font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.label-styles{font-weight:400;font-family:Inter,Arial,sans-serif;font-size:16px;line-height:19.36px;text-align:left;margin-top:1rem;margin-bottom:.5rem}.select-container{position:relative;display:inline-block;width:100%}.select-container lucide-icon{position:absolute;right:.75rem;top:50%;transform:translateY(-50%);pointer-events:none;color:#5e6366}.ng-select{display:block;width:100%;font-family:Inter,Arial,sans-serif;color:#333;font-size:1rem}.ng-select .ng-select-container{display:flex;align-items:center;border:1px solid #ccc;border-radius:4px;padding:.5rem;background-color:#fff;color:#333}.ng-select .ng-select-container .ng-value-container{display:flex;align-items:center;flex-grow:1}.ng-select .ng-select-container .ng-clear{display:none}.ng-select .ng-select-container .ng-input{flex-grow:1;border:none;outline:none}.custom-ng-select.ng-select .ng-select-container .ng-input>input{box-sizing:border-box;background:none transparent;border:0 none;box-shadow:none;outline:none;padding:.5rem!important;cursor:default;width:100%}.ng-select .ng-dropdown-panel{border:1px solid #ccc;border-radius:4px;background-color:#fff;color:#333;box-shadow:0 2px 4px #0000001a}.ng-select .ng-dropdown-panel .ng-option{padding:8px;cursor:pointer}.ng-select .ng-dropdown-panel .ng-option:hover{background-color:#f1f1f1}.ng-select .ng-dropdown-panel .ng-option.selected{background-color:#007bff;color:#fff}\n"] }]
|
|
1306
1313
|
}], ctorParameters: function () { return [{ type: AuthService }, { type: i2.HttpClient }]; }, propDecorators: { label: [{
|
|
1307
1314
|
type: Input
|
|
1308
1315
|
}], data: [{
|
|
@@ -1323,6 +1330,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImpo
|
|
|
1323
1330
|
type: Input
|
|
1324
1331
|
}], searchUrl: [{
|
|
1325
1332
|
type: Input
|
|
1333
|
+
}], multiple: [{
|
|
1334
|
+
type: Input
|
|
1335
|
+
}], searchParams: [{
|
|
1336
|
+
type: Input
|
|
1326
1337
|
}], keyupEvent: [{
|
|
1327
1338
|
type: Output
|
|
1328
1339
|
}] } });
|