ca-components 1.2.17 → 1.2.19
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/ca-input/config/ca-input.config.mjs +1 -1
- package/esm2022/lib/components/ca-input-dropdown/ca-input-dropdown.component.mjs +13 -52
- package/fesm2022/ca-components.mjs +12 -51
- package/fesm2022/ca-components.mjs.map +1 -1
- package/lib/components/ca-input/config/ca-input.config.d.ts +1 -1
- package/lib/components/ca-input-dropdown/ca-input-dropdown.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -11982,7 +11982,10 @@ class CaInputDropdownComponent {
|
|
|
11982
11982
|
return this.superControl.control;
|
|
11983
11983
|
}
|
|
11984
11984
|
writeValue(value) {
|
|
11985
|
-
const
|
|
11985
|
+
const findInOptions = this.inputConfig.searchinGroupIndex
|
|
11986
|
+
? this.getMainGroup()
|
|
11987
|
+
: this._options;
|
|
11988
|
+
const findOption = findInOptions.find((option) => option[this.optionValue] == value);
|
|
11986
11989
|
if (findOption) {
|
|
11987
11990
|
this.setDropdownValue(findOption);
|
|
11988
11991
|
}
|
|
@@ -12351,6 +12354,13 @@ class CaInputDropdownComponent {
|
|
|
12351
12354
|
this.selectedItem.emit(this._activeItem);
|
|
12352
12355
|
}
|
|
12353
12356
|
}
|
|
12357
|
+
getMainGroup() {
|
|
12358
|
+
let mainGroup = [];
|
|
12359
|
+
this._options.map((groups) => {
|
|
12360
|
+
mainGroup.push(...groups[this.inputConfig.searchinGroupIndex]);
|
|
12361
|
+
});
|
|
12362
|
+
return mainGroup;
|
|
12363
|
+
}
|
|
12354
12364
|
dropDownKeyNavigation({ keyCode, data, }) {
|
|
12355
12365
|
// Navigate down
|
|
12356
12366
|
if (keyCode === 40) {
|
|
@@ -12360,38 +12370,11 @@ class CaInputDropdownComponent {
|
|
|
12360
12370
|
if (keyCode === 38) {
|
|
12361
12371
|
this.dropdownNavigation(-1);
|
|
12362
12372
|
}
|
|
12363
|
-
// Press Escape
|
|
12364
|
-
if (keyCode === 27) {
|
|
12365
|
-
// if (this.inputConfig?.commands?.active) {
|
|
12366
|
-
// this.inputConfig.commands = undefined;
|
|
12367
|
-
// this.inputRef.isVisibleCommands = false;
|
|
12368
|
-
// this.inputRef.isFocusInput = false;
|
|
12369
|
-
// }
|
|
12370
|
-
// if (this.inputConfig.dropdownLabel) {
|
|
12371
|
-
// this.getSuperControl?.setErrors(null);
|
|
12372
|
-
// // this.inputConfig.dropdownLabelNew = false;
|
|
12373
|
-
// // this.inputConfig.commands!.active = false;
|
|
12374
|
-
// // if (!this.inputConfig.hideColorValidations) {
|
|
12375
|
-
// // this.inputConfig.blackInput = false;
|
|
12376
|
-
// // }
|
|
12377
|
-
// this.inputRef.isFocusInput = false;
|
|
12378
|
-
// this.inputRef.isEditInput = false;
|
|
12379
|
-
// this.inputRef.inputElement.nativeElement.blur();
|
|
12380
|
-
// if (this.labelMode === 'Color') {
|
|
12381
|
-
// this.getSuperControl!.patchValue(null);
|
|
12382
|
-
// this.selectedLabelMode.emit('Label');
|
|
12383
|
-
// }
|
|
12384
|
-
// }
|
|
12385
|
-
}
|
|
12386
12373
|
// Press 'enter'
|
|
12387
12374
|
if (keyCode === 13) {
|
|
12388
12375
|
let selectedItem;
|
|
12389
12376
|
if (this.inputConfig.searchinGroupIndex) {
|
|
12390
|
-
let mainGroup =
|
|
12391
|
-
this._options.map((groups) => {
|
|
12392
|
-
mainGroup.push(...groups[this.inputConfig
|
|
12393
|
-
.searchinGroupIndex]);
|
|
12394
|
-
});
|
|
12377
|
+
let mainGroup = this.getMainGroup();
|
|
12395
12378
|
selectedItem = mainGroup[this.inputHoveredItem];
|
|
12396
12379
|
}
|
|
12397
12380
|
else {
|
|
@@ -12415,31 +12398,9 @@ class CaInputDropdownComponent {
|
|
|
12415
12398
|
if (keyCode === 9) {
|
|
12416
12399
|
if (!this.popoverRef.isOpen())
|
|
12417
12400
|
this.popoverRef?.open();
|
|
12418
|
-
return;
|
|
12419
|
-
//this.popoverRef.open();
|
|
12420
|
-
//return;
|
|
12421
|
-
if (this._options.length === 1 &&
|
|
12422
|
-
this._options[0].id !== 7655 &&
|
|
12423
|
-
this._options[0].id !== 7654) {
|
|
12424
|
-
// let selectedItem = null;
|
|
12425
|
-
// if (this._template === 'fuel-franchise') {
|
|
12426
|
-
// selectedItem = this._options[0]?.businessName
|
|
12427
|
-
// ? this._options[0]?.businessName
|
|
12428
|
-
// : this._options[0]?.name;
|
|
12429
|
-
// } else {
|
|
12430
|
-
// selectedItem = this._options[0]?.number
|
|
12431
|
-
// ? this._options[0]?.number.toString().trim()
|
|
12432
|
-
// : this._options[0].name!.toString().trim();
|
|
12433
|
-
// }
|
|
12434
|
-
// this.pickupElementWithKeyboard(selectedItem, data);
|
|
12435
|
-
}
|
|
12436
|
-
else {
|
|
12437
|
-
this.popoverRef.open();
|
|
12438
|
-
}
|
|
12439
12401
|
}
|
|
12440
12402
|
}
|
|
12441
12403
|
setDropdownValue(option, optionValue, label) {
|
|
12442
|
-
console.log('WHAT IS OPTION', option);
|
|
12443
12404
|
const optValue = optionValue ? optionValue : this.optionValue;
|
|
12444
12405
|
const lbel = label ? label : this.label;
|
|
12445
12406
|
const controlValue = optValue
|