{"version":3,"file":"bloomreach-brie-list.mjs","sources":["../../../../projects/brie/list/components/list.component.ts","../../../../projects/brie/list/components/list.component.html","../../../../projects/brie/list/list.module.ts","../../../../projects/brie/list/models/list.ts","../../../../projects/brie/list/public-api.ts","../../../../projects/brie/list/bloomreach-brie-list.ts"],"sourcesContent":["/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  ChangeDetectionStrategy,\n  Component,\n  EventEmitter,\n  Input,\n  OnChanges,\n  Output,\n  SimpleChanges,\n} from '@angular/core';\nimport { CdkDragDrop, DragDropModule, moveItemInArray } from '@angular/cdk/drag-drop';\nimport { BrieButtonGroupActions, BrieButtonGroupModule, BrieButtonType } from '@bloomreach/brie/button-group';\nimport { BrieIconModule, BrieIconSize } from '@bloomreach/brie/icon';\n\nimport { MatListModule } from '@angular/material/list';\nimport { MatDividerModule } from '@angular/material/divider';\n\nimport { BrieListClickEvent, BrieListConfig, BrieListElement } from '../models/list';\n\n@Component({\n  selector: 'brie-list',\n  templateUrl: './list.component.html',\n  styleUrls: ['./list.component.scss'],\n  changeDetection: ChangeDetectionStrategy.Eager,\n  imports: [\n    BrieButtonGroupModule,\n    BrieIconModule,\n    MatDividerModule,\n    MatListModule,\n    DragDropModule,\n  ],\n\n})\nexport class BrieListComponent implements OnChanges {\n  @Input() dataSource: BrieListElement<string | number>[];\n  @Input() config: BrieListConfig = { default: {} };\n  @Input() selectedElement?: BrieListElement<string | number> | null;\n\n  @Output() clickedAction = new EventEmitter<BrieListClickEvent>();\n  @Output() selectedElementChange = new EventEmitter<BrieListElement<any>>();\n  @Output() dropListDropped = new EventEmitter<Array<BrieListElement<any>>>();\n\n  actions: BrieButtonGroupActions[];\n\n  ngOnChanges(changes: SimpleChanges): void {\n    if (changes.dataSource && this.dataSource) {\n      this.actions = this.dataSource.reduce<BrieButtonGroupActions[]>((actions, listElement) => {\n        return [...actions, this.getActions(listElement)];\n      }, []);\n    }\n  }\n\n  onElementClick(event: MouseEvent, listElement: BrieListElement<any>): void {\n    this.selectedElementChange.emit(listElement);\n  }\n\n  drop($event: CdkDragDrop<BrieListElement<any>>): void {\n    moveItemInArray(this.dataSource, $event.previousIndex, $event.currentIndex);\n    this.dropListDropped.emit(this.dataSource);\n  }\n\n  isMultiline(listElement: BrieListElement<string | number>): boolean {\n    return listElement.multiline ?? this.config.default.multiline ?? false;\n  }\n\n  isSelected(listElement: BrieListElement<string | number>): boolean {\n    return listElement.id === this.selectedElement?.id;\n  }\n\n  isDragDisabled(listElement: BrieListElement<string | number>): boolean {\n    return listElement.draggable ?? this.config.default.draggable ?? true;\n  }\n\n  getIconSize(listElement: BrieListElement<string | number>): BrieIconSize | undefined {\n    return this.isMultiline(listElement)\n      ? BrieIconSize.XXL\n      : listElement.icon?.size || this.config.default.icon?.size;\n  }\n\n  getActions(listElement: BrieListElement<string | number>): BrieButtonGroupActions {\n    const listActions = listElement.actions || this.config.default.actions || [];\n\n    return [\n      listActions.map((listAction) => ({\n        id: listAction.id,\n        type: listAction.type || BrieButtonType.Icon,\n        text: listAction.text,\n        color: listAction.color,\n        icon: listAction.icon,\n        tooltip: listAction.tooltip,\n        action: (event) => {\n          event.stopPropagation();\n          this.clickedAction.emit({ event, listElement, listAction });\n        },\n      })),\n    ];\n  }\n}\n","<!--\nCopyright 2022-2023 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttps://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-->\n\n<mat-nav-list cdkDropList (cdkDropListDropped)=\"drop($event)\">\n  @for (listElement of dataSource; track listElement; let i = $index) {\n    <mat-list-item cdkDrag\n      [attr.id]=\"listElement.id\"\n      class=\"brie-list-item\"\n      [class.multiline]=\"isMultiline(listElement)\"\n      [class.selected]=\"isSelected(listElement)\"\n      [cdkDragDisabled]=\"isDragDisabled(listElement)\"\n      (click)=\"onElementClick($event, listElement)\">\n      <div class=\"brie-list-item-content\">\n        @if (listElement.icon || config.default.icon) {\n          <brie-icon\n            [type]=\"listElement.icon?.type || this.config.default.icon?.type\"\n            [name]=\"listElement.icon?.name || config.default.icon?.name || ''\"\n            [size]=\"getIconSize(listElement)\"\n          [fontSet]=\"listElement.icon?.fontSet || config.default?.icon?.fontSet\"></brie-icon>\n        }\n        <div class=\"brie-list-item-main\">\n          <div class=\"brie-list-item-title\">{{ listElement.title }}</div>\n          @if (listElement.subtitle) {\n            <div class=\"brie-list-item-subtitle\">{{ listElement.subtitle }}</div>\n          }\n        </div>\n      </div>\n      @if (listElement.actions || config.default.actions) {\n        <div class=\"brie-list-item-actions\">\n          <brie-button-group [actions]=\"actions[i]\"></brie-button-group>\n        </div>\n      }\n    </mat-list-item>\n    <mat-divider></mat-divider>\n  }\n</mat-nav-list>\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { NgModule } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { DragDropModule } from '@angular/cdk/drag-drop';\nimport { MatDividerModule } from '@angular/material/divider';\nimport { MatListModule } from '@angular/material/list';\nimport { BrieButtonGroupModule } from '@bloomreach/brie/button-group';\nimport { BrieIconModule } from '@bloomreach/brie/icon';\n\nimport { BrieListComponent } from './components/list.component';\n\n@NgModule({\n  exports: [\n    BrieListComponent,\n  ],\n  imports: [\n    BrieListComponent,\n    BrieButtonGroupModule,\n    BrieIconModule,\n    CommonModule,\n    DragDropModule,\n    MatDividerModule,\n    MatListModule,\n  ],\n})\nexport class BrieListModule { }\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BrieButtonType, BrieThemeColor } from '@bloomreach/brie/button-group';\nimport { BrieIconType, BrieIconSize } from '@bloomreach/brie/icon';\n\nexport interface BrieListElement<T extends string | number = string> extends BrieListDefault {\n  id: T;\n  title: string;\n  subtitle?: string;\n  children?: BrieListElement<T>[];\n}\n\nexport interface BrieListDefault {\n  icon?: {\n    name: string;\n    fontSet?: string;\n    type?: BrieIconType;\n    size?: BrieIconSize\n  };\n  draggable?: boolean;\n  multiline?: boolean;\n  actions?: BrieListAction[];\n}\n\nexport interface BrieListAction {\n  id: string;\n  type?: BrieButtonType,\n  text?: string;\n  color?: BrieThemeColor;\n  tooltip?: string;\n  icon?: {\n    name: string;\n    fontSet?: string;\n  };\n}\n\nexport interface BrieListConfig {\n  default: BrieListDefault;\n}\n\nexport interface BrieListClickEvent {\n  event: MouseEvent;\n  listElement: BrieListElement<any>;\n  listAction?: BrieListAction;\n}\n","/*\n * Copyright 2025-2026 Bloomreach. All rights reserved. (https://www.bloomreach.com/)\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *  https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './list.module';\nexport * from './components/list.component';\nexport * from './models/list';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;AAcG;MAkCU,iBAAiB,CAAA;AAd9B,IAAA,WAAA,GAAA;AAgBW,QAAA,IAAA,CAAA,MAAM,GAAmB,EAAE,OAAO,EAAE,EAAE,EAAE;AAGvC,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,YAAY,EAAsB;AACtD,QAAA,IAAA,CAAA,qBAAqB,GAAG,IAAI,YAAY,EAAwB;AAChE,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAA+B;AAyD5E,IAAA;AArDC,IAAA,WAAW,CAAC,OAAsB,EAAA;QAChC,IAAI,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC,UAAU,EAAE;AACzC,YAAA,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,UAAU,CAAC,MAAM,CAA2B,CAAC,OAAO,EAAE,WAAW,KAAI;gBACvF,OAAO,CAAC,GAAG,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;YACnD,CAAC,EAAE,EAAE,CAAC;QACR;IACF;IAEA,cAAc,CAAC,KAAiB,EAAE,WAAiC,EAAA;AACjE,QAAA,IAAI,CAAC,qBAAqB,CAAC,IAAI,C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