@apexara/ng-components 1.0.5 → 1.0.6-test.2
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 +298 -25
- package/fesm2022/apexara-ng-components-checkbox.mjs +53 -11
- package/fesm2022/apexara-ng-components-checkbox.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-chip.mjs +5 -2
- package/fesm2022/apexara-ng-components-chip.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-datepicker.mjs +65 -70
- package/fesm2022/apexara-ng-components-datepicker.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-dialog.mjs +2 -2
- package/fesm2022/apexara-ng-components-dialog.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-drawer.mjs +12 -22
- package/fesm2022/apexara-ng-components-drawer.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-expander.mjs +3 -15
- package/fesm2022/apexara-ng-components-expander.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-image.mjs +3 -5
- package/fesm2022/apexara-ng-components-image.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-input.mjs +19 -19
- package/fesm2022/apexara-ng-components-input.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-listbox.mjs +41 -33
- package/fesm2022/apexara-ng-components-listbox.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-more-options.mjs +132 -0
- package/fesm2022/apexara-ng-components-more-options.mjs.map +1 -0
- package/fesm2022/apexara-ng-components-radiobutton.mjs +2 -2
- package/fesm2022/apexara-ng-components-radiobutton.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-select.mjs +96 -79
- package/fesm2022/apexara-ng-components-select.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-snackbar.mjs +2 -44
- package/fesm2022/apexara-ng-components-snackbar.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-table.mjs +175 -102
- package/fesm2022/apexara-ng-components-table.mjs.map +1 -1
- package/fesm2022/apexara-ng-components-textarea.mjs +20 -17
- package/fesm2022/apexara-ng-components-textarea.mjs.map +1 -1
- package/package.json +5 -2
- package/types/apexara-ng-components-checkbox.d.ts +17 -8
- package/types/apexara-ng-components-chip.d.ts +7 -1
- package/types/apexara-ng-components-datepicker.d.ts +4 -6
- package/types/apexara-ng-components-drawer.d.ts +3 -4
- package/types/apexara-ng-components-image.d.ts +2 -3
- package/types/apexara-ng-components-input.d.ts +6 -8
- package/types/apexara-ng-components-listbox.d.ts +7 -8
- package/types/apexara-ng-components-more-options.d.ts +34 -0
- package/types/apexara-ng-components-select.d.ts +13 -10
- package/types/apexara-ng-components-snackbar.d.ts +0 -3
- package/types/apexara-ng-components-table.d.ts +46 -23
- package/types/apexara-ng-components-textarea.d.ts +6 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apexara-ng-components-input.mjs","sources":["../../../../projects/apexara/ng-components/input/src/input.component.ts","../../../../projects/apexara/ng-components/input/src/input.component.html","../../../../projects/apexara/ng-components/input/apexara-ng-components-input.ts"],"sourcesContent":["import { Component, ChangeDetectorRef, Input, Output, EventEmitter, HostListener } from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { RouterLink } from '@angular/router';\nimport { AbstractControl, FormGroup, FormsModule, ReactiveFormsModule } from '@angular/forms';\n\nimport { Subscription } from 'rxjs';\n\nimport { ApexImageComponent } from '@apexara/ng-components/image';\n\nimport { ApexTooltipDirective, TooltipPosition } from '@apexara/ng-components/tooltip';\n\nexport interface ApexInputOptions {\n label: string;\n type?: string;\n tooltip?: string;\n disabled?: boolean;\n placeholder?: string;\n helperText?: string;\n helperRoute?: string;\n prefixImg?: string;\n suffixImg?: string;\n formGroup?: FormGroup;\n formControlName?: string;\n errors?: ApexControlErrors;\n}\n\nexport interface ApexControlErrors {\n [x: string]: string;\n}\n\n@Component({\n selector: 'apex-input',\n templateUrl: './input.component.html',\n styleUrls: ['./input.component.css'],\n imports: [\n NgClass,\n NgTemplateOutlet,\n RouterLink,\n FormsModule,\n ApexImageComponent,\n ReactiveFormsModule,\n ApexTooltipDirective,\n ApexTooltipDirective\n ]\n})\n\nexport class ApexInputComponent {\n\n constructor(private changeDetectorRef: ChangeDetectorRef) { \n this.changeDetectorRef.detach();\n }\n\n @Input() options!: ApexInputOptions;\n\n @Output() inputChange = new EventEmitter<string>();\n @Output() suffixImgChange = new EventEmitter<void>();\n @Output() helperTextChange = new EventEmitter<void>();\n\n public label!: string;\n public controlInvalid = false;\n public tooltipPosition = TooltipPosition;\n\n private controlSubscription!: Subscription;\n private control: AbstractControl | null = null;\n\n public ngOnInit(): void {\n this.setControl();\n\n this.changeDetectorRef.detectChanges();\n }\n\n public ngOnDestroy(): void {\n if (this.controlSubscription) {\n this.controlSubscription.unsubscribe();\n }\n }\n\n public onInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n \n const sanitizedValue = input.value.replace(/([\\u2700-\\u27BF]|[\\uE000-\\uF8FF]|[\\uD83C-\\uDBFF\\uDC00-\\uDFFF])/g, '');\n \n input.value = sanitizedValue;\n \n this.inputChange.emit(sanitizedValue);\n \n this.changeDetectorRef.detectChanges();\n }\n\n public onSuffixImage(): void {\n this.suffixImgChange.emit();\n\n this.changeDetectorRef.detectChanges();\n }\n\n public onHelperText(): void {\n this.helperTextChange.emit();\n\n this.changeDetectorRef.detectChanges();\n }\n\n @HostListener('focusout')\n onFocusOut(): void {\n this.initChange();\n }\n\n private setControl(): void {\n if (!this.options) {\n return;\n }\n\n if (!this.options.placeholder) {\n this.options.placeholder = this.options.label;\n }\n \n if (!this.options.formGroup || !this.options.formControlName) {\n return;\n }\n\n this.control = this.options.formGroup.controls[this.options.formControlName];\n\n this.checkIfControlDisabled(this.control);\n\n this.control.markAsTouched();\n\n this.controlSubscription = this.control.statusChanges.subscribe(() => {\n this.initChange();\n });\n }\n\n private initChange(): void {\n if (!this.control) {\n return;\n }\n\n this.checkIfControlInvalid(this.control);\n\n this.getLabel();\n\n this.changeDetectorRef.detectChanges();\n }\n\n private checkIfControlInvalid(control: AbstractControl): void {\n this.controlInvalid = control.touched && control.invalid;\n }\n\n private checkIfControlDisabled(control: AbstractControl): void {\n if (control.disabled || this.options.disabled) {\n control.disable();\n \n this.options.disabled = true;\n }\n }\n\n private getLabel(): void {\n this.label = '';\n\n const options = this.options!;\n const formGroup = options.formGroup;\n const formControlName = options.formControlName;\n\n if (formGroup && formControlName && options.errors && this.controlInvalid) {\n for (const error in options.errors) {\n if (formGroup.controls[formControlName].hasError(error)) {\n this.label = options.errors[error];\n\n return;\n }\n }\n\n }\n }\n\n}\n","@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"input-field\" [ngClass]=\"{ 'disabled': options.disabled }\">\n <ng-container [ngTemplateOutlet]=\"prefix\" [ngTemplateOutletContext]=\"{ prefixImg: options.prefixImg }\"></ng-container>\n\n <input [disabled]=\"options.disabled\" class=\"input\" autocomplete=\"off\" [type]=\"options.type ? options.type : 'text'\" [placeholder]=\"options.placeholder\" (input)=\"onInput($event)\"/>\n\n <ng-container [ngTemplateOutlet]=\"suffix\" [ngTemplateOutletContext]=\"{ suffixImg: options.suffixImg }\"></ng-container>\n </div>\n } @else {\n <div class=\"input-field\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'error': controlInvalid, 'disabled': options.disabled }\">\n <ng-container [ngTemplateOutlet]=\"prefix\" [ngTemplateOutletContext]=\"{ prefixImg: options.prefixImg }\"></ng-container>\n\n @if (options.formControlName) {\n <input class=\"input\" autocomplete=\"off\" [type]=\"options.type ? options.type : 'text'\" [placeholder]=\"options.placeholder\" [formControlName]=\"options.formControlName\"/>\n }\n\n <ng-container [ngTemplateOutlet]=\"suffix\" [ngTemplateOutletContext]=\"{ suffixImg: options.suffixImg }\"></ng-container>\n </div>\n\n <div class=\"footer\" [ngClass]=\"{ 'error': controlInvalid }\">\n {{ label }}\n </div>\n }\n}\n\n<ng-template #prefix let-prefixImg=\"prefixImg\">\n @if (prefixImg) {\n <apex-img class=\"icon left\" [src]=\"'assets/img/' + prefixImg\" [alt]=\"'Input prefix icon'\"></apex-img>\n }\n</ng-template>\n\n<ng-template #suffix let-suffixImg=\"suffixImg\">\n @if (suffixImg) {\n <apex-img class=\"icon right\" [src]=\"'assets/img/' + suffixImg\" (click)=\"onSuffixImage()\" [alt]=\"'Input suffix icon'\"></apex-img>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MA8Ca,kBAAkB,CAAA;AAE7B,IAAA,WAAA,CAAoB,iBAAoC,EAAA;QAApC,IAAA,CAAA,iBAAiB,GAAjB,iBAAiB;AAM3B,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAU;AACxC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAQ;AAC1C,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,YAAY,EAAQ;QAG9C,IAAA,CAAA,cAAc,GAAG,KAAK;QACtB,IAAA,CAAA,eAAe,GAAG,eAAe;QAGhC,IAAA,CAAA,OAAO,GAA2B,IAAI;AAd5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,"file":"apexara-ng-components-input.mjs","sources":["../../../../projects/apexara/ng-components/input/src/input.component.ts","../../../../projects/apexara/ng-components/input/src/input.component.html","../../../../projects/apexara/ng-components/input/apexara-ng-components-input.ts"],"sourcesContent":["import { Component, Input, Output, EventEmitter, HostListener, signal } from '@angular/core';\nimport { NgClass, NgTemplateOutlet } from '@angular/common';\nimport { RouterLink } from '@angular/router';\nimport { AbstractControl, FormGroup, FormsModule, ReactiveFormsModule, TouchedChangeEvent } from '@angular/forms';\n\nimport { Subscription, filter } from 'rxjs';\n\nimport { ApexImageComponent } from '@apexara/ng-components/image';\n\nimport { ApexTooltipDirective, TooltipPosition } from '@apexara/ng-components/tooltip';\n\nexport interface ApexInputOptions {\n label: string;\n type?: string;\n tooltip?: string;\n disabled?: boolean;\n placeholder?: string;\n helperText?: string;\n helperRoute?: string;\n prefixImg?: string;\n suffixImg?: string;\n formGroup?: FormGroup;\n formControlName?: string;\n errors?: ApexControlErrors;\n}\n\nexport interface ApexControlErrors {\n [x: string]: string;\n}\n\n@Component({\n selector: 'apex-input',\n templateUrl: './input.component.html',\n styleUrls: ['./input.component.css'],\n imports: [\n NgClass,\n NgTemplateOutlet,\n RouterLink,\n FormsModule,\n ApexImageComponent,\n ReactiveFormsModule,\n ApexTooltipDirective,\n ApexTooltipDirective\n ]\n})\n\nexport class ApexInputComponent {\n\n @Input() options!: ApexInputOptions;\n\n @Output() inputChange = new EventEmitter<string>();\n @Output() suffixImgChange = new EventEmitter<void>();\n @Output() helperTextChange = new EventEmitter<void>();\n\n public label = signal('');\n public controlInvalid = signal(false);\n public tooltipPosition = TooltipPosition;\n\n private controlSubscription!: Subscription;\n private control: AbstractControl | null = null;\n\n public ngOnInit(): void {\n this.setControl();\n }\n\n public ngOnDestroy(): void {\n if (this.controlSubscription) {\n this.controlSubscription.unsubscribe();\n }\n }\n\n public onInput(event: Event): void {\n const input = event.target as HTMLInputElement;\n\n const sanitizedValue = input.value.replace(/([\\u2700-\\u27BF]|[\\uE000-\\uF8FF]|[\\uD83C-\\uDBFF\\uDC00-\\uDFFF])/g, '');\n\n input.value = sanitizedValue;\n\n this.inputChange.emit(sanitizedValue);\n }\n\n public onSuffixImage(): void {\n this.suffixImgChange.emit();\n }\n\n public onHelperText(): void {\n this.helperTextChange.emit();\n }\n\n @HostListener('focusout')\n onFocusOut(): void {\n this.initChange();\n }\n\n private setControl(): void {\n if (!this.options) {\n return;\n }\n\n if (!this.options.placeholder) {\n this.options.placeholder = this.options.label;\n }\n\n if (!this.options.formGroup || !this.options.formControlName) {\n return;\n }\n\n this.control = this.options.formGroup.controls[this.options.formControlName];\n\n this.checkIfControlDisabled(this.control);\n\n this.control.markAsTouched();\n\n this.controlSubscription = this.control.statusChanges.subscribe(() => {\n this.initChange();\n });\n\n this.controlSubscription.add(\n this.control.events\n .pipe(filter(event => event instanceof TouchedChangeEvent))\n .subscribe(() => {\n this.initChange();\n })\n );\n }\n\n private initChange(): void {\n if (!this.control) {\n return;\n }\n\n this.checkIfControlInvalid(this.control);\n\n this.getLabel();\n }\n\n private checkIfControlInvalid(control: AbstractControl): void {\n this.controlInvalid.set(control.touched && control.invalid);\n }\n\n private checkIfControlDisabled(control: AbstractControl): void {\n if (control.disabled || this.options.disabled) {\n control.disable();\n\n this.options.disabled = true;\n }\n }\n\n private getLabel(): void {\n this.label.set('');\n\n const options = this.options!;\n const formGroup = options.formGroup;\n const formControlName = options.formControlName;\n\n if (formGroup && formControlName && options.errors && this.controlInvalid()) {\n for (const error in options.errors) {\n if (formGroup.controls[formControlName].hasError(error)) {\n this.label.set(options.errors[error]);\n\n return;\n }\n }\n\n }\n }\n\n}\n","@if (options) {\n @if (options.label !== '') {\n <div class=\"header\">\n <div class=\"label-wrapper\">\n <label>{{ options.label }}</label>\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n @if (options.helperText) {\n <div class=\"header-helper\" (click)=\"onHelperText()\" [routerLink]=\"options.helperRoute\">{{ options.helperText }}</div>\n }\n </div>\n }\n\n @if (!options.formGroup) {\n <div class=\"input-field\" [ngClass]=\"{ 'disabled': options.disabled }\">\n <ng-container [ngTemplateOutlet]=\"prefix\" [ngTemplateOutletContext]=\"{ prefixImg: options.prefixImg }\"></ng-container>\n\n <input [disabled]=\"options.disabled\" class=\"input\" autocomplete=\"off\" [type]=\"options.type ? options.type : 'text'\" [placeholder]=\"options.placeholder\" (input)=\"onInput($event)\"/>\n\n <ng-container [ngTemplateOutlet]=\"suffix\" [ngTemplateOutletContext]=\"{ suffixImg: options.suffixImg }\"></ng-container>\n </div>\n } @else {\n <div class=\"input-field\" [formGroup]=\"options.formGroup\" [ngClass]=\"{ 'error': controlInvalid(), 'disabled': options.disabled }\">\n <ng-container [ngTemplateOutlet]=\"prefix\" [ngTemplateOutletContext]=\"{ prefixImg: options.prefixImg }\"></ng-container>\n\n @if (options.formControlName) {\n <input class=\"input\" autocomplete=\"off\" [type]=\"options.type ? options.type : 'text'\" [placeholder]=\"options.placeholder\" [formControlName]=\"options.formControlName\"/>\n }\n\n <ng-container [ngTemplateOutlet]=\"suffix\" [ngTemplateOutletContext]=\"{ suffixImg: options.suffixImg }\"></ng-container>\n </div>\n\n <div class=\"footer\" [ngClass]=\"{ 'error': controlInvalid() }\">\n {{ label() }}\n </div>\n }\n}\n\n<ng-template #prefix let-prefixImg=\"prefixImg\">\n @if (prefixImg) {\n <apex-img class=\"icon left\" [src]=\"'assets/img/' + prefixImg\" [alt]=\"'Input prefix icon'\"></apex-img>\n }\n</ng-template>\n\n<ng-template #suffix let-suffixImg=\"suffixImg\">\n @if (suffixImg) {\n <apex-img class=\"icon right\" [src]=\"'assets/img/' + suffixImg\" (click)=\"onSuffixImage()\" [alt]=\"'Input suffix icon'\"></apex-img>\n }\n</ng-template>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;MA8Ca,kBAAkB,CAAA;AAhB/B,IAAA,WAAA,GAAA;AAoBY,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,YAAY,EAAU;AACxC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAAQ;AAC1C,QAAA,IAAA,CAAA,gBAAgB,GAAG,IAAI,YAAY,EAAQ;AAE9C,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,EAAE,iDAAC;AAClB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,KAAK,0DAAC;QAC9B,IAAA,CAAA,eAAe,GAAG,eAAe;QAGhC,IAAA,CAAA,OAAO,GAA2B,IAAI;AA4G/C,IAAA;IA1GQ,QAAQ,GAAA;QACb,IAAI,CAAC,UAAU,EAAE;IACnB;IAEO,WAAW,GAAA;AAChB,QAAA,IAAI,IAAI,CAAC,mBAAmB,EAAE;AAC5B,YAAA,IAAI,CAAC,mBAAmB,CAAC,WAAW,EAAE;QACxC;IACF;AAEO,IAAA,OAAO,CAAC,KAAY,EAAA;AACzB,QAAA,MAAM,KAAK,GAAG,KAAK,CAAC,MAA0B;AAE9C,QAAA,MAAM,cAAc,GAAG,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,iEAAiE,EAAE,EAAE,CAAC;AAEjH,QAAA,KAAK,CAAC,KAAK,GAAG,cAAc;AAE5B,QAAA,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,cAAc,CAAC;IACvC;IAEO,aAAa,GAAA;AAClB,QAAA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QAAA,EAAA,UAAA,EAAA,MAAA,EAAA,CAAA,KAAA,EAAA,KAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EAClB,mBAAmB,gVACnB,oBAAoB,EAAA,QAAA,EAAA,eAAA,EAAA,MAAA,EAAA,CAAA,aAAA,EAAA,iBAAA,CAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAKX,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAhB9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,YAAY,EAAA,OAAA,EAGb;wBACP,OAAO;wBACP,gBAAgB;wBAChB,UAAU;wBACV,WAAW;wBACX,kBAAkB;wBAClB,mBAAmB;wBACnB,oBAAoB;wBACpB;AACD,qBAAA,EAAA,QAAA,EAAA,o9FAAA,EAAA,MAAA,EAAA,CAAA,61EAAA,CAAA,EAAA;;sBAKA;;sBAEA;;sBACA;;sBACA;;sBAqCA,YAAY;uBAAC,UAAU;;;AEzF1B;;AAEG;;;;"}
|
|
@@ -1,20 +1,21 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { EventEmitter, HostListener, Output, Input, ViewChild, Component } from '@angular/core';
|
|
2
|
+
import { EventEmitter, signal, HostListener, Output, Input, ViewChild, Component } from '@angular/core';
|
|
3
3
|
import * as i1 from '@angular/cdk/scrolling';
|
|
4
4
|
import { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';
|
|
5
|
-
import {
|
|
5
|
+
import { TouchedChangeEvent } from '@angular/forms';
|
|
6
|
+
import { fromEvent, tap, debounceTime, filter } from 'rxjs';
|
|
6
7
|
import { TooltipPosition, ApexTooltipDirective } from '@apexara/ng-components/tooltip';
|
|
7
8
|
|
|
8
9
|
class ApexListboxComponent {
|
|
9
|
-
constructor(elementRef
|
|
10
|
+
constructor(elementRef) {
|
|
10
11
|
this.elementRef = elementRef;
|
|
11
|
-
this.changeDetectorRef = changeDetectorRef;
|
|
12
12
|
this.listbox = null;
|
|
13
13
|
this.virtualScroll = false;
|
|
14
14
|
this.itemSize = 28; // Must match CSS row height of an item
|
|
15
15
|
this.selectChange = new EventEmitter();
|
|
16
16
|
this.tooltipPosition = TooltipPosition;
|
|
17
|
-
this.
|
|
17
|
+
this.controlError = signal('', ...(ngDevMode ? [{ debugName: "controlError" }] : []));
|
|
18
|
+
this.controlInvalid = signal(false, ...(ngDevMode ? [{ debugName: "controlInvalid" }] : []));
|
|
18
19
|
this.control = null;
|
|
19
20
|
this.controlSubscription = null;
|
|
20
21
|
this.documentKeyupValue = '';
|
|
@@ -27,14 +28,11 @@ class ApexListboxComponent {
|
|
|
27
28
|
// Drag selection state
|
|
28
29
|
this.dragSelecting = false;
|
|
29
30
|
this.dragAnchorIndex = 0;
|
|
31
|
+
this.selectedItems = signal([], ...(ngDevMode ? [{ debugName: "selectedItems" }] : []));
|
|
30
32
|
}
|
|
31
33
|
ngOnInit() {
|
|
32
34
|
this.control = this.getControl();
|
|
33
|
-
this.selectedItems
|
|
34
|
-
if (!this.virtualScroll) {
|
|
35
|
-
this.changeDetectorRef.detach();
|
|
36
|
-
}
|
|
37
|
-
this.changeDetectorRef.detectChanges();
|
|
35
|
+
this.selectedItems.set(new Array(this.options.data.length).fill(null));
|
|
38
36
|
}
|
|
39
37
|
ngAfterViewInit() {
|
|
40
38
|
this.documentKeyDownSubscription = fromEvent(this.elementRef.nativeElement, 'keydown')
|
|
@@ -48,12 +46,11 @@ class ApexListboxComponent {
|
|
|
48
46
|
}
|
|
49
47
|
}
|
|
50
48
|
ngOnChanges(changes) {
|
|
51
|
-
if (changes['options'] && changes['options'].currentValue['data'] && this.selectedItems) {
|
|
52
|
-
this.selectedItems.
|
|
49
|
+
if (changes['options'] && changes['options'].currentValue['data'] && this.selectedItems()) {
|
|
50
|
+
this.selectedItems.set([]);
|
|
53
51
|
// Refresh virtual viewport if enabled
|
|
54
52
|
setTimeout(() => {
|
|
55
53
|
this.cdkViewport?.checkViewportSize();
|
|
56
|
-
this.changeDetectorRef.detectChanges();
|
|
57
54
|
});
|
|
58
55
|
}
|
|
59
56
|
}
|
|
@@ -180,45 +177,47 @@ class ApexListboxComponent {
|
|
|
180
177
|
addSelectedItems(index) {
|
|
181
178
|
const isIndexNumber = typeof index === 'number';
|
|
182
179
|
this.lastSelectedItemIndex = isIndexNumber ? index : index.slice(-1)[0];
|
|
180
|
+
const items = [...this.selectedItems()];
|
|
183
181
|
if (isIndexNumber) {
|
|
184
|
-
|
|
182
|
+
items[index] = this.options.data[index];
|
|
185
183
|
}
|
|
186
184
|
else {
|
|
187
185
|
for (let i of index) {
|
|
188
|
-
|
|
186
|
+
items[i] = this.options.data[i];
|
|
189
187
|
}
|
|
190
188
|
}
|
|
189
|
+
this.selectedItems.set(items);
|
|
191
190
|
if (this.control) {
|
|
192
|
-
this.control.setValue(
|
|
191
|
+
this.control.setValue(items.filter(value => value !== null));
|
|
193
192
|
}
|
|
194
|
-
this.selectChange.emit(
|
|
195
|
-
this.changeDetectorRef.detectChanges();
|
|
193
|
+
this.selectChange.emit(items.filter(Boolean));
|
|
196
194
|
}
|
|
197
195
|
removeSelectedItems(index) {
|
|
198
196
|
const isIndexNumber = typeof index === 'number';
|
|
197
|
+
const items = [...this.selectedItems()];
|
|
199
198
|
if (isIndexNumber) {
|
|
200
|
-
|
|
199
|
+
items[index] = null;
|
|
201
200
|
}
|
|
202
201
|
else {
|
|
203
202
|
for (let i of index) {
|
|
204
|
-
|
|
203
|
+
items[i] = null;
|
|
205
204
|
}
|
|
206
205
|
}
|
|
206
|
+
this.selectedItems.set(items);
|
|
207
207
|
if (this.control) {
|
|
208
|
-
this.control?.setValue(
|
|
208
|
+
this.control?.setValue(items.filter(value => value !== null));
|
|
209
209
|
}
|
|
210
|
-
this.selectChange.emit(
|
|
211
|
-
this.changeDetectorRef.detectChanges();
|
|
210
|
+
this.selectChange.emit(items.filter(Boolean));
|
|
212
211
|
}
|
|
213
212
|
clearAllSelections() {
|
|
214
|
-
this.selectedItems
|
|
213
|
+
this.selectedItems.set(new Array(this.options.data.length).fill(null));
|
|
215
214
|
if (this.control) {
|
|
216
215
|
this.control.setValue([]);
|
|
217
216
|
}
|
|
218
217
|
this.selectChange.emit([]);
|
|
219
218
|
}
|
|
220
219
|
isIndexSelected(index) {
|
|
221
|
-
return !!this.selectedItems[index];
|
|
220
|
+
return !!this.selectedItems()[index];
|
|
222
221
|
}
|
|
223
222
|
trackByIndex(index) { return index; }
|
|
224
223
|
scrollIndexIntoView(index) {
|
|
@@ -250,35 +249,44 @@ class ApexListboxComponent {
|
|
|
250
249
|
this.checkIfControlInvalid(this.control);
|
|
251
250
|
this.getControlError(this.control);
|
|
252
251
|
});
|
|
252
|
+
this.controlSubscription.add(this.options.formGroup.controls[this.options.formControlName].events
|
|
253
|
+
.pipe(filter(event => event instanceof TouchedChangeEvent))
|
|
254
|
+
.subscribe(() => {
|
|
255
|
+
if (!this.control) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
this.checkIfControlInvalid(this.control);
|
|
259
|
+
this.getControlError(this.control);
|
|
260
|
+
}));
|
|
253
261
|
return this.options.formGroup.get(this.options.formControlName);
|
|
254
262
|
}
|
|
255
263
|
return null;
|
|
256
264
|
}
|
|
257
265
|
checkIfControlInvalid(control) {
|
|
258
|
-
this.controlInvalid
|
|
266
|
+
this.controlInvalid.set(control.invalid);
|
|
259
267
|
}
|
|
260
268
|
getControlError(control) {
|
|
261
|
-
this.controlError
|
|
269
|
+
this.controlError.set('');
|
|
262
270
|
const options = this.options;
|
|
263
|
-
if (options.errors && this.controlInvalid) {
|
|
271
|
+
if (options.errors && this.controlInvalid()) {
|
|
264
272
|
for (const error in options.errors) {
|
|
265
273
|
if (control.hasError(error)) {
|
|
266
|
-
this.controlError
|
|
274
|
+
this.controlError.set(options.errors[error]);
|
|
267
275
|
return;
|
|
268
276
|
}
|
|
269
277
|
}
|
|
270
278
|
}
|
|
271
279
|
}
|
|
272
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexListboxComponent, deps: [{ token: i0.ElementRef }
|
|
273
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexListboxComponent, isStandalone: true, selector: "apex-listbox", inputs: { options: "options", virtualScroll: "virtualScroll", itemSize: "itemSize" }, outputs: { selectChange: "selectChange" }, host: { listeners: { "document:mouseup": "mouseup()", "keyup": "keyup($event)" } }, viewQueries: [{ propertyName: "listbox", first: true, predicate: ["listbox"], descendants: true }, { propertyName: "cdkViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (options) {\n <div class=\"listbox-header\">\n @if (options.label) {\n <label>{{ options.label }}</label>\n }\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n <div #listbox tabindex=\"0\" class=\"container\" [class.error]=\"controlInvalid\">\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport class=\"cdk-listbox-viewport\" [itemSize]=\"itemSize\" [style.overflow-y]=\"shouldShowViewportScroll() ? 'auto' : 'hidden'\">\n <div class=\"item\"\n *cdkVirtualFor=\"let data of options.data; let i = index; trackBy: trackByIndex\"\n [attr.value]=\"i\"\n [style.height.px]=\"itemSize\"\n [style.line-height.px]=\"itemSize\"\n [class.selected]=\"isIndexSelected(i)\"\n (mousedown)=\"mousedown(i)\"\n (mouseover)=\"mouseover(i)\">\n {{ data.label }}\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div class=\"container-inner\">\n @for (data of options.data; track data.value) {\n <div class=\"item\" [attr.value]=\"$index\" [style.height.px]=\"itemSize\" [style.line-height.px]=\"itemSize\" [class.selected]=\"isIndexSelected($index)\" (mousedown)=\"mousedown($index)\" (mouseover)=\"mouseover($index)\">\n {{ data.label }}\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"footer\" [class.error]=\"controlInvalid\">\n {{ controlError }}\n </div>\n}\n", styles: [":host{width:fit-content}.container-inner:focus{outline:none}:host(.no-margin) .container{margin-top:0}.listbox-header{display:flex;align-items:center;justify-content:flex-start}label{font-size:14px;font-weight:600;color:var(--apex-listbox-label-color, default);padding:2px}.tooltip-icon path{fill:var(--apex-listbox-tooltip-icon-fill, transparent);stroke:var(--apex-listbox-tooltip-icon-stroke, #C6C6C6)}.container{min-width:264px;outline:none;box-sizing:border-box;color:var(--apex-listbox-item-color, #00000099);background-color:var(--apex-listbox-background-color, #FFFFFF);border:1px solid var(--apex-listbox-border-color, #F2F2F2);border-radius:8px;padding:2px}.container:hover,.container:focus{border-color:var(--apex-listbox-border-hover-color, #4B5368)}.container.error{border-color:var(--apex-listbox-border-invalid-color, #F96138)}.container-inner{height:224px;overflow-y:scroll;padding:0}.cdk-listbox-viewport{height:224px;overflow-y:auto;padding:0}.item{-webkit-user-select:none;user-select:none;font-size:14px;padding:0 4px;box-sizing:border-box;position:relative;overflow:hidden;cursor:pointer;z-index:1}.item.selected{color:var(--apex-listbox-item-selected-color, #F96138)}.item:after{width:5px;height:5px;position:absolute;top:50%;left:50%;content:\"\";background:#80808031;border-radius:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease-out}.item.selected:after{transform:translate(-50%,-50%) scale(50)}.footer{height:14px;font-size:12px;margin-top:2px}.footer.error{color:var(--apex-input-error-color, #F96138)}\n"], dependencies: [{ kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: ApexTooltipDirective, selector: "[apexTooltip]", inputs: ["apexTooltip", "tooltipPosition"] }] }); }
|
|
280
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexListboxComponent, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
281
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexListboxComponent, isStandalone: true, selector: "apex-listbox", inputs: { options: "options", virtualScroll: "virtualScroll", itemSize: "itemSize" }, outputs: { selectChange: "selectChange" }, host: { listeners: { "document:mouseup": "mouseup()", "keyup": "keyup($event)" } }, viewQueries: [{ propertyName: "listbox", first: true, predicate: ["listbox"], descendants: true }, { propertyName: "cdkViewport", first: true, predicate: CdkVirtualScrollViewport, descendants: true }], usesOnChanges: true, ngImport: i0, template: "@if (options) {\n <div class=\"listbox-header\">\n @if (options.label) {\n <label>{{ options.label }}</label>\n }\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n <div #listbox tabindex=\"0\" class=\"container\" [class.error]=\"controlInvalid()\">\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport class=\"cdk-listbox-viewport\" [itemSize]=\"itemSize\" [style.overflow-y]=\"shouldShowViewportScroll() ? 'auto' : 'hidden'\">\n <div class=\"item\"\n *cdkVirtualFor=\"let data of options.data; let i = index; trackBy: trackByIndex\"\n [attr.value]=\"i\"\n [style.height.px]=\"itemSize\"\n [style.line-height.px]=\"itemSize\"\n [class.selected]=\"isIndexSelected(i)\"\n (mousedown)=\"mousedown(i)\"\n (mouseover)=\"mouseover(i)\">\n {{ data.label }}\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div class=\"container-inner\">\n @for (data of options.data; track data.value) {\n <div class=\"item\" [attr.value]=\"$index\" [style.height.px]=\"itemSize\" [style.line-height.px]=\"itemSize\" [class.selected]=\"isIndexSelected($index)\" (mousedown)=\"mousedown($index)\" (mouseover)=\"mouseover($index)\">\n {{ data.label }}\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"footer\" [class.error]=\"controlInvalid()\">\n {{ controlError() }}\n </div>\n}\n", styles: [":host{width:fit-content}.container-inner:focus{outline:none}:host(.no-margin) .container{margin-top:0}.listbox-header{display:flex;align-items:center;justify-content:flex-start}label{font-size:14px;font-weight:600;color:var(--apex-listbox-label-color, default);padding:2px}.tooltip-icon path{fill:var(--apex-listbox-tooltip-icon-fill, transparent);stroke:var(--apex-listbox-tooltip-icon-stroke, #C6C6C6)}.container{min-width:264px;outline:none;box-sizing:border-box;color:var(--apex-listbox-item-color, #00000099);background-color:var(--apex-listbox-background-color, #FFFFFF);border:1px solid var(--apex-listbox-border-color, #F2F2F2);border-radius:8px;padding:2px}.container:hover,.container:focus{border-color:var(--apex-listbox-border-hover-color, #4B5368)}.container.error{border-color:var(--apex-listbox-border-invalid-color, #F96138)}.container-inner{height:224px;overflow-y:scroll;padding:0}.cdk-listbox-viewport{height:224px;overflow-y:auto;padding:0}.item{-webkit-user-select:none;user-select:none;font-size:14px;padding:0 4px;box-sizing:border-box;position:relative;overflow:hidden;cursor:pointer;z-index:1}.item.selected{color:var(--apex-listbox-item-selected-color, #F96138)}.item:after{width:5px;height:5px;position:absolute;top:50%;left:50%;content:\"\";background:#80808031;border-radius:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease-out}.item.selected:after{transform:translate(-50%,-50%) scale(50)}.footer{height:14px;font-size:12px;margin-top:2px}.footer.error{color:var(--apex-input-error-color, #F96138)}\n"], dependencies: [{ kind: "ngmodule", type: ScrollingModule }, { kind: "directive", type: i1.CdkFixedSizeVirtualScroll, selector: "cdk-virtual-scroll-viewport[itemSize]", inputs: ["itemSize", "minBufferPx", "maxBufferPx"] }, { kind: "directive", type: i1.CdkVirtualForOf, selector: "[cdkVirtualFor][cdkVirtualForOf]", inputs: ["cdkVirtualForOf", "cdkVirtualForTrackBy", "cdkVirtualForTemplate", "cdkVirtualForTemplateCacheSize"] }, { kind: "component", type: i1.CdkVirtualScrollViewport, selector: "cdk-virtual-scroll-viewport", inputs: ["orientation", "appendOnly"], outputs: ["scrolledIndexChange"] }, { kind: "directive", type: ApexTooltipDirective, selector: "[apexTooltip]", inputs: ["apexTooltip", "tooltipPosition"] }] }); }
|
|
274
282
|
}
|
|
275
283
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexListboxComponent, decorators: [{
|
|
276
284
|
type: Component,
|
|
277
285
|
args: [{ standalone: true, selector: 'apex-listbox', imports: [
|
|
278
286
|
ScrollingModule,
|
|
279
287
|
ApexTooltipDirective,
|
|
280
|
-
], template: "@if (options) {\n <div class=\"listbox-header\">\n @if (options.label) {\n <label>{{ options.label }}</label>\n }\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n <div #listbox tabindex=\"0\" class=\"container\" [class.error]=\"controlInvalid\">\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport class=\"cdk-listbox-viewport\" [itemSize]=\"itemSize\" [style.overflow-y]=\"shouldShowViewportScroll() ? 'auto' : 'hidden'\">\n <div class=\"item\"\n *cdkVirtualFor=\"let data of options.data; let i = index; trackBy: trackByIndex\"\n [attr.value]=\"i\"\n [style.height.px]=\"itemSize\"\n [style.line-height.px]=\"itemSize\"\n [class.selected]=\"isIndexSelected(i)\"\n (mousedown)=\"mousedown(i)\"\n (mouseover)=\"mouseover(i)\">\n {{ data.label }}\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div class=\"container-inner\">\n @for (data of options.data; track data.value) {\n <div class=\"item\" [attr.value]=\"$index\" [style.height.px]=\"itemSize\" [style.line-height.px]=\"itemSize\" [class.selected]=\"isIndexSelected($index)\" (mousedown)=\"mousedown($index)\" (mouseover)=\"mouseover($index)\">\n {{ data.label }}\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"footer\" [class.error]=\"controlInvalid\">\n {{ controlError }}\n </div>\n}\n", styles: [":host{width:fit-content}.container-inner:focus{outline:none}:host(.no-margin) .container{margin-top:0}.listbox-header{display:flex;align-items:center;justify-content:flex-start}label{font-size:14px;font-weight:600;color:var(--apex-listbox-label-color, default);padding:2px}.tooltip-icon path{fill:var(--apex-listbox-tooltip-icon-fill, transparent);stroke:var(--apex-listbox-tooltip-icon-stroke, #C6C6C6)}.container{min-width:264px;outline:none;box-sizing:border-box;color:var(--apex-listbox-item-color, #00000099);background-color:var(--apex-listbox-background-color, #FFFFFF);border:1px solid var(--apex-listbox-border-color, #F2F2F2);border-radius:8px;padding:2px}.container:hover,.container:focus{border-color:var(--apex-listbox-border-hover-color, #4B5368)}.container.error{border-color:var(--apex-listbox-border-invalid-color, #F96138)}.container-inner{height:224px;overflow-y:scroll;padding:0}.cdk-listbox-viewport{height:224px;overflow-y:auto;padding:0}.item{-webkit-user-select:none;user-select:none;font-size:14px;padding:0 4px;box-sizing:border-box;position:relative;overflow:hidden;cursor:pointer;z-index:1}.item.selected{color:var(--apex-listbox-item-selected-color, #F96138)}.item:after{width:5px;height:5px;position:absolute;top:50%;left:50%;content:\"\";background:#80808031;border-radius:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease-out}.item.selected:after{transform:translate(-50%,-50%) scale(50)}.footer{height:14px;font-size:12px;margin-top:2px}.footer.error{color:var(--apex-input-error-color, #F96138)}\n"] }]
|
|
281
|
-
}], ctorParameters: () => [{ type: i0.ElementRef }
|
|
288
|
+
], template: "@if (options) {\n <div class=\"listbox-header\">\n @if (options.label) {\n <label>{{ options.label }}</label>\n }\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n <div #listbox tabindex=\"0\" class=\"container\" [class.error]=\"controlInvalid()\">\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport class=\"cdk-listbox-viewport\" [itemSize]=\"itemSize\" [style.overflow-y]=\"shouldShowViewportScroll() ? 'auto' : 'hidden'\">\n <div class=\"item\"\n *cdkVirtualFor=\"let data of options.data; let i = index; trackBy: trackByIndex\"\n [attr.value]=\"i\"\n [style.height.px]=\"itemSize\"\n [style.line-height.px]=\"itemSize\"\n [class.selected]=\"isIndexSelected(i)\"\n (mousedown)=\"mousedown(i)\"\n (mouseover)=\"mouseover(i)\">\n {{ data.label }}\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div class=\"container-inner\">\n @for (data of options.data; track data.value) {\n <div class=\"item\" [attr.value]=\"$index\" [style.height.px]=\"itemSize\" [style.line-height.px]=\"itemSize\" [class.selected]=\"isIndexSelected($index)\" (mousedown)=\"mousedown($index)\" (mouseover)=\"mouseover($index)\">\n {{ data.label }}\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"footer\" [class.error]=\"controlInvalid()\">\n {{ controlError() }}\n </div>\n}\n", styles: [":host{width:fit-content}.container-inner:focus{outline:none}:host(.no-margin) .container{margin-top:0}.listbox-header{display:flex;align-items:center;justify-content:flex-start}label{font-size:14px;font-weight:600;color:var(--apex-listbox-label-color, default);padding:2px}.tooltip-icon path{fill:var(--apex-listbox-tooltip-icon-fill, transparent);stroke:var(--apex-listbox-tooltip-icon-stroke, #C6C6C6)}.container{min-width:264px;outline:none;box-sizing:border-box;color:var(--apex-listbox-item-color, #00000099);background-color:var(--apex-listbox-background-color, #FFFFFF);border:1px solid var(--apex-listbox-border-color, #F2F2F2);border-radius:8px;padding:2px}.container:hover,.container:focus{border-color:var(--apex-listbox-border-hover-color, #4B5368)}.container.error{border-color:var(--apex-listbox-border-invalid-color, #F96138)}.container-inner{height:224px;overflow-y:scroll;padding:0}.cdk-listbox-viewport{height:224px;overflow-y:auto;padding:0}.item{-webkit-user-select:none;user-select:none;font-size:14px;padding:0 4px;box-sizing:border-box;position:relative;overflow:hidden;cursor:pointer;z-index:1}.item.selected{color:var(--apex-listbox-item-selected-color, #F96138)}.item:after{width:5px;height:5px;position:absolute;top:50%;left:50%;content:\"\";background:#80808031;border-radius:50%;transform:translate(-50%,-50%) scale(0);transition:transform .2s ease-out}.item.selected:after{transform:translate(-50%,-50%) scale(50)}.footer{height:14px;font-size:12px;margin-top:2px}.footer.error{color:var(--apex-input-error-color, #F96138)}\n"] }]
|
|
289
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }], propDecorators: { listbox: [{
|
|
282
290
|
type: ViewChild,
|
|
283
291
|
args: ['listbox']
|
|
284
292
|
}], cdkViewport: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apexara-ng-components-listbox.mjs","sources":["../../../../projects/apexara/ng-components/listbox/src/listbox.component.ts","../../../../projects/apexara/ng-components/listbox/src/listbox.component.html","../../../../projects/apexara/ng-components/listbox/apexara-ng-components-listbox.ts"],"sourcesContent":["import { Component, SimpleChanges, ViewChild, ElementRef, ChangeDetectorRef, Input, Output, EventEmitter, HostListener } from '@angular/core';\nimport { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\nimport { FormGroup, AbstractControl } from '@angular/forms';\n\nimport { Subscription, debounceTime, fromEvent, tap } from 'rxjs';\n\nimport { ApexSelectData } from '@apexara/ng-components/select';\nimport { ApexControlErrors } from '@apexara/ng-components/input';\nimport { ApexTooltipDirective, TooltipPosition } from '@apexara/ng-components/tooltip';\n\nexport interface ApexListBoxOptions {\n data: ApexSelectData[];\n label?: string;\n tooltip?: string;\n formGroup?: FormGroup;\n formControlName?: string;\n errors?: ApexControlErrors;\n}\n\n@Component({\n standalone: true,\n selector: 'apex-listbox',\n templateUrl: './listbox.component.html',\n styleUrls: ['./listbox.component.css'],\n imports: [\n ScrollingModule,\n ApexTooltipDirective,\n ]\n})\n\nexport class ApexListboxComponent {\n\n constructor (\n private elementRef: ElementRef,\n private changeDetectorRef: ChangeDetectorRef) {\n }\n\n @ViewChild('listbox') listbox: ElementRef<HTMLDivElement> | null = null;\n @ViewChild(CdkVirtualScrollViewport) cdkViewport?: CdkVirtualScrollViewport;\n\n @Input() options!: ApexListBoxOptions;\n\n @Input() virtualScroll: boolean = false;\n @Input() itemSize: number = 28; // Must match CSS row height of an item\n\n @Output() selectChange = new EventEmitter<ApexSelectData[]>();\n\n public tooltipPosition = TooltipPosition;\n\n public controlError!: string;\n public controlInvalid = false;\n public control: AbstractControl | null = null; \n public controlSubscription: Subscription | null = null;\n\n private documentKeyupValue = '';\n private documentKeyupValueResetTime = 1000;\n private documentKeyDownSubscription!: Subscription;\n\n private isMetaHold = false;\n private isShiftHold = false;\n\n private listHeight: number = 224; // Default matches CSS\n\n private lastSelectedItemIndex = 0;\n private lastSelectedItemIndexOnShiftHold = 0;\n\n // Drag selection state\n private dragSelecting = false;\n private dragAnchorIndex = 0;\n\n private selectedItems!: (ApexSelectData | null)[];\n\n public ngOnInit(): void {\n this.control = this.getControl();\n \n this.selectedItems = new Array(this.options.data.length).fill(null);\n\n if (!this.virtualScroll) {\n this.changeDetectorRef.detach();\n }\n\n this.changeDetectorRef.detectChanges();\n }\n\n public ngAfterViewInit(): void {\n this.documentKeyDownSubscription = fromEvent<KeyboardEvent>(this.elementRef.nativeElement, 'keydown')\n .pipe(\n tap(event => { this.keydown(event) }),\n debounceTime(this.documentKeyupValueResetTime))\n .subscribe(() => { this.documentKeyupValue = '' });\n }\n\n public ngOnDestroy(): void {\n this.documentKeyDownSubscription.unsubscribe();\n\n if (this.controlSubscription) {\n this.controlSubscription?.unsubscribe();\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes['options'] && changes['options'].currentValue['data'] && this.selectedItems) {\n this.selectedItems.length = 0;\n\n // Refresh virtual viewport if enabled\n setTimeout(() => {\n this.cdkViewport?.checkViewportSize();\n this.changeDetectorRef.detectChanges();\n });\n }\n }\n\n public mousedown(index: number): void {\n this.dragSelecting = true;\n this.dragAnchorIndex = index;\n\n if (this.isShiftHold) {\n const max = Math.max(index, this.lastSelectedItemIndexOnShiftHold);\n const min = Math.min(index, this.lastSelectedItemIndexOnShiftHold);\n\n const indices = [] as number[];\n\n for (let i = min; i <= max; i++) { indices.push(i); }\n\n this.clearAllSelections();\n this.addSelectedItems(indices);\n return;\n }\n\n if (this.isMetaHold) {\n if (this.isIndexSelected(index)) {\n this.removeSelectedItems(index);\n } else {\n this.addSelectedItems(index);\n }\n return;\n }\n\n this.clearAllSelections();\n this.addSelectedItems(index);\n }\n\n @HostListener('document:mouseup')\n public mouseup(): void {\n this.dragSelecting = false;\n }\n\n @HostListener('keyup', ['$event'])\n public keyup(event: KeyboardEvent): void {\n if (event.code.toLowerCase().includes('shift')) {\n this.isShiftHold = false;\n\n return;\n }\n\n if (event.code.toLowerCase().includes('meta') || event.code.toLowerCase().includes('control')) {\n this.isMetaHold = false;\n }\n }\n\n public mouseover(index: number): void {\n if (!this.dragSelecting || this.isMetaHold || this.isShiftHold) {\n return;\n }\n\n const min = Math.min(this.dragAnchorIndex, index);\n const max = Math.max(this.dragAnchorIndex, index);\n\n const indices: number[] = [];\n for (let i = min; i <= max; i++) { indices.push(i); }\n\n this.clearAllSelections();\n this.addSelectedItems(indices);\n }\n\n private keydown(event: KeyboardEvent): void {\n if ((document.activeElement !== this.listbox?.nativeElement) && (document.activeElement !== this.listbox?.nativeElement.childNodes[0])) {\n return;\n }\n\n if (event.code.toLowerCase().includes('shift')) {\n this.isShiftHold = true;\n this.lastSelectedItemIndexOnShiftHold = this.lastSelectedItemIndex;\n }\n\n if (event.code.toLowerCase().includes('meta') || event.code.toLowerCase().includes('control')) {\n this.isMetaHold = true;\n }\n\n if (event.code.toLowerCase().includes('arrowdown')) {\n event.preventDefault();\n\n this.documentArrowsKeyup(true);\n\n return;\n }\n\n if (event.code.toLowerCase().includes('arrowup')) {\n event.preventDefault();\n\n this.documentArrowsKeyup(false);\n\n return;\n }\n\n this.documentKeyup(event);\n }\n\n private documentArrowsKeyup(isDownArrow: boolean): void {\n const dataLength = this.options.data.length;\n\n let newIndex = isDownArrow ? this.lastSelectedItemIndex + 1 : this.lastSelectedItemIndex - 1;\n\n if (this.isShiftHold) {\n if (newIndex < 0 || newIndex === dataLength) {\n return;\n }\n\n if (this.isIndexSelected(newIndex)) {\n const indexForDeselect = isDownArrow ? newIndex - 1 : newIndex + 1;\n this.removeSelectedItems(indexForDeselect);\n } else {\n this.addSelectedItems(newIndex);\n }\n\n this.lastSelectedItemIndex = newIndex;\n this.scrollIndexIntoView(newIndex);\n\n return;\n }\n\n this.clearAllSelections();\n\n newIndex = newIndex < 0 ? 0 : newIndex;\n newIndex = newIndex >= dataLength ? dataLength - 1 : newIndex;\n\n this.addSelectedItems(newIndex);\n this.scrollIndexIntoView(newIndex);\n }\n\n private documentKeyup(event: KeyboardEvent): void {\n if (this.isMetaHold && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n\n const itemsToAdd = [...this.options.data.keys()];\n this.addSelectedItems(itemsToAdd);\n\n return;\n }\n\n this.documentKeyupValue = this.documentKeyupValue + event.key.toLowerCase();\n\n let newIndex: number | null = null;\n\n for (let i = 0; i < this.options.data.length; i++) {\n const subLabel = this.options.data[i].label.substring(0, this.documentKeyupValue.length).toLowerCase();\n\n if (subLabel === this.documentKeyupValue) {\n newIndex = i;\n\n break;\n }\n }\n\n if (newIndex !== null) {\n this.clearAllSelections();\n this.addSelectedItems(newIndex);\n this.scrollIndexIntoView(newIndex);\n }\n }\n\n private addSelectedItems(index: number | number[]) {\n const isIndexNumber = typeof index === 'number';\n\n this.lastSelectedItemIndex = isIndexNumber ? index : index.slice(-1)[0];\n\n if (isIndexNumber) {\n this.selectedItems[index] = this.options.data[index];\n } else {\n for (let i of index) {\n this.selectedItems[i] = this.options.data[i];\n }\n }\n\n if (this.control) {\n this.control.setValue(this.selectedItems.filter(value => value !== null));\n }\n\n this.selectChange.emit(this.selectedItems.filter(Boolean) as ApexSelectData[]);\n\n this.changeDetectorRef.detectChanges();\n }\n\n private removeSelectedItems(index: number | number[]) {\n const isIndexNumber = typeof index === 'number';\n\n if (isIndexNumber) {\n this.selectedItems[index] = null;\n } else {\n for (let i of index) {\n this.selectedItems[i] = null;\n }\n }\n\n if (this.control) {\n this.control?.setValue(this.selectedItems.filter(value => value !== null));\n }\n\n this.selectChange.emit(this.selectedItems.filter(Boolean) as ApexSelectData[]);\n\n this.changeDetectorRef.detectChanges();\n }\n\n private clearAllSelections(): void {\n this.selectedItems = new Array(this.options.data.length).fill(null);\n\n if (this.control) {\n this.control.setValue([]);\n }\n\n this.selectChange.emit([]);\n }\n\n public isIndexSelected(index: number): boolean {\n return !!this.selectedItems[index];\n }\n\n public trackByIndex(index: number): number { return index; }\n\n private scrollIndexIntoView(index: number): void {\n if (this.virtualScroll && this.cdkViewport) {\n this.cdkViewport.scrollToIndex(index, 'smooth');\n return;\n }\n\n const container = this.listbox?.nativeElement;\n\n if (!container) {\n return;\n }\n\n const target = container.querySelector(`.item[value=\"${index}\"]`);\n target?.scrollIntoView({ block: 'nearest' });\n }\n\n public shouldShowViewportScroll(): boolean {\n if (!this.virtualScroll) {\n return false;\n }\n\n const renderedCount = this.options?.data ? this.options.data.length : 0;\n\n const rowsHeight = this.itemSize * renderedCount;\n\n return rowsHeight > this.listHeight;\n }\n\n private getControl(): AbstractControl | null {\n if (this.options.formGroup && this.options.formControlName) {\n this.controlSubscription = this.options.formGroup.controls[this.options.formControlName].valueChanges.subscribe(() => {\n if (!this.control) {\n return;\n }\n \n this.checkIfControlInvalid(this.control);\n\n this.getControlError(this.control);\n });\n\n return this.options.formGroup.get(this.options.formControlName);\n }\n \n return null;\n }\n\n private checkIfControlInvalid(control: AbstractControl): void {\n this.controlInvalid = control.invalid;\n }\n\n private getControlError(control: AbstractControl): void {\n this.controlError = '';\n\n const options = this.options!;\n\n if (options.errors && this.controlInvalid) {\n for (const error in options.errors) {\n if (control.hasError(error)) {\n this.controlError = options.errors[error];\n\n return;\n }\n }\n\n }\n }\n\n}\n","@if (options) {\n <div class=\"listbox-header\">\n @if (options.label) {\n <label>{{ options.label }}</label>\n }\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n <div #listbox tabindex=\"0\" class=\"container\" [class.error]=\"controlInvalid\">\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport class=\"cdk-listbox-viewport\" [itemSize]=\"itemSize\" [style.overflow-y]=\"shouldShowViewportScroll() ? 'auto' : 'hidden'\">\n <div class=\"item\"\n *cdkVirtualFor=\"let data of options.data; let i = index; trackBy: trackByIndex\"\n [attr.value]=\"i\"\n [style.height.px]=\"itemSize\"\n [style.line-height.px]=\"itemSize\"\n [class.selected]=\"isIndexSelected(i)\"\n (mousedown)=\"mousedown(i)\"\n (mouseover)=\"mouseover(i)\">\n {{ data.label }}\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div class=\"container-inner\">\n @for (data of options.data; track data.value) {\n <div class=\"item\" [attr.value]=\"$index\" [style.height.px]=\"itemSize\" [style.line-height.px]=\"itemSize\" [class.selected]=\"isIndexSelected($index)\" (mousedown)=\"mousedown($index)\" (mouseover)=\"mouseover($index)\">\n {{ data.label }}\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"footer\" [class.error]=\"controlInvalid\">\n {{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;uBAAC,kBAAkB;;sBAK/B,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AEnJnC;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"apexara-ng-components-listbox.mjs","sources":["../../../../projects/apexara/ng-components/listbox/src/listbox.component.ts","../../../../projects/apexara/ng-components/listbox/src/listbox.component.html","../../../../projects/apexara/ng-components/listbox/apexara-ng-components-listbox.ts"],"sourcesContent":["import { Component, SimpleChanges, ViewChild, ElementRef, Input, Output, EventEmitter, HostListener, signal } from '@angular/core';\nimport { ScrollingModule, CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\nimport { FormGroup, AbstractControl, TouchedChangeEvent } from '@angular/forms';\n\nimport { Subscription, debounceTime, filter, fromEvent, tap } from 'rxjs';\n\nimport { ApexSelectData } from '@apexara/ng-components/select';\nimport { ApexControlErrors } from '@apexara/ng-components/input';\nimport { ApexTooltipDirective, TooltipPosition } from '@apexara/ng-components/tooltip';\n\nexport interface ApexListBoxOptions {\n data: ApexSelectData[];\n label?: string;\n tooltip?: string;\n formGroup?: FormGroup;\n formControlName?: string;\n errors?: ApexControlErrors;\n}\n\n@Component({\n standalone: true,\n selector: 'apex-listbox',\n templateUrl: './listbox.component.html',\n styleUrls: ['./listbox.component.css'],\n imports: [\n ScrollingModule,\n ApexTooltipDirective,\n ]\n})\n\nexport class ApexListboxComponent {\n\n constructor (private elementRef: ElementRef) { }\n\n @ViewChild('listbox') listbox: ElementRef<HTMLDivElement> | null = null;\n @ViewChild(CdkVirtualScrollViewport) cdkViewport?: CdkVirtualScrollViewport;\n\n @Input() options!: ApexListBoxOptions;\n\n @Input() virtualScroll: boolean = false;\n @Input() itemSize: number = 28; // Must match CSS row height of an item\n\n @Output() selectChange = new EventEmitter<ApexSelectData[]>();\n\n public tooltipPosition = TooltipPosition;\n\n public controlError = signal('');\n public controlInvalid = signal(false);\n public control: AbstractControl | null = null;\n public controlSubscription: Subscription | null = null;\n\n private documentKeyupValue = '';\n private documentKeyupValueResetTime = 1000;\n private documentKeyDownSubscription!: Subscription;\n\n private isMetaHold = false;\n private isShiftHold = false;\n\n private listHeight: number = 224; // Default matches CSS\n\n private lastSelectedItemIndex = 0;\n private lastSelectedItemIndexOnShiftHold = 0;\n\n // Drag selection state\n private dragSelecting = false;\n private dragAnchorIndex = 0;\n\n private selectedItems = signal<(ApexSelectData | null)[]>([]);\n\n public ngOnInit(): void {\n this.control = this.getControl();\n\n this.selectedItems.set(new Array(this.options.data.length).fill(null));\n }\n\n public ngAfterViewInit(): void {\n this.documentKeyDownSubscription = fromEvent<KeyboardEvent>(this.elementRef.nativeElement, 'keydown')\n .pipe(\n tap(event => { this.keydown(event) }),\n debounceTime(this.documentKeyupValueResetTime))\n .subscribe(() => { this.documentKeyupValue = '' });\n }\n\n public ngOnDestroy(): void {\n this.documentKeyDownSubscription.unsubscribe();\n\n if (this.controlSubscription) {\n this.controlSubscription?.unsubscribe();\n }\n }\n\n public ngOnChanges(changes: SimpleChanges): void {\n if (changes['options'] && changes['options'].currentValue['data'] && this.selectedItems()) {\n this.selectedItems.set([]);\n\n // Refresh virtual viewport if enabled\n setTimeout(() => {\n this.cdkViewport?.checkViewportSize();\n });\n }\n }\n\n public mousedown(index: number): void {\n this.dragSelecting = true;\n this.dragAnchorIndex = index;\n\n if (this.isShiftHold) {\n const max = Math.max(index, this.lastSelectedItemIndexOnShiftHold);\n const min = Math.min(index, this.lastSelectedItemIndexOnShiftHold);\n\n const indices = [] as number[];\n\n for (let i = min; i <= max; i++) { indices.push(i); }\n\n this.clearAllSelections();\n this.addSelectedItems(indices);\n return;\n }\n\n if (this.isMetaHold) {\n if (this.isIndexSelected(index)) {\n this.removeSelectedItems(index);\n } else {\n this.addSelectedItems(index);\n }\n return;\n }\n\n this.clearAllSelections();\n this.addSelectedItems(index);\n }\n\n @HostListener('document:mouseup')\n public mouseup(): void {\n this.dragSelecting = false;\n }\n\n @HostListener('keyup', ['$event'])\n public keyup(event: KeyboardEvent): void {\n if (event.code.toLowerCase().includes('shift')) {\n this.isShiftHold = false;\n\n return;\n }\n\n if (event.code.toLowerCase().includes('meta') || event.code.toLowerCase().includes('control')) {\n this.isMetaHold = false;\n }\n }\n\n public mouseover(index: number): void {\n if (!this.dragSelecting || this.isMetaHold || this.isShiftHold) {\n return;\n }\n\n const min = Math.min(this.dragAnchorIndex, index);\n const max = Math.max(this.dragAnchorIndex, index);\n\n const indices: number[] = [];\n for (let i = min; i <= max; i++) { indices.push(i); }\n\n this.clearAllSelections();\n this.addSelectedItems(indices);\n }\n\n private keydown(event: KeyboardEvent): void {\n if ((document.activeElement !== this.listbox?.nativeElement) && (document.activeElement !== this.listbox?.nativeElement.childNodes[0])) {\n return;\n }\n\n if (event.code.toLowerCase().includes('shift')) {\n this.isShiftHold = true;\n this.lastSelectedItemIndexOnShiftHold = this.lastSelectedItemIndex;\n }\n\n if (event.code.toLowerCase().includes('meta') || event.code.toLowerCase().includes('control')) {\n this.isMetaHold = true;\n }\n\n if (event.code.toLowerCase().includes('arrowdown')) {\n event.preventDefault();\n\n this.documentArrowsKeyup(true);\n\n return;\n }\n\n if (event.code.toLowerCase().includes('arrowup')) {\n event.preventDefault();\n\n this.documentArrowsKeyup(false);\n\n return;\n }\n\n this.documentKeyup(event);\n }\n\n private documentArrowsKeyup(isDownArrow: boolean): void {\n const dataLength = this.options.data.length;\n\n let newIndex = isDownArrow ? this.lastSelectedItemIndex + 1 : this.lastSelectedItemIndex - 1;\n\n if (this.isShiftHold) {\n if (newIndex < 0 || newIndex === dataLength) {\n return;\n }\n\n if (this.isIndexSelected(newIndex)) {\n const indexForDeselect = isDownArrow ? newIndex - 1 : newIndex + 1;\n this.removeSelectedItems(indexForDeselect);\n } else {\n this.addSelectedItems(newIndex);\n }\n\n this.lastSelectedItemIndex = newIndex;\n this.scrollIndexIntoView(newIndex);\n\n return;\n }\n\n this.clearAllSelections();\n\n newIndex = newIndex < 0 ? 0 : newIndex;\n newIndex = newIndex >= dataLength ? dataLength - 1 : newIndex;\n\n this.addSelectedItems(newIndex);\n this.scrollIndexIntoView(newIndex);\n }\n\n private documentKeyup(event: KeyboardEvent): void {\n if (this.isMetaHold && event.key.toLowerCase() === 'a') {\n event.preventDefault();\n\n const itemsToAdd = [...this.options.data.keys()];\n this.addSelectedItems(itemsToAdd);\n\n return;\n }\n\n this.documentKeyupValue = this.documentKeyupValue + event.key.toLowerCase();\n\n let newIndex: number | null = null;\n\n for (let i = 0; i < this.options.data.length; i++) {\n const subLabel = this.options.data[i].label.substring(0, this.documentKeyupValue.length).toLowerCase();\n\n if (subLabel === this.documentKeyupValue) {\n newIndex = i;\n\n break;\n }\n }\n\n if (newIndex !== null) {\n this.clearAllSelections();\n this.addSelectedItems(newIndex);\n this.scrollIndexIntoView(newIndex);\n }\n }\n\n private addSelectedItems(index: number | number[]) {\n const isIndexNumber = typeof index === 'number';\n\n this.lastSelectedItemIndex = isIndexNumber ? index : index.slice(-1)[0];\n\n const items = [...this.selectedItems()];\n\n if (isIndexNumber) {\n items[index] = this.options.data[index];\n } else {\n for (let i of index) {\n items[i] = this.options.data[i];\n }\n }\n\n this.selectedItems.set(items);\n\n if (this.control) {\n this.control.setValue(items.filter(value => value !== null));\n }\n\n this.selectChange.emit(items.filter(Boolean) as ApexSelectData[]);\n }\n\n private removeSelectedItems(index: number | number[]) {\n const isIndexNumber = typeof index === 'number';\n\n const items = [...this.selectedItems()];\n\n if (isIndexNumber) {\n items[index] = null;\n } else {\n for (let i of index) {\n items[i] = null;\n }\n }\n\n this.selectedItems.set(items);\n\n if (this.control) {\n this.control?.setValue(items.filter(value => value !== null));\n }\n\n this.selectChange.emit(items.filter(Boolean) as ApexSelectData[]);\n }\n\n private clearAllSelections(): void {\n this.selectedItems.set(new Array(this.options.data.length).fill(null));\n\n if (this.control) {\n this.control.setValue([]);\n }\n\n this.selectChange.emit([]);\n }\n\n public isIndexSelected(index: number): boolean {\n return !!this.selectedItems()[index];\n }\n\n public trackByIndex(index: number): number { return index; }\n\n private scrollIndexIntoView(index: number): void {\n if (this.virtualScroll && this.cdkViewport) {\n this.cdkViewport.scrollToIndex(index, 'smooth');\n return;\n }\n\n const container = this.listbox?.nativeElement;\n\n if (!container) {\n return;\n }\n\n const target = container.querySelector(`.item[value=\"${index}\"]`);\n target?.scrollIntoView({ block: 'nearest' });\n }\n\n public shouldShowViewportScroll(): boolean {\n if (!this.virtualScroll) {\n return false;\n }\n\n const renderedCount = this.options?.data ? this.options.data.length : 0;\n\n const rowsHeight = this.itemSize * renderedCount;\n\n return rowsHeight > this.listHeight;\n }\n\n private getControl(): AbstractControl | null {\n if (this.options.formGroup && this.options.formControlName) {\n this.controlSubscription = this.options.formGroup.controls[this.options.formControlName].valueChanges.subscribe(() => {\n if (!this.control) {\n return;\n }\n\n this.checkIfControlInvalid(this.control);\n\n this.getControlError(this.control);\n });\n\n this.controlSubscription.add(\n this.options.formGroup.controls[this.options.formControlName].events\n .pipe(filter(event => event instanceof TouchedChangeEvent))\n .subscribe(() => {\n if (!this.control) {\n return;\n }\n\n this.checkIfControlInvalid(this.control);\n this.getControlError(this.control);\n })\n );\n\n return this.options.formGroup.get(this.options.formControlName);\n }\n\n return null;\n }\n\n private checkIfControlInvalid(control: AbstractControl): void {\n this.controlInvalid.set(control.invalid);\n }\n\n private getControlError(control: AbstractControl): void {\n this.controlError.set('');\n\n const options = this.options!;\n\n if (options.errors && this.controlInvalid()) {\n for (const error in options.errors) {\n if (control.hasError(error)) {\n this.controlError.set(options.errors[error]);\n\n return;\n }\n }\n\n }\n }\n\n}\n","@if (options) {\n <div class=\"listbox-header\">\n @if (options.label) {\n <label>{{ options.label }}</label>\n }\n\n @if (options.tooltip) {\n <svg class=\"tooltip-icon\" [apexTooltip]=\"options.tooltip\" [tooltipPosition]=\"tooltipPosition.Above\" width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <g>\n <path d=\"M8 14A6 6 0 1 0 8 2a6 6 0 0 0 0 12z\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/><path d=\"M7.5 7.5H8V11h.5\" stroke-linecap=\"round\" stroke-linejoin=\"round\"/>\n <path d=\"M8.25 5.25a.25.25 0 1 1-.5 0 .25.25 0 0 1 .5 0z\" fill=\"#fff\"/>\n </g>\n </svg>\n }\n </div>\n\n <div #listbox tabindex=\"0\" class=\"container\" [class.error]=\"controlInvalid()\">\n @if (virtualScroll) {\n <cdk-virtual-scroll-viewport class=\"cdk-listbox-viewport\" [itemSize]=\"itemSize\" [style.overflow-y]=\"shouldShowViewportScroll() ? 'auto' : 'hidden'\">\n <div class=\"item\"\n *cdkVirtualFor=\"let data of options.data; let i = index; trackBy: trackByIndex\"\n [attr.value]=\"i\"\n [style.height.px]=\"itemSize\"\n [style.line-height.px]=\"itemSize\"\n [class.selected]=\"isIndexSelected(i)\"\n (mousedown)=\"mousedown(i)\"\n (mouseover)=\"mouseover(i)\">\n {{ data.label }}\n </div>\n </cdk-virtual-scroll-viewport>\n } @else {\n <div class=\"container-inner\">\n @for (data of options.data; track data.value) {\n <div class=\"item\" [attr.value]=\"$index\" [style.height.px]=\"itemSize\" [style.line-height.px]=\"itemSize\" [class.selected]=\"isIndexSelected($index)\" (mousedown)=\"mousedown($index)\" (mouseover)=\"mouseover($index)\">\n {{ data.label }}\n </div>\n }\n </div>\n }\n </div>\n\n <div class=\"footer\" [class.error]=\"controlInvalid()\">\n {{ controlError() }}\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;MA8Ba,oBAAoB,CAAA;AAE/B,IAAA,WAAA,CAAqB,UAAsB,EAAA;QAAtB,IAAA,CAAA,UAAU,GAAV,UAAU;QAET,IAAA,CAAA,OAAO,GAAsC,IAAI;QAK9D,IAAA,CAAA,aAAa,GAAY,KAAK;AAC9B,QAAA,IAAA,CAAA,QAAQ,GAAW,EAAE,CAAC;AAErB,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,YA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;sBAOA,SAAS;uBAAC,SAAS;;sBACnB,SAAS;uBAAC,wBAAwB;;sBAElC;;sBAEA;;sBACA;;sBAEA;;sBA0FA,YAAY;uBAAC,kBAAkB;;sBAK/B,YAAY;uBAAC,OAAO,EAAE,CAAC,QAAQ,CAAC;;;AEzInC;;AAEG;;;;"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { input, output, viewChild, signal, afterNextRender, HostListener, Component } from '@angular/core';
|
|
3
|
+
import { NgClass } from '@angular/common';
|
|
4
|
+
import { ApexImageComponent } from '@apexara/ng-components/image';
|
|
5
|
+
|
|
6
|
+
class ApexMoreOptionsComponent {
|
|
7
|
+
constructor(elementRef, injector) {
|
|
8
|
+
this.elementRef = elementRef;
|
|
9
|
+
this.injector = injector;
|
|
10
|
+
this.items = input([], ...(ngDevMode ? [{ debugName: "items" }] : []));
|
|
11
|
+
this.vertical = input(false, ...(ngDevMode ? [{ debugName: "vertical" }] : []));
|
|
12
|
+
this.itemClick = output();
|
|
13
|
+
this.dropdownRef = viewChild('dropdown', ...(ngDevMode ? [{ debugName: "dropdownRef" }] : []));
|
|
14
|
+
this.isOpen = signal(false, ...(ngDevMode ? [{ debugName: "isOpen" }] : []));
|
|
15
|
+
this.scrollBlockersAttached = false;
|
|
16
|
+
this.wheelListener = (event) => this.blockScroll(event);
|
|
17
|
+
}
|
|
18
|
+
ngOnDestroy() {
|
|
19
|
+
this.detachScrollBlockers();
|
|
20
|
+
}
|
|
21
|
+
toggle(event) {
|
|
22
|
+
this.isOpen.update(v => !v);
|
|
23
|
+
if (this.isOpen()) {
|
|
24
|
+
afterNextRender(() => {
|
|
25
|
+
this.positionDropdown();
|
|
26
|
+
this.attachScrollBlockers();
|
|
27
|
+
}, { injector: this.injector });
|
|
28
|
+
}
|
|
29
|
+
else {
|
|
30
|
+
this.detachScrollBlockers();
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
onItemClick(item, event) {
|
|
34
|
+
if (item.disabled) {
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
37
|
+
if (item.execute) {
|
|
38
|
+
item.execute();
|
|
39
|
+
}
|
|
40
|
+
this.itemClick.emit(item);
|
|
41
|
+
this.isOpen.set(false);
|
|
42
|
+
this.detachScrollBlockers();
|
|
43
|
+
}
|
|
44
|
+
onDocumentClick(event) {
|
|
45
|
+
const clickedInside = this.elementRef.nativeElement.contains(event.target);
|
|
46
|
+
const dropdownEl = this.dropdownRef()?.nativeElement;
|
|
47
|
+
const clickedDropdown = dropdownEl?.contains(event.target);
|
|
48
|
+
if (!clickedInside && !clickedDropdown && this.isOpen()) {
|
|
49
|
+
this.isOpen.set(false);
|
|
50
|
+
this.detachScrollBlockers();
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
positionDropdown() {
|
|
54
|
+
const dropdown = this.dropdownRef();
|
|
55
|
+
if (!dropdown) {
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
const trigger = this.elementRef.nativeElement.querySelector('.trigger');
|
|
59
|
+
const rect = trigger.getBoundingClientRect();
|
|
60
|
+
const dropdownEl = dropdown.nativeElement;
|
|
61
|
+
// Position below trigger initially
|
|
62
|
+
dropdownEl.style.top = `${rect.bottom + 4}px`;
|
|
63
|
+
dropdownEl.style.bottom = 'unset';
|
|
64
|
+
// Check if dropdown overflows viewport bottom — if so, open upward
|
|
65
|
+
if (dropdownEl.getBoundingClientRect().bottom > window.innerHeight) {
|
|
66
|
+
dropdownEl.style.top = 'unset';
|
|
67
|
+
dropdownEl.style.bottom = `${window.innerHeight - rect.top + 4}px`;
|
|
68
|
+
}
|
|
69
|
+
// Horizontal positioning
|
|
70
|
+
const dropdownWidth = dropdownEl.offsetWidth;
|
|
71
|
+
const left = rect.left + rect.width / 2;
|
|
72
|
+
if (left + dropdownWidth / 2 > window.innerWidth - 10) {
|
|
73
|
+
dropdownEl.style.left = `${window.innerWidth - 10 - dropdownWidth}px`;
|
|
74
|
+
dropdownEl.style.transform = '';
|
|
75
|
+
}
|
|
76
|
+
else {
|
|
77
|
+
dropdownEl.style.left = `${left}px`;
|
|
78
|
+
dropdownEl.style.transform = 'translateX(-50%)';
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
blockScroll(event) {
|
|
82
|
+
const dropdown = this.dropdownRef();
|
|
83
|
+
if (!dropdown) {
|
|
84
|
+
return;
|
|
85
|
+
}
|
|
86
|
+
const dropdownEl = dropdown.nativeElement;
|
|
87
|
+
const isInsideDropdown = dropdownEl.contains(event.target);
|
|
88
|
+
if (isInsideDropdown) {
|
|
89
|
+
const canScroll = dropdownEl.scrollHeight > dropdownEl.clientHeight;
|
|
90
|
+
if (!canScroll) {
|
|
91
|
+
event.preventDefault();
|
|
92
|
+
}
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
event.preventDefault();
|
|
96
|
+
}
|
|
97
|
+
attachScrollBlockers() {
|
|
98
|
+
if (this.scrollBlockersAttached) {
|
|
99
|
+
return;
|
|
100
|
+
}
|
|
101
|
+
window.addEventListener('wheel', this.wheelListener, { passive: false });
|
|
102
|
+
window.addEventListener('touchmove', this.wheelListener, { passive: false });
|
|
103
|
+
this.scrollBlockersAttached = true;
|
|
104
|
+
}
|
|
105
|
+
detachScrollBlockers() {
|
|
106
|
+
if (!this.scrollBlockersAttached) {
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
window.removeEventListener('wheel', this.wheelListener);
|
|
110
|
+
window.removeEventListener('touchmove', this.wheelListener);
|
|
111
|
+
this.scrollBlockersAttached = false;
|
|
112
|
+
}
|
|
113
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexMoreOptionsComponent, deps: [{ token: i0.ElementRef }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
114
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.2", type: ApexMoreOptionsComponent, isStandalone: true, selector: "apex-more-options", inputs: { items: { classPropertyName: "items", publicName: "items", isSignal: true, isRequired: false, transformFunction: null }, vertical: { classPropertyName: "vertical", publicName: "vertical", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { itemClick: "itemClick" }, host: { listeners: { "document:click": "onDocumentClick($event)" } }, viewQueries: [{ propertyName: "dropdownRef", first: true, predicate: ["dropdown"], descendants: true, isSignal: true }], ngImport: i0, template: "<div class=\"trigger\" [ngClass]=\"{ opened: isOpen(), vertical: vertical() }\" (click)=\"toggle($event)\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.75 8C4.75 8.14834 4.70601 8.29334 4.6236 8.41668C4.54119 8.54001 4.42406 8.63614 4.28701 8.69291C4.14997 8.74967 3.99917 8.76453 3.85368 8.73559C3.7082 8.70665 3.57456 8.63522 3.46967 8.53033C3.36478 8.42544 3.29335 8.2918 3.26441 8.14632C3.23547 8.00083 3.25032 7.85003 3.30709 7.71299C3.36386 7.57594 3.45999 7.45881 3.58332 7.3764C3.70666 7.29399 3.85166 7.25 4 7.25C4.19884 7.25023 4.38948 7.32932 4.53008 7.46992C4.67068 7.61052 4.74977 7.80116 4.75 8ZM12 7.25C11.8517 7.25 11.7067 7.29399 11.5833 7.3764C11.46 7.45881 11.3639 7.57594 11.3071 7.71299C11.2503 7.85003 11.2355 8.00083 11.2644 8.14632C11.2933 8.2918 11.3648 8.42544 11.4697 8.53033C11.5746 8.63522 11.7082 8.70665 11.8537 8.73559C11.9992 8.76453 12.15 8.74967 12.287 8.69291C12.4241 8.63614 12.5412 8.54001 12.6236 8.41668C12.706 8.29334 12.75 8.14834 12.75 8C12.7498 7.80116 12.6707 7.61052 12.5301 7.46992C12.3895 7.32932 12.1988 7.25023 12 7.25ZM8 7.25C7.85166 7.25 7.70666 7.29399 7.58332 7.3764C7.45999 7.45881 7.36386 7.57594 7.30709 7.71299C7.25033 7.85003 7.23547 8.00083 7.26441 8.14632C7.29335 8.2918 7.36478 8.42544 7.46967 8.53033C7.57456 8.63522 7.7082 8.70665 7.85368 8.73559C7.99917 8.76453 8.14997 8.74967 8.28701 8.69291C8.42406 8.63614 8.54119 8.54001 8.6236 8.41668C8.70601 8.29334 8.75 8.14834 8.75 8C8.74977 7.80116 8.67068 7.61052 8.53008 7.46992C8.38948 7.32932 8.19884 7.25023 8 7.25Z\"/>\n </svg>\n</div>\n\n@if (isOpen()) {\n <div class=\"dropdown\" #dropdown>\n @if (items().length > 0) {\n @for (item of items(); track $index) {\n <div class=\"dropdown-item\"\n [ngClass]=\"{ disabled: item.disabled }\"\n (click)=\"onItemClick(item, $event)\">\n @if (item.icon) {\n <div class=\"item-icon\">\n <apex-img [src]=\"'assets/img/' + item.icon\" [alt]=\"'Action icon.'\"></apex-img>\n </div>\n }\n <span>{{ item.label }}</span>\n </div>\n }\n } @else {\n <ng-content></ng-content>\n }\n </div>\n}\n", styles: [":host{display:inline-block}.trigger{width:var(--apex-more-options-trigger-size, 32px);height:var(--apex-more-options-trigger-size, 32px);display:flex;justify-content:center;align-items:center;background:var(--apex-more-options-trigger-background, transparent);border:1px solid var(--apex-more-options-trigger-border-color, #E9E9E9);border-radius:var(--apex-more-options-trigger-border-radius, 8px);box-sizing:border-box;cursor:pointer}.trigger:hover,.trigger.opened{background:var(--apex-more-options-trigger-hover-background, #F7F8FB)}.trigger.vertical svg{transform:rotate(90deg)}.trigger svg path{fill:var(--apex-more-options-icon-fill, #000000)}.dropdown{min-width:184px;width:fit-content;position:fixed;background-color:var(--apex-more-options-dropdown-background, #FFFFFF);border-radius:var(--apex-more-options-dropdown-border-radius, 8px);box-shadow:var(--apex-more-options-dropdown-box-shadow, 0px 4px 8px 0px rgba(214, 214, 214, .35));overflow:hidden;z-index:10}.dropdown-item{height:var(--apex-more-options-item-height, 44px);display:flex;align-items:center;justify-content:flex-start;color:var(--apex-more-options-item-color, #0B1222);font-size:14px;font-weight:500;cursor:pointer;padding:0 12px}.dropdown-item:hover{background-color:var(--apex-more-options-item-hover-background, #F3F3F3)}.dropdown-item.disabled{opacity:.5;pointer-events:none}.dropdown-item span{white-space:nowrap;margin:0 12px}.item-icon{width:20px;height:20px;min-width:20px;display:flex;justify-content:center;align-items:center}.item-icon apex-img{max-width:20px;max-height:20px;display:flex;justify-content:center;align-items:center}.item-icon apex-img path{fill:var(--apex-more-options-item-icon-fill, #5D6068);stroke:var(--apex-more-options-item-icon-stroke, #ffffff00)}\n"], dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: ApexImageComponent, selector: "apex-img", inputs: ["src", "alt"] }] }); }
|
|
115
|
+
}
|
|
116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.2", ngImport: i0, type: ApexMoreOptionsComponent, decorators: [{
|
|
117
|
+
type: Component,
|
|
118
|
+
args: [{ selector: 'apex-more-options', imports: [
|
|
119
|
+
NgClass,
|
|
120
|
+
ApexImageComponent
|
|
121
|
+
], template: "<div class=\"trigger\" [ngClass]=\"{ opened: isOpen(), vertical: vertical() }\" (click)=\"toggle($event)\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.75 8C4.75 8.14834 4.70601 8.29334 4.6236 8.41668C4.54119 8.54001 4.42406 8.63614 4.28701 8.69291C4.14997 8.74967 3.99917 8.76453 3.85368 8.73559C3.7082 8.70665 3.57456 8.63522 3.46967 8.53033C3.36478 8.42544 3.29335 8.2918 3.26441 8.14632C3.23547 8.00083 3.25032 7.85003 3.30709 7.71299C3.36386 7.57594 3.45999 7.45881 3.58332 7.3764C3.70666 7.29399 3.85166 7.25 4 7.25C4.19884 7.25023 4.38948 7.32932 4.53008 7.46992C4.67068 7.61052 4.74977 7.80116 4.75 8ZM12 7.25C11.8517 7.25 11.7067 7.29399 11.5833 7.3764C11.46 7.45881 11.3639 7.57594 11.3071 7.71299C11.2503 7.85003 11.2355 8.00083 11.2644 8.14632C11.2933 8.2918 11.3648 8.42544 11.4697 8.53033C11.5746 8.63522 11.7082 8.70665 11.8537 8.73559C11.9992 8.76453 12.15 8.74967 12.287 8.69291C12.4241 8.63614 12.5412 8.54001 12.6236 8.41668C12.706 8.29334 12.75 8.14834 12.75 8C12.7498 7.80116 12.6707 7.61052 12.5301 7.46992C12.3895 7.32932 12.1988 7.25023 12 7.25ZM8 7.25C7.85166 7.25 7.70666 7.29399 7.58332 7.3764C7.45999 7.45881 7.36386 7.57594 7.30709 7.71299C7.25033 7.85003 7.23547 8.00083 7.26441 8.14632C7.29335 8.2918 7.36478 8.42544 7.46967 8.53033C7.57456 8.63522 7.7082 8.70665 7.85368 8.73559C7.99917 8.76453 8.14997 8.74967 8.28701 8.69291C8.42406 8.63614 8.54119 8.54001 8.6236 8.41668C8.70601 8.29334 8.75 8.14834 8.75 8C8.74977 7.80116 8.67068 7.61052 8.53008 7.46992C8.38948 7.32932 8.19884 7.25023 8 7.25Z\"/>\n </svg>\n</div>\n\n@if (isOpen()) {\n <div class=\"dropdown\" #dropdown>\n @if (items().length > 0) {\n @for (item of items(); track $index) {\n <div class=\"dropdown-item\"\n [ngClass]=\"{ disabled: item.disabled }\"\n (click)=\"onItemClick(item, $event)\">\n @if (item.icon) {\n <div class=\"item-icon\">\n <apex-img [src]=\"'assets/img/' + item.icon\" [alt]=\"'Action icon.'\"></apex-img>\n </div>\n }\n <span>{{ item.label }}</span>\n </div>\n }\n } @else {\n <ng-content></ng-content>\n }\n </div>\n}\n", styles: [":host{display:inline-block}.trigger{width:var(--apex-more-options-trigger-size, 32px);height:var(--apex-more-options-trigger-size, 32px);display:flex;justify-content:center;align-items:center;background:var(--apex-more-options-trigger-background, transparent);border:1px solid var(--apex-more-options-trigger-border-color, #E9E9E9);border-radius:var(--apex-more-options-trigger-border-radius, 8px);box-sizing:border-box;cursor:pointer}.trigger:hover,.trigger.opened{background:var(--apex-more-options-trigger-hover-background, #F7F8FB)}.trigger.vertical svg{transform:rotate(90deg)}.trigger svg path{fill:var(--apex-more-options-icon-fill, #000000)}.dropdown{min-width:184px;width:fit-content;position:fixed;background-color:var(--apex-more-options-dropdown-background, #FFFFFF);border-radius:var(--apex-more-options-dropdown-border-radius, 8px);box-shadow:var(--apex-more-options-dropdown-box-shadow, 0px 4px 8px 0px rgba(214, 214, 214, .35));overflow:hidden;z-index:10}.dropdown-item{height:var(--apex-more-options-item-height, 44px);display:flex;align-items:center;justify-content:flex-start;color:var(--apex-more-options-item-color, #0B1222);font-size:14px;font-weight:500;cursor:pointer;padding:0 12px}.dropdown-item:hover{background-color:var(--apex-more-options-item-hover-background, #F3F3F3)}.dropdown-item.disabled{opacity:.5;pointer-events:none}.dropdown-item span{white-space:nowrap;margin:0 12px}.item-icon{width:20px;height:20px;min-width:20px;display:flex;justify-content:center;align-items:center}.item-icon apex-img{max-width:20px;max-height:20px;display:flex;justify-content:center;align-items:center}.item-icon apex-img path{fill:var(--apex-more-options-item-icon-fill, #5D6068);stroke:var(--apex-more-options-item-icon-stroke, #ffffff00)}\n"] }]
|
|
122
|
+
}], ctorParameters: () => [{ type: i0.ElementRef }, { type: i0.Injector }], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], vertical: [{ type: i0.Input, args: [{ isSignal: true, alias: "vertical", required: false }] }], itemClick: [{ type: i0.Output, args: ["itemClick"] }], dropdownRef: [{ type: i0.ViewChild, args: ['dropdown', { isSignal: true }] }], onDocumentClick: [{
|
|
123
|
+
type: HostListener,
|
|
124
|
+
args: ['document:click', ['$event']]
|
|
125
|
+
}] } });
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Generated bundle index. Do not edit.
|
|
129
|
+
*/
|
|
130
|
+
|
|
131
|
+
export { ApexMoreOptionsComponent };
|
|
132
|
+
//# sourceMappingURL=apexara-ng-components-more-options.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apexara-ng-components-more-options.mjs","sources":["../../../../projects/apexara/ng-components/more-options/src/more-options.component.ts","../../../../projects/apexara/ng-components/more-options/src/more-options.component.html","../../../../projects/apexara/ng-components/more-options/apexara-ng-components-more-options.ts"],"sourcesContent":["import {\n Component, ElementRef, HostListener,\n input, output, signal, viewChild, Injector, afterNextRender\n} from '@angular/core';\nimport { NgClass } from '@angular/common';\n\nimport { ApexImageComponent } from '@apexara/ng-components/image';\n\nexport interface ApexMoreOptionsItem {\n icon?: string;\n label: string;\n execute?: () => void;\n disabled?: boolean;\n}\n\n@Component({\n selector: 'apex-more-options',\n templateUrl: './more-options.component.html',\n styleUrls: ['./more-options.component.css'],\n imports: [\n NgClass,\n ApexImageComponent\n ],\n})\n\nexport class ApexMoreOptionsComponent {\n\n constructor(\n private elementRef: ElementRef,\n private injector: Injector) { }\n\n public items = input<ApexMoreOptionsItem[]>([]);\n public vertical = input(false);\n\n public itemClick = output<ApexMoreOptionsItem>();\n\n public dropdownRef = viewChild<ElementRef>('dropdown');\n\n public isOpen = signal(false);\n\n private scrollBlockersAttached = false;\n private wheelListener = (event: WheelEvent | TouchEvent) => this.blockScroll(event);\n\n\n public ngOnDestroy(): void {\n this.detachScrollBlockers();\n }\n\n public toggle(event: MouseEvent): void {\n this.isOpen.update(v => !v);\n\n if (this.isOpen()) {\n afterNextRender(() => {\n this.positionDropdown();\n this.attachScrollBlockers();\n }, { injector: this.injector });\n } else {\n this.detachScrollBlockers();\n }\n }\n\n public onItemClick(item: ApexMoreOptionsItem, event: MouseEvent): void {\n if (item.disabled) {\n return;\n }\n\n if (item.execute) {\n item.execute();\n }\n\n this.itemClick.emit(item);\n this.isOpen.set(false);\n this.detachScrollBlockers();\n }\n\n @HostListener('document:click', ['$event'])\n public onDocumentClick(event: Event): void {\n const clickedInside = this.elementRef.nativeElement.contains(event.target);\n const dropdownEl = this.dropdownRef()?.nativeElement;\n const clickedDropdown = dropdownEl?.contains(event.target);\n\n if (!clickedInside && !clickedDropdown && this.isOpen()) {\n this.isOpen.set(false);\n this.detachScrollBlockers();\n }\n }\n\n private positionDropdown(): void {\n const dropdown = this.dropdownRef();\n\n if (!dropdown) {\n return;\n }\n\n const trigger = this.elementRef.nativeElement.querySelector('.trigger');\n const rect = trigger.getBoundingClientRect();\n const dropdownEl = dropdown.nativeElement;\n\n // Position below trigger initially\n dropdownEl.style.top = `${rect.bottom + 4}px`;\n dropdownEl.style.bottom = 'unset';\n\n // Check if dropdown overflows viewport bottom — if so, open upward\n if (dropdownEl.getBoundingClientRect().bottom > window.innerHeight) {\n dropdownEl.style.top = 'unset';\n dropdownEl.style.bottom = `${window.innerHeight - rect.top + 4}px`;\n }\n\n // Horizontal positioning\n const dropdownWidth = dropdownEl.offsetWidth;\n const left = rect.left + rect.width / 2;\n\n if (left + dropdownWidth / 2 > window.innerWidth - 10) {\n dropdownEl.style.left = `${window.innerWidth - 10 - dropdownWidth}px`;\n dropdownEl.style.transform = '';\n } else {\n dropdownEl.style.left = `${left}px`;\n dropdownEl.style.transform = 'translateX(-50%)';\n }\n }\n\n private blockScroll(event: WheelEvent | TouchEvent): void {\n const dropdown = this.dropdownRef();\n if (!dropdown) {\n return;\n }\n\n const dropdownEl = dropdown.nativeElement;\n const isInsideDropdown = dropdownEl.contains(event.target as HTMLElement);\n\n if (isInsideDropdown) {\n const canScroll = dropdownEl.scrollHeight > dropdownEl.clientHeight;\n if (!canScroll) {\n event.preventDefault();\n }\n return;\n }\n\n event.preventDefault();\n }\n\n private attachScrollBlockers(): void {\n if (this.scrollBlockersAttached) {\n return;\n }\n\n window.addEventListener('wheel', this.wheelListener, { passive: false });\n window.addEventListener('touchmove', this.wheelListener, { passive: false });\n\n this.scrollBlockersAttached = true;\n }\n\n private detachScrollBlockers(): void {\n if (!this.scrollBlockersAttached) {\n return;\n }\n\n window.removeEventListener('wheel', this.wheelListener as EventListener);\n window.removeEventListener('touchmove', this.wheelListener as EventListener);\n\n this.scrollBlockersAttached = false;\n }\n\n}\n","<div class=\"trigger\" [ngClass]=\"{ opened: isOpen(), vertical: vertical() }\" (click)=\"toggle($event)\">\n <svg width=\"16\" height=\"16\" viewBox=\"0 0 16 16\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\">\n <path d=\"M4.75 8C4.75 8.14834 4.70601 8.29334 4.6236 8.41668C4.54119 8.54001 4.42406 8.63614 4.28701 8.69291C4.14997 8.74967 3.99917 8.76453 3.85368 8.73559C3.7082 8.70665 3.57456 8.63522 3.46967 8.53033C3.36478 8.42544 3.29335 8.2918 3.26441 8.14632C3.23547 8.00083 3.25032 7.85003 3.30709 7.71299C3.36386 7.57594 3.45999 7.45881 3.58332 7.3764C3.70666 7.29399 3.85166 7.25 4 7.25C4.19884 7.25023 4.38948 7.32932 4.53008 7.46992C4.67068 7.61052 4.74977 7.80116 4.75 8ZM12 7.25C11.8517 7.25 11.7067 7.29399 11.5833 7.3764C11.46 7.45881 11.3639 7.57594 11.3071 7.71299C11.2503 7.85003 11.2355 8.00083 11.2644 8.14632C11.2933 8.2918 11.3648 8.42544 11.4697 8.53033C11.5746 8.63522 11.7082 8.70665 11.8537 8.73559C11.9992 8.76453 12.15 8.74967 12.287 8.69291C12.4241 8.63614 12.5412 8.54001 12.6236 8.41668C12.706 8.29334 12.75 8.14834 12.75 8C12.7498 7.80116 12.6707 7.61052 12.5301 7.46992C12.3895 7.32932 12.1988 7.25023 12 7.25ZM8 7.25C7.85166 7.25 7.70666 7.29399 7.58332 7.3764C7.45999 7.45881 7.36386 7.57594 7.30709 7.71299C7.25033 7.85003 7.23547 8.00083 7.26441 8.14632C7.29335 8.2918 7.36478 8.42544 7.46967 8.53033C7.57456 8.63522 7.7082 8.70665 7.85368 8.73559C7.99917 8.76453 8.14997 8.74967 8.28701 8.69291C8.42406 8.63614 8.54119 8.54001 8.6236 8.41668C8.70601 8.29334 8.75 8.14834 8.75 8C8.74977 7.80116 8.67068 7.61052 8.53008 7.46992C8.38948 7.32932 8.19884 7.25023 8 7.25Z\"/>\n </svg>\n</div>\n\n@if (isOpen()) {\n <div class=\"dropdown\" #dropdown>\n @if (items().length > 0) {\n @for (item of items(); track $index) {\n <div class=\"dropdown-item\"\n [ngClass]=\"{ disabled: item.disabled }\"\n (click)=\"onItemClick(item, $event)\">\n @if (item.icon) {\n <div class=\"item-icon\">\n <apex-img [src]=\"'assets/img/' + item.icon\" [alt]=\"'Action icon.'\"></apex-img>\n </div>\n }\n <span>{{ item.label }}</span>\n </div>\n }\n } @else {\n <ng-content></ng-content>\n }\n </div>\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;MAyBa,wBAAwB,CAAA;IAEnC,WAAA,CACU,UAAsB,EACtB,QAAkB,EAAA;QADlB,IAAA,CAAA,UAAU,GAAV,UAAU;QACV,IAAA,CAAA,QAAQ,GAAR,QAAQ;AAEX,QAAA,IAAA,CAAA,KAAK,GAAG,KAAK,CAAwB,EAAE,iDAAC;AACxC,QAAA,IAAA,CAAA,QAAQ,GAAG,KAAK,CAAC,KAAK,oDAAC;QAEvB,IAAA,CAAA,SAAS,GAAG,MAAM,EAAuB;AAEzC,QAAA,IAAA,CAAA,WAAW,GAAG,SAAS,CAAa,UAAU,uDAAC;AAE/C,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,KAAK,kDAAC;QAErB,IAAA,CAAA,sBAAsB,GAAG,KAAK;AAC9B,QAAA,IAAA,CAAA,aAAa,GAAG,CAAC,KAA8B,KAAK,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC;IAZnD;IAezB,WAAW,GAAA;QAChB,IAAI,CAAC,oBAAoB,EAAE;IAC7B;AAEO,IAAA,MAAM,CAAC,KAAiB,EAAA;AAC7B,QAAA,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;AAE3B,QAAA,IAAI,IAAI,CAAC,MAAM,EAAE,EAAE;YACjB,eAAe,CAAC,MAAK;g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