@acorex/components 18.14.1-next.0 → 18.14.1-next.1
Sign up to get free protection for your applications and to get access to all the features.
- package/calendar/lib/calendar.component.d.ts +16 -5
- package/calendar/lib/calendar.module.d.ts +2 -1
- package/check-box/lib/check-box.component.d.ts +13 -5
- package/cron-job/README.md +3 -0
- package/cron-job/index.d.ts +8 -0
- package/cron-job/lib/cron-job-container/cron-job-container.component.d.ts +31 -0
- package/cron-job/lib/cron-job.module.d.ts +25 -0
- package/cron-job/lib/cron-job.service.d.ts +22 -0
- package/cron-job/lib/day/day.component.d.ts +22 -0
- package/cron-job/lib/day/day.model.d.ts +61 -0
- package/cron-job/lib/day/day.service.d.ts +17 -0
- package/cron-job/lib/hours/hours.component.d.ts +14 -0
- package/cron-job/lib/hours/hours.model.d.ts +5 -0
- package/cron-job/lib/hours/hours.service.d.ts +13 -0
- package/cron-job/lib/minutes/minutes.component.d.ts +14 -0
- package/cron-job/lib/minutes/minutes.model.d.ts +5 -0
- package/cron-job/lib/minutes/minutes.service.d.ts +13 -0
- package/cron-job/lib/month/month.component.d.ts +16 -0
- package/cron-job/lib/month/month.model.d.ts +5 -0
- package/cron-job/lib/month/month.service.d.ts +14 -0
- package/cron-job/lib/seconds/seconds.component.d.ts +14 -0
- package/cron-job/lib/seconds/seconds.model.d.ts +5 -0
- package/cron-job/lib/seconds/seconds.service.d.ts +13 -0
- package/cron-job/lib/types/iexpression.d.ts +3 -0
- package/cron-job/lib/types/shared.model.d.ts +37 -0
- package/cron-job/lib/year/year.component.d.ts +15 -0
- package/cron-job/lib/year/year.model.d.ts +16 -0
- package/cron-job/lib/year/year.service.d.ts +12 -0
- package/datetime-input/lib/datetime-input.component.d.ts +9 -0
- package/datetime-picker/lib/datetime-picker.component.d.ts +1 -0
- package/esm2022/calendar/lib/calendar.component.mjs +186 -158
- package/esm2022/calendar/lib/calendar.module.mjs +5 -4
- package/esm2022/check-box/lib/check-box.component.mjs +39 -22
- package/esm2022/cron-job/acorex-components-cron-job.mjs +5 -0
- package/esm2022/cron-job/index.mjs +9 -0
- package/esm2022/cron-job/lib/cron-job-container/cron-job-container.component.mjs +90 -0
- package/esm2022/cron-job/lib/cron-job.module.mjs +80 -0
- package/esm2022/cron-job/lib/cron-job.service.mjs +60 -0
- package/esm2022/cron-job/lib/day/day.component.mjs +61 -0
- package/esm2022/cron-job/lib/day/day.model.mjs +88 -0
- package/esm2022/cron-job/lib/day/day.service.mjs +196 -0
- package/esm2022/cron-job/lib/hours/hours.component.mjs +38 -0
- package/esm2022/cron-job/lib/hours/hours.model.mjs +8 -0
- package/esm2022/cron-job/lib/hours/hours.service.mjs +82 -0
- package/esm2022/cron-job/lib/minutes/minutes.component.mjs +38 -0
- package/esm2022/cron-job/lib/minutes/minutes.model.mjs +8 -0
- package/esm2022/cron-job/lib/minutes/minutes.service.mjs +82 -0
- package/esm2022/cron-job/lib/month/month.component.mjs +47 -0
- package/esm2022/cron-job/lib/month/month.model.mjs +8 -0
- package/esm2022/cron-job/lib/month/month.service.mjs +96 -0
- package/esm2022/cron-job/lib/seconds/seconds.component.mjs +38 -0
- package/esm2022/cron-job/lib/seconds/seconds.model.mjs +8 -0
- package/esm2022/cron-job/lib/seconds/seconds.service.mjs +82 -0
- package/esm2022/cron-job/lib/types/iexpression.mjs +2 -0
- package/esm2022/cron-job/lib/types/shared.model.mjs +49 -0
- package/esm2022/cron-job/lib/year/year.component.mjs +45 -0
- package/esm2022/cron-job/lib/year/year.model.mjs +28 -0
- package/esm2022/cron-job/lib/year/year.service.mjs +82 -0
- package/esm2022/datetime-input/lib/datetime-input.component.mjs +38 -10
- package/esm2022/datetime-picker/lib/datetime-picker.component.mjs +17 -4
- package/esm2022/list/lib/list.component.mjs +3 -3
- package/esm2022/loading/lib/loading.component.mjs +7 -3
- package/esm2022/loading/lib/loading.service.mjs +3 -3
- package/esm2022/radio/lib/radio.component.mjs +3 -3
- package/esm2022/selection-list/lib/selection-list.component.mjs +70 -28
- package/esm2022/text-box/lib/text-box.component.mjs +11 -8
- package/fesm2022/acorex-components-calendar.mjs +187 -159
- package/fesm2022/acorex-components-calendar.mjs.map +1 -1
- package/fesm2022/acorex-components-check-box.mjs +39 -22
- package/fesm2022/acorex-components-check-box.mjs.map +1 -1
- package/fesm2022/acorex-components-cron-job.mjs +1191 -0
- package/fesm2022/acorex-components-cron-job.mjs.map +1 -0
- package/fesm2022/acorex-components-datetime-input.mjs +36 -8
- package/fesm2022/acorex-components-datetime-input.mjs.map +1 -1
- package/fesm2022/acorex-components-datetime-picker.mjs +15 -2
- package/fesm2022/acorex-components-datetime-picker.mjs.map +1 -1
- package/fesm2022/acorex-components-list.mjs +2 -2
- package/fesm2022/acorex-components-list.mjs.map +1 -1
- package/fesm2022/acorex-components-loading.mjs +8 -4
- package/fesm2022/acorex-components-loading.mjs.map +1 -1
- package/fesm2022/acorex-components-radio.mjs +2 -2
- package/fesm2022/acorex-components-radio.mjs.map +1 -1
- package/fesm2022/acorex-components-selection-list.mjs +69 -27
- package/fesm2022/acorex-components-selection-list.mjs.map +1 -1
- package/fesm2022/acorex-components-text-box.mjs +10 -7
- package/fesm2022/acorex-components-text-box.mjs.map +1 -1
- package/package.json +7 -1
- package/selection-list/lib/selection-list.component.d.ts +26 -6
- package/text-box/lib/text-box.component.d.ts +2 -2
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-list.mjs","sources":["../../../../libs/components/list/src/lib/list.component.ts","../../../../libs/components/list/src/lib/list.component.html","../../../../libs/components/list/src/lib/list.module.ts","../../../../libs/components/list/src/acorex-components-list.ts"],"sourcesContent":["import {\n AXComponent,\n AXDataSource,\n AXEvent,\n AXFocusableComponent,\n AXItemClickEvent,\n AXListDataSource,\n AXValuableComponent,\n AX_SELECTION_DATA_TOKEN,\n MXSelectionBridgeService,\n MXSelectionValueComponent,\n convertArrayToDataSource,\n} from '@acorex/components/common';\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n OnInit,\n Optional,\n Output,\n SkipSelf,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n WritableSignal,\n forwardRef,\n signal,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface AXListScrollIndexChanged extends AXEvent {\n index: number;\n}\n\n/**\n * provides a list control with various input options and events for user interaction.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-list',\n templateUrl: './list.component.html',\n styleUrls: ['./list.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n inputs: ['id', 'name', 'disabled', 'readonly', 'valueField', 'textField', 'textTemplate', 'disabledField', 'multiple', 'selectionMode'],\n outputs: ['onValueChanged', 'disabledChange', 'readOnlyChange', 'onBlur', 'onFocus'],\n providers: [\n { provide: AXComponent, useExisting: AXListComponent },\n { provide: AXFocusableComponent, useExisting: AXListComponent },\n { provide: AXValuableComponent, useExisting: AXListComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXListComponent),\n multi: true,\n },\n {\n provide: AX_SELECTION_DATA_TOKEN,\n useFactory: (existingService: MXSelectionBridgeService) => {\n return existingService || new MXSelectionBridgeService();\n },\n deps: [[new Optional(), new SkipSelf(), AX_SELECTION_DATA_TOKEN]],\n },\n ],\n})\nexport class AXListComponent extends MXSelectionValueComponent implements OnInit {\n /**\n * Emitted when an item in the list is clicked.\n *\n * @event\n */\n @Output()\n onItemClick: EventEmitter<AXItemClickEvent<any>> = new EventEmitter<AXItemClickEvent<any>>();\n\n /**\n * Defines the data source for the list.\n *\n * @defaultValue convertArrayToDataSource([])\n */\n @Input()\n dataSource: AXDataSource<unknown> = convertArrayToDataSource([]);\n\n /**\n * @ignore\n */\n itemHeightSignal: WritableSignal<number | 'auto'> = signal(40);\n\n /**\n * Sets the height of each item in the list.\n */\n @Input()\n public set itemHeight(v: number | 'auto') {\n this.itemHeightSignal.set(v);\n }\n\n /**\n * Template for rendering individual items in the list.\n */\n @Input()\n itemTemplate: TemplateRef<unknown>;\n\n /**\n * Template to display when the list is empty.\n */\n @Input()\n emptyTemplate: TemplateRef<unknown>;\n\n /**\n * Template to show while the list is loading.\n */\n @Input()\n loadingTemplate: TemplateRef<unknown>;\n\n /**\n * Emitted when the index of the scrolled item changes.\n *\n * @event\n */\n @Output()\n onScrolledIndexChanged: EventEmitter<AXListScrollIndexChanged> = new EventEmitter<AXListScrollIndexChanged>();\n\n /**\n * Specifies whether the checkbox is enabled.\n *\n * @defaultValue true\n */\n @Input()\n checkbox = true;\n\n /**\n * @ignore\n */\n protected listDataSource: AXListDataSource<unknown>;\n\n /**\n * @ignore\n */\n protected isLoading = signal(true);\n\n /**\n * @ignore\n */\n protected hasItems = false;\n\n /**\n * @ignore\n */\n private lastIndex = 0;\n\n /**\n * @ignore\n */\n private postponeFocus = false;\n\n /**\n * @ignore\n */\n @ViewChild(CdkVirtualScrollViewport)\n private viewport: CdkVirtualScrollViewport;\n\n trackByIdx(i) {\n return i;\n }\n\n /**\n * @ignore\n */\n override ngOnInit() {\n super.ngOnInit();\n this.listDataSource = new AXListDataSource<unknown>({\n source: this.dataSource,\n });\n this.listDataSource.source.onLoadingChanged.subscribe((data) => {\n this.isLoading.set(data);\n });\n this.listDataSource.source.onChanged.subscribe((data) => {\n this.hasItems = data.totalCount > 0;\n setTimeout(() => {\n this.render();\n }, 100);\n });\n }\n /**\n * @ignore\n */\n _handleOnItemClick(e: MouseEvent, item: any) {\n if (this.readonly || this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (this.isItemDisabled(item)) {\n return;\n }\n this.toggleSelect(item);\n this.onItemClick.emit({\n component: this,\n item,\n htmlElement: e.target as HTMLElement,\n isUserInteraction: true,\n nativeEvent: e,\n });\n }\n\n /**\n * @ignore\n */\n @HostListener('keydown', ['$event'])\n _handleKeydown(e: KeyboardEvent) {\n if ((e.code === 'ArrowDown' || e.code === 'ArrowUp') && this.hasItems) {\n this.focusItemByNav(e.key === 'ArrowDown' ? 1 : -1);\n e.preventDefault();\n }\n if ((e.code === 'Space' || e.code === 'Enter') && this.hasItems) {\n if (this.readonly || this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n const id = document.activeElement?.closest('li')?.dataset['id'];\n this.toggleSelect(id);\n e.preventDefault();\n e.stopPropagation();\n }\n }\n\n /**\n * @ignore\n */\n private focusItemByNav(sign: -1 | 1): void {\n const list = this.getHostElement().querySelector('ul');\n const fn = (s) => list.querySelector<HTMLDivElement>(s);\n const itemDiv: HTMLElement = document.activeElement?.closest('li') || fn(`li.ax-state-selected`) || fn(`li`);\n const next = (sign == 1 ? itemDiv.nextElementSibling : itemDiv.previousElementSibling) as HTMLElement;\n if (next) {\n next.focus();\n }\n }\n\n /**\n * @ignore\n */\n protected _handleOnscrolledIndexChange(e: number) {\n this.lastIndex = e;\n this.onScrolledIndexChanged.emit({\n component: this,\n index: this.lastIndex,\n isUserInteraction: true,\n });\n }\n\n /**\n * Retrieves an item from the data source based on the provided key.\n *\n * @param key The key used to identify the item.\n * @ignore\n */\n getItemByKey(key: unknown): Promise<unknown> | unknown {\n return this.dataSource.find(key);\n }\n\n /**\n * Renders the component by updating the viewport size, scrolling to the last index, and optionally focusing the element.\n */\n public render() {\n this.viewport.checkViewportSize();\n this.viewport.scrollToIndex(this.lastIndex);\n if (this.postponeFocus) {\n this.postponeFocus = false;\n this.focus();\n }\n }\n\n /**\n * Refreshes the list by clearing the selection cache and reloading the data source.\n * @ignore\n */\n public refresh() {\n this.clearSelectionCache();\n this.listDataSource.refresh();\n }\n\n /**\n * Scrolls the viewport to the specified item index.\n * @param index The index of the item to scroll to.\n * @ignore\n */\n public scrollToIndex(index: number) {\n this.viewport.scrollToIndex(index);\n }\n /**\n * Sets focus to the first selectable list item. If no item is available, postpones focus.\n */\n override focus(): void {\n const list = this.getHostElement().querySelector('ul');\n const focusable = list.querySelector<HTMLElement>('li.ax-state-selected') ?? list.querySelector<HTMLElement>('li.list-item');\n if (focusable) {\n focusable.focus();\n } else {\n this.postponeFocus = true;\n }\n }\n\n /**\n * Determines whether to show the empty template based on the presence of items and loading state.\n * @ignore\n */\n showEmptyTemplate = () => this.emptyTemplate && this.hasItems === false && this.isLoading() === false;\n\n /**\n * @ignore\n */\n @HostBinding('class')\n get __hostClass(): string {\n const _class = `ax-default ${this.showEmptyTemplate() ? 'ax-state-empty' : ''}`;\n return this.itemTemplate ? '' : _class;\n }\n}\n","<div class=\"list-container\" cdkVirtualScrollingElement>\n <ng-content select=\"ax-header\"></ng-content>\n <cdk-virtual-scroll-viewport [itemSize]=\"itemHeightSignal()\" [style.--item-height]=\"itemHeightSignal()+'px'\"\n (scrolledIndexChange)=\"_handleOnscrolledIndexChange($event)\">\n <ul>\n <!-- Item Template -->\n <ng-container *cdkVirtualFor=\"let item of listDataSource;let i = index; trackBy: trackByIdx\">\n <ng-container *ngIf=\"item;else loadingTpl\">\n <li [class.ax-state-selected]=\"isItemSelected(item)\" class=\"list-item\"\n [class.ax-state-disabled]=\"isItemDisabled(item)\" [attr.tabindex]=\"i\"\n (click)=\"_handleOnItemClick($event, item)\" [attr.data-id]=\"getValue(item)\">\n <!-- Custom Item Template -->\n <ng-container *ngIf=\"itemTemplate;else defaultItemTpl\">\n <ng-container *ngTemplateOutlet=\"itemTemplate;context: { $implicit: { data:item } }\">\n </ng-container>\n </ng-container>\n <!-- Default Item Template -->\n <ng-template #defaultItemTpl>\n <ng-container *ngIf=\"item;else loadingTpl\">\n <div class=\"ax-label-container\">\n <input class=\"ax-checkbox\" *ngIf=\"multiple && checkbox\" type=\"checkbox\"\n [checked]=\"isItemSelected(item)\" [disabled]=\"isItemDisabled(item)\"\n tabindex=\"0\" />\n <span\n [class.ax-checkbox-label]=\"multiple && checkbox\">{{getDisplayText(item)}}</span>\n </div>\n <!-- <i class=\"ax-icon ax-icon-check ax-selected-icon\" *ngIf=\"isItemSelected(item) \"></i> -->\n </ng-container>\n </ng-template>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n </cdk-virtual-scroll-viewport>\n <ng-content select=\"ax-footer\"></ng-content>\n</div>\n<!-- Loading Template -->\n<ng-template #loadingTpl>\n <!-- Custom Loading Template -->\n <ng-container *ngIf=\"loadingTemplate;else defaultLoadingTpl\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\">\n </ng-container>\n </ng-container>\n <!-- Default Loading Template -->\n <ng-template #defaultLoadingTpl>\n <li>{{'loading' | translate | async }}</li>\n </ng-template>\n</ng-template>\n<!-- Empty Template -->\n@if(showEmptyTemplate()){\n<div class=\"empty-container\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n</div>\n}","import { AXTranslationModule } from '@acorex/core/translation';\nimport { ScrollingModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXListComponent } from './list.component';\n\nconst COMPONENT = [AXListComponent];\nconst MODULES = [CommonModule, ScrollingModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXListModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;AAsCA;;;;AAIG;AA2BG,MAAO,eAAgB,SAAQ,yBAAyB,CAAA;AA1B9D,IAAA,WAAA,GAAA;;AA2BE;;;;AAIG;AAEH,QAAA,IAAA,CAAA,WAAW,GAAwC,IAAI,YAAY,EAAyB;AAE5F;;;;AAIG;AAEH,QAAA,IAAA,CAAA,UAAU,GAA0B,wBAAwB,CAAC,EAAE,CAAC;AAEhE;;AAEG;AACH,QAAA,IAAA,CAAA,gBAAgB,GAAoC,MAAM,CAAC,EAAE,CAAC;AA4B9D;;;;AAIG;AAEH,QAAA,IAAA,CAAA,sBAAsB,GAA2C,IAAI,YAAY,EAA4B;AAE7G;;;;AAIG;QAEH,IAAQ,CAAA,QAAA,GAAG,IAAI;AAOf;;AAEG;AAC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d,iBAAA;;;ACdD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-list.mjs","sources":["../../../../libs/components/list/src/lib/list.component.ts","../../../../libs/components/list/src/lib/list.component.html","../../../../libs/components/list/src/lib/list.module.ts","../../../../libs/components/list/src/acorex-components-list.ts"],"sourcesContent":["import {\n AXComponent,\n AXDataSource,\n AXEvent,\n AXFocusableComponent,\n AXItemClickEvent,\n AXListDataSource,\n AXValuableComponent,\n AX_SELECTION_DATA_TOKEN,\n MXSelectionBridgeService,\n MXSelectionValueComponent,\n convertArrayToDataSource,\n} from '@acorex/components/common';\nimport { CdkVirtualScrollViewport } from '@angular/cdk/scrolling';\nimport {\n ChangeDetectionStrategy,\n Component,\n EventEmitter,\n HostBinding,\n HostListener,\n Input,\n OnInit,\n Optional,\n Output,\n SkipSelf,\n TemplateRef,\n ViewChild,\n ViewEncapsulation,\n WritableSignal,\n forwardRef,\n signal,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\nexport interface AXListScrollIndexChanged extends AXEvent {\n index: number;\n}\n\n/**\n * provides a list control with various input options and events for user interaction.\n *\n * @category Components\n */\n@Component({\n selector: 'ax-list',\n templateUrl: './list.component.html',\n styleUrls: ['./list.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n inputs: ['id', 'name', 'disabled', 'readonly', 'valueField', 'textField', 'textTemplate', 'disabledField', 'multiple', 'selectionMode'],\n outputs: ['onValueChanged', 'disabledChange', 'readOnlyChange', 'onBlur', 'onFocus'],\n providers: [\n { provide: AXComponent, useExisting: AXListComponent },\n { provide: AXFocusableComponent, useExisting: AXListComponent },\n { provide: AXValuableComponent, useExisting: AXListComponent },\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXListComponent),\n multi: true,\n },\n {\n provide: AX_SELECTION_DATA_TOKEN,\n useFactory: (existingService: MXSelectionBridgeService) => {\n return existingService || new MXSelectionBridgeService();\n },\n deps: [[new Optional(), new SkipSelf(), AX_SELECTION_DATA_TOKEN]],\n },\n ],\n})\nexport class AXListComponent extends MXSelectionValueComponent implements OnInit {\n /**\n * Emitted when an item in the list is clicked.\n *\n * @event\n */\n @Output()\n onItemClick: EventEmitter<AXItemClickEvent<any>> = new EventEmitter<AXItemClickEvent<any>>();\n\n /**\n * Defines the data source for the list.\n *\n * @defaultValue convertArrayToDataSource([])\n */\n @Input()\n dataSource: AXDataSource<unknown> = convertArrayToDataSource([]);\n\n /**\n * @ignore\n */\n itemHeightSignal: WritableSignal<number | 'auto'> = signal(40);\n\n /**\n * Sets the height of each item in the list.\n */\n @Input()\n public set itemHeight(v: number | 'auto') {\n this.itemHeightSignal.set(v);\n }\n\n /**\n * Template for rendering individual items in the list.\n */\n @Input()\n itemTemplate: TemplateRef<unknown>;\n\n /**\n * Template to display when the list is empty.\n */\n @Input()\n emptyTemplate: TemplateRef<unknown>;\n\n /**\n * Template to show while the list is loading.\n */\n @Input()\n loadingTemplate: TemplateRef<unknown>;\n\n /**\n * Emitted when the index of the scrolled item changes.\n *\n * @event\n */\n @Output()\n onScrolledIndexChanged: EventEmitter<AXListScrollIndexChanged> = new EventEmitter<AXListScrollIndexChanged>();\n\n /**\n * Specifies whether the checkbox is enabled.\n *\n * @defaultValue true\n */\n @Input()\n checkbox = true;\n\n /**\n * @ignore\n */\n protected listDataSource: AXListDataSource<unknown>;\n\n /**\n * @ignore\n */\n protected isLoading = signal(true);\n\n /**\n * @ignore\n */\n protected hasItems = false;\n\n /**\n * @ignore\n */\n private lastIndex = 0;\n\n /**\n * @ignore\n */\n private postponeFocus = false;\n\n /**\n * @ignore\n */\n @ViewChild(CdkVirtualScrollViewport)\n private viewport: CdkVirtualScrollViewport;\n\n trackByIdx(i) {\n return i;\n }\n\n /**\n * @ignore\n */\n override ngOnInit() {\n super.ngOnInit();\n this.listDataSource = new AXListDataSource<unknown>({\n source: this.dataSource,\n });\n this.listDataSource.source.onLoadingChanged.subscribe((data) => {\n this.isLoading.set(data);\n });\n this.listDataSource.source.onChanged.subscribe((data) => {\n this.hasItems = data.totalCount > 0;\n setTimeout(() => {\n this.render();\n }, 100);\n });\n }\n /**\n * @ignore\n */\n _handleOnItemClick(e: MouseEvent, item: any) {\n if (this.readonly || this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n if (this.isItemDisabled(item)) {\n return;\n }\n this.toggleSelect(item);\n this.onItemClick.emit({\n component: this,\n item,\n htmlElement: e.target as HTMLElement,\n isUserInteraction: true,\n nativeEvent: e,\n });\n }\n\n /**\n * @ignore\n */\n @HostListener('keydown', ['$event'])\n _handleKeydown(e: KeyboardEvent) {\n if ((e.code === 'ArrowDown' || e.code === 'ArrowUp') && this.hasItems) {\n this.focusItemByNav(e.key === 'ArrowDown' ? 1 : -1);\n e.preventDefault();\n }\n if ((e.code === 'Space' || e.code === 'Enter') && this.hasItems) {\n if (this.readonly || this.disabled) {\n e.preventDefault();\n e.stopPropagation();\n return;\n }\n const id = document.activeElement?.closest('li')?.dataset['id'];\n this.toggleSelect(id);\n e.preventDefault();\n e.stopPropagation();\n }\n }\n\n /**\n * @ignore\n */\n private focusItemByNav(sign: -1 | 1): void {\n const list = this.getHostElement().querySelector('ul');\n const fn = (s) => list.querySelector<HTMLDivElement>(s);\n const itemDiv: HTMLElement = document.activeElement?.closest('li') || fn(`li.ax-state-selected`) || fn(`li`);\n const next = (sign == 1 ? itemDiv.nextElementSibling : itemDiv.previousElementSibling) as HTMLElement;\n if (next) {\n next.focus();\n }\n }\n\n /**\n * @ignore\n */\n protected _handleOnscrolledIndexChange(e: number) {\n this.lastIndex = e;\n this.onScrolledIndexChanged.emit({\n component: this,\n index: this.lastIndex,\n isUserInteraction: true,\n });\n }\n\n /**\n * Retrieves an item from the data source based on the provided key.\n *\n * @param key The key used to identify the item.\n * @ignore\n */\n getItemByKey(key: unknown): Promise<unknown> | unknown {\n return this.dataSource.find(key);\n }\n\n /**\n * Renders the component by updating the viewport size, scrolling to the last index, and optionally focusing the element.\n */\n public render() {\n this.viewport.checkViewportSize();\n this.viewport.scrollToIndex(this.lastIndex);\n if (this.postponeFocus) {\n this.postponeFocus = false;\n this.focus();\n }\n }\n\n /**\n * Refreshes the list by clearing the selection cache and reloading the data source.\n * @ignore\n */\n public refresh() {\n this.clearSelectionCache();\n this.listDataSource.refresh();\n }\n\n /**\n * Scrolls the viewport to the specified item index.\n * @param index The index of the item to scroll to.\n * @ignore\n */\n public scrollToIndex(index: number) {\n this.viewport.scrollToIndex(index);\n }\n /**\n * Sets focus to the first selectable list item. If no item is available, postpones focus.\n */\n override focus(): void {\n const list = this.getHostElement().querySelector('ul');\n const focusable = list.querySelector<HTMLElement>('li.ax-state-selected') ?? list.querySelector<HTMLElement>('li.list-item');\n if (focusable) {\n focusable.focus();\n } else {\n this.postponeFocus = true;\n }\n }\n\n /**\n * Determines whether to show the empty template based on the presence of items and loading state.\n * @ignore\n */\n showEmptyTemplate = () => this.emptyTemplate && this.hasItems === false && this.isLoading() === false;\n\n /**\n * @ignore\n */\n @HostBinding('class')\n get __hostClass(): string {\n const _class = `ax-default ${this.showEmptyTemplate() ? 'ax-state-empty' : ''}`;\n return this.itemTemplate ? '' : _class;\n }\n}\n","<div class=\"list-container\" cdkVirtualScrollingElement>\n <ng-content select=\"ax-header\"></ng-content>\n <cdk-virtual-scroll-viewport\n [itemSize]=\"itemHeightSignal()\"\n [style.--item-height]=\"itemHeightSignal() + 'px'\"\n (scrolledIndexChange)=\"_handleOnscrolledIndexChange($event)\"\n >\n <ul>\n <!-- Item Template -->\n <ng-container *cdkVirtualFor=\"let item of listDataSource; let i = index; trackBy: trackByIdx\">\n <ng-container *ngIf=\"item !== null && item !== undefined; else loadingTpl\">\n <li\n [class.ax-state-selected]=\"isItemSelected(item)\"\n class=\"list-item\"\n [class.ax-state-disabled]=\"isItemDisabled(item)\"\n [attr.tabindex]=\"i\"\n (click)=\"_handleOnItemClick($event, item)\"\n [attr.data-id]=\"getValue(item)\"\n >\n <!-- Custom Item Template -->\n <ng-container *ngIf=\"itemTemplate; else defaultItemTpl\">\n <ng-container *ngTemplateOutlet=\"itemTemplate; context: { $implicit: { data: item } }\">\n </ng-container>\n </ng-container>\n <!-- Default Item Template -->\n <ng-template #defaultItemTpl>\n <ng-container *ngIf=\"item !== null && item !== undefined; else loadingTpl\">\n <div class=\"ax-label-container\">\n <input\n class=\"ax-checkbox\"\n *ngIf=\"multiple && checkbox\"\n type=\"checkbox\"\n [checked]=\"isItemSelected(item)\"\n [disabled]=\"isItemDisabled(item)\"\n tabindex=\"0\"\n />\n <span [class.ax-checkbox-label]=\"multiple && checkbox\">{{ getDisplayText(item) }}</span>\n </div>\n <!-- <i class=\"ax-icon ax-icon-check ax-selected-icon\" *ngIf=\"isItemSelected(item) \"></i> -->\n </ng-container>\n </ng-template>\n </li>\n </ng-container>\n </ng-container>\n </ul>\n </cdk-virtual-scroll-viewport>\n <ng-content select=\"ax-footer\"></ng-content>\n</div>\n<!-- Loading Template -->\n<ng-template #loadingTpl>\n <!-- Custom Loading Template -->\n <ng-container *ngIf=\"loadingTemplate; else defaultLoadingTpl\">\n <ng-container *ngTemplateOutlet=\"loadingTemplate\"> </ng-container>\n </ng-container>\n <!-- Default Loading Template -->\n <ng-template #defaultLoadingTpl>\n <li>{{ 'loading' | translate | async }}</li>\n </ng-template>\n</ng-template>\n<!-- Empty Template -->\n@if (showEmptyTemplate()) {\n <div class=\"empty-container\">\n <ng-container *ngTemplateOutlet=\"emptyTemplate\"></ng-container>\n </div>\n}\n","import { AXTranslationModule } from '@acorex/core/translation';\nimport { ScrollingModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXListComponent } from './list.component';\n\nconst COMPONENT = [AXListComponent];\nconst MODULES = [CommonModule, ScrollingModule, AXTranslationModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXListModule {}\n","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mBAAmB,CAAA,EAAA,OAAA,EAAA,CADhD,eAAe,CAAA,EAAA,CAAA,CAAA;AASrB,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,YAAY,YAJV,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,YAAY,EAAA,UAAA,EAAA,CAAA;kBANxB,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;AACvB,oBAAA,SAAS,EAAE,EAAE;AACd,iBAAA;;;ACdD;;AAEG;;;;"}
|
@@ -139,11 +139,15 @@ class AXLoadingComponent extends MXBaseComponent {
|
|
139
139
|
}
|
140
140
|
}
|
141
141
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXLoadingComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
142
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXLoadingComponent, selector: "ax-loading", inputs: { visible: "visible", type: "type", context: "context" }, outputs: { visibleChange: "visibleChange" }, usesInheritance: true, ngImport: i0, template: `
|
142
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.0", type: AXLoadingComponent, selector: "ax-loading", inputs: { visible: "visible", type: "type", context: "context" }, outputs: { visibleChange: "visibleChange" }, usesInheritance: true, ngImport: i0, template: `
|
143
|
+
<ng-template [cdkPortalOutlet]="_selectedPortal" (attached)="_handleAttched($event)"></ng-template>
|
144
|
+
`, isInline: true, styles: ["ax-loading{position:relative;padding-left:.25rem;padding-right:.25rem}ax-loading:before,ax-loading:after{position:absolute;inset-inline-start:50%;top:50%;height:100%;width:100%;transform:translate(-50%);transform:translateY(-50%);transform:scale(0);border-radius:9999px;content:\"\"}ax-loading:before,ax-loading:after{background-color:transparent;animation:1s ease-in-out both ax-pulse;animation-duration:2s;animation-iteration-count:infinite}@keyframes ax-pulse{50%{transform:scale3d(1.05,1.05,1.05)}}ax-loading ax-loading-spinner{display:flex;gap:.75rem}.ax-loading-overlay-backdrop{background-color:rgba(var(--ax-color-surface));opacity:.85!important}.ax-loading-pane{height:100%!important;width:100%!important;bottom:0;inset-inline-end:0px;inset-inline-start:0px;top:0}.ax-loading-pane .cdk-dialog-container{display:flex!important;align-items:center;justify-content:center}.ax-loading-pane .cdk-dialog-container:focus,.ax-loading-pane .cdk-dialog-container:focus-visible,.ax-loading-pane .cdk-dialog-container:focus-within{outline:2px solid transparent;outline-offset:2px}\n"], dependencies: [{ kind: "directive", type: i1.CdkPortalOutlet, selector: "[cdkPortalOutlet]", inputs: ["cdkPortalOutlet"], outputs: ["attached"], exportAs: ["cdkPortalOutlet"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
143
145
|
}
|
144
146
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXLoadingComponent, decorators: [{
|
145
147
|
type: Component,
|
146
|
-
args: [{ selector: 'ax-loading', template: `
|
148
|
+
args: [{ selector: 'ax-loading', template: `
|
149
|
+
<ng-template [cdkPortalOutlet]="_selectedPortal" (attached)="_handleAttched($event)"></ng-template>
|
150
|
+
`, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, styles: ["ax-loading{position:relative;padding-left:.25rem;padding-right:.25rem}ax-loading:before,ax-loading:after{position:absolute;inset-inline-start:50%;top:50%;height:100%;width:100%;transform:translate(-50%);transform:translateY(-50%);transform:scale(0);border-radius:9999px;content:\"\"}ax-loading:before,ax-loading:after{background-color:transparent;animation:1s ease-in-out both ax-pulse;animation-duration:2s;animation-iteration-count:infinite}@keyframes ax-pulse{50%{transform:scale3d(1.05,1.05,1.05)}}ax-loading ax-loading-spinner{display:flex;gap:.75rem}.ax-loading-overlay-backdrop{background-color:rgba(var(--ax-color-surface));opacity:.85!important}.ax-loading-pane{height:100%!important;width:100%!important;bottom:0;inset-inline-end:0px;inset-inline-start:0px;top:0}.ax-loading-pane .cdk-dialog-container{display:flex!important;align-items:center;justify-content:center}.ax-loading-pane .cdk-dialog-container:focus,.ax-loading-pane .cdk-dialog-container:focus-visible,.ax-loading-pane .cdk-dialog-container:focus-within{outline:2px solid transparent;outline-offset:2px}\n"] }]
|
147
151
|
}], propDecorators: { visibleChange: [{
|
148
152
|
type: Output
|
149
153
|
}], visible: [{
|
@@ -187,10 +191,10 @@ class AXLoadingService {
|
|
187
191
|
ce.style.position = 'relative';
|
188
192
|
ov.style.position = 'absolute';
|
189
193
|
ce.appendChild(bg);
|
190
|
-
ce.appendChild(ov);
|
191
194
|
setTimeout(() => {
|
195
|
+
ce.appendChild(ov);
|
192
196
|
ov.style.position = 'absolute';
|
193
|
-
}
|
197
|
+
});
|
194
198
|
}
|
195
199
|
return id;
|
196
200
|
// TODO: diabled focus and click, maybe we need a service and directive for it
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-loading.mjs","sources":["../../../../libs/components/loading/src/lib/loading-spinner.component.ts","../../../../libs/components/loading/src/lib/loading.config.ts","../../../../libs/components/loading/src/lib/loading.component.ts","../../../../libs/components/loading/src/lib/loading.service.ts","../../../../libs/components/loading/src/lib/loading.directive.ts","../../../../libs/components/loading/src/lib/loading.module.ts","../../../../libs/components/loading/src/acorex-components-loading.ts"],"sourcesContent":["import { AXStyleColorType } from '@acorex/components/common';\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\n\n/**\n * A loading spinner component that displays a rotating spinner icon.\n * @category Components\n */\n@Component({\n selector: 'ax-loading-spinner',\n template: `\n <span\n class=\"ax-loader ax-{{ color }}\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n [style.border-width.px]=\"stroke\"\n [style.border-color]=\"color\"\n ></span>\n @if (text) {\n <span> {{ text }} </span>\n }\n `,\n styleUrls: ['./loading-spinner.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXLoadingSpinnerComponent {\n /**\n * The text to display alongside the spinner.\n * @ignore\n */\n @Input()\n text: string;\n\n /**\n * Color of the spinner. Can be a predefined style color or a custom color.\n * @defaultValue 'ghost'\n */\n @Input()\n color: AXStyleColorType | string = 'ghost';\n\n /**\n * Size of the spinner, in pixels. This determines both the width and height of the spinner.\n * @defaultValue 16\n */\n @Input() size = 16;\n\n /**\n * Thickness of the spinner's border, in pixels. This affects the visual weight of the spinner's outline.\n * @defaultValue 3\n */\n @Input() stroke = 3;\n}\n","import { InjectionToken } from '@angular/core';\nimport { AXLoadingSpinnerComponent } from './loading-spinner.component';\n\nexport interface AXLoadingConfig {\n spinner: unknown;\n}\n\nexport const AX_LOADING_CONFIG = new InjectionToken<AXLoadingConfig>('AX_LOADING_CONFIG', {\n providedIn: 'root',\n factory: () => AXLoadingDefaultConfig,\n});\n\nexport const AXLoadingDefaultConfig: AXLoadingConfig = {\n spinner: AXLoadingSpinnerComponent,\n};\n\nexport type PartialLoadingConfig = Partial<AXLoadingConfig>;\n\nexport function loadingConfig(config: PartialLoadingConfig = {}): AXLoadingConfig {\n const result = {\n ...AXLoadingDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { MXBaseComponent } from '@acorex/components/common';\nimport { CdkPortalOutletAttachedRef, ComponentPortal, ComponentType, Portal } from '@angular/cdk/portal';\nimport {\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { AXLoadingConfig, AX_LOADING_CONFIG } from './loading.config';\n\n/**\n * A component that displays a loading indicator.\n * @category Components\n */\n@Component({\n selector: 'ax-loading',\n template: ` <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template> `,\n styleUrls: ['./loading.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXLoadingComponent extends MXBaseComponent implements OnInit {\n private config: AXLoadingConfig = inject(AX_LOADING_CONFIG);\n\n /**\n * @ignore\n */\n protected _selectedPortal: Portal<unknown>;\n\n /**\n * Emits an event when the visibility state of the component changes.\n * @event\n */\n @Output()\n visibleChange: EventEmitter<boolean> = new EventEmitter();\n\n /**\n * @ignore\n */\n private _visible: boolean;\n\n /**\n * Determines whether the component is visible or not.\n */\n @Input()\n public get visible(): boolean {\n return this._visible;\n }\n\n /**\n * Sets the visibility of the component and emits a visibility change event.\n *\n * @param v - A boolean value indicating whether the component should be visible.\n */\n public set visible(v: boolean) {\n if (v != this._visible) {\n this._visible = v;\n v ? this.getHostElement().classList.remove('ax-hide') : this.getHostElement().classList.add('ax-hide');\n this.visibleChange.emit(v);\n }\n }\n\n /**\n * Specifies the type of loading indicator to display.\n * @defaultValue 'spinner'\n */\n @Input()\n type = 'spinner';\n\n /**\n * Provides additional context or data that may be used by the component.\n */\n @Input()\n context?: unknown;\n\n /**\n * @ignore\n */\n override ngOnInit() {\n super.ngOnInit();\n this._selectedPortal = new ComponentPortal(this.config.spinner as ComponentType<unknown>);\n this.cdr.markForCheck();\n }\n\n /**\n * @ignore\n */\n protected _handleAttched(ref: CdkPortalOutletAttachedRef) {\n ref = ref as ComponentRef<unknown>;\n if (ref.instance && this.context) {\n Object.assign(ref.instance, this.context);\n }\n }\n}\n","import { Dialog } from '@angular/cdk/dialog';\nimport { Injectable, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, asyncScheduler } from 'rxjs';\nimport { finalize, observeOn } from 'rxjs/operators';\nimport { AXLoadingComponent } from './loading.component';\n\ntype LoadingContext = object;\ntype LoaderId = string | number; // expected enum values\nconst DEFAULT_LOADER_ID: LoaderId = '_DEFAULT';\n\n@Injectable()\nexport class AXLoadingService {\n // WeakMap will remove components from itself upon\n // their garbage collection by JS runtime.\n protected loadingStates = new WeakMap<LoadingContext, Map<LoaderId, boolean>>();\n // Both loading state maps are kept in-sync such that\n // they can be used by both sync and async methods.\n protected loadingStates$ = new WeakMap<LoadingContext, Map<LoaderId, BehaviorSubject<boolean>>>();\n\n private dialog = inject(Dialog);\n\n show(config?: { location?: Element; type?: string; context?: unknown }): number {\n const ce = (config?.location ?? document.body) as HTMLDivElement;\n const dialogRef = this.dialog.open(AXLoadingComponent, {\n hasBackdrop: true,\n disableClose: true,\n restoreFocus: true,\n closeOnDestroy: true,\n closeOnNavigation: true,\n ariaModal: true,\n role: 'alertdialog',\n panelClass: ['ax-loading-pane', 'ax-animate-fadeIn'],\n backdropClass: ['ax-loading-overlay-backdrop', 'ax-animate-fadeIn'],\n });\n const id = new Date().getTime();\n dialogRef.componentInstance.visible = true;\n dialogRef.componentInstance.id = id.toString();\n if (ce != document.body) {\n const bg = dialogRef.overlayRef.backdropElement;\n const ov = dialogRef.overlayRef.overlayElement;\n ce.style.position = 'relative';\n ov.style.position = 'absolute';\n ce.appendChild(bg);\n ce.appendChild(ov);\n setTimeout(() => {\n ov.style.position = 'absolute';\n }, 0);\n }\n return id;\n // TODO: diabled focus and click, maybe we need a service and directive for it\n }\n\n hide(id: number): void {\n const f = this.dialog.openDialogs.find((c) => c.componentInstance.id === id.toString());\n if (f) {\n f.close();\n }\n }\n\n doLoading<V>(source$: Observable<V>, context: LoadingContext, loaderId?: LoaderId): Observable<V> {\n this.startLoading(context, loaderId);\n return source$.pipe(\n observeOn(asyncScheduler),\n finalize(() => this.endLoading(context, loaderId)),\n );\n }\n\n isLoading(context: LoadingContext, loaderId?: LoaderId): boolean {\n const loaderStates = this.loadingStates.get(context);\n\n if (!loaderStates) {\n return false;\n } else {\n if (loaderId !== undefined) {\n return loaderStates.get(this.getLoaderId(loaderId)) ?? false;\n } else {\n return [...loaderStates.values()].filter((state) => state).length > 0;\n }\n }\n }\n\n isLoading$(context: LoadingContext, loaderId?: LoaderId | any): Observable<boolean> {\n const coalescedLoaderId = this.getLoaderId(loaderId);\n\n if (!this.hasLoadingStates(context, coalescedLoaderId)) {\n this.setLoadingState(context, false, loaderId);\n }\n\n return this.loadingStates$.get(context).get(coalescedLoaderId);\n }\n\n startLoading(context: LoadingContext, loaderId?: LoaderId): void {\n this.setLoadingState(context, true, this.getLoaderId(loaderId));\n }\n\n endLoading(context: LoadingContext, loaderId?: LoaderId): void {\n this.setLoadingState(context, false, this.getLoaderId(loaderId));\n }\n\n clearLoadings(): void {\n this.loadingStates = new WeakMap<LoadingContext, Map<LoaderId, boolean>>();\n this.loadingStates$ = new WeakMap<LoadingContext, Map<LoaderId, BehaviorSubject<boolean>>>();\n }\n\n protected setLoadingState(context: LoadingContext, state: boolean, loaderId: LoaderId): void {\n if (!this.hasLoadingStates(context, loaderId)) {\n if (this.hasContextLoadingState(context)) {\n this.loadingStates.get(context).set(loaderId, state);\n this.loadingStates$.get(context).set(loaderId, new BehaviorSubject<boolean>(state));\n } else {\n this.loadingStates.set(context, new Map<LoaderId, boolean>([[loaderId, state]]));\n this.loadingStates$.set(context, new Map<LoaderId, BehaviorSubject<boolean>>([[loaderId, new BehaviorSubject<boolean>(state)]]));\n }\n } else {\n this.loadingStates.get(context).set(loaderId, state);\n this.loadingStates$.get(context).get(loaderId).next(state);\n }\n }\n\n protected hasLoadingStates(context: LoadingContext, loaderId: LoaderId) {\n return this.hasContextLoadingState(context) && this.hasLoaderLoadingState(context, loaderId);\n }\n\n protected hasContextLoadingState(context: LoadingContext) {\n return this.loadingStates.has(context) && this.loadingStates$.has(context);\n }\n\n protected hasLoaderLoadingState(context: LoadingContext, loaderId: LoaderId) {\n return this.loadingStates.get(context).has(loaderId) && this.loadingStates$.get(context).has(loaderId);\n }\n\n protected getLoaderId(loaderId?: LoaderId): LoaderId {\n return loaderId ?? DEFAULT_LOADER_ID;\n }\n}\n","import { Directive, ElementRef, Input } from '@angular/core';\nimport { AXLoadingService } from './loading.service';\n\n// This directive places an overlay with a loading spinner over its host element\n// if isLoading equals to true and hides the overlay when isLoading becomes false.\n@Directive({\n selector: '[axIsLoading]',\n})\nexport class AXLoadingDirective {\n private _hostElement!: HTMLDivElement;\n private _loadingRef!: number;\n\n private _isLoading: boolean;\n\n @Input('axIsLoading')\n public get isLoading(): boolean {\n return this._isLoading;\n }\n public set isLoading(v: boolean) {\n this._isLoading = v;\n if (v) {\n this._loadingRef = this.loadingService.show({\n location: this._hostElement,\n });\n } else {\n this.loadingService.hide(this._loadingRef);\n }\n }\n\n constructor(\n protected readonly elementRef: ElementRef,\n protected readonly loadingService: AXLoadingService,\n ) {\n this._hostElement = this.elementRef.nativeElement;\n }\n}\n","import { DialogModule } from '@angular/cdk/dialog';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXLoadingSpinnerComponent } from './loading-spinner.component';\nimport { AXLoadingComponent } from './loading.component';\nimport { AXLoadingDirective } from './loading.directive';\nimport { AXLoadingService } from './loading.service';\n\nconst COMPONENT = [AXLoadingComponent, AXLoadingDirective, AXLoadingSpinnerComponent];\nconst MODULES = [CommonModule, OverlayModule, DialogModule, PortalModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXLoadingService],\n})\nexport class AXLoadingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":["i1.AXLoadingService"],"mappings":";;;;;;;;;;;AAGA;;;AAGG;MAkBU,yBAAyB,CAAA;AAjBtC,IAAA,WAAA,GAAA;AAyBE;;;AAGG;QAEH,IAAK,CAAA,KAAA,GAA8B,OAAO;AAE1C;;;AAGG;QACM,IAAI,CAAA,IAAA,GAAG,EAAE;AAElB;;;AAGG;QACM,IAAM,C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AAE,YAAY,EAAE,YAAY,CAAC;MAQ5D,eAAe,CAAA;8GAAf,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA,CAAA;AAAf,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,iBATT,kBAAkB,EAAE,kBAAkB,EAAE,yBAAyB,aACnE,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,CAAA,EAAA,OAAA,EAAA,CADrD,kBAAkB,EAAE,kBAAkB,EAAE,yBAAyB,CAAA,EAAA,CAAA,CAAA;AASvE,IAAA,SAAA,IAAA,CAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,eAAe,EAFf,SAAA,EAAA,CAAC,gBAAgB,CAAC,YAFhB,OAAO,CAAA,EAAA,CAAA,CAAA;;2FAIT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;oBACvB,SAAS,EAAE,CAAC,gBAAgB,CAAC;AAC9B,iBAAA;;;AClBD;;AAEG;;;;"}
|
1
|
+
{"version":3,"file":"acorex-components-loading.mjs","sources":["../../../../libs/components/loading/src/lib/loading-spinner.component.ts","../../../../libs/components/loading/src/lib/loading.config.ts","../../../../libs/components/loading/src/lib/loading.component.ts","../../../../libs/components/loading/src/lib/loading.service.ts","../../../../libs/components/loading/src/lib/loading.directive.ts","../../../../libs/components/loading/src/lib/loading.module.ts","../../../../libs/components/loading/src/acorex-components-loading.ts"],"sourcesContent":["import { AXStyleColorType } from '@acorex/components/common';\nimport { Component, Input, ViewEncapsulation } from '@angular/core';\n\n/**\n * A loading spinner component that displays a rotating spinner icon.\n * @category Components\n */\n@Component({\n selector: 'ax-loading-spinner',\n template: `\n <span\n class=\"ax-loader ax-{{ color }}\"\n [style.width.px]=\"size\"\n [style.height.px]=\"size\"\n [style.border-width.px]=\"stroke\"\n [style.border-color]=\"color\"\n ></span>\n @if (text) {\n <span> {{ text }} </span>\n }\n `,\n styleUrls: ['./loading-spinner.component.scss'],\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXLoadingSpinnerComponent {\n /**\n * The text to display alongside the spinner.\n * @ignore\n */\n @Input()\n text: string;\n\n /**\n * Color of the spinner. Can be a predefined style color or a custom color.\n * @defaultValue 'ghost'\n */\n @Input()\n color: AXStyleColorType | string = 'ghost';\n\n /**\n * Size of the spinner, in pixels. This determines both the width and height of the spinner.\n * @defaultValue 16\n */\n @Input() size = 16;\n\n /**\n * Thickness of the spinner's border, in pixels. This affects the visual weight of the spinner's outline.\n * @defaultValue 3\n */\n @Input() stroke = 3;\n}\n","import { InjectionToken } from '@angular/core';\nimport { AXLoadingSpinnerComponent } from './loading-spinner.component';\n\nexport interface AXLoadingConfig {\n spinner: unknown;\n}\n\nexport const AX_LOADING_CONFIG = new InjectionToken<AXLoadingConfig>('AX_LOADING_CONFIG', {\n providedIn: 'root',\n factory: () => AXLoadingDefaultConfig,\n});\n\nexport const AXLoadingDefaultConfig: AXLoadingConfig = {\n spinner: AXLoadingSpinnerComponent,\n};\n\nexport type PartialLoadingConfig = Partial<AXLoadingConfig>;\n\nexport function loadingConfig(config: PartialLoadingConfig = {}): AXLoadingConfig {\n const result = {\n ...AXLoadingDefaultConfig,\n ...config,\n };\n return result;\n}\n","import { MXBaseComponent } from '@acorex/components/common';\nimport { CdkPortalOutletAttachedRef, ComponentPortal, ComponentType, Portal } from '@angular/cdk/portal';\nimport {\n ChangeDetectionStrategy,\n Component,\n ComponentRef,\n EventEmitter,\n Input,\n OnInit,\n Output,\n ViewEncapsulation,\n inject,\n} from '@angular/core';\nimport { AXLoadingConfig, AX_LOADING_CONFIG } from './loading.config';\n\n/**\n * A component that displays a loading indicator.\n * @category Components\n */\n@Component({\n selector: 'ax-loading',\n template: `\n <ng-template [cdkPortalOutlet]=\"_selectedPortal\" (attached)=\"_handleAttched($event)\"></ng-template>\n `,\n styleUrls: ['./loading.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n})\nexport class AXLoadingComponent extends MXBaseComponent implements OnInit {\n private config: AXLoadingConfig = inject(AX_LOADING_CONFIG);\n\n /**\n * @ignore\n */\n protected _selectedPortal: Portal<unknown>;\n\n /**\n * Emits an event when the visibility state of the component changes.\n * @event\n */\n @Output()\n visibleChange: EventEmitter<boolean> = new EventEmitter();\n\n /**\n * @ignore\n */\n private _visible: boolean;\n\n /**\n * Determines whether the component is visible or not.\n */\n @Input()\n public get visible(): boolean {\n return this._visible;\n }\n\n /**\n * Sets the visibility of the component and emits a visibility change event.\n *\n * @param v - A boolean value indicating whether the component should be visible.\n */\n public set visible(v: boolean) {\n if (v != this._visible) {\n this._visible = v;\n v ? this.getHostElement().classList.remove('ax-hide') : this.getHostElement().classList.add('ax-hide');\n this.visibleChange.emit(v);\n }\n }\n\n /**\n * Specifies the type of loading indicator to display.\n * @defaultValue 'spinner'\n */\n @Input()\n type = 'spinner';\n\n /**\n * Provides additional context or data that may be used by the component.\n */\n @Input()\n context?: unknown;\n\n /**\n * @ignore\n */\n override ngOnInit() {\n super.ngOnInit();\n this._selectedPortal = new ComponentPortal(this.config.spinner as ComponentType<unknown>);\n this.cdr.markForCheck();\n }\n\n /**\n * @ignore\n */\n protected _handleAttched(ref: CdkPortalOutletAttachedRef) {\n ref = ref as ComponentRef<unknown>;\n if (ref.instance && this.context) {\n Object.assign(ref.instance, this.context);\n }\n }\n}\n","import { Dialog } from '@angular/cdk/dialog';\nimport { Injectable, inject } from '@angular/core';\nimport { BehaviorSubject, Observable, asyncScheduler } from 'rxjs';\nimport { finalize, observeOn } from 'rxjs/operators';\nimport { AXLoadingComponent } from './loading.component';\n\ntype LoadingContext = object;\ntype LoaderId = string | number; // expected enum values\nconst DEFAULT_LOADER_ID: LoaderId = '_DEFAULT';\n\n@Injectable()\nexport class AXLoadingService {\n // WeakMap will remove components from itself upon\n // their garbage collection by JS runtime.\n protected loadingStates = new WeakMap<LoadingContext, Map<LoaderId, boolean>>();\n // Both loading state maps are kept in-sync such that\n // they can be used by both sync and async methods.\n protected loadingStates$ = new WeakMap<LoadingContext, Map<LoaderId, BehaviorSubject<boolean>>>();\n\n private dialog = inject(Dialog);\n\n show(config?: { location?: Element; type?: string; context?: unknown }): number {\n const ce = (config?.location ?? document.body) as HTMLDivElement;\n const dialogRef = this.dialog.open(AXLoadingComponent, {\n hasBackdrop: true,\n disableClose: true,\n restoreFocus: true,\n closeOnDestroy: true,\n closeOnNavigation: true,\n ariaModal: true,\n role: 'alertdialog',\n panelClass: ['ax-loading-pane', 'ax-animate-fadeIn'],\n backdropClass: ['ax-loading-overlay-backdrop', 'ax-animate-fadeIn'],\n });\n const id = new Date().getTime();\n dialogRef.componentInstance.visible = true;\n dialogRef.componentInstance.id = id.toString();\n if (ce != document.body) {\n const bg = dialogRef.overlayRef.backdropElement;\n const ov = dialogRef.overlayRef.overlayElement;\n ce.style.position = 'relative';\n ov.style.position = 'absolute';\n\n ce.appendChild(bg);\n\n setTimeout(() => {\n ce.appendChild(ov);\n ov.style.position = 'absolute';\n });\n }\n return id;\n // TODO: diabled focus and click, maybe we need a service and directive for it\n }\n\n hide(id: number): void {\n const f = this.dialog.openDialogs.find((c) => c.componentInstance.id === id.toString());\n if (f) {\n f.close();\n }\n }\n\n doLoading<V>(source$: Observable<V>, context: LoadingContext, loaderId?: LoaderId): Observable<V> {\n this.startLoading(context, loaderId);\n return source$.pipe(\n observeOn(asyncScheduler),\n finalize(() => this.endLoading(context, loaderId)),\n );\n }\n\n isLoading(context: LoadingContext, loaderId?: LoaderId): boolean {\n const loaderStates = this.loadingStates.get(context);\n\n if (!loaderStates) {\n return false;\n } else {\n if (loaderId !== undefined) {\n return loaderStates.get(this.getLoaderId(loaderId)) ?? false;\n } else {\n return [...loaderStates.values()].filter((state) => state).length > 0;\n }\n }\n }\n\n isLoading$(context: LoadingContext, loaderId?: LoaderId | any): Observable<boolean> {\n const coalescedLoaderId = this.getLoaderId(loaderId);\n\n if (!this.hasLoadingStates(context, coalescedLoaderId)) {\n this.setLoadingState(context, false, loaderId);\n }\n\n return this.loadingStates$.get(context).get(coalescedLoaderId);\n }\n\n startLoading(context: LoadingContext, loaderId?: LoaderId): void {\n this.setLoadingState(context, true, this.getLoaderId(loaderId));\n }\n\n endLoading(context: LoadingContext, loaderId?: LoaderId): void {\n this.setLoadingState(context, false, this.getLoaderId(loaderId));\n }\n\n clearLoadings(): void {\n this.loadingStates = new WeakMap<LoadingContext, Map<LoaderId, boolean>>();\n this.loadingStates$ = new WeakMap<LoadingContext, Map<LoaderId, BehaviorSubject<boolean>>>();\n }\n\n protected setLoadingState(context: LoadingContext, state: boolean, loaderId: LoaderId): void {\n if (!this.hasLoadingStates(context, loaderId)) {\n if (this.hasContextLoadingState(context)) {\n this.loadingStates.get(context).set(loaderId, state);\n this.loadingStates$.get(context).set(loaderId, new BehaviorSubject<boolean>(state));\n } else {\n this.loadingStates.set(context, new Map<LoaderId, boolean>([[loaderId, state]]));\n this.loadingStates$.set(\n context,\n new Map<LoaderId, BehaviorSubject<boolean>>([[loaderId, new BehaviorSubject<boolean>(state)]]),\n );\n }\n } else {\n this.loadingStates.get(context).set(loaderId, state);\n this.loadingStates$.get(context).get(loaderId).next(state);\n }\n }\n\n protected hasLoadingStates(context: LoadingContext, loaderId: LoaderId) {\n return this.hasContextLoadingState(context) && this.hasLoaderLoadingState(context, loaderId);\n }\n\n protected hasContextLoadingState(context: LoadingContext) {\n return this.loadingStates.has(context) && this.loadingStates$.has(context);\n }\n\n protected hasLoaderLoadingState(context: LoadingContext, loaderId: LoaderId) {\n return this.loadingStates.get(context).has(loaderId) && this.loadingStates$.get(context).has(loaderId);\n }\n\n protected getLoaderId(loaderId?: LoaderId): LoaderId {\n return loaderId ?? DEFAULT_LOADER_ID;\n }\n}\n","import { Directive, ElementRef, Input } from '@angular/core';\nimport { AXLoadingService } from './loading.service';\n\n// This directive places an overlay with a loading spinner over its host element\n// if isLoading equals to true and hides the overlay when isLoading becomes false.\n@Directive({\n selector: '[axIsLoading]',\n})\nexport class AXLoadingDirective {\n private _hostElement!: HTMLDivElement;\n private _loadingRef!: number;\n\n private _isLoading: boolean;\n\n @Input('axIsLoading')\n public get isLoading(): boolean {\n return this._isLoading;\n }\n public set isLoading(v: boolean) {\n this._isLoading = v;\n if (v) {\n this._loadingRef = this.loadingService.show({\n location: this._hostElement,\n });\n } else {\n this.loadingService.hide(this._loadingRef);\n }\n }\n\n constructor(\n protected readonly elementRef: ElementRef,\n protected readonly loadingService: AXLoadingService,\n ) {\n this._hostElement = this.elementRef.nativeElement;\n }\n}\n","import { DialogModule } from '@angular/cdk/dialog';\nimport { OverlayModule } from '@angular/cdk/overlay';\nimport { PortalModule } from '@angular/cdk/portal';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { AXLoadingSpinnerComponent } from './loading-spinner.component';\nimport { AXLoadingComponent } from './loading.component';\nimport { AXLoadingDirective } from './loading.directive';\nimport { AXLoadingService } from './loading.service';\n\nconst COMPONENT = [AXLoadingComponent, AXLoadingDirective, AXLoadingSpinnerComponent];\nconst MODULES = [CommonModule, OverlayModule, DialogModule, PortalModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [AXLoadingService],\n})\nexport class AXLoadingModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from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A,CAAA,CAAA;;2FAIT,eAAe,EAAA,UAAA,EAAA,CAAA;kBAN3B,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,YAAY,EAAE,CAAC,GAAG,SAAS,CAAC;AAC5B,oBAAA,OAAO,EAAE,CAAC,GAAG,OAAO,CAAC;AACrB,oBAAA,OAAO,EAAE,CAAC,GAAG,SAAS,CAAC;oBACvB,SAAS,EAAE,CAAC,gBAAgB,CAAC;AAC9B,iBAAA;;;AClBD;;AAEG;;;;"}
|
@@ -38,7 +38,7 @@ class AXRadioComponent extends MXValueComponent {
|
|
38
38
|
useExisting: forwardRef(() => AXRadioComponent),
|
39
39
|
multi: true,
|
40
40
|
},
|
41
|
-
], queries: [{ propertyName: "_labels", predicate: AXLabelComponent }], usesInheritance: true, ngImport: i0, template: "
|
41
|
+
], queries: [{ propertyName: "_labels", predicate: AXLabelComponent }], usesInheritance: true, ngImport: i0, template: "<div class=\"ax-radio-label\" [class.ax-state-readonly]=\"readonly\" [class.ax-state-disabled]=\"disabled\">\n <div class=\"ax-radio-start-side\">\n <input\n [id]=\"id\"\n class=\"ax-radio\"\n type=\"radio\"\n [ngModel]=\"value\"\n [checked]=\"value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [tabindex]=\"tabIndex\"\n (ngModelChange)=\"_handleModelChange($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n />\n </div>\n <div class=\"ax-radio-end-side\">\n <ng-content select=\"ax-label\"></ng-content>\n <ng-content select=\"ax-form-hint\"></ng-content>\n <span class=\"ax-error-container\"></span>\n </div>\n</div>\n<ng-content select=\"ax-validation-rule\"></ng-content>\n", styles: [".ax-radio-label{display:flex;width:fit-content;-webkit-user-select:none;user-select:none;align-items:flex-start;font-size:.875rem;line-height:1.25rem}.ax-radio-label.ax-state-readonly{opacity:.75}.ax-radio-label .ax-radio-start-side{display:flex;height:1.25rem;align-items:center}.ax-radio-label .ax-radio-end-side{margin-inline-start:.75rem}\n"], dependencies: [{ kind: "directive", type: i1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i1.RadioControlValueAccessor, selector: "input[type=radio][formControlName],input[type=radio][formControl],input[type=radio][ngModel]", inputs: ["name", "formControlName", "value"] }, { kind: "directive", type: i1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
42
42
|
}
|
43
43
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXRadioComponent, decorators: [{
|
44
44
|
type: Component,
|
@@ -48,7 +48,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
48
48
|
useExisting: forwardRef(() => AXRadioComponent),
|
49
49
|
multi: true,
|
50
50
|
},
|
51
|
-
], template: "
|
51
|
+
], template: "<div class=\"ax-radio-label\" [class.ax-state-readonly]=\"readonly\" [class.ax-state-disabled]=\"disabled\">\n <div class=\"ax-radio-start-side\">\n <input\n [id]=\"id\"\n class=\"ax-radio\"\n type=\"radio\"\n [ngModel]=\"value\"\n [checked]=\"value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [tabindex]=\"tabIndex\"\n (ngModelChange)=\"_handleModelChange($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n />\n </div>\n <div class=\"ax-radio-end-side\">\n <ng-content select=\"ax-label\"></ng-content>\n <ng-content select=\"ax-form-hint\"></ng-content>\n <span class=\"ax-error-container\"></span>\n </div>\n</div>\n<ng-content select=\"ax-validation-rule\"></ng-content>\n", styles: [".ax-radio-label{display:flex;width:fit-content;-webkit-user-select:none;user-select:none;align-items:flex-start;font-size:.875rem;line-height:1.25rem}.ax-radio-label.ax-state-readonly{opacity:.75}.ax-radio-label .ax-radio-start-side{display:flex;height:1.25rem;align-items:center}.ax-radio-label .ax-radio-end-side{margin-inline-start:.75rem}\n"] }]
|
52
52
|
}], propDecorators: { _labels: [{
|
53
53
|
type: ContentChildren,
|
54
54
|
args: [AXLabelComponent]
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"acorex-components-radio.mjs","sources":["../../../../libs/components/radio/src/lib/radio.component.ts","../../../../libs/components/radio/src/lib/radio.component.html","../../../../libs/components/radio/src/lib/radio.module.ts","../../../../libs/components/radio/src/acorex-components-radio.ts"],"sourcesContent":["import { MXValueComponent } from '@acorex/components/common';\nimport { AXLabelComponent } from '@acorex/components/label';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n HostListener,\n QueryList,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category\n */\n@Component({\n selector: 'ax-radio',\n templateUrl: './radio.component.html',\n styleUrls: ['./radio.component.scss'],\n inputs: ['disabled', 'tabIndex', 'readonly', 'value', 'name', 'id', 'checked'],\n outputs: ['onBlur', 'onFocus', 'valueChange', 'onValueChanged'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXRadioComponent),\n multi: true,\n },\n ],\n})\nexport class AXRadioComponent extends MXValueComponent<boolean | null> implements AfterViewChecked {\n\n /** @ignore */\n @ContentChildren(AXLabelComponent)\n\n /** @ignore */\n private _labels: QueryList<AXLabelComponent>;\n\n /** @ignore */\n ngAfterViewChecked() {\n this._labels?.forEach((c) => {\n c.for = this;\n });\n }\n\n /** @ignore */\n @HostListener('click', ['$event'])\n\n /** @ignore */\n private _handleClick(e: UIEvent) {\n e.stopPropagation();\n if (this.readonly || this.disabled) {\n e.preventDefault();\n return false;\n }\n return true;\n }\n\n /** @ignore */\n protected _handleModelChange(value: boolean | null) {\n this.commitValue(value, true);\n }\n}\n","
|
1
|
+
{"version":3,"file":"acorex-components-radio.mjs","sources":["../../../../libs/components/radio/src/lib/radio.component.ts","../../../../libs/components/radio/src/lib/radio.component.html","../../../../libs/components/radio/src/lib/radio.module.ts","../../../../libs/components/radio/src/acorex-components-radio.ts"],"sourcesContent":["import { MXValueComponent } from '@acorex/components/common';\nimport { AXLabelComponent } from '@acorex/components/label';\nimport {\n AfterViewChecked,\n ChangeDetectionStrategy,\n Component,\n ContentChildren,\n HostListener,\n QueryList,\n ViewEncapsulation,\n forwardRef,\n} from '@angular/core';\nimport { NG_VALUE_ACCESSOR } from '@angular/forms';\n\n/**\n * The Button is a component which detects user interaction and triggers a corresponding event\n *\n * @category\n */\n@Component({\n selector: 'ax-radio',\n templateUrl: './radio.component.html',\n styleUrls: ['./radio.component.scss'],\n inputs: ['disabled', 'tabIndex', 'readonly', 'value', 'name', 'id', 'checked'],\n outputs: ['onBlur', 'onFocus', 'valueChange', 'onValueChanged'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: forwardRef(() => AXRadioComponent),\n multi: true,\n },\n ],\n})\nexport class AXRadioComponent extends MXValueComponent<boolean | null> implements AfterViewChecked {\n\n /** @ignore */\n @ContentChildren(AXLabelComponent)\n\n /** @ignore */\n private _labels: QueryList<AXLabelComponent>;\n\n /** @ignore */\n ngAfterViewChecked() {\n this._labels?.forEach((c) => {\n c.for = this;\n });\n }\n\n /** @ignore */\n @HostListener('click', ['$event'])\n\n /** @ignore */\n private _handleClick(e: UIEvent) {\n e.stopPropagation();\n if (this.readonly || this.disabled) {\n e.preventDefault();\n return false;\n }\n return true;\n }\n\n /** @ignore */\n protected _handleModelChange(value: boolean | null) {\n this.commitValue(value, true);\n }\n}\n","<div class=\"ax-radio-label\" [class.ax-state-readonly]=\"readonly\" [class.ax-state-disabled]=\"disabled\">\n <div class=\"ax-radio-start-side\">\n <input\n [id]=\"id\"\n class=\"ax-radio\"\n type=\"radio\"\n [ngModel]=\"value\"\n [checked]=\"value\"\n [disabled]=\"disabled\"\n [readonly]=\"readonly\"\n [tabindex]=\"tabIndex\"\n (ngModelChange)=\"_handleModelChange($event)\"\n (focus)=\"emitOnFocusEvent($event)\"\n (blur)=\"emitOnBlurEvent($event)\"\n />\n </div>\n <div class=\"ax-radio-end-side\">\n <ng-content select=\"ax-label\"></ng-content>\n <ng-content select=\"ax-form-hint\"></ng-content>\n <span class=\"ax-error-container\"></span>\n </div>\n</div>\n<ng-content select=\"ax-validation-rule\"></ng-content>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\nimport { AXRadioComponent } from './radio.component';\n\nconst COMPONENT = [AXRadioComponent];\nconst MODULES = [CommonModule, FormsModule];\n\n@NgModule({\n declarations: [...COMPONENT],\n imports: [...MODULES],\n exports: [...COMPONENT],\n providers: [],\n})\nexport class AXRadioModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;AAcA;;;;AAIG;AAiBG,MAAO,gBAAiB,SAAQ,gBAAgC,CAAA;;IASpE,kBAAkB,GAAA;QAChB,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,KAAI;AAC1B,YAAA,CAAC,CAAC,GAAG,GAAG,IAAI;AACd,SAAC,CAAC;;;AAOI,IAAA,YAAY,CAAC,CAAU,EAAA;QAC7B,CAAC,CAAC,eAAe,EAAE;QACnB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QA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, AXFocusableComponent, AXValuableComponent, MXSelectionBridgeService, AX_SELECTION_DATA_TOKEN } from '@acorex/components/common';
|
2
2
|
import * as i0 from '@angular/core';
|
3
|
-
import { input,
|
3
|
+
import { input, forwardRef, HostBinding, Input, ChangeDetectionStrategy, ViewEncapsulation, Component, NgModule } from '@angular/core';
|
4
4
|
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
|
5
5
|
import * as i1 from '@angular/common';
|
6
6
|
import { CommonModule } from '@angular/common';
|
@@ -29,26 +29,12 @@ class AXSelectionListComponent extends MXSelectionValueComponent {
|
|
29
29
|
* @param {TemplateRef<unknown>} customTemplate
|
30
30
|
*/
|
31
31
|
this.customTemplate = input();
|
32
|
-
/**
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
* Sets the list of items.
|
39
|
-
* @param {void}
|
40
|
-
*/
|
41
|
-
this.items = input([]);
|
42
|
-
this.#onItemsChange = effect(() => {
|
43
|
-
this.items();
|
44
|
-
this.clearSelectionCache();
|
45
|
-
});
|
46
|
-
/**
|
47
|
-
* Sets the field used for displaying hints.
|
48
|
-
*
|
49
|
-
* @param {string} v
|
50
|
-
*/
|
51
|
-
this.hintField = input('hint');
|
32
|
+
/** @ignore */
|
33
|
+
this._showControl = true;
|
34
|
+
/** @ignore */
|
35
|
+
this._items = [];
|
36
|
+
/** @ignore */
|
37
|
+
this._hintField = 'hint';
|
52
38
|
/**
|
53
39
|
* Defines the visual appearance of the selection list.
|
54
40
|
*
|
@@ -56,14 +42,66 @@ class AXSelectionListComponent extends MXSelectionValueComponent {
|
|
56
42
|
*/
|
57
43
|
this.look = 'solid';
|
58
44
|
}
|
59
|
-
|
45
|
+
/**
|
46
|
+
* @param {void}
|
47
|
+
* Gets the current state of the control visibility.
|
48
|
+
*/
|
49
|
+
get showControl() {
|
50
|
+
return this._showControl;
|
51
|
+
}
|
52
|
+
/**
|
53
|
+
* @param {boolean} v
|
54
|
+
* Sets the visibility state of the control.
|
55
|
+
*/
|
56
|
+
set showControl(v) {
|
57
|
+
this.setOption({
|
58
|
+
name: 'showControl',
|
59
|
+
value: v,
|
60
|
+
});
|
61
|
+
}
|
62
|
+
/**
|
63
|
+
* Gets the list of items.
|
64
|
+
* @param {void}
|
65
|
+
*/
|
66
|
+
get items() {
|
67
|
+
return this._items;
|
68
|
+
}
|
69
|
+
/**
|
70
|
+
* Sets the list of items.
|
71
|
+
*
|
72
|
+
* @param {any[]} v
|
73
|
+
*/
|
74
|
+
set items(v) {
|
75
|
+
this.clearSelectionCache();
|
76
|
+
this.setOption({
|
77
|
+
name: 'items',
|
78
|
+
value: v,
|
79
|
+
});
|
80
|
+
}
|
81
|
+
/**
|
82
|
+
* Gets the field used for displaying hints.
|
83
|
+
*/
|
84
|
+
get hintField() {
|
85
|
+
return this._hintField;
|
86
|
+
}
|
87
|
+
/**
|
88
|
+
* Sets the field used for displaying hints.
|
89
|
+
*
|
90
|
+
* @param {string} v
|
91
|
+
*/
|
92
|
+
set hintField(v) {
|
93
|
+
this.setOption({
|
94
|
+
name: 'hintField',
|
95
|
+
value: v,
|
96
|
+
});
|
97
|
+
}
|
60
98
|
/**
|
61
99
|
* Retrieves an item from the list by its key.
|
62
100
|
*
|
63
101
|
* @param {unknown} key - The key to search for.
|
64
102
|
*/
|
65
103
|
getItemByKey(key) {
|
66
|
-
return this.items
|
104
|
+
return this.items.find((c) => c == this.value || c[this.valueField] == key);
|
67
105
|
}
|
68
106
|
/** @ignore */
|
69
107
|
_handleOnItemValueChange(item, e) {
|
@@ -84,7 +122,7 @@ class AXSelectionListComponent extends MXSelectionValueComponent {
|
|
84
122
|
];
|
85
123
|
}
|
86
124
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXSelectionListComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
|
87
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXSelectionListComponent, selector: "ax-selection-list", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: false, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: false, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: false, isRequired: false, transformFunction: null }, readonlyField: { classPropertyName: "readonlyField", publicName: "readonlyField", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, customTemplate: { classPropertyName: "customTemplate", publicName: "customTemplate", isSignal: true, isRequired: false, transformFunction: null }, showControl: { classPropertyName: "showControl", publicName: "showControl", isSignal:
|
125
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.0", type: AXSelectionListComponent, selector: "ax-selection-list", inputs: { id: { classPropertyName: "id", publicName: "id", isSignal: false, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: false, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: false, isRequired: false, transformFunction: null }, readonly: { classPropertyName: "readonly", publicName: "readonly", isSignal: false, isRequired: false, transformFunction: null }, tabIndex: { classPropertyName: "tabIndex", publicName: "tabIndex", isSignal: false, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: false, isRequired: false, transformFunction: null }, value: { classPropertyName: "value", publicName: "value", isSignal: false, isRequired: false, transformFunction: null }, valueField: { classPropertyName: "valueField", publicName: "valueField", isSignal: false, isRequired: false, transformFunction: null }, textField: { classPropertyName: "textField", publicName: "textField", isSignal: false, isRequired: false, transformFunction: null }, disabledField: { classPropertyName: "disabledField", publicName: "disabledField", isSignal: false, isRequired: false, transformFunction: null }, readonlyField: { classPropertyName: "readonlyField", publicName: "readonlyField", isSignal: false, isRequired: false, transformFunction: null }, multiple: { classPropertyName: "multiple", publicName: "multiple", isSignal: false, isRequired: false, transformFunction: null }, direction: { classPropertyName: "direction", publicName: "direction", isSignal: true, isRequired: false, transformFunction: null }, customTemplate: { classPropertyName: "customTemplate", publicName: "customTemplate", isSignal: true, isRequired: false, transformFunction: null }, showControl: { classPropertyName: "showControl", publicName: "showControl", isSignal: false, isRequired: false, transformFunction: null }, items: { classPropertyName: "items", publicName: "items", isSignal: false, isRequired: false, transformFunction: null }, look: { classPropertyName: "look", publicName: "look", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { onValueChanged: "onValueChanged", onBlur: "onBlur", onFocus: "onFocus" }, host: { properties: { "class": "this.__hostClass" } }, providers: [
|
88
126
|
{ provide: AXComponent, useExisting: AXSelectionListComponent },
|
89
127
|
{ provide: AXFocusableComponent, useExisting: AXSelectionListComponent },
|
90
128
|
{ provide: AXValuableComponent, useExisting: AXSelectionListComponent },
|
@@ -97,7 +135,7 @@ class AXSelectionListComponent extends MXSelectionValueComponent {
|
|
97
135
|
provide: AX_SELECTION_DATA_TOKEN,
|
98
136
|
useClass: MXSelectionBridgeService,
|
99
137
|
},
|
100
|
-
], usesInheritance: true, ngImport: i0, template: "<ul class=\"ax-{{ direction() }}\">\n @for (item of items
|
138
|
+
], usesInheritance: true, ngImport: i0, template: "<ul class=\"ax-{{ direction() }}\">\n @for (item of items; let i = $index; track i) {\n <li [class.ax-state-selected]=\"isItemSelected(item)\" [class.ax-state-disabled]=\"item.disabled\">\n <label [class.ax-hide-control]=\"!showControl\">\n @if (multiple) {\n <input\n [id]=\"id + '-' + i\"\n class=\"ax-checkbox\"\n type=\"checkbox\"\n (change)=\"_handleOnItemValueChange(item, $event)\"\n [checked]=\"isItemSelected(item)\"\n [disabled]=\"disabled || item[disabledField] || readonly\"\n />\n } @else {\n <input\n [id]=\"id + '-' + i\"\n class=\"ax-radio\"\n type=\"radio\"\n [attr.name]=\"id\"\n (change)=\"_handleOnItemValueChange(item, $event)\"\n [checked]=\"isItemSelected(item)\"\n [disabled]=\"disabled || item[disabledField] || readonly\"\n />\n }\n\n @if (customTemplate()) {\n <div>\n <ng-container *ngTemplateOutlet=\"customTemplate(); context: { $implicit: { data: item } }\">\n </ng-container>\n </div>\n } @else {\n <div>\n {{ getDisplayText(item) }}\n @if (item[hintField]) {\n <p class=\"ax-hint-text\">\n {{ item[hintField] }}\n </p>\n }\n </div>\n }\n </label>\n </li>\n }\n</ul>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: [".ax-dark ax-selection-list.ax-look-card ul.ax-vertical>li.ax-state-selected label,.ax-dark ax-selection-list.ax-look-card ul.ax-horizontal>li.ax-state-selected label{background-color:rgba(var(--ax-color-primary-900),.25)}ax-selection-list.ax-look-divided ul.ax-vertical li:last-child label,ax-selection-list.ax-look-divided ul.ax-horizontal li:last-child label{border-style:none}ax-selection-list.ax-look-divided ul.ax-vertical>li label{border-bottom-width:1px;border-color:rgba(var(--ax-color-border-default));padding-bottom:.875rem}ax-selection-list.ax-look-divided ul.ax-horizontal>li label{border-inline-end-width:1px;border-color:rgba(var(--ax-color-border-default))}ax-selection-list.ax-look-card ul{gap:.75rem}ax-selection-list.ax-look-card ul.ax-vertical>li label,ax-selection-list.ax-look-card ul.ax-horizontal>li label{border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default))}ax-selection-list.ax-look-card ul.ax-vertical>li.ax-state-selected label,ax-selection-list.ax-look-card ul.ax-horizontal>li.ax-state-selected label{border-color:rgba(var(--ax-color-primary-500));background-color:rgba(var(--ax-color-primary-50))}ax-selection-list.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-selection-list ul{display:flex;flex-wrap:wrap}ax-selection-list ul.ax-vertical{flex-direction:column}ax-selection-list ul.ax-horizontal{flex-direction:row}ax-selection-list ul li{cursor:pointer;-webkit-user-select:none;user-select:none}ax-selection-list ul li label{display:flex;cursor:pointer;align-items:flex-start;padding:.5rem .75rem}ax-selection-list ul li label.ax-hide-control .ax-checkbox,ax-selection-list ul li label.ax-hide-control .ax-radio{display:none}ax-selection-list ul li label.ax-hide-control>div{margin-inline-start:0px}ax-selection-list ul li label .ax-checkbox,ax-selection-list ul li label .ax-radio{margin-top:.25rem}ax-selection-list ul li label>div{margin-inline-start:.75rem;font-size:.875rem;line-height:1.25rem;font-weight:500}ax-selection-list ul li label>div .ax-hint-text{margin-top:.25rem;font-weight:400;color:rgb(var(--ax-color-text-default),.75)}ax-selection-list ul li.ax-state-disabled{opacity:.5}ax-selection-list ul li.ax-state-disabled *{cursor:not-allowed}ax-selection-list.ax-state-error{color:rgba(var(--ax-color-danger-500))}ax-selection-list.ax-state-error .ax-checkbox-checkmark,ax-selection-list.ax-state-error .ax-radio-checkmark{border-color:rgba(var(--ax-color-danger-500))}\n"], dependencies: [{ kind: "directive", type: i1.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); }
|
101
139
|
}
|
102
140
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImport: i0, type: AXSelectionListComponent, decorators: [{
|
103
141
|
type: Component,
|
@@ -127,8 +165,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.0", ngImpor
|
|
127
165
|
provide: AX_SELECTION_DATA_TOKEN,
|
128
166
|
useClass: MXSelectionBridgeService,
|
129
167
|
},
|
130
|
-
], template: "<ul class=\"ax-{{ direction() }}\">\n @for (item of items
|
131
|
-
}], propDecorators: {
|
168
|
+
], template: "<ul class=\"ax-{{ direction() }}\">\n @for (item of items; let i = $index; track i) {\n <li [class.ax-state-selected]=\"isItemSelected(item)\" [class.ax-state-disabled]=\"item.disabled\">\n <label [class.ax-hide-control]=\"!showControl\">\n @if (multiple) {\n <input\n [id]=\"id + '-' + i\"\n class=\"ax-checkbox\"\n type=\"checkbox\"\n (change)=\"_handleOnItemValueChange(item, $event)\"\n [checked]=\"isItemSelected(item)\"\n [disabled]=\"disabled || item[disabledField] || readonly\"\n />\n } @else {\n <input\n [id]=\"id + '-' + i\"\n class=\"ax-radio\"\n type=\"radio\"\n [attr.name]=\"id\"\n (change)=\"_handleOnItemValueChange(item, $event)\"\n [checked]=\"isItemSelected(item)\"\n [disabled]=\"disabled || item[disabledField] || readonly\"\n />\n }\n\n @if (customTemplate()) {\n <div>\n <ng-container *ngTemplateOutlet=\"customTemplate(); context: { $implicit: { data: item } }\">\n </ng-container>\n </div>\n } @else {\n <div>\n {{ getDisplayText(item) }}\n @if (item[hintField]) {\n <p class=\"ax-hint-text\">\n {{ item[hintField] }}\n </p>\n }\n </div>\n }\n </label>\n </li>\n }\n</ul>\n<ng-content select=\"ax-validation-rule\"> </ng-content>\n", styles: [".ax-dark ax-selection-list.ax-look-card ul.ax-vertical>li.ax-state-selected label,.ax-dark ax-selection-list.ax-look-card ul.ax-horizontal>li.ax-state-selected label{background-color:rgba(var(--ax-color-primary-900),.25)}ax-selection-list.ax-look-divided ul.ax-vertical li:last-child label,ax-selection-list.ax-look-divided ul.ax-horizontal li:last-child label{border-style:none}ax-selection-list.ax-look-divided ul.ax-vertical>li label{border-bottom-width:1px;border-color:rgba(var(--ax-color-border-default));padding-bottom:.875rem}ax-selection-list.ax-look-divided ul.ax-horizontal>li label{border-inline-end-width:1px;border-color:rgba(var(--ax-color-border-default))}ax-selection-list.ax-look-card ul{gap:.75rem}ax-selection-list.ax-look-card ul.ax-vertical>li label,ax-selection-list.ax-look-card ul.ax-horizontal>li label{border-radius:var(--ax-rounded-border-default);border-width:1px;border-color:rgba(var(--ax-color-border-default))}ax-selection-list.ax-look-card ul.ax-vertical>li.ax-state-selected label,ax-selection-list.ax-look-card ul.ax-horizontal>li.ax-state-selected label{border-color:rgba(var(--ax-color-primary-500));background-color:rgba(var(--ax-color-primary-50))}ax-selection-list.ax-state-disabled{cursor:not-allowed;opacity:.5}ax-selection-list ul{display:flex;flex-wrap:wrap}ax-selection-list ul.ax-vertical{flex-direction:column}ax-selection-list ul.ax-horizontal{flex-direction:row}ax-selection-list ul li{cursor:pointer;-webkit-user-select:none;user-select:none}ax-selection-list ul li label{display:flex;cursor:pointer;align-items:flex-start;padding:.5rem .75rem}ax-selection-list ul li label.ax-hide-control .ax-checkbox,ax-selection-list ul li label.ax-hide-control .ax-radio{display:none}ax-selection-list ul li label.ax-hide-control>div{margin-inline-start:0px}ax-selection-list ul li label .ax-checkbox,ax-selection-list ul li label .ax-radio{margin-top:.25rem}ax-selection-list ul li label>div{margin-inline-start:.75rem;font-size:.875rem;line-height:1.25rem;font-weight:500}ax-selection-list ul li label>div .ax-hint-text{margin-top:.25rem;font-weight:400;color:rgb(var(--ax-color-text-default),.75)}ax-selection-list ul li.ax-state-disabled{opacity:.5}ax-selection-list ul li.ax-state-disabled *{cursor:not-allowed}ax-selection-list.ax-state-error{color:rgba(var(--ax-color-danger-500))}ax-selection-list.ax-state-error .ax-checkbox-checkmark,ax-selection-list.ax-state-error .ax-radio-checkmark{border-color:rgba(var(--ax-color-danger-500))}\n"] }]
|
169
|
+
}], propDecorators: { showControl: [{
|
170
|
+
type: Input
|
171
|
+
}], items: [{
|
172
|
+
type: Input
|
173
|
+
}], look: [{
|
132
174
|
type: Input
|
133
175
|
}], __hostClass: [{
|
134
176
|
type: HostBinding,
|