novo-elements 11.1.0-next.2 → 11.1.0-next.4
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/fesm2022/novo-elements-elements-tabbed-group-picker.mjs +8 -3
- package/fesm2022/novo-elements-elements-tabbed-group-picker.mjs.map +1 -1
- package/fesm2022/novo-elements-utils.mjs +114 -1
- package/fesm2022/novo-elements-utils.mjs.map +1 -1
- package/package.json +1 -1
- package/utils/Helpers.d.ts +114 -0
|
@@ -51,6 +51,9 @@ class NovoTabbedGroupPickerElement {
|
|
|
51
51
|
this.scrollViewportHeight = 351;
|
|
52
52
|
this.virtualScrollItemSize = 39;
|
|
53
53
|
this.getSelectedState = (childArray) => {
|
|
54
|
+
if (!Array.isArray(childArray)) {
|
|
55
|
+
return undefined;
|
|
56
|
+
}
|
|
54
57
|
const numberOfSelectedItems = childArray.filter(({ selected }) => selected).length;
|
|
55
58
|
if (!numberOfSelectedItems) {
|
|
56
59
|
return undefined;
|
|
@@ -162,9 +165,11 @@ class NovoTabbedGroupPickerElement {
|
|
|
162
165
|
};
|
|
163
166
|
}
|
|
164
167
|
replaceChildrenWithReferences(parent, sortedData, compareFunction, warnFunction) {
|
|
165
|
-
parent
|
|
166
|
-
.
|
|
167
|
-
|
|
168
|
+
if (Array.isArray(parent?.children)) {
|
|
169
|
+
parent.children = parent.children
|
|
170
|
+
.map((child) => binarySearch(child, sortedData, compareFunction) || warnFunction(child))
|
|
171
|
+
.filter(Boolean); // since map can return undefined, remove undefined elements
|
|
172
|
+
}
|
|
168
173
|
}
|
|
169
174
|
makeWarningFunction(parentLabel, childLabel, childValueField) {
|
|
170
175
|
return (child) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"novo-elements-elements-tabbed-group-picker.mjs","sources":["../../../projects/novo-elements/src/elements/tabbed-group-picker/TabbedGroupPicker.ts","../../../projects/novo-elements/src/elements/tabbed-group-picker/TabbedGroupPicker.html","../../../projects/novo-elements/src/elements/tabbed-group-picker/TabbedGroupPicker.module.ts","../../../projects/novo-elements/src/elements/tabbed-group-picker/novo-elements-elements-tabbed-group-picker.ts"],"sourcesContent":["import { CdkScrollable } from '@angular/cdk/scrolling';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { NovoLabelService } from 'novo-elements/services';\nimport { binarySearch, BooleanInput, Helpers } from 'novo-elements/utils';\nimport { NOVO_OPTION_PARENT_COMPONENT } from 'novo-elements/elements/common';\nimport { NovoDropdownElement } from 'novo-elements/elements/dropdown';\n\nexport type TabbedGroupPickerTab = {\n typeName: string;\n typeLabel: string;\n valueField: string;\n labelField: string;\n scrollOffset?: number;\n icon?: string;\n} & (ParentTab | ChildTab);\n\nexport type ParentTab = {\n childTypeName: string;\n data: Array<ParentOption>;\n};\n\ntype BaseOption = {\n selected?: boolean;\n indeterminate?: boolean;\n} & { [key: string]: any };\n\ntype ParentOption = BaseOption & {\n children: Option[];\n};\n\ntype Option = BaseOption | ParentOption;\n\nexport type ChildTab = {\n data: Array<{ selected?: boolean } & { [key: string]: any }>;\n};\n\nexport type TabbedGroupPickerQuickSelect = {\n label: string;\n selected?: boolean;\n childTypeName?: string;\n children?: (({ selected?: boolean } & { [key: string]: any }) | number)[];\n all?: boolean;\n};\n\nexport type QuickSelectConfig = { label: string; items: TabbedGroupPickerQuickSelect[] };\n\nexport type TabbedGroupPickerButtonConfig = {\n theme: string;\n side: string;\n icon: string;\n label: string;\n size?: string;\n};\n\n@Component({\n selector: 'novo-tabbed-group-picker',\n templateUrl: './TabbedGroupPicker.html',\n styleUrls: ['./TabbedGroupPicker.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NOVO_OPTION_PARENT_COMPONENT, useExisting: NovoTabbedGroupPickerElement }],\n standalone: false\n})\nexport class NovoTabbedGroupPickerElement implements OnDestroy, OnInit {\n @ViewChild('tabbedGroupPickerVirtualScrollViewport')\n private scrollableInstance: CdkScrollable;\n @ViewChild('inputElement')\n private inputElement: ElementRef<HTMLInputElement>;\n @ViewChild('dropdown')\n public dropdown: NovoDropdownElement;\n\n multiple = true;\n\n @Input() buttonConfig: TabbedGroupPickerButtonConfig;\n @Input() tabs: TabbedGroupPickerTab[];\n @Input() quickSelectConfig: QuickSelectConfig;\n @Input() showFooter = false;\n\n // In activation mode, no checkboxes are displayed, and only the selectionActivated event occurs.\n @BooleanInput()\n @Input() selectionEnabled = true;\n\n @Output() activation = new EventEmitter<any>();\n @Output() selectionChange = new EventEmitter<TabbedGroupPickerTab[]>();\n @Output() applyChange: EventEmitter<any> = new EventEmitter<any>();\n @Output() cancelChange: EventEmitter<any> = new EventEmitter<any>();\n\n displayTabs: TabbedGroupPickerTab[];\n displayTabIndex: number = 0;\n\n filterText: BehaviorSubject<string> = new BehaviorSubject('');\n filterTextSubscription: Subscription;\n\n loading = true;\n showClearAll: boolean = false;\n\n appliedState: TabbedGroupPickerTab[];\n\n // Initial height based on 13 px font rendered in chrome. Actual height retrieved onDropdownToggled.\n scrollViewportHeight: number = 351;\n virtualScrollItemSize: number = 39;\n\n constructor(public labelService: NovoLabelService, private ref: ChangeDetectorRef) {}\n\n get displayTab(): TabbedGroupPickerTab {\n return this.displayTabs[this.displayTabIndex];\n }\n set displayTab(tab: TabbedGroupPickerTab) {\n this.displayTabIndex = this.tabs.map(({ typeName }) => typeName).indexOf(tab.typeName);\n }\n\n get minBufferPx() {\n return this.scrollViewportHeight; // render at least 2x the number of items visible (viewport + min buffer)\n }\n\n get maxBufferPx() {\n return 2 * this.scrollViewportHeight; // render at most 3x the number of items visible (viewport + max buffer)\n }\n\n ngOnInit(): void {\n this.loadValues();\n this.loading = false;\n this.filterTextSubscription = this.filterText.pipe(debounceTime(300)).subscribe({\n next: this.filter,\n });\n }\n\n ngOnDestroy(): void {\n if (this.filterTextSubscription) {\n this.filterTextSubscription.unsubscribe();\n }\n }\n\n loadValues() {\n this.setupDisplayData();\n this.createChildrenReferences();\n this.initializeDescendantSelection();\n this.updateParentsAndQuickSelect();\n this.updateClearAll();\n }\n\n changeTab(tab: TabbedGroupPickerTab) {\n this.displayTab = tab;\n if (this.scrollableInstance) {\n this.scrollableInstance.scrollTo({ behavior: 'auto', top: 0 });\n }\n }\n\n getPixelHeight(element: HTMLElement) {\n return Number(getComputedStyle(element, '').height.match(/(\\d+(\\.\\d+)?)px$/)[1]);\n }\n\n setupDisplayData(): void {\n // shallow copy here so that reassigning displayTabs[i].data doesn't mutate tabs[i].data\n // but both data values point to the same items\n this.displayTabs = this.tabs.map((tab) => ({ ...tab }));\n this.displayTab = this.tabs[0];\n this.updateAppliedState();\n }\n\n // Replace each parent's child object with a reference to the child to avoid\n // a child lookup for selected status; linking references allows M x N\n // time complexity instead of M x N^2\n createChildrenReferences(): void {\n this.tabs.forEach((tab) => {\n // would rather filter but TypeScript still wants a type narrowing here\n if ('childTypeName' in tab) {\n const childTab = this.tabs.find(({ typeName }) => typeName === tab.childTypeName);\n const compareFunction = this.makeCompareFunction(childTab.valueField);\n const warnFunction = this.makeWarningFunction(tab.typeName, childTab.typeName, childTab.valueField);\n const sortedChildren = childTab.data.slice().sort(compareFunction);\n\n tab.data\n .filter(({ children }) => children?.length)\n .forEach((parent: { children?: any[] }) =>\n this.replaceChildrenWithReferences(parent as ParentOption, sortedChildren, compareFunction, warnFunction),\n );\n }\n });\n if (this.quickSelectConfig) {\n this.quickSelectConfig.items\n .filter((parent) => 'all' in parent)\n .forEach((parent) => {\n parent.children = this.tabs.find(({ typeName }) => parent.childTypeName === typeName).data;\n });\n\n this.quickSelectConfig.items\n .filter((parent) => !('all' in parent))\n .forEach((parent) => {\n const childTab = this.tabs.find(({ typeName }) => typeName === parent.childTypeName);\n const compareFunction = this.makeCompareFunction(childTab.valueField);\n const warnFunction = this.makeWarningFunction(parent.label, childTab.typeName, childTab.valueField);\n const sortedChildren = childTab.data.slice().sort(compareFunction);\n\n this.replaceChildrenWithReferences(parent as ParentOption, sortedChildren, compareFunction, warnFunction);\n });\n }\n }\n\n makeCompareFunction<T>(key: string): (a: T | { [key: string]: T }, b: T | { [key: string]: T }) => 1 | -1 | 0 | undefined {\n return (a: T | { [key: string]: T }, b: T | { [key: string]: T }) => {\n const aValue: T = (a && a[key]) || a;\n const bValue: T = (b && b[key]) || b;\n\n if (aValue < bValue) {\n return -1;\n } else if (aValue > bValue) {\n return 1;\n } else if (aValue === bValue) {\n return 0;\n } else {\n return undefined;\n }\n };\n }\n\n replaceChildrenWithReferences(\n parent: { children: any[] },\n sortedData: ChildTab['data'],\n compareFunction: (a, b) => 1 | -1 | 0,\n warnFunction: (child) => void,\n ): void {\n parent.children = parent.children\n .map((child) => binarySearch(child, sortedData, compareFunction) || warnFunction(child))\n .filter(Boolean); // since map can return undefined, remove undefined elements\n }\n\n makeWarningFunction(parentLabel: string, childLabel: string, childValueField): (child) => void {\n return (child) => {\n const childValue = child[childValueField] || child;\n console.warn(`No ${childLabel} found with value ${childValue} for parent ${parentLabel}`);\n };\n }\n\n onDropdownToggle(event) {\n this.filterText.next('');\n this.inputElement.nativeElement?.focus();\n if (event) {\n this.scrollViewportHeight = this.getPixelHeight(this.scrollableInstance.getElementRef().nativeElement);\n this.virtualScrollItemSize = this.getPixelHeight(this.scrollableInstance.getElementRef().nativeElement.querySelector('novo-option'));\n // Emit a fake scroll event so the rendered items update\n this.scrollableInstance.getElementRef().nativeElement.dispatchEvent(new Event('scroll'));\n }\n }\n\n activateItem(item: any, tab?: TabbedGroupPickerTab): void {\n if (this.selectionEnabled) {\n item.selected = !item.selected;\n this.onItemToggled(item);\n }\n this.activation.emit({ ...item, scope: tab?.typeName || 'quickselect' });\n }\n\n onItemToggled(item: Option) {\n if (Array.isArray(item.children)) {\n this.updateDescendants(item.selected, item.children);\n }\n this.updateParentsAndQuickSelect();\n this.updateClearAll(item.selected);\n this.emitSelectedValues();\n this.ref.markForCheck();\n }\n\n initializeDescendantSelection() {\n this.tabs.forEach((tab) => {\n if ('childTypeName' in tab && tab.data?.length) {\n tab.data.forEach((parent) => {\n if (parent.selected && parent.children?.length) {\n parent.children.forEach((child) => {\n child.selected = true;\n });\n }\n });\n }\n });\n }\n\n updateDescendants(parentIsSelected: boolean, children: Option[]): void {\n children.forEach((item) => {\n if (parentIsSelected) {\n item.selected = true;\n } else {\n delete item.selected;\n }\n if (Array.isArray(item.children)) {\n this.updateDescendants(item.selected, item.children);\n }\n });\n }\n\n updateClearAll(itemWasJustSelected?: boolean) {\n if (!this.selectionEnabled) {\n this.showClearAll = false;\n } else {\n this.showClearAll = itemWasJustSelected\n ? true\n : this.tabs.some((tab) => {\n if ((tab as ParentTab).childTypeName) {\n return tab.data.some(({ selected, indeterminate }) => selected || indeterminate);\n } else {\n return tab.data.some(({ selected }) => selected);\n }\n });\n }\n }\n\n updateParentsAndQuickSelect(): void {\n // mutate here to avoid dereferencing the objects in displayTabs\n this.tabs\n .filter((tab) => 'childTypeName' in tab && !!tab.childTypeName)\n .forEach((tab) => {\n const parents = tab.data.filter(({ children }: { children?: any[] }) => children?.length);\n\n parents.forEach((parent: ParentOption) => {\n ['indeterminate', 'selected'].forEach((selectedStateOption) => delete parent[selectedStateOption]);\n\n const selectedState = this.getSelectedState(parent.children);\n if (selectedState) {\n parent[selectedState] = true;\n }\n });\n });\n\n if (this.quickSelectConfig) {\n this.quickSelectConfig.items.forEach((quickSelect) => {\n delete quickSelect.selected;\n const selectedState = this.getSelectedState(quickSelect.children as (Option)[]);\n if (selectedState) {\n quickSelect[selectedState] = true;\n }\n });\n }\n }\n\n getSelectedState = (childArray: Option[]): 'selected' | 'indeterminate' | undefined => {\n const numberOfSelectedItems = childArray.filter(({ selected }) => selected).length;\n if (!numberOfSelectedItems) {\n return undefined;\n }\n return numberOfSelectedItems === childArray.length ? 'selected' : 'indeterminate';\n };\n\n getSelectedValues(): TabbedGroupPickerTab[] {\n return this.tabs.map((tab) => ({\n ...tab,\n data: tab.data.filter(({ selected }) => selected),\n }));\n }\n\n emitSelectedValues() {\n this.selectionChange.emit(this.getSelectedValues());\n }\n\n updateAppliedState() {\n this.appliedState = Helpers.deepClone(this.displayTabs);\n }\n\n apply() {\n this.updateAppliedState();\n this.applyChange.emit(this.getSelectedValues());\n this.dropdown.closePanel();\n }\n\n cancel() {\n this.revertState();\n this.cancelChange.emit(this.tabs);\n this.ref.markForCheck();\n this.dropdown.closePanel();\n }\n\n revertState() {\n this.tabs = Helpers.deepClone(this.appliedState);\n this.loadValues();\n }\n\n deselectEverything(event) {\n Helpers.swallowEvent(event);\n this.showClearAll = false;\n if (this.quickSelectConfig) {\n this.quickSelectConfig.items.forEach((quickSelect) => {\n delete quickSelect.selected;\n });\n }\n this.tabs.forEach((tab) => {\n if ((tab as ParentTab).childTypeName) {\n tab.data.forEach((item) => {\n delete item.selected;\n delete item.indeterminate;\n item.children.forEach((child) => delete child.selected);\n });\n } else {\n (tab as ChildTab).data.forEach((item) => delete item.selected);\n }\n });\n this.emitSelectedValues();\n this.ref.markForCheck();\n }\n\n onClearFilter(event) {\n Helpers.swallowEvent(event);\n this.filterText.next('');\n }\n\n onFilter(event: { target: { value: string } }) {\n this.filterText.next(event.target.value);\n }\n\n filter = (searchTerm: string) => {\n this.displayTabs.forEach(\n (displayTab, i) =>\n (displayTab.data = this.tabs[i].data.filter((item) =>\n item[displayTab.labelField].toLowerCase().includes(searchTerm.toLowerCase()) ||\n item[displayTab.valueField]?.toString().toLowerCase().includes(searchTerm.toLowerCase()),\n )),\n );\n this.ref.markForCheck();\n };\n}\n","<novo-dropdown (toggled)=\"onDropdownToggle($event)\" multiple #dropdown>\n <novo-button\n class=\"tabbed-group-picker-button\"\n [theme]=\"buttonConfig.theme\"\n [side]=\"buttonConfig.side\"\n [size]=\"buttonConfig.size\"\n [icon]=\"buttonConfig.icon\"\n [loading]=\"loading\">\n <ng-content></ng-content>\n <div class=\"tabbed-group-picker-button-label\">{{ buttonConfig.label }}</div>\n </novo-button>\n <div class=\"tabbed-group-picker-search\" data-automation-id=\"tabbed-group-picker-search\" (keydown)=\"dropdown._handleKeydown($event)\">\n <input #inputElement type=\"text\" [placeholder]=\"labelService.search\" [value]=\"filterText | async\" (input)=\"onFilter($event)\" />\n <i class=\"bhi-search\" *ngIf=\"!(filterText | async)\"></i>\n <i class=\"bhi-times\" *ngIf=\"(filterText | async)\" (click)=\"onClearFilter($event)\" (keydown.space)=\"onClearFilter($event)\"></i>\n </div>\n <div class=\"tabbed-group-picker-column-container\" (keydown)=\"dropdown._handleKeydown($event)\">\n <div class=\"tabbed-group-picker-column left\">\n <novo-nav theme=\"white\" direction=\"vertical\">\n <novo-tab *ngFor=\"let tab of displayTabs\" [attr.data-automation-id]=\"tab.typeName\"\n (activeChange)=\"changeTab(tab)\">\n <span>{{ tab.typeLabel }} ({{ tab.data.length }})</span><i class=\"bhi-next\"></i>\n </novo-tab>\n </novo-nav>\n <novo-button *ngIf=\"showClearAll && !showFooter\" class=\"clear-all-button\" theme=\"dialogue\" icon=\"times\" side=\"right\"\n color=\"grapefruit\" (click)=\"deselectEverything($event)\" (keydown.space)=\"deselectEverything($event)\">{{ labelService.clear }}</novo-button>\n </div>\n <div class=\"tabbed-group-picker-column right\">\n <div class=\"quick-select\" *ngIf=\"quickSelectConfig && !(filterText | async)\">\n <novo-optgroup class=\"quick-select-list\" [label]=\"quickSelectConfig.label\">\n <novo-option\n class=\"quick-select-item\"\n *ngFor=\"let quickSelect of quickSelectConfig.items\"\n [attr.data-automation-id]=\"quickSelect.label\"\n [allowSelection]=\"selectionEnabled\"\n [selected]=\"quickSelect.selected\"\n (click)=\"activateItem(quickSelect)\"\n (keydown.space)=\"activateItem(quickSelect)\"\n novoInert>\n {{quickSelect.label}}\n </novo-option>\n </novo-optgroup>\n </div>\n <novo-optgroup *ngIf=\"displayTab.data.length\">\n <cdk-virtual-scroll-viewport\n [itemSize]=\"virtualScrollItemSize\"\n [maxBufferPx]=\"maxBufferPx\"\n [minBufferPx]=\"minBufferPx\"\n #tabbedGroupPickerVirtualScrollViewport>\n <novo-option\n *cdkVirtualFor=\"let item of displayTab.data\"\n [attr.data-automation-id]=\"item[displayTab.labelField]\"\n [attr.data-automation-value]=\"item[displayTab.valueField]\"\n [allowSelection]=\"selectionEnabled\"\n [selected]=\"item.selected\"\n (click)=\"activateItem(item, displayTab)\"\n (keydown.space)=\"activateItem(item, displayTab)\"\n novoInert>\n {{item[displayTab.labelField]}}\n </novo-option>\n </cdk-virtual-scroll-viewport>\n </novo-optgroup>\n <div class=\"tabbed-group-picker-empty-item\" *ngIf=\"!displayTab.data.length && (filterText | async)\">\n <i class=\"{{ displayTab.icon || 'bhi-search' }}\"></i>\n <div class=\"empty-item-main-message\">{{ labelService.tabbedGroupPickerEmpty }}</div>\n <div class=\"empty-item-sub-message\">{{ labelService.tabbedGroupClearSuggestion(displayTab.typeLabel) }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"footer\" *ngIf=\"showFooter\">\n <div class=\"save-cancel-button-container\">\n <novo-button\n class=\"clear-all-button\"\n *ngIf=\"showClearAll\"\n theme=\"dialogue\"\n icon=\"times\"\n side=\"right\"\n color=\"grapefruit\"\n (click)=\"deselectEverything($event)\">{{ labelService.clear }}</novo-button>\n </div>\n <div class=\"save-cancel-button-container\">\n <novo-button\n class=\"cancel-button\"\n marginRight=\"1rem\"\n theme=\"dialogue\"\n (click)=\"cancel()\">{{ labelService.cancel }}</novo-button>\n <novo-button\n class=\"save-button\"\n theme=\"primary\"\n color=\"primary\"\n (click)=\"apply()\">{{ labelService.apply }}</novo-button>\n </div>\n </div>\n</novo-dropdown>","// NG2\nimport { ScrollingModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n// APP\nimport { NovoLabelService } from 'novo-elements/services';\nimport { NovoButtonModule } from 'novo-elements/elements/button';\nimport { NovoCheckboxModule } from 'novo-elements/elements/checkbox';\nimport { NovoOptionModule } from 'novo-elements/elements/common';\nimport { NovoDropdownModule } from 'novo-elements/elements/dropdown';\nimport { NovoFormExtrasModule } from 'novo-elements/elements/form';\nimport { NovoListModule } from 'novo-elements/elements/list';\nimport { NovoTabModule } from 'novo-elements/elements/tabs';\nimport { NovoTabbedGroupPickerElement } from './TabbedGroupPicker';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ScrollingModule,\n NovoTabModule,\n NovoListModule,\n NovoFormExtrasModule,\n NovoButtonModule,\n NovoDropdownModule,\n NovoOptionModule,\n NovoCheckboxModule,\n ],\n providers: [NovoLabelService],\n declarations: [NovoTabbedGroupPickerElement],\n exports: [NovoTabbedGroupPickerElement],\n})\nexport class NovoTabbedGroupPickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2Ea,4BAA4B,CAAA;IAuCvC,WAAmB,CAAA,YAA8B,EAAU,GAAsB,EAAA;QAA9D,IAAY,CAAA,YAAA,GAAZ,YAAY;QAA4B,IAAG,CAAA,GAAA,GAAH,GAAG;QA/B9D,IAAQ,CAAA,QAAA,GAAG,IAAI;QAKN,IAAU,CAAA,UAAA,GAAG,KAAK;;QAIlB,IAAgB,CAAA,gBAAA,GAAG,IAAI;AAEtB,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAO;AACpC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAA0B;AAC5D,QAAA,IAAA,CAAA,WAAW,GAAsB,IAAI,YAAY,EAAO;AACxD,QAAA,IAAA,CAAA,YAAY,GAAsB,IAAI,YAAY,EAAO;QAGnE,IAAe,CAAA,eAAA,GAAW,CAAC;AAE3B,QAAA,IAAA,CAAA,UAAU,GAA4B,IAAI,eAAe,CAAC,EAAE,CAAC;QAG7D,IAAO,CAAA,OA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SAAA,EAAA,CAAC,gBAAgB,CAAC,YAX3B,YAAY;YACZ,WAAW;YACX,eAAe;YACf,aAAa;YACb,cAAc;YACd,oBAAoB;YACpB,gBAAgB;YAChB,kBAAkB;YAClB,gBAAgB;YAChB,kBAAkB,CAAA,EAAA,CAAA,CAAA;;4FAMT,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAjBvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;wBACb,cAAc;wBACd,oBAAoB;wBACpB,gBAAgB;wBAChB,kBAAkB;wBAClB,gBAAgB;wBAChB,kBAAkB;AACnB,qBAAA;oBACD,SAAS,EAAE,CAAC,gBAAgB,CAAC;oBAC7B,YAAY,EAAE,CAAC,4BAA4B,CAAC;oBAC5C,OAAO,EAAE,CAAC,4BAA4B,CAAC;AACxC,iBAAA;;;AChCD;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"novo-elements-elements-tabbed-group-picker.mjs","sources":["../../../projects/novo-elements/src/elements/tabbed-group-picker/TabbedGroupPicker.ts","../../../projects/novo-elements/src/elements/tabbed-group-picker/TabbedGroupPicker.html","../../../projects/novo-elements/src/elements/tabbed-group-picker/TabbedGroupPicker.module.ts","../../../projects/novo-elements/src/elements/tabbed-group-picker/novo-elements-elements-tabbed-group-picker.ts"],"sourcesContent":["import { CdkScrollable } from '@angular/cdk/scrolling';\nimport {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n ElementRef,\n EventEmitter,\n Input,\n OnDestroy,\n OnInit,\n Output,\n ViewChild,\n} from '@angular/core';\nimport { BehaviorSubject, Subscription } from 'rxjs';\nimport { debounceTime } from 'rxjs/operators';\nimport { NovoLabelService } from 'novo-elements/services';\nimport { binarySearch, BooleanInput, Helpers } from 'novo-elements/utils';\nimport { NOVO_OPTION_PARENT_COMPONENT } from 'novo-elements/elements/common';\nimport { NovoDropdownElement } from 'novo-elements/elements/dropdown';\n\nexport type TabbedGroupPickerTab = {\n typeName: string;\n typeLabel: string;\n valueField: string;\n labelField: string;\n scrollOffset?: number;\n icon?: string;\n} & (ParentTab | ChildTab);\n\nexport type ParentTab = {\n childTypeName: string;\n data: Array<ParentOption>;\n};\n\ntype BaseOption = {\n selected?: boolean;\n indeterminate?: boolean;\n} & { [key: string]: any };\n\ntype ParentOption = BaseOption & {\n children: Option[];\n};\n\ntype Option = BaseOption | ParentOption;\n\nexport type ChildTab = {\n data: Array<{ selected?: boolean } & { [key: string]: any }>;\n};\n\nexport type TabbedGroupPickerQuickSelect = {\n label: string;\n selected?: boolean;\n childTypeName?: string;\n children?: (({ selected?: boolean } & { [key: string]: any }) | number)[];\n all?: boolean;\n};\n\nexport type QuickSelectConfig = { label: string; items: TabbedGroupPickerQuickSelect[] };\n\nexport type TabbedGroupPickerButtonConfig = {\n theme: string;\n side: string;\n icon: string;\n label: string;\n size?: string;\n};\n\n@Component({\n selector: 'novo-tabbed-group-picker',\n templateUrl: './TabbedGroupPicker.html',\n styleUrls: ['./TabbedGroupPicker.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n providers: [{ provide: NOVO_OPTION_PARENT_COMPONENT, useExisting: NovoTabbedGroupPickerElement }],\n standalone: false\n})\nexport class NovoTabbedGroupPickerElement implements OnDestroy, OnInit {\n @ViewChild('tabbedGroupPickerVirtualScrollViewport')\n private scrollableInstance: CdkScrollable;\n @ViewChild('inputElement')\n private inputElement: ElementRef<HTMLInputElement>;\n @ViewChild('dropdown')\n public dropdown: NovoDropdownElement;\n\n multiple = true;\n\n @Input() buttonConfig: TabbedGroupPickerButtonConfig;\n @Input() tabs: TabbedGroupPickerTab[];\n @Input() quickSelectConfig: QuickSelectConfig;\n @Input() showFooter = false;\n\n // In activation mode, no checkboxes are displayed, and only the selectionActivated event occurs.\n @BooleanInput()\n @Input() selectionEnabled = true;\n\n @Output() activation = new EventEmitter<any>();\n @Output() selectionChange = new EventEmitter<TabbedGroupPickerTab[]>();\n @Output() applyChange: EventEmitter<any> = new EventEmitter<any>();\n @Output() cancelChange: EventEmitter<any> = new EventEmitter<any>();\n\n displayTabs: TabbedGroupPickerTab[];\n displayTabIndex: number = 0;\n\n filterText: BehaviorSubject<string> = new BehaviorSubject('');\n filterTextSubscription: Subscription;\n\n loading = true;\n showClearAll: boolean = false;\n\n appliedState: TabbedGroupPickerTab[];\n\n // Initial height based on 13 px font rendered in chrome. Actual height retrieved onDropdownToggled.\n scrollViewportHeight: number = 351;\n virtualScrollItemSize: number = 39;\n\n constructor(public labelService: NovoLabelService, private ref: ChangeDetectorRef) {}\n\n get displayTab(): TabbedGroupPickerTab {\n return this.displayTabs[this.displayTabIndex];\n }\n set displayTab(tab: TabbedGroupPickerTab) {\n this.displayTabIndex = this.tabs.map(({ typeName }) => typeName).indexOf(tab.typeName);\n }\n\n get minBufferPx() {\n return this.scrollViewportHeight; // render at least 2x the number of items visible (viewport + min buffer)\n }\n\n get maxBufferPx() {\n return 2 * this.scrollViewportHeight; // render at most 3x the number of items visible (viewport + max buffer)\n }\n\n ngOnInit(): void {\n this.loadValues();\n this.loading = false;\n this.filterTextSubscription = this.filterText.pipe(debounceTime(300)).subscribe({\n next: this.filter,\n });\n }\n\n ngOnDestroy(): void {\n if (this.filterTextSubscription) {\n this.filterTextSubscription.unsubscribe();\n }\n }\n\n loadValues() {\n this.setupDisplayData();\n this.createChildrenReferences();\n this.initializeDescendantSelection();\n this.updateParentsAndQuickSelect();\n this.updateClearAll();\n }\n\n changeTab(tab: TabbedGroupPickerTab) {\n this.displayTab = tab;\n if (this.scrollableInstance) {\n this.scrollableInstance.scrollTo({ behavior: 'auto', top: 0 });\n }\n }\n\n getPixelHeight(element: HTMLElement) {\n return Number(getComputedStyle(element, '').height.match(/(\\d+(\\.\\d+)?)px$/)[1]);\n }\n\n setupDisplayData(): void {\n // shallow copy here so that reassigning displayTabs[i].data doesn't mutate tabs[i].data\n // but both data values point to the same items\n this.displayTabs = this.tabs.map((tab) => ({ ...tab }));\n this.displayTab = this.tabs[0];\n this.updateAppliedState();\n }\n\n // Replace each parent's child object with a reference to the child to avoid\n // a child lookup for selected status; linking references allows M x N\n // time complexity instead of M x N^2\n createChildrenReferences(): void {\n this.tabs.forEach((tab) => {\n // would rather filter but TypeScript still wants a type narrowing here\n if ('childTypeName' in tab) {\n const childTab = this.tabs.find(({ typeName }) => typeName === tab.childTypeName);\n const compareFunction = this.makeCompareFunction(childTab.valueField);\n const warnFunction = this.makeWarningFunction(tab.typeName, childTab.typeName, childTab.valueField);\n const sortedChildren = childTab.data.slice().sort(compareFunction);\n\n tab.data\n .filter(({ children }) => children?.length)\n .forEach((parent: { children?: any[] }) =>\n this.replaceChildrenWithReferences(parent as ParentOption, sortedChildren, compareFunction, warnFunction),\n );\n }\n });\n if (this.quickSelectConfig) {\n this.quickSelectConfig.items\n .filter((parent) => 'all' in parent)\n .forEach((parent) => {\n parent.children = this.tabs.find(({ typeName }) => parent.childTypeName === typeName).data;\n });\n\n this.quickSelectConfig.items\n .filter((parent) => !('all' in parent))\n .forEach((parent) => {\n const childTab = this.tabs.find(({ typeName }) => typeName === parent.childTypeName);\n const compareFunction = this.makeCompareFunction(childTab.valueField);\n const warnFunction = this.makeWarningFunction(parent.label, childTab.typeName, childTab.valueField);\n const sortedChildren = childTab.data.slice().sort(compareFunction);\n\n this.replaceChildrenWithReferences(parent as ParentOption, sortedChildren, compareFunction, warnFunction);\n });\n }\n }\n\n makeCompareFunction<T>(key: string): (a: T | { [key: string]: T }, b: T | { [key: string]: T }) => 1 | -1 | 0 | undefined {\n return (a: T | { [key: string]: T }, b: T | { [key: string]: T }) => {\n const aValue: T = (a && a[key]) || a;\n const bValue: T = (b && b[key]) || b;\n\n if (aValue < bValue) {\n return -1;\n } else if (aValue > bValue) {\n return 1;\n } else if (aValue === bValue) {\n return 0;\n } else {\n return undefined;\n }\n };\n }\n\n replaceChildrenWithReferences(\n parent: { children: any[] },\n sortedData: ChildTab['data'],\n compareFunction: (a, b) => 1 | -1 | 0,\n warnFunction: (child) => void,\n ): void {\n if (Array.isArray(parent?.children)) {\n parent.children = parent.children\n .map((child) => binarySearch(child, sortedData, compareFunction) || warnFunction(child))\n .filter(Boolean); // since map can return undefined, remove undefined elements\n }\n }\n\n makeWarningFunction(parentLabel: string, childLabel: string, childValueField): (child) => void {\n return (child) => {\n const childValue = child[childValueField] || child;\n console.warn(`No ${childLabel} found with value ${childValue} for parent ${parentLabel}`);\n };\n }\n\n onDropdownToggle(event) {\n this.filterText.next('');\n this.inputElement.nativeElement?.focus();\n if (event) {\n this.scrollViewportHeight = this.getPixelHeight(this.scrollableInstance.getElementRef().nativeElement);\n this.virtualScrollItemSize = this.getPixelHeight(this.scrollableInstance.getElementRef().nativeElement.querySelector('novo-option'));\n // Emit a fake scroll event so the rendered items update\n this.scrollableInstance.getElementRef().nativeElement.dispatchEvent(new Event('scroll'));\n }\n }\n\n activateItem(item: any, tab?: TabbedGroupPickerTab): void {\n if (this.selectionEnabled) {\n item.selected = !item.selected;\n this.onItemToggled(item);\n }\n this.activation.emit({ ...item, scope: tab?.typeName || 'quickselect' });\n }\n\n onItemToggled(item: Option) {\n if (Array.isArray(item.children)) {\n this.updateDescendants(item.selected, item.children);\n }\n this.updateParentsAndQuickSelect();\n this.updateClearAll(item.selected);\n this.emitSelectedValues();\n this.ref.markForCheck();\n }\n\n initializeDescendantSelection() {\n this.tabs.forEach((tab) => {\n if ('childTypeName' in tab && tab.data?.length) {\n tab.data.forEach((parent) => {\n if (parent.selected && parent.children?.length) {\n parent.children.forEach((child) => {\n child.selected = true;\n });\n }\n });\n }\n });\n }\n\n updateDescendants(parentIsSelected: boolean, children: Option[]): void {\n children.forEach((item) => {\n if (parentIsSelected) {\n item.selected = true;\n } else {\n delete item.selected;\n }\n if (Array.isArray(item.children)) {\n this.updateDescendants(item.selected, item.children);\n }\n });\n }\n\n updateClearAll(itemWasJustSelected?: boolean) {\n if (!this.selectionEnabled) {\n this.showClearAll = false;\n } else {\n this.showClearAll = itemWasJustSelected\n ? true\n : this.tabs.some((tab) => {\n if ((tab as ParentTab).childTypeName) {\n return tab.data.some(({ selected, indeterminate }) => selected || indeterminate);\n } else {\n return tab.data.some(({ selected }) => selected);\n }\n });\n }\n }\n\n updateParentsAndQuickSelect(): void {\n // mutate here to avoid dereferencing the objects in displayTabs\n this.tabs\n .filter((tab) => 'childTypeName' in tab && !!tab.childTypeName)\n .forEach((tab) => {\n const parents = tab.data.filter(({ children }: { children?: any[] }) => children?.length);\n\n parents.forEach((parent: ParentOption) => {\n ['indeterminate', 'selected'].forEach((selectedStateOption) => delete parent[selectedStateOption]);\n\n const selectedState = this.getSelectedState(parent.children);\n if (selectedState) {\n parent[selectedState] = true;\n }\n });\n });\n\n if (this.quickSelectConfig) {\n this.quickSelectConfig.items.forEach((quickSelect) => {\n delete quickSelect.selected;\n const selectedState = this.getSelectedState(quickSelect.children as (Option)[]);\n if (selectedState) {\n quickSelect[selectedState] = true;\n }\n });\n }\n }\n\n getSelectedState = (childArray: Option[]): 'selected' | 'indeterminate' | undefined => {\n if (!Array.isArray(childArray)) {\n return undefined;\n }\n const numberOfSelectedItems = childArray.filter(({ selected }) => selected).length;\n if (!numberOfSelectedItems) {\n return undefined;\n }\n return numberOfSelectedItems === childArray.length ? 'selected' : 'indeterminate';\n };\n\n getSelectedValues(): TabbedGroupPickerTab[] {\n return this.tabs.map((tab) => ({\n ...tab,\n data: tab.data.filter(({ selected }) => selected),\n }));\n }\n\n emitSelectedValues() {\n this.selectionChange.emit(this.getSelectedValues());\n }\n\n updateAppliedState() {\n this.appliedState = Helpers.deepClone(this.displayTabs);\n }\n\n apply() {\n this.updateAppliedState();\n this.applyChange.emit(this.getSelectedValues());\n this.dropdown.closePanel();\n }\n\n cancel() {\n this.revertState();\n this.cancelChange.emit(this.tabs);\n this.ref.markForCheck();\n this.dropdown.closePanel();\n }\n\n revertState() {\n this.tabs = Helpers.deepClone(this.appliedState);\n this.loadValues();\n }\n\n deselectEverything(event) {\n Helpers.swallowEvent(event);\n this.showClearAll = false;\n if (this.quickSelectConfig) {\n this.quickSelectConfig.items.forEach((quickSelect) => {\n delete quickSelect.selected;\n });\n }\n this.tabs.forEach((tab) => {\n if ((tab as ParentTab).childTypeName) {\n tab.data.forEach((item) => {\n delete item.selected;\n delete item.indeterminate;\n item.children.forEach((child) => delete child.selected);\n });\n } else {\n (tab as ChildTab).data.forEach((item) => delete item.selected);\n }\n });\n this.emitSelectedValues();\n this.ref.markForCheck();\n }\n\n onClearFilter(event) {\n Helpers.swallowEvent(event);\n this.filterText.next('');\n }\n\n onFilter(event: { target: { value: string } }) {\n this.filterText.next(event.target.value);\n }\n\n filter = (searchTerm: string) => {\n this.displayTabs.forEach(\n (displayTab, i) =>\n (displayTab.data = this.tabs[i].data.filter((item) =>\n item[displayTab.labelField].toLowerCase().includes(searchTerm.toLowerCase()) ||\n item[displayTab.valueField]?.toString().toLowerCase().includes(searchTerm.toLowerCase()),\n )),\n );\n this.ref.markForCheck();\n };\n}\n","<novo-dropdown (toggled)=\"onDropdownToggle($event)\" multiple #dropdown>\n <novo-button\n class=\"tabbed-group-picker-button\"\n [theme]=\"buttonConfig.theme\"\n [side]=\"buttonConfig.side\"\n [size]=\"buttonConfig.size\"\n [icon]=\"buttonConfig.icon\"\n [loading]=\"loading\">\n <ng-content></ng-content>\n <div class=\"tabbed-group-picker-button-label\">{{ buttonConfig.label }}</div>\n </novo-button>\n <div class=\"tabbed-group-picker-search\" data-automation-id=\"tabbed-group-picker-search\" (keydown)=\"dropdown._handleKeydown($event)\">\n <input #inputElement type=\"text\" [placeholder]=\"labelService.search\" [value]=\"filterText | async\" (input)=\"onFilter($event)\" />\n <i class=\"bhi-search\" *ngIf=\"!(filterText | async)\"></i>\n <i class=\"bhi-times\" *ngIf=\"(filterText | async)\" (click)=\"onClearFilter($event)\" (keydown.space)=\"onClearFilter($event)\"></i>\n </div>\n <div class=\"tabbed-group-picker-column-container\" (keydown)=\"dropdown._handleKeydown($event)\">\n <div class=\"tabbed-group-picker-column left\">\n <novo-nav theme=\"white\" direction=\"vertical\">\n <novo-tab *ngFor=\"let tab of displayTabs\" [attr.data-automation-id]=\"tab.typeName\"\n (activeChange)=\"changeTab(tab)\">\n <span>{{ tab.typeLabel }} ({{ tab.data.length }})</span><i class=\"bhi-next\"></i>\n </novo-tab>\n </novo-nav>\n <novo-button *ngIf=\"showClearAll && !showFooter\" class=\"clear-all-button\" theme=\"dialogue\" icon=\"times\" side=\"right\"\n color=\"grapefruit\" (click)=\"deselectEverything($event)\" (keydown.space)=\"deselectEverything($event)\">{{ labelService.clear }}</novo-button>\n </div>\n <div class=\"tabbed-group-picker-column right\">\n <div class=\"quick-select\" *ngIf=\"quickSelectConfig && !(filterText | async)\">\n <novo-optgroup class=\"quick-select-list\" [label]=\"quickSelectConfig.label\">\n <novo-option\n class=\"quick-select-item\"\n *ngFor=\"let quickSelect of quickSelectConfig.items\"\n [attr.data-automation-id]=\"quickSelect.label\"\n [allowSelection]=\"selectionEnabled\"\n [selected]=\"quickSelect.selected\"\n (click)=\"activateItem(quickSelect)\"\n (keydown.space)=\"activateItem(quickSelect)\"\n novoInert>\n {{quickSelect.label}}\n </novo-option>\n </novo-optgroup>\n </div>\n <novo-optgroup *ngIf=\"displayTab.data.length\">\n <cdk-virtual-scroll-viewport\n [itemSize]=\"virtualScrollItemSize\"\n [maxBufferPx]=\"maxBufferPx\"\n [minBufferPx]=\"minBufferPx\"\n #tabbedGroupPickerVirtualScrollViewport>\n <novo-option\n *cdkVirtualFor=\"let item of displayTab.data\"\n [attr.data-automation-id]=\"item[displayTab.labelField]\"\n [attr.data-automation-value]=\"item[displayTab.valueField]\"\n [allowSelection]=\"selectionEnabled\"\n [selected]=\"item.selected\"\n (click)=\"activateItem(item, displayTab)\"\n (keydown.space)=\"activateItem(item, displayTab)\"\n novoInert>\n {{item[displayTab.labelField]}}\n </novo-option>\n </cdk-virtual-scroll-viewport>\n </novo-optgroup>\n <div class=\"tabbed-group-picker-empty-item\" *ngIf=\"!displayTab.data.length && (filterText | async)\">\n <i class=\"{{ displayTab.icon || 'bhi-search' }}\"></i>\n <div class=\"empty-item-main-message\">{{ labelService.tabbedGroupPickerEmpty }}</div>\n <div class=\"empty-item-sub-message\">{{ labelService.tabbedGroupClearSuggestion(displayTab.typeLabel) }}\n </div>\n </div>\n </div>\n </div>\n <div class=\"footer\" *ngIf=\"showFooter\">\n <div class=\"save-cancel-button-container\">\n <novo-button\n class=\"clear-all-button\"\n *ngIf=\"showClearAll\"\n theme=\"dialogue\"\n icon=\"times\"\n side=\"right\"\n color=\"grapefruit\"\n (click)=\"deselectEverything($event)\">{{ labelService.clear }}</novo-button>\n </div>\n <div class=\"save-cancel-button-container\">\n <novo-button\n class=\"cancel-button\"\n marginRight=\"1rem\"\n theme=\"dialogue\"\n (click)=\"cancel()\">{{ labelService.cancel }}</novo-button>\n <novo-button\n class=\"save-button\"\n theme=\"primary\"\n color=\"primary\"\n (click)=\"apply()\">{{ labelService.apply }}</novo-button>\n </div>\n </div>\n</novo-dropdown>","// NG2\nimport { ScrollingModule } from '@angular/cdk/scrolling';\nimport { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { FormsModule } from '@angular/forms';\n// APP\nimport { NovoLabelService } from 'novo-elements/services';\nimport { NovoButtonModule } from 'novo-elements/elements/button';\nimport { NovoCheckboxModule } from 'novo-elements/elements/checkbox';\nimport { NovoOptionModule } from 'novo-elements/elements/common';\nimport { NovoDropdownModule } from 'novo-elements/elements/dropdown';\nimport { NovoFormExtrasModule } from 'novo-elements/elements/form';\nimport { NovoListModule } from 'novo-elements/elements/list';\nimport { NovoTabModule } from 'novo-elements/elements/tabs';\nimport { NovoTabbedGroupPickerElement } from './TabbedGroupPicker';\n\n@NgModule({\n imports: [\n CommonModule,\n FormsModule,\n ScrollingModule,\n NovoTabModule,\n NovoListModule,\n NovoFormExtrasModule,\n NovoButtonModule,\n NovoDropdownModule,\n NovoOptionModule,\n NovoCheckboxModule,\n ],\n providers: [NovoLabelService],\n declarations: [NovoTabbedGroupPickerElement],\n exports: [NovoTabbedGroupPickerElement],\n})\nexport class NovoTabbedGroupPickerModule {}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA2Ea,4BAA4B,CAAA;IAuCvC,WAAmB,CAAA,YAA8B,EAAU,GAAsB,EAAA;QAA9D,IAAY,CAAA,YAAA,GAAZ,YAAY;QAA4B,IAAG,CAAA,GAAA,GAAH,GAAG;QA/B9D,IAAQ,CAAA,QAAA,GAAG,IAAI;QAKN,IAAU,CAAA,UAAA,GAAG,KAAK;;QAIlB,IAAgB,CAAA,gBAAA,GAAG,IAAI;AAEtB,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,YAAY,EAAO;AACpC,QAAA,IAAA,CAAA,eAAe,GAAG,IAAI,YAAY,EAA0B;AAC5D,QAAA,IAAA,CAAA,WAAW,GAAsB,IAAI,YAAY,EAAO;AACxD,QAAA,IAAA,CAAA,YAAY,GAAsB,IAAI,YAAY,EAAO;QAGnE,IAAe,CAAA,eAAA,GAAW,CAAC;AAE3B,QAAA,IAAA,CAAA,UAAU,GAA4B,IAAI,eAAe,CAAC,EAAE,CAAC;QAG7D,IAAO,CAAA,OAAA,GAAG,IAAI;QACd,IAAY,CAAA,YAAA,GAAY,KAAK;;QAK7B,IAAoB,CAAA,oBAAA,GAAW,GAAG;QAClC,IAAqB,CAAA,qBAAA,GAAW,EAAE;AA4OlC,QAAA,IAAA,CAAA,gBAAgB,GAAG,CAAC,UAAoB,KAA8C;YACpF,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE;AAC9B,gBAAA,OAAO,SAAS;;AAElB,YAAA,MAAM,qBAAqB,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,KAAK,QAAQ,CAAC,CAAC,MAAM;YAClF,IAAI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AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,WAAW;wBACX,eAAe;wBACf,aAAa;wBACb,cAAc;wBACd,oBAAoB;wBACpB,gBAAgB;wBAChB,kBAAkB;wBAClB,gBAAgB;wBAChB,kBAAkB;AACnB,qBAAA;oBACD,SAAS,EAAE,CAAC,gBAAgB,CAAC;oBAC7B,YAAY,EAAE,CAAC,4BAA4B,CAAC;oBAC5C,OAAO,EAAE,CAAC,4BAA4B,CAAC;AACxC,iBAAA;;;AChCD;;AAEG;;;;"}
|
|
@@ -21568,6 +21568,11 @@ function Deferred() {
|
|
|
21568
21568
|
|
|
21569
21569
|
// @dynamic
|
|
21570
21570
|
class Helpers {
|
|
21571
|
+
/**
|
|
21572
|
+
* Checks if the provided value is an Angular TemplateRef
|
|
21573
|
+
* @param value - The value to check
|
|
21574
|
+
* @returns true if the value is an instance of TemplateRef, false otherwise
|
|
21575
|
+
*/
|
|
21571
21576
|
static isTemplateRef(value) {
|
|
21572
21577
|
return value instanceof TemplateRef;
|
|
21573
21578
|
}
|
|
@@ -21580,6 +21585,13 @@ class Helpers {
|
|
|
21580
21585
|
event.preventDefault();
|
|
21581
21586
|
}
|
|
21582
21587
|
}
|
|
21588
|
+
/**
|
|
21589
|
+
* Interpolates a string or function with provided properties
|
|
21590
|
+
* Replaces placeholders in the format $variableName with values from props
|
|
21591
|
+
* @param str - The format string or function to interpolate
|
|
21592
|
+
* @param props - The object containing values to replace placeholders
|
|
21593
|
+
* @returns The interpolated string
|
|
21594
|
+
*/
|
|
21583
21595
|
static interpolate(str, props) {
|
|
21584
21596
|
if (typeof str === 'function') {
|
|
21585
21597
|
return str(props);
|
|
@@ -21597,6 +21609,14 @@ class Helpers {
|
|
|
21597
21609
|
return value !== undefined ? value : '';
|
|
21598
21610
|
});
|
|
21599
21611
|
}
|
|
21612
|
+
/**
|
|
21613
|
+
* Interpolates a format string (or array of strings) with provided data
|
|
21614
|
+
* Attempts to replace all variables, returning the first successful interpolation
|
|
21615
|
+
* or an empty string if all attempts fail
|
|
21616
|
+
* @param formatString - A single format string or array of format strings to try
|
|
21617
|
+
* @param data - The object containing values to replace placeholders
|
|
21618
|
+
* @returns The first successfully interpolated string, or an empty string
|
|
21619
|
+
*/
|
|
21600
21620
|
static interpolateWithFallback(formatString, data) {
|
|
21601
21621
|
// Format string can be an array, it will attempt to interpolate each item
|
|
21602
21622
|
// in the array, if there is a failure to replace it will mark it as such
|
|
@@ -21649,6 +21669,11 @@ class Helpers {
|
|
|
21649
21669
|
return props.hasOwnProperty(key.substr(1));
|
|
21650
21670
|
});
|
|
21651
21671
|
}
|
|
21672
|
+
/**
|
|
21673
|
+
* Checks if the provided value is a plain object
|
|
21674
|
+
* @param item - The value to check
|
|
21675
|
+
* @returns true if the value is an object but not an array or null, false otherwise
|
|
21676
|
+
*/
|
|
21652
21677
|
static isObject(item) {
|
|
21653
21678
|
return item && typeof item === 'object' && !Array.isArray(item) && item !== null;
|
|
21654
21679
|
}
|
|
@@ -21658,12 +21683,23 @@ class Helpers {
|
|
|
21658
21683
|
static isString(obj) {
|
|
21659
21684
|
return typeof obj === 'string';
|
|
21660
21685
|
}
|
|
21686
|
+
/**
|
|
21687
|
+
* Escapes special regex characters in a string
|
|
21688
|
+
* @param obj - The value to escape (if it's a string)
|
|
21689
|
+
* @returns The escaped string if input is a string, otherwise the original value
|
|
21690
|
+
*/
|
|
21661
21691
|
static escapeString(obj) {
|
|
21662
21692
|
if (Helpers.isString(obj)) {
|
|
21663
21693
|
return obj.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
|
|
21664
21694
|
}
|
|
21665
21695
|
return obj;
|
|
21666
21696
|
}
|
|
21697
|
+
/**
|
|
21698
|
+
* Checks if a value is a valid number (string or numeric type)
|
|
21699
|
+
* @param val - The value to check
|
|
21700
|
+
* @param includeNegatives - Whether to allow negative numbers (default: false)
|
|
21701
|
+
* @returns true if the value is a valid number, false otherwise
|
|
21702
|
+
*/
|
|
21667
21703
|
static isNumber(val, includeNegatives = false) {
|
|
21668
21704
|
const numberRegex = includeNegatives ? /^-{0,1}\d*\.?\d*$/ : /^\d*\.?\d*$/;
|
|
21669
21705
|
if (typeof val === 'string') {
|
|
@@ -21703,6 +21739,11 @@ class Helpers {
|
|
|
21703
21739
|
static isDate(obj) {
|
|
21704
21740
|
return obj instanceof Date;
|
|
21705
21741
|
}
|
|
21742
|
+
/**
|
|
21743
|
+
* Checks if a string is a valid ISO 8601 date format
|
|
21744
|
+
* @param str - The string to validate
|
|
21745
|
+
* @returns true if the string is a valid ISO date, false otherwise
|
|
21746
|
+
*/
|
|
21706
21747
|
static isIsoDate(str) {
|
|
21707
21748
|
if (!/\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z/.test(str)) {
|
|
21708
21749
|
return false;
|
|
@@ -21710,6 +21751,11 @@ class Helpers {
|
|
|
21710
21751
|
const d = new Date(str);
|
|
21711
21752
|
return d.toISOString() === str;
|
|
21712
21753
|
}
|
|
21754
|
+
/**
|
|
21755
|
+
* Converts a value to an array
|
|
21756
|
+
* @param obj - The value to convert
|
|
21757
|
+
* @returns An empty array if undefined, the value wrapped in an array if not already an array, or the array as-is
|
|
21758
|
+
*/
|
|
21713
21759
|
static convertToArray(obj) {
|
|
21714
21760
|
if (obj === undefined) {
|
|
21715
21761
|
return [];
|
|
@@ -21719,6 +21765,12 @@ class Helpers {
|
|
|
21719
21765
|
}
|
|
21720
21766
|
return obj;
|
|
21721
21767
|
}
|
|
21768
|
+
/**
|
|
21769
|
+
* Creates a comparator function for sorting objects by specified fields
|
|
21770
|
+
* @param fields - A field name, array of field names, or custom comparator function
|
|
21771
|
+
* @param reverse - Whether to reverse the sort order (default: false for ascending)
|
|
21772
|
+
* @returns A comparator function suitable for use with Array.sort()
|
|
21773
|
+
*/
|
|
21722
21774
|
static sortByField(fields, reverse = false) {
|
|
21723
21775
|
return (previous, current) => {
|
|
21724
21776
|
if (Helpers.isFunction(fields)) {
|
|
@@ -21756,6 +21808,13 @@ class Helpers {
|
|
|
21756
21808
|
return 0;
|
|
21757
21809
|
};
|
|
21758
21810
|
}
|
|
21811
|
+
/**
|
|
21812
|
+
* Creates a filter function for filtering objects by field values
|
|
21813
|
+
* Supports exact matching, arrays, ranges, and complex filter objects
|
|
21814
|
+
* @param key - The field key to filter on (supports dot notation for nested properties)
|
|
21815
|
+
* @param value - The filter value (can be a function, array, range object, or regex pattern string)
|
|
21816
|
+
* @returns A filter function suitable for use with Array.filter()
|
|
21817
|
+
*/
|
|
21759
21818
|
static filterByField(key, value) {
|
|
21760
21819
|
return (item) => {
|
|
21761
21820
|
const results = [];
|
|
@@ -21803,11 +21862,23 @@ class Helpers {
|
|
|
21803
21862
|
return results.every((x) => x);
|
|
21804
21863
|
};
|
|
21805
21864
|
}
|
|
21865
|
+
/**
|
|
21866
|
+
* Finds the first ancestor element that matches the provided CSS selector
|
|
21867
|
+
* @param element - The starting element to search from
|
|
21868
|
+
* @param selector - The CSS selector to match against
|
|
21869
|
+
* @returns The first matching ancestor element, or undefined if none found
|
|
21870
|
+
*/
|
|
21806
21871
|
static findAncestor(element, selector) {
|
|
21807
21872
|
while ((element = element.parentElement) && !element.matches.call(element, selector))
|
|
21808
21873
|
; // tslint:disable-line
|
|
21809
21874
|
return element;
|
|
21810
21875
|
}
|
|
21876
|
+
/**
|
|
21877
|
+
* Creates a deep clone of an object or array
|
|
21878
|
+
* Recursively clones all nested properties and array elements
|
|
21879
|
+
* @param item - The item to clone
|
|
21880
|
+
* @returns A deep clone of the provided item
|
|
21881
|
+
*/
|
|
21811
21882
|
static deepClone(item) {
|
|
21812
21883
|
if (Array.isArray(item)) {
|
|
21813
21884
|
const newArr = [];
|
|
@@ -21837,6 +21908,13 @@ class Helpers {
|
|
|
21837
21908
|
}
|
|
21838
21909
|
return item;
|
|
21839
21910
|
}
|
|
21911
|
+
/**
|
|
21912
|
+
* Recursively merges multiple objects into a single object
|
|
21913
|
+
* Nested objects and arrays are merged deeply
|
|
21914
|
+
* @param objs - Two or more objects to merge
|
|
21915
|
+
* @returns A new object with all properties merged
|
|
21916
|
+
* @throws Error if fewer than 2 objects are provided
|
|
21917
|
+
*/
|
|
21840
21918
|
static deepAssign(...objs) {
|
|
21841
21919
|
if (objs.length < 2) {
|
|
21842
21920
|
throw new Error('Need two or more objects to merge');
|
|
@@ -21906,6 +21984,11 @@ class Helpers {
|
|
|
21906
21984
|
return e;
|
|
21907
21985
|
}
|
|
21908
21986
|
}
|
|
21987
|
+
/**
|
|
21988
|
+
* Converts a Date object to an object with formatted date and time parts
|
|
21989
|
+
* @param date - The Date object to convert
|
|
21990
|
+
* @returns An object with date components (year, month, day, hour, minute, second, weekday, era, dayPeriod)
|
|
21991
|
+
*/
|
|
21909
21992
|
static dateToObject(date) {
|
|
21910
21993
|
const dateObj = {
|
|
21911
21994
|
day: '',
|
|
@@ -21937,10 +22020,22 @@ class Helpers {
|
|
|
21937
22020
|
return dateObj;
|
|
21938
22021
|
}
|
|
21939
22022
|
}
|
|
22023
|
+
/**
|
|
22024
|
+
* Helper class for safe property access using dot notation
|
|
22025
|
+
*/
|
|
21940
22026
|
class Can {
|
|
22027
|
+
/**
|
|
22028
|
+
* Creates a new Can instance
|
|
22029
|
+
* @param obj - The object to wrap for safe property access
|
|
22030
|
+
*/
|
|
21941
22031
|
constructor(obj) {
|
|
21942
22032
|
this.obj = obj;
|
|
21943
22033
|
}
|
|
22034
|
+
/**
|
|
22035
|
+
* Safely accesses a property using dot notation
|
|
22036
|
+
* @param key - The property key (supports dot notation for nested properties)
|
|
22037
|
+
* @returns The property value or undefined
|
|
22038
|
+
*/
|
|
21944
22039
|
have(key) {
|
|
21945
22040
|
const props = key.split('.');
|
|
21946
22041
|
let item = this.obj;
|
|
@@ -21952,14 +22047,32 @@ class Can {
|
|
|
21952
22047
|
}
|
|
21953
22048
|
return item;
|
|
21954
22049
|
}
|
|
22050
|
+
/**
|
|
22051
|
+
* Checks if a value is defined (not undefined)
|
|
22052
|
+
* @param thing - The value to check
|
|
22053
|
+
* @returns true if the value is defined, false otherwise
|
|
22054
|
+
*/
|
|
21955
22055
|
check(thing) {
|
|
21956
22056
|
return thing !== void 0;
|
|
21957
22057
|
}
|
|
21958
22058
|
}
|
|
22059
|
+
/**
|
|
22060
|
+
* Factory function to create a Can instance for safe property access
|
|
22061
|
+
* @param obj - The object to wrap
|
|
22062
|
+
* @returns A new Can instance
|
|
22063
|
+
*/
|
|
21959
22064
|
function can(obj) {
|
|
21960
22065
|
return new Can(obj);
|
|
21961
22066
|
}
|
|
21962
|
-
|
|
22067
|
+
/**
|
|
22068
|
+
* Performs a binary search on a sorted array
|
|
22069
|
+
* Note: Assumes the array is already sorted according to the compare function
|
|
22070
|
+
* @param item - The item to search for
|
|
22071
|
+
* @param array - The sorted array to search in
|
|
22072
|
+
* @param compare - Comparator function that returns -1 (item < array[i]), 0 (equal), or 1 (item > array[i])
|
|
22073
|
+
* @returns The matching item if found, undefined otherwise
|
|
22074
|
+
* @throws Error if the item is not comparable to an array element
|
|
22075
|
+
*/
|
|
21963
22076
|
function binarySearch(item, array, compare) {
|
|
21964
22077
|
return search(0, array.length - 1);
|
|
21965
22078
|
function search(min, max) {
|