ng-hub-ui-board 19.3.7 → 19.3.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.npmignore CHANGED
@@ -1 +1,2 @@
1
- node_modules
1
+ # Nested package.json's are only needed for development.
2
+ **/package.json
@@ -0,0 +1,393 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Directive, input, computed, contentChild, TemplateRef, output, Component, NgModule, Pipe } from '@angular/core';
3
+ import * as i1 from '@angular/cdk/drag-drop';
4
+ import { moveItemInArray, transferArrayItem, DragDropModule } from '@angular/cdk/drag-drop';
5
+ import { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';
6
+
7
+ /**
8
+ * Directive that allows customization of column footer templates within board columns.
9
+ *
10
+ * This directive enables developers to define custom templates for column footers,
11
+ * perfect for displaying summary information, quick actions, statistics,
12
+ * or any column-specific controls at the bottom of each column.
13
+ *
14
+ * @publicApi
15
+ *
16
+ * @example
17
+ * ```html
18
+ * <ng-template columnFooterTpt let-column="column">
19
+ * <div class="custom-footer">
20
+ * <div class="column-summary">
21
+ * <span>Total: {{ column.cards.length }}</span>
22
+ * <span>Priority Items: {{ getPriorityItems(column) }}</span>
23
+ * </div>
24
+ * <button (click)="quickAddCard(column)">Quick Add</button>
25
+ * </div>
26
+ * </ng-template>
27
+ * ```
28
+ */
29
+ class BoardColumnFooterDirective {
30
+ templateRef;
31
+ /**
32
+ * Creates a new BoardColumnFooterDirective instance.
33
+ *
34
+ * @param templateRef - The template reference that contains the custom column footer layout
35
+ */
36
+ constructor(templateRef) {
37
+ this.templateRef = templateRef;
38
+ }
39
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: BoardColumnFooterDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
40
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.3", type: BoardColumnFooterDirective, isStandalone: true, selector: "[columnFooterTpt]", ngImport: i0 });
41
+ }
42
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: BoardColumnFooterDirective, decorators: [{
43
+ type: Directive,
44
+ args: [{
45
+ selector: '[columnFooterTpt]',
46
+ standalone: true
47
+ }]
48
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
49
+
50
+ /**
51
+ * Directive that allows customization of column header templates within board columns.
52
+ *
53
+ * This directive provides the ability to define custom templates for rendering column headers,
54
+ * giving developers full control over the appearance and functionality of column headers
55
+ * including titles, descriptions, actions, and metadata display.
56
+ *
57
+ * @publicApi
58
+ *
59
+ * @example
60
+ * ```html
61
+ * <ng-template columnHeaderTpt let-column="column">
62
+ * <div class="custom-header">
63
+ * <h2>{{ column.title }}</h2>
64
+ * <span class="card-count">{{ column.cards.length }} items</span>
65
+ * <button (click)="addCard(column)">Add Card</button>
66
+ * </div>
67
+ * </ng-template>
68
+ * ```
69
+ */
70
+ class BoardColumnHeaderDirective {
71
+ templateRef;
72
+ /**
73
+ * Creates a new BoardColumnHeaderDirective instance.
74
+ *
75
+ * @param templateRef - The template reference that contains the custom column header layout
76
+ */
77
+ constructor(templateRef) {
78
+ this.templateRef = templateRef;
79
+ }
80
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: BoardColumnHeaderDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
81
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.3", type: BoardColumnHeaderDirective, isStandalone: true, selector: "[columnHeaderTpt]", ngImport: i0 });
82
+ }
83
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: BoardColumnHeaderDirective, decorators: [{
84
+ type: Directive,
85
+ args: [{
86
+ selector: '[columnHeaderTpt]',
87
+ standalone: true
88
+ }]
89
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
90
+
91
+ /**
92
+ * Directive that allows customization of card templates within board columns.
93
+ *
94
+ * This directive is used to define custom templates for rendering board cards.
95
+ * It provides access to the template reference that can be used by the board component
96
+ * to render cards with custom layouts and styling.
97
+ *
98
+ * @publicApi
99
+ *
100
+ * @example
101
+ * ```html
102
+ * <ng-template cardTpt let-card="item" let-column="column">
103
+ * <div class="custom-card">
104
+ * <h3>{{ card.title }}</h3>
105
+ * <p>{{ card.description }}</p>
106
+ * </div>
107
+ * </ng-template>
108
+ * ```
109
+ */
110
+ class CardTemplateDirective {
111
+ templateRef;
112
+ /**
113
+ * Creates a new CardTemplateDirective instance.
114
+ *
115
+ * @param templateRef - The template reference that contains the custom card layout
116
+ */
117
+ constructor(templateRef) {
118
+ this.templateRef = templateRef;
119
+ }
120
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardTemplateDirective, deps: [{ token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive });
121
+ static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "20.2.3", type: CardTemplateDirective, isStandalone: true, selector: "[cardTpt]", ngImport: i0 });
122
+ }
123
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: CardTemplateDirective, decorators: [{
124
+ type: Directive,
125
+ args: [{
126
+ selector: '[cardTpt]',
127
+ standalone: true
128
+ }]
129
+ }], ctorParameters: () => [{ type: i0.TemplateRef }] });
130
+
131
+ /**
132
+ * Standalone Kanban-style board component that provides column-based drag-and-drop,
133
+ * custom templates and infinite-scroll detection.
134
+ *
135
+ * @publicApi
136
+ */
137
+ class HubBoardComponent {
138
+ /**
139
+ * Reactive input containing the full board definition (columns and cards).
140
+ */
141
+ board = input(...(ngDevMode ? [undefined, { debugName: "board" }] : []));
142
+ /**
143
+ * Pixel threshold used when determining whether a column has reached scroll end.
144
+ * Allows for fractional scroll values across different browsers.
145
+ */
146
+ scrollDetectionPadding = 1;
147
+ /**
148
+ * Derived list of board columns exposed as a signal to the template.
149
+ */
150
+ columns = computed(() => {
151
+ return this.board()?.columns ?? [];
152
+ }, ...(ngDevMode ? [{ debugName: "columns" }] : []));
153
+ /**
154
+ * When true, column reordering via drag-and-drop is disabled.
155
+ */
156
+ columnSortingDisabled = input(false, ...(ngDevMode ? [{ debugName: "columnSortingDisabled" }] : []));
157
+ /**
158
+ * Custom card template supplied via the `cardTpt` structural directive.
159
+ */
160
+ cardTpt = contentChild(CardTemplateDirective, ...(ngDevMode ? [{ debugName: "cardTpt", read: (TemplateRef) }] : [{
161
+ read: (TemplateRef)
162
+ }]));
163
+ /**
164
+ * Custom column header template supplied via the `columnHeaderTpt` structural directive.
165
+ */
166
+ columnHeaderTpt = contentChild(BoardColumnHeaderDirective, ...(ngDevMode ? [{ debugName: "columnHeaderTpt", read: (TemplateRef) }] : [{
167
+ read: (TemplateRef)
168
+ }]));
169
+ /**
170
+ * Custom column footer template supplied via the `columnFooterTpt` structural directive.
171
+ */
172
+ columnFooterTpt = contentChild(BoardColumnFooterDirective, ...(ngDevMode ? [{ debugName: "columnFooterTpt", read: (TemplateRef) }] : [{
173
+ read: (TemplateRef)
174
+ }]));
175
+ /**
176
+ * Emits each time a card is clicked within the board.
177
+ */
178
+ onCardClick = output();
179
+ /**
180
+ * Emits when a card has been repositioned, either within the same column or into another column.
181
+ */
182
+ onCardMoved = output();
183
+ /**
184
+ * Emits when columns are reordered through drag-and-drop.
185
+ */
186
+ onColumnMoved = output();
187
+ /**
188
+ * Emits when a column body is scrolled to its end, enabling infinite-scroll behaviour.
189
+ */
190
+ reachedEnd = output();
191
+ /**
192
+ * Default predicate that allows any card to be dropped into any column.
193
+ *
194
+ * @returns Always `true`, indicating that drop operations are permitted.
195
+ */
196
+ defaultEnterPredicateFn = () => true;
197
+ /**
198
+ * Emits the clicked card through {@link onCardClick}.
199
+ *
200
+ * @param item - The card that triggered the click event.
201
+ */
202
+ cardClick(item) {
203
+ this.onCardClick.emit(item);
204
+ }
205
+ /**
206
+ * Updates column order when a drag-and-drop operation completes and emits the resulting event.
207
+ *
208
+ * @param event - Drag-and-drop metadata describing the column movement.
209
+ */
210
+ dropColumn(event) {
211
+ moveItemInArray(event.container.data, event.previousIndex, event.currentIndex);
212
+ this.onColumnMoved.emit(event);
213
+ }
214
+ /**
215
+ * Applies card reordering or transfer logic depending on the drag-drop target,
216
+ * then emits the corresponding drag event metadata.
217
+ *
218
+ * @param event - Drag-and-drop metadata describing the card movement.
219
+ */
220
+ dropCard(event) {
221
+ if (event.previousContainer === event.container) {
222
+ // Reorder the card within the same column
223
+ moveItemInArray(event.container.data.cards, event.previousIndex, event.currentIndex);
224
+ }
225
+ else {
226
+ // Transfer the card from one column to another
227
+ transferArrayItem(event.previousContainer.data.cards, event.container.data.cards, event.previousIndex, event.currentIndex);
228
+ }
229
+ this.onCardMoved.emit(event);
230
+ }
231
+ /**
232
+ * Emits {@link reachedEnd} once a column body is scrolled to its bottom.
233
+ *
234
+ * @param index - Index of the scrolled column within the board.
235
+ * @param event - Browser scroll event originating from the column body element.
236
+ */
237
+ onScroll(index, event) {
238
+ const el = event.target;
239
+ if (!el) {
240
+ return;
241
+ }
242
+ const scrolledToBottom = el.scrollTop + el.clientHeight >= el.scrollHeight - this.scrollDetectionPadding;
243
+ if (!scrolledToBottom) {
244
+ return;
245
+ }
246
+ const column = this.board()?.columns?.[index];
247
+ if (!column) {
248
+ return;
249
+ }
250
+ this.reachedEnd.emit({
251
+ index,
252
+ data: column
253
+ });
254
+ }
255
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: HubBoardComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
256
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.3", type: HubBoardComponent, isStandalone: true, selector: "hub-board, hub-ui-board", inputs: { board: { classPropertyName: "board", publicName: "board", isSignal: true, isRequired: false, transformFunction: null }, columnSortingDisabled: { classPropertyName: "columnSortingDisabled", publicName: "columnSortingDisabled", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { onCardClick: "onCardClick", onCardMoved: "onCardMoved", onColumnMoved: "onColumnMoved", reachedEnd: "reachedEnd" }, host: { classAttribute: "hub-board" }, queries: [{ propertyName: "cardTpt", first: true, predicate: CardTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "columnHeaderTpt", first: true, predicate: BoardColumnHeaderDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "columnFooterTpt", first: true, predicate: BoardColumnFooterDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "@if (columns().length) {\n<div\n\tclass=\"hub-board__drop-list\"\n\tcdkDropList\n\tcdkDropListOrientation=\"horizontal\"\n\t[cdkDropListData]=\"columns()\"\n\t(cdkDropListDropped)=\"dropColumn($event)\"\n\t[cdkDropListSortingDisabled]=\"columnSortingDisabled()\"\n>\n\t<div cdkDropListGroup class=\"hub-board__columns\">\n\t\t@for (column of columns(); let index = $index; track column) {\n\t\t<div class=\"hub-board__column-container\" cdkDrag [cdkDragData]=\"column\" [cdkDragDisabled]=\"column.disabled\">\n\t\t\t<div class=\"hub-board__column\" [ngClass]=\"column.classlist\" [ngStyle]=\"column.style\">\n\t\t\t\t<div class=\"hub-board__column-header\">\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t[ngTemplateOutlet]=\"columnHeaderTpt() || defaultColumnHeaderTpt\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ column: column }\"\n\t\t\t\t\t>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"hub-board__column-body\"\n\t\t\t\t\tcdkDropList\n\t\t\t\t\t[cdkDropListData]=\"column\"\n\t\t\t\t\t(cdkDropListDropped)=\"dropCard($event)\"\n\t\t\t\t\t(scroll)=\"onScroll(index, $event)\"\n\t\t\t\t\t[cdkDropListEnterPredicate]=\"column.predicate ?? defaultEnterPredicateFn\"\n\t\t\t\t\t[cdkDropListSortingDisabled]=\"column.cardSortingDisabled\"\n\t\t\t\t>\n\t\t\t\t\t@for ( card of column.cards; let index = $index; track card ) {\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"hub-board__card\"\n\t\t\t\t\t\t[class.hub-board__card--disabled]=\"card.disabled\"\n\t\t\t\t\t\tcdkDrag\n\t\t\t\t\t\t[cdkDragData]=\"card\"\n\t\t\t\t\t\t[cdkDragDisabled]=\"card.disabled\"\n\t\t\t\t\t\t(click)=\"cardClick(card)\"\n\t\t\t\t\t\t(mousedown)=\"card.disabled && $event.stopPropagation()\"\n\t\t\t\t\t\t[ngClass]=\"card.classlist\"\n\t\t\t\t\t\t[ngStyle]=\"card.style\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"hub-board__card-body\">\n\t\t\t\t\t\t\t<ng-container\n\t\t\t\t\t\t\t\t[ngTemplateOutlet]=\"cardTpt() || defaultCardTpt\"\n\t\t\t\t\t\t\t\t[ngTemplateOutletContext]=\"{\n\t\t\t\t\t\t\t\t\titem: card,\n\t\t\t\t\t\t\t\t\tcolumn\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\n\t\t\t\t@if (columnFooterTpt()) {\n\t\t\t\t<div class=\"hub-board__column-footer\">\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t[ngTemplateOutlet]=\"columnFooterTpt() ?? null\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{\n\t\t\t\t\t\t\tcolumn: column\n\t\t\t\t\t\t}\"\n\t\t\t\t\t>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t}\n\t</div>\n</div>\n}\n\n<ng-template #defaultCardTpt let-item=\"item\">\n\t<h6 class=\"hub-board__card-title\">{{ item.title }}</h6>\n\t<p class=\"hub-board__card-subtitle\">{{ item.description }}</p>\n</ng-template>\n\n<ng-template #defaultColumnHeaderTpt let-column=\"column\">\n\t<div class=\"d-flex flex-column\">\n\t\t<h5 class=\"hub-board__column-header-title\">\n\t\t\t{{ column.title }}\n\t\t</h5>\n\t\t<h6 class=\"hub-board__column-header-subtitle\">\n\t\t\t{{ column.description }}\n\t\t</h6>\n\t</div>\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "ngmodule", type: DragDropModule }, { kind: "directive", type: i1.CdkDropList, selector: "[cdkDropList], cdk-drop-list", inputs: ["cdkDropListConnectedTo", "cdkDropListData", "cdkDropListOrientation", "id", "cdkDropListLockAxis", "cdkDropListDisabled", "cdkDropListSortingDisabled", "cdkDropListEnterPredicate", "cdkDropListSortPredicate", "cdkDropListAutoScrollDisabled", "cdkDropListAutoScrollStep", "cdkDropListElementContainer", "cdkDropListHasAnchor"], outputs: ["cdkDropListDropped", "cdkDropListEntered", "cdkDropListExited", "cdkDropListSorted"], exportAs: ["cdkDropList"] }, { kind: "directive", type: i1.CdkDropListGroup, selector: "[cdkDropListGroup]", inputs: ["cdkDropListGroupDisabled"], exportAs: ["cdkDropListGroup"] }, { kind: "directive", type: i1.CdkDrag, selector: "[cdkDrag]", inputs: ["cdkDragData", "cdkDragLockAxis", "cdkDragRootElement", "cdkDragBoundary", "cdkDragStartDelay", "cdkDragFreeDragPosition", "cdkDragDisabled", "cdkDragConstrainPosition", "cdkDragPreviewClass", "cdkDragPreviewContainer", "cdkDragScale"], outputs: ["cdkDragStarted", "cdkDragReleased", "cdkDragEnded", "cdkDragEntered", "cdkDragExited", "cdkDragDropped", "cdkDragMoved"], exportAs: ["cdkDrag"] }] });
257
+ }
258
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: HubBoardComponent, decorators: [{
259
+ type: Component,
260
+ args: [{ selector: 'hub-board, hub-ui-board', imports: [NgClass, NgStyle, NgTemplateOutlet, DragDropModule], host: {
261
+ class: 'hub-board'
262
+ }, template: "@if (columns().length) {\n<div\n\tclass=\"hub-board__drop-list\"\n\tcdkDropList\n\tcdkDropListOrientation=\"horizontal\"\n\t[cdkDropListData]=\"columns()\"\n\t(cdkDropListDropped)=\"dropColumn($event)\"\n\t[cdkDropListSortingDisabled]=\"columnSortingDisabled()\"\n>\n\t<div cdkDropListGroup class=\"hub-board__columns\">\n\t\t@for (column of columns(); let index = $index; track column) {\n\t\t<div class=\"hub-board__column-container\" cdkDrag [cdkDragData]=\"column\" [cdkDragDisabled]=\"column.disabled\">\n\t\t\t<div class=\"hub-board__column\" [ngClass]=\"column.classlist\" [ngStyle]=\"column.style\">\n\t\t\t\t<div class=\"hub-board__column-header\">\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t[ngTemplateOutlet]=\"columnHeaderTpt() || defaultColumnHeaderTpt\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ column: column }\"\n\t\t\t\t\t>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"hub-board__column-body\"\n\t\t\t\t\tcdkDropList\n\t\t\t\t\t[cdkDropListData]=\"column\"\n\t\t\t\t\t(cdkDropListDropped)=\"dropCard($event)\"\n\t\t\t\t\t(scroll)=\"onScroll(index, $event)\"\n\t\t\t\t\t[cdkDropListEnterPredicate]=\"column.predicate ?? defaultEnterPredicateFn\"\n\t\t\t\t\t[cdkDropListSortingDisabled]=\"column.cardSortingDisabled\"\n\t\t\t\t>\n\t\t\t\t\t@for ( card of column.cards; let index = $index; track card ) {\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"hub-board__card\"\n\t\t\t\t\t\t[class.hub-board__card--disabled]=\"card.disabled\"\n\t\t\t\t\t\tcdkDrag\n\t\t\t\t\t\t[cdkDragData]=\"card\"\n\t\t\t\t\t\t[cdkDragDisabled]=\"card.disabled\"\n\t\t\t\t\t\t(click)=\"cardClick(card)\"\n\t\t\t\t\t\t(mousedown)=\"card.disabled && $event.stopPropagation()\"\n\t\t\t\t\t\t[ngClass]=\"card.classlist\"\n\t\t\t\t\t\t[ngStyle]=\"card.style\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"hub-board__card-body\">\n\t\t\t\t\t\t\t<ng-container\n\t\t\t\t\t\t\t\t[ngTemplateOutlet]=\"cardTpt() || defaultCardTpt\"\n\t\t\t\t\t\t\t\t[ngTemplateOutletContext]=\"{\n\t\t\t\t\t\t\t\t\titem: card,\n\t\t\t\t\t\t\t\t\tcolumn\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\n\t\t\t\t@if (columnFooterTpt()) {\n\t\t\t\t<div class=\"hub-board__column-footer\">\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t[ngTemplateOutlet]=\"columnFooterTpt() ?? null\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{\n\t\t\t\t\t\t\tcolumn: column\n\t\t\t\t\t\t}\"\n\t\t\t\t\t>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t}\n\t</div>\n</div>\n}\n\n<ng-template #defaultCardTpt let-item=\"item\">\n\t<h6 class=\"hub-board__card-title\">{{ item.title }}</h6>\n\t<p class=\"hub-board__card-subtitle\">{{ item.description }}</p>\n</ng-template>\n\n<ng-template #defaultColumnHeaderTpt let-column=\"column\">\n\t<div class=\"d-flex flex-column\">\n\t\t<h5 class=\"hub-board__column-header-title\">\n\t\t\t{{ column.title }}\n\t\t</h5>\n\t\t<h6 class=\"hub-board__column-header-subtitle\">\n\t\t\t{{ column.description }}\n\t\t</h6>\n\t</div>\n</ng-template>\n" }]
263
+ }] });
264
+
265
+ /**
266
+ * Angular module that provides board functionality with drag-and-drop support.
267
+ *
268
+ * This module includes all the necessary components and directives for creating
269
+ * Kanban-style boards with customizable columns, cards, and templates.
270
+ *
271
+ * @deprecated Use standalone components instead. Import individual components and directives directly.
272
+ * @publicApi
273
+ *
274
+ * @example
275
+ * ```typescript
276
+ * // Legacy module approach (not recommended)
277
+ * import { BoardModule } from 'ng-hub-ui-board';
278
+ *
279
+ * @NgModule({
280
+ * imports: [BoardModule]
281
+ * })
282
+ * export class AppModule {}
283
+ *
284
+ * // Recommended standalone approach
285
+ * import { HubBoardComponent, CardTemplateDirective } from 'ng-hub-ui-board';
286
+ *
287
+ * @Component({
288
+ * standalone: true,
289
+ * imports: [HubBoardComponent, CardTemplateDirective]
290
+ * })
291
+ * export class MyComponent {}
292
+ * ```
293
+ */
294
+ class BoardModule {
295
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: BoardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
296
+ static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "20.2.3", ngImport: i0, type: BoardModule, imports: [HubBoardComponent,
297
+ CardTemplateDirective,
298
+ BoardColumnHeaderDirective,
299
+ BoardColumnFooterDirective], exports: [HubBoardComponent,
300
+ CardTemplateDirective,
301
+ BoardColumnHeaderDirective,
302
+ BoardColumnFooterDirective] });
303
+ static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: BoardModule, imports: [HubBoardComponent] });
304
+ }
305
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: BoardModule, decorators: [{
306
+ type: NgModule,
307
+ args: [{
308
+ declarations: [],
309
+ imports: [
310
+ HubBoardComponent,
311
+ CardTemplateDirective,
312
+ BoardColumnHeaderDirective,
313
+ BoardColumnFooterDirective
314
+ ],
315
+ exports: [
316
+ HubBoardComponent,
317
+ CardTemplateDirective,
318
+ BoardColumnHeaderDirective,
319
+ BoardColumnFooterDirective
320
+ ]
321
+ }]
322
+ }] });
323
+
324
+ /**
325
+ * Converts a hexadecimal color string into its inverted counterpart, offering both
326
+ * high-contrast black/white and full-spectrum inversion modes.
327
+ *
328
+ * @publicApi
329
+ */
330
+ class InvertColorPipe {
331
+ /**
332
+ * Inverts a HEX color value.
333
+ *
334
+ * @param hex - Color expressed as a 3- or 6-digit HEX string with or without a hash prefix.
335
+ * @param bw - When `true`, returns either black or white based on perceived brightness to maximise contrast.
336
+ * @returns The inverted color represented as a 6-digit HEX string (always prefixed with `#`).
337
+ * @throws Error if the provided value cannot be parsed as a valid HEX color.
338
+ */
339
+ transform(hex, bw) {
340
+ if (!hex) {
341
+ return '#000000';
342
+ }
343
+ let normalizedHex = hex;
344
+ if (normalizedHex.indexOf('#') === 0) {
345
+ normalizedHex = normalizedHex.slice(1);
346
+ }
347
+ if (normalizedHex.length === 3) {
348
+ // Convert shorthand notation (e.g., #abc) to full length (#aabbcc)
349
+ normalizedHex =
350
+ normalizedHex[0] +
351
+ normalizedHex[0] +
352
+ normalizedHex[1] +
353
+ normalizedHex[1] +
354
+ normalizedHex[2] +
355
+ normalizedHex[2];
356
+ }
357
+ if (normalizedHex.length !== 6) {
358
+ throw new Error('Invalid HEX color.');
359
+ }
360
+ const r = parseInt(normalizedHex.slice(0, 2), 16);
361
+ const g = parseInt(normalizedHex.slice(2, 4), 16);
362
+ const b = parseInt(normalizedHex.slice(4, 6), 16);
363
+ if (bw) {
364
+ // http://stackoverflow.com/a/3943023/112731
365
+ return r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF';
366
+ }
367
+ const invertedR = (255 - r).toString(16).padStart(2, '0');
368
+ const invertedG = (255 - g).toString(16).padStart(2, '0');
369
+ const invertedB = (255 - b).toString(16).padStart(2, '0');
370
+ return `#${invertedR}${invertedG}${invertedB}`;
371
+ }
372
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InvertColorPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
373
+ static ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "20.2.3", ngImport: i0, type: InvertColorPipe, isStandalone: true, name: "invertColor" });
374
+ }
375
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.3", ngImport: i0, type: InvertColorPipe, decorators: [{
376
+ type: Pipe,
377
+ args: [{
378
+ name: 'invertColor',
379
+ standalone: true
380
+ }]
381
+ }] });
382
+
383
+ /*
384
+ * Public API Surface of board
385
+ */
386
+ // module
387
+
388
+ /**
389
+ * Generated bundle index. Do not edit.
390
+ */
391
+
392
+ export { BoardColumnFooterDirective, BoardColumnHeaderDirective, BoardModule, CardTemplateDirective, HubBoardComponent, InvertColorPipe };
393
+ //# sourceMappingURL=ng-hub-ui-board.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ng-hub-ui-board.mjs","sources":["../../../projects/board/src/lib/directives/board-column-footer.directive.ts","../../../projects/board/src/lib/directives/board-column-header.directive.ts","../../../projects/board/src/lib/directives/card-template.directive.ts","../../../projects/board/src/lib/components/board/board.component.ts","../../../projects/board/src/lib/components/board/board.component.html","../../../projects/board/src/lib/board.module.ts","../../../projects/board/src/lib/pipes/invert-color.pipe.ts","../../../projects/board/src/public-api.ts","../../../projects/board/src/ng-hub-ui-board.ts"],"sourcesContent":["import { Directive, TemplateRef } from '@angular/core';\n\n/**\n * Directive that allows customization of column footer templates within board columns.\n * \n * This directive enables developers to define custom templates for column footers,\n * perfect for displaying summary information, quick actions, statistics,\n * or any column-specific controls at the bottom of each column.\n * \n * @publicApi\n * \n * @example\n * ```html\n * <ng-template columnFooterTpt let-column=\"column\">\n * <div class=\"custom-footer\">\n * <div class=\"column-summary\">\n * <span>Total: {{ column.cards.length }}</span>\n * <span>Priority Items: {{ getPriorityItems(column) }}</span>\n * </div>\n * <button (click)=\"quickAddCard(column)\">Quick Add</button>\n * </div>\n * </ng-template>\n * ```\n */\n@Directive({\n\tselector: '[columnFooterTpt]',\n\tstandalone: true\n})\nexport class BoardColumnFooterDirective {\n\t/**\n\t * Creates a new BoardColumnFooterDirective instance.\n\t * \n\t * @param templateRef - The template reference that contains the custom column footer layout\n\t */\n\tconstructor(public templateRef: TemplateRef<unknown>) {}\n}\n","import { Directive, TemplateRef } from '@angular/core';\n\n/**\n * Directive that allows customization of column header templates within board columns.\n * \n * This directive provides the ability to define custom templates for rendering column headers,\n * giving developers full control over the appearance and functionality of column headers\n * including titles, descriptions, actions, and metadata display.\n * \n * @publicApi\n * \n * @example\n * ```html\n * <ng-template columnHeaderTpt let-column=\"column\">\n * <div class=\"custom-header\">\n * <h2>{{ column.title }}</h2>\n * <span class=\"card-count\">{{ column.cards.length }} items</span>\n * <button (click)=\"addCard(column)\">Add Card</button>\n * </div>\n * </ng-template>\n * ```\n */\n@Directive({\n\tselector: '[columnHeaderTpt]',\n\tstandalone: true\n})\nexport class BoardColumnHeaderDirective {\n\t/**\n\t * Creates a new BoardColumnHeaderDirective instance.\n\t * \n\t * @param templateRef - The template reference that contains the custom column header layout\n\t */\n\tconstructor(public templateRef: TemplateRef<unknown>) {}\n}\n","import { Directive, TemplateRef } from '@angular/core';\n\n/**\n * Directive that allows customization of card templates within board columns.\n * \n * This directive is used to define custom templates for rendering board cards.\n * It provides access to the template reference that can be used by the board component\n * to render cards with custom layouts and styling.\n * \n * @publicApi\n * \n * @example\n * ```html\n * <ng-template cardTpt let-card=\"item\" let-column=\"column\">\n * <div class=\"custom-card\">\n * <h3>{{ card.title }}</h3>\n * <p>{{ card.description }}</p>\n * </div>\n * </ng-template>\n * ```\n */\n@Directive({\n\tselector: '[cardTpt]',\n\tstandalone: true\n})\nexport class CardTemplateDirective {\n\t/**\n\t * Creates a new CardTemplateDirective instance.\n\t * \n\t * @param templateRef - The template reference that contains the custom card layout\n\t */\n\tconstructor(public templateRef: TemplateRef<unknown>) {}\n}\n","import { CdkDragDrop, DragDropModule, moveItemInArray, transferArrayItem } from '@angular/cdk/drag-drop';\nimport { NgClass, NgStyle, NgTemplateOutlet } from '@angular/common';\nimport { Component, Signal, TemplateRef, computed, contentChild, input, output } from '@angular/core';\nimport { BoardColumnFooterDirective } from '../../directives/board-column-footer.directive';\nimport { BoardColumnHeaderDirective } from '../../directives/board-column-header.directive';\nimport { CardTemplateDirective } from '../../directives/card-template.directive';\nimport { Board } from '../../models/board';\nimport { BoardCard } from '../../models/board-card';\nimport { BoardColumn } from '../../models/board-column';\nimport { ReachedEndEvent } from '../../models/reached-end-event';\n\n/**\n * Standalone Kanban-style board component that provides column-based drag-and-drop,\n * custom templates and infinite-scroll detection.\n *\n * @publicApi\n */\n@Component({\n\tselector: 'hub-board, hub-ui-board',\n\ttemplateUrl: './board.component.html',\n\timports: [NgClass, NgStyle, NgTemplateOutlet, DragDropModule],\n\thost: {\n\t\tclass: 'hub-board'\n\t}\n})\nexport class HubBoardComponent {\n\t/**\n\t * Reactive input containing the full board definition (columns and cards).\n\t */\n\treadonly board = input<Board>();\n\n\t/**\n\t * Pixel threshold used when determining whether a column has reached scroll end.\n\t * Allows for fractional scroll values across different browsers.\n\t */\n\tprivate readonly scrollDetectionPadding = 1;\n\n\t/**\n\t * Derived list of board columns exposed as a signal to the template.\n\t */\n\tcolumns: Signal<Array<BoardColumn>> = computed(() => {\n\t\treturn this.board()?.columns ?? [];\n\t});\n\n\t/**\n\t * When true, column reordering via drag-and-drop is disabled.\n\t */\n\treadonly columnSortingDisabled = input<boolean>(false);\n\n\t/**\n\t * Custom card template supplied via the `cardTpt` structural directive.\n\t */\n\treadonly cardTpt = contentChild(CardTemplateDirective, {\n\t\tread: TemplateRef<unknown>\n\t});\n\n\t/**\n\t * Custom column header template supplied via the `columnHeaderTpt` structural directive.\n\t */\n\treadonly columnHeaderTpt = contentChild(BoardColumnHeaderDirective, {\n\t\tread: TemplateRef<unknown>\n\t});\n\n\t/**\n\t * Custom column footer template supplied via the `columnFooterTpt` structural directive.\n\t */\n\treadonly columnFooterTpt = contentChild(BoardColumnFooterDirective, {\n\t\tread: TemplateRef<unknown>\n\t});\n\n\t/**\n\t * Emits each time a card is clicked within the board.\n\t */\n\treadonly onCardClick = output<BoardCard>();\n\n\t/**\n\t * Emits when a card has been repositioned, either within the same column or into another column.\n\t */\n\treadonly onCardMoved = output<CdkDragDrop<BoardColumn, BoardColumn, BoardCard<any>>>();\n\n\t/**\n\t * Emits when columns are reordered through drag-and-drop.\n\t */\n\treadonly onColumnMoved = output<CdkDragDrop<BoardColumn[]>>();\n\n\t/**\n\t * Emits when a column body is scrolled to its end, enabling infinite-scroll behaviour.\n\t */\n\treadonly reachedEnd = output<ReachedEndEvent>();\n\n\t/**\n\t * Default predicate that allows any card to be dropped into any column.\n\t *\n\t * @returns Always `true`, indicating that drop operations are permitted.\n\t */\n\tdefaultEnterPredicateFn = () => true;\n\n\t/**\n\t * Emits the clicked card through {@link onCardClick}.\n\t *\n\t * @param item - The card that triggered the click event.\n\t */\n\tcardClick(item: BoardCard) {\n\t\tthis.onCardClick.emit(item);\n\t}\n\n\t/**\n\t * Updates column order when a drag-and-drop operation completes and emits the resulting event.\n\t *\n\t * @param event - Drag-and-drop metadata describing the column movement.\n\t */\n\tdropColumn(event: CdkDragDrop<BoardColumn[]>) {\n\t\tmoveItemInArray(event.container.data, event.previousIndex, event.currentIndex);\n\t\tthis.onColumnMoved.emit(event);\n\t}\n\n\t/**\n\t * Applies card reordering or transfer logic depending on the drag-drop target,\n\t * then emits the corresponding drag event metadata.\n\t *\n\t * @param event - Drag-and-drop metadata describing the card movement.\n\t */\n\tdropCard(event: CdkDragDrop<BoardColumn, BoardColumn, BoardCard<any>>) {\n\t\tif (event.previousContainer === event.container) {\n\t\t\t// Reorder the card within the same column\n\t\t\tmoveItemInArray(event.container.data.cards, event.previousIndex, event.currentIndex);\n\t\t} else {\n\t\t\t// Transfer the card from one column to another\n\t\t\ttransferArrayItem(\n\t\t\t\tevent.previousContainer.data.cards,\n\t\t\t\tevent.container.data.cards,\n\t\t\t\tevent.previousIndex,\n\t\t\t\tevent.currentIndex\n\t\t\t);\n\t\t}\n\t\tthis.onCardMoved.emit(event);\n\t}\n\n\t/**\n\t * Emits {@link reachedEnd} once a column body is scrolled to its bottom.\n\t *\n\t * @param index - Index of the scrolled column within the board.\n\t * @param event - Browser scroll event originating from the column body element.\n\t */\n\tonScroll(index: number, event: Event) {\n\t\tconst el = event.target as HTMLElement | null;\n\t\tif (!el) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst scrolledToBottom = el.scrollTop + el.clientHeight >= el.scrollHeight - this.scrollDetectionPadding;\n\n\t\tif (!scrolledToBottom) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst column = this.board()?.columns?.[index];\n\t\tif (!column) {\n\t\t\treturn;\n\t\t}\n\n\t\tthis.reachedEnd.emit({\n\t\t\tindex,\n\t\t\tdata: column\n\t\t});\n\t}\n}\n","@if (columns().length) {\n<div\n\tclass=\"hub-board__drop-list\"\n\tcdkDropList\n\tcdkDropListOrientation=\"horizontal\"\n\t[cdkDropListData]=\"columns()\"\n\t(cdkDropListDropped)=\"dropColumn($event)\"\n\t[cdkDropListSortingDisabled]=\"columnSortingDisabled()\"\n>\n\t<div cdkDropListGroup class=\"hub-board__columns\">\n\t\t@for (column of columns(); let index = $index; track column) {\n\t\t<div class=\"hub-board__column-container\" cdkDrag [cdkDragData]=\"column\" [cdkDragDisabled]=\"column.disabled\">\n\t\t\t<div class=\"hub-board__column\" [ngClass]=\"column.classlist\" [ngStyle]=\"column.style\">\n\t\t\t\t<div class=\"hub-board__column-header\">\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t[ngTemplateOutlet]=\"columnHeaderTpt() || defaultColumnHeaderTpt\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{ column: column }\"\n\t\t\t\t\t>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t\t<div\n\t\t\t\t\tclass=\"hub-board__column-body\"\n\t\t\t\t\tcdkDropList\n\t\t\t\t\t[cdkDropListData]=\"column\"\n\t\t\t\t\t(cdkDropListDropped)=\"dropCard($event)\"\n\t\t\t\t\t(scroll)=\"onScroll(index, $event)\"\n\t\t\t\t\t[cdkDropListEnterPredicate]=\"column.predicate ?? defaultEnterPredicateFn\"\n\t\t\t\t\t[cdkDropListSortingDisabled]=\"column.cardSortingDisabled\"\n\t\t\t\t>\n\t\t\t\t\t@for ( card of column.cards; let index = $index; track card ) {\n\t\t\t\t\t<div\n\t\t\t\t\t\tclass=\"hub-board__card\"\n\t\t\t\t\t\t[class.hub-board__card--disabled]=\"card.disabled\"\n\t\t\t\t\t\tcdkDrag\n\t\t\t\t\t\t[cdkDragData]=\"card\"\n\t\t\t\t\t\t[cdkDragDisabled]=\"card.disabled\"\n\t\t\t\t\t\t(click)=\"cardClick(card)\"\n\t\t\t\t\t\t(mousedown)=\"card.disabled && $event.stopPropagation()\"\n\t\t\t\t\t\t[ngClass]=\"card.classlist\"\n\t\t\t\t\t\t[ngStyle]=\"card.style\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<div class=\"hub-board__card-body\">\n\t\t\t\t\t\t\t<ng-container\n\t\t\t\t\t\t\t\t[ngTemplateOutlet]=\"cardTpt() || defaultCardTpt\"\n\t\t\t\t\t\t\t\t[ngTemplateOutletContext]=\"{\n\t\t\t\t\t\t\t\t\titem: card,\n\t\t\t\t\t\t\t\t\tcolumn\n\t\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t</ng-container>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\n\t\t\t\t@if (columnFooterTpt()) {\n\t\t\t\t<div class=\"hub-board__column-footer\">\n\t\t\t\t\t<ng-container\n\t\t\t\t\t\t[ngTemplateOutlet]=\"columnFooterTpt() ?? null\"\n\t\t\t\t\t\t[ngTemplateOutletContext]=\"{\n\t\t\t\t\t\t\tcolumn: column\n\t\t\t\t\t\t}\"\n\t\t\t\t\t>\n\t\t\t\t\t</ng-container>\n\t\t\t\t</div>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t\t}\n\t</div>\n</div>\n}\n\n<ng-template #defaultCardTpt let-item=\"item\">\n\t<h6 class=\"hub-board__card-title\">{{ item.title }}</h6>\n\t<p class=\"hub-board__card-subtitle\">{{ item.description }}</p>\n</ng-template>\n\n<ng-template #defaultColumnHeaderTpt let-column=\"column\">\n\t<div class=\"d-flex flex-column\">\n\t\t<h5 class=\"hub-board__column-header-title\">\n\t\t\t{{ column.title }}\n\t\t</h5>\n\t\t<h6 class=\"hub-board__column-header-subtitle\">\n\t\t\t{{ column.description }}\n\t\t</h6>\n\t</div>\n</ng-template>\n","import { NgModule } from '@angular/core';\nimport { HubBoardComponent } from './components/board/board.component';\nimport { BoardColumnFooterDirective } from './directives/board-column-footer.directive';\nimport { BoardColumnHeaderDirective } from './directives/board-column-header.directive';\nimport { CardTemplateDirective } from './directives/card-template.directive';\n\n/**\n * Angular module that provides board functionality with drag-and-drop support.\n * \n * This module includes all the necessary components and directives for creating\n * Kanban-style boards with customizable columns, cards, and templates.\n * \n * @deprecated Use standalone components instead. Import individual components and directives directly.\n * @publicApi\n * \n * @example\n * ```typescript\n * // Legacy module approach (not recommended)\n * import { BoardModule } from 'ng-hub-ui-board';\n * \n * @NgModule({\n * imports: [BoardModule]\n * })\n * export class AppModule {}\n * \n * // Recommended standalone approach\n * import { HubBoardComponent, CardTemplateDirective } from 'ng-hub-ui-board';\n * \n * @Component({\n * standalone: true,\n * imports: [HubBoardComponent, CardTemplateDirective]\n * })\n * export class MyComponent {}\n * ```\n */\n@NgModule({\n\tdeclarations: [],\n\timports: [\n\t\tHubBoardComponent,\n\t\tCardTemplateDirective,\n\t\tBoardColumnHeaderDirective,\n\t\tBoardColumnFooterDirective\n\t],\n\texports: [\n\t\tHubBoardComponent,\n\t\tCardTemplateDirective,\n\t\tBoardColumnHeaderDirective,\n\t\tBoardColumnFooterDirective\n\t]\n})\nexport class BoardModule {}\n","import { Pipe, PipeTransform } from '@angular/core';\n\n/**\n * Converts a hexadecimal color string into its inverted counterpart, offering both\n * high-contrast black/white and full-spectrum inversion modes.\n *\n * @publicApi\n */\n@Pipe({\n\tname: 'invertColor',\n\tstandalone: true\n})\nexport class InvertColorPipe implements PipeTransform {\n\t/**\n\t * Inverts a HEX color value.\n\t *\n\t * @param hex - Color expressed as a 3- or 6-digit HEX string with or without a hash prefix.\n\t * @param bw - When `true`, returns either black or white based on perceived brightness to maximise contrast.\n\t * @returns The inverted color represented as a 6-digit HEX string (always prefixed with `#`).\n\t * @throws Error if the provided value cannot be parsed as a valid HEX color.\n\t */\n\ttransform(hex: string, bw: boolean): string {\n\t\tif (!hex) {\n\t\t\treturn '#000000';\n\t\t}\n\n\t\tlet normalizedHex = hex;\n\t\tif (normalizedHex.indexOf('#') === 0) {\n\t\t\tnormalizedHex = normalizedHex.slice(1);\n\t\t}\n\n\t\tif (normalizedHex.length === 3) {\n\t\t\t// Convert shorthand notation (e.g., #abc) to full length (#aabbcc)\n\t\t\tnormalizedHex =\n\t\t\t\tnormalizedHex[0] +\n\t\t\t\tnormalizedHex[0] +\n\t\t\t\tnormalizedHex[1] +\n\t\t\t\tnormalizedHex[1] +\n\t\t\t\tnormalizedHex[2] +\n\t\t\t\tnormalizedHex[2];\n\t\t}\n\n\t\tif (normalizedHex.length !== 6) {\n\t\t\tthrow new Error('Invalid HEX color.');\n\t\t}\n\n\t\tconst r = parseInt(normalizedHex.slice(0, 2), 16);\n\t\tconst g = parseInt(normalizedHex.slice(2, 4), 16);\n\t\tconst b = parseInt(normalizedHex.slice(4, 6), 16);\n\n\t\tif (bw) {\n\t\t\t// http://stackoverflow.com/a/3943023/112731\n\t\t\treturn r * 0.299 + g * 0.587 + b * 0.114 > 186 ? '#000000' : '#FFFFFF';\n\t\t}\n\n\t\tconst invertedR = (255 - r).toString(16).padStart(2, '0');\n\t\tconst invertedG = (255 - g).toString(16).padStart(2, '0');\n\t\tconst invertedB = (255 - b).toString(16).padStart(2, '0');\n\n\t\treturn `#${invertedR}${invertedG}${invertedB}`;\n\t}\n}\n","/*\n * Public API Surface of board\n */\n\n// module\nexport * from './lib/board.module';\n\n// directives\nexport * from './lib/directives/board-column-footer.directive';\nexport * from './lib/directives/board-column-header.directive';\nexport * from './lib/directives/card-template.directive';\n\n// components\nexport * from './lib/components/board/board.component';\n\n// pipes\nexport * from './lib/pipes/invert-color.pipe';\n\n// models\nexport * from './lib/models/board';\nexport * from './lib/models/board-card';\nexport * from './lib/models/board-column';\nexport * from './lib/models/reached-end-event';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;AAEA;;;;;;;;;;;;;;;;;;;;;AAqBG;MAKU,0BAA0B,CAAA;AAMnB,IAAA,WAAA;AALnB;;;;AAIG;AACH,IAAA,WAAA,CAAmB,WAAiC,EAAA;QAAjC,IAAA,CAAA,WAAW,GAAX,WAAW;IAAyB;uGAN3C,0BAA0B,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,WAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,SAAA,EAAA,CAAA;2FAA1B,0BAA0B,EAAA,YAAA,EAAA,IAAA,EAAA,QAAA,EAAA,mBAAA,EAAA,QAAA,EAAA,EAAA,EAAA,CAAA;;2FAA1B,0BAA0B,EAAA,UAAA,EAAA,CAAA;kBAJtC,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,QAAQ,EAAE,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