@siemens/element-ng 47.1.0 → 47.2.0
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/accordion/index.d.ts +9 -0
- package/accordion/package.json +3 -0
- package/accordion/si-accordion-hcollapse.service.d.ts +17 -0
- package/accordion/si-accordion.component.d.ts +37 -0
- package/accordion/si-accordion.module.d.ts +8 -0
- package/accordion/si-accordion.service.d.ts +17 -0
- package/accordion/si-collapsible-panel.component.d.ts +89 -0
- package/action-modal/index.d.ts +6 -0
- package/action-modal/package.json +3 -0
- package/action-modal/si-action-dialog.service.d.ts +49 -0
- package/action-modal/si-action-dialog.types.d.ts +92 -0
- package/action-modal/si-alert-dialog/si-alert-dialog.component.d.ts +32 -0
- package/action-modal/si-confirmation-dialog/si-confirmation-dialog.component.d.ts +40 -0
- package/action-modal/si-delete-confirmation-dialog/si-delete-confirmation-dialog.component.d.ts +45 -0
- package/action-modal/si-edit-discard-dialog/si-edit-discard-dialog.component.d.ts +68 -0
- package/auto-collapsable-list/index.d.ts +10 -0
- package/auto-collapsable-list/package.json +3 -0
- package/auto-collapsable-list/si-auto-collapsable-list-additional-content.directive.d.ts +6 -0
- package/auto-collapsable-list/si-auto-collapsable-list-item.directive.d.ts +29 -0
- package/auto-collapsable-list/si-auto-collapsable-list-measurable.class.d.ts +16 -0
- package/auto-collapsable-list/si-auto-collapsable-list-overflow-item.directive.d.ts +12 -0
- package/auto-collapsable-list/si-auto-collapsable-list.directive.d.ts +47 -0
- package/auto-collapsable-list/si-auto-collapsable-list.module.d.ts +10 -0
- package/color-picker/index.d.ts +5 -0
- package/color-picker/package.json +3 -0
- package/color-picker/si-color-picker.component.d.ts +61 -0
- package/common/models/menu.model.d.ts +2 -2
- package/connection-strength/index.d.ts +6 -0
- package/connection-strength/package.json +3 -0
- package/connection-strength/si-connection-strength.component.d.ts +19 -0
- package/connection-strength/si-connection-strength.module.d.ts +7 -0
- package/copyright-notice/index.d.ts +7 -0
- package/copyright-notice/package.json +3 -0
- package/copyright-notice/si-copyright-notice.component.d.ts +18 -0
- package/copyright-notice/si-copyright-notice.d.ts +23 -0
- package/copyright-notice/si-copyright-notice.module.d.ts +7 -0
- package/empty-state/index.d.ts +6 -0
- package/empty-state/package.json +3 -0
- package/empty-state/si-empty-state.component.d.ts +18 -0
- package/empty-state/si-empty-state.module.d.ts +7 -0
- package/fesm2022/siemens-element-ng-accordion.mjs +314 -0
- package/fesm2022/siemens-element-ng-accordion.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-action-modal.mjs +363 -0
- package/fesm2022/siemens-element-ng-action-modal.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-auto-collapsable-list.mjs +312 -0
- package/fesm2022/siemens-element-ng-auto-collapsable-list.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-color-picker.mjs +176 -0
- package/fesm2022/siemens-element-ng-color-picker.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-connection-strength.mjs +58 -0
- package/fesm2022/siemens-element-ng-connection-strength.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-copyright-notice.mjs +71 -0
- package/fesm2022/siemens-element-ng-copyright-notice.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-empty-state.mjs +59 -0
- package/fesm2022/siemens-element-ng-empty-state.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-footer.mjs +55 -0
- package/fesm2022/siemens-element-ng-footer.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-icon.mjs +8 -1
- package/fesm2022/siemens-element-ng-icon.mjs.map +1 -1
- package/fesm2022/siemens-element-ng-inline-notification.mjs +82 -0
- package/fesm2022/siemens-element-ng-inline-notification.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-loading-spinner.mjs +248 -0
- package/fesm2022/siemens-element-ng-loading-spinner.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-menu.mjs +350 -0
- package/fesm2022/siemens-element-ng-menu.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-modal.mjs +345 -0
- package/fesm2022/siemens-element-ng-modal.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-pagination.mjs +145 -0
- package/fesm2022/siemens-element-ng-pagination.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-password-toggle.mjs +88 -0
- package/fesm2022/siemens-element-ng-password-toggle.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-summary-chip.mjs +77 -0
- package/fesm2022/siemens-element-ng-summary-chip.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-tooltip.mjs +233 -0
- package/fesm2022/siemens-element-ng-tooltip.mjs.map +1 -0
- package/fesm2022/siemens-element-ng-translate.mjs.map +1 -1
- package/footer/index.d.ts +6 -0
- package/footer/package.json +3 -0
- package/footer/si-footer.component.d.ts +14 -0
- package/footer/si-footer.module.d.ts +7 -0
- package/icon/element-icons.d.ts +7 -0
- package/inline-notification/index.d.ts +6 -0
- package/inline-notification/package.json +3 -0
- package/inline-notification/si-inline-notification.component.d.ts +42 -0
- package/inline-notification/si-inline-notification.module.d.ts +7 -0
- package/loading-spinner/index.d.ts +9 -0
- package/loading-spinner/package.json +3 -0
- package/loading-spinner/si-loading-button.component.d.ts +31 -0
- package/loading-spinner/si-loading-spinner.component.d.ts +32 -0
- package/loading-spinner/si-loading-spinner.directive.d.ts +36 -0
- package/loading-spinner/si-loading-spinner.module.d.ts +8 -0
- package/loading-spinner/si-loading-spinner.service.d.ts +18 -0
- package/menu/index.d.ts +15 -0
- package/menu/package.json +3 -0
- package/menu/si-menu-action.service.d.ts +13 -0
- package/menu/si-menu-bar.directive.d.ts +12 -0
- package/menu/si-menu-divider.directive.d.ts +5 -0
- package/menu/si-menu-factory-item-guard.directive.d.ts +11 -0
- package/menu/si-menu-factory.component.d.ts +15 -0
- package/menu/si-menu-header.directive.d.ts +5 -0
- package/menu/si-menu-item-base.directive.d.ts +16 -0
- package/menu/si-menu-item-checkbox.component.d.ts +10 -0
- package/menu/si-menu-item-radio.component.d.ts +10 -0
- package/menu/si-menu-item.component.d.ts +10 -0
- package/menu/si-menu-model.d.ts +91 -0
- package/menu/si-menu.directive.d.ts +6 -0
- package/menu/si-menu.module.d.ts +14 -0
- package/modal/index.d.ts +7 -0
- package/modal/modal.helpers.d.ts +8 -0
- package/modal/modalref.d.ts +64 -0
- package/modal/package.json +3 -0
- package/modal/si-modal.component.d.ts +32 -0
- package/modal/si-modal.service.d.ts +57 -0
- package/package.json +67 -3
- package/pagination/index.d.ts +6 -0
- package/pagination/package.json +3 -0
- package/pagination/si-pagination.component.d.ts +65 -0
- package/pagination/si-pagination.module.d.ts +7 -0
- package/password-toggle/index.d.ts +6 -0
- package/password-toggle/package.json +3 -0
- package/password-toggle/si-password-toggle.component.d.ts +39 -0
- package/password-toggle/si-password-toggle.module.d.ts +7 -0
- package/summary-chip/index.d.ts +5 -0
- package/summary-chip/package.json +3 -0
- package/summary-chip/si-summary-chip.component.d.ts +44 -0
- package/template-i18n.json +19 -1
- package/tooltip/index.d.ts +7 -0
- package/tooltip/package.json +3 -0
- package/tooltip/si-tooltip.component.d.ts +25 -0
- package/tooltip/si-tooltip.directive.d.ts +45 -0
- package/tooltip/si-tooltip.module.d.ts +7 -0
- package/tooltip/si-tooltip.service.d.ts +44 -0
- package/translate/si-translatable-keys.interface.d.ts +18 -0
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import * as i0 from '@angular/core';
|
|
2
|
+
import { inject, ElementRef, Directive, input, booleanAttribute, signal, computed, contentChild, ChangeDetectorRef, ContentChildren, NgModule } from '@angular/core';
|
|
3
|
+
import { ResizeObserverService } from '@siemens/element-ng/resize-observer';
|
|
4
|
+
import { map, distinctUntilChanged, shareReplay, switchMap, startWith, auditTime } from 'rxjs/operators';
|
|
5
|
+
import { BehaviorSubject, of, combineLatest } from 'rxjs';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Copyright Siemens 2016 - 2025.
|
|
9
|
+
* SPDX-License-Identifier: MIT
|
|
10
|
+
*/
|
|
11
|
+
class SiAutoCollapsableListMeasurable {
|
|
12
|
+
/** Emits on element width changes. */
|
|
13
|
+
size$;
|
|
14
|
+
elementRef = inject((ElementRef));
|
|
15
|
+
resizeObserverService = inject(ResizeObserverService);
|
|
16
|
+
ngAfterViewInit() {
|
|
17
|
+
this.size$ = this.resizeObserverService
|
|
18
|
+
.observe(this.elementRef.nativeElement, 0, true, true)
|
|
19
|
+
.pipe(map(size => size.width), distinctUntilChanged(), shareReplay(1));
|
|
20
|
+
}
|
|
21
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListMeasurable, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
22
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiAutoCollapsableListMeasurable, isStandalone: true, ngImport: i0 });
|
|
23
|
+
}
|
|
24
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListMeasurable, decorators: [{
|
|
25
|
+
type: Directive
|
|
26
|
+
}] });
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Copyright Siemens 2016 - 2025.
|
|
30
|
+
* SPDX-License-Identifier: MIT
|
|
31
|
+
*/
|
|
32
|
+
class SiAutoCollapsableListItemDirective extends SiAutoCollapsableListMeasurable {
|
|
33
|
+
/**
|
|
34
|
+
* Hide this item even if enough space is available.
|
|
35
|
+
* When calculating the overall available size, this item is still considered when forceHide=true
|
|
36
|
+
*
|
|
37
|
+
* @defaultValue false
|
|
38
|
+
*/
|
|
39
|
+
forceHide = input(false, { transform: booleanAttribute });
|
|
40
|
+
/**
|
|
41
|
+
* True if enough space is available for this item.
|
|
42
|
+
*
|
|
43
|
+
* @defaultValue false
|
|
44
|
+
*/
|
|
45
|
+
canBeVisible = signal(false);
|
|
46
|
+
/**
|
|
47
|
+
* True if this item is actually visible to the user
|
|
48
|
+
*/
|
|
49
|
+
isVisible = computed(() => this.canBeVisible() && !this.forceHide());
|
|
50
|
+
ngAfterViewInit() {
|
|
51
|
+
if (getComputedStyle(this.elementRef.nativeElement).display === 'inline') {
|
|
52
|
+
console.error('siAutoCollapsibleListItem does not work on items with display="inline"');
|
|
53
|
+
}
|
|
54
|
+
super.ngAfterViewInit();
|
|
55
|
+
}
|
|
56
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListItemDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
57
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: SiAutoCollapsableListItemDirective, isStandalone: true, selector: "[siAutoCollapsableListItem]", inputs: { forceHide: { classPropertyName: "forceHide", publicName: "forceHide", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.visibility": "isVisible() ? \"visible\" : \"hidden\"", "style.position": "isVisible() ? \"\" : \"absolute\"", "style.z-index": "isVisible() ? \"\" : \"-1\"" } }, exportAs: ["siAutoCollapsableListItem"], usesInheritance: true, ngImport: i0 });
|
|
58
|
+
}
|
|
59
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListItemDirective, decorators: [{
|
|
60
|
+
type: Directive,
|
|
61
|
+
args: [{
|
|
62
|
+
selector: '[siAutoCollapsableListItem]',
|
|
63
|
+
exportAs: 'siAutoCollapsableListItem',
|
|
64
|
+
host: {
|
|
65
|
+
'[style.visibility]': 'isVisible() ? "visible" : "hidden"',
|
|
66
|
+
'[style.position]': 'isVisible() ? "" : "absolute"',
|
|
67
|
+
// Ensure hidden items are behind the visible ones. Otherwise, the visible ones are not clickable
|
|
68
|
+
'[style.z-index]': 'isVisible() ? "" : "-1"'
|
|
69
|
+
}
|
|
70
|
+
}]
|
|
71
|
+
}] });
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Copyright Siemens 2016 - 2025.
|
|
75
|
+
* SPDX-License-Identifier: MIT
|
|
76
|
+
*/
|
|
77
|
+
class SiAutoCollapsableListAdditionalContentDirective extends SiAutoCollapsableListMeasurable {
|
|
78
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListAdditionalContentDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
79
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiAutoCollapsableListAdditionalContentDirective, isStandalone: true, selector: "[siAutoCollapsableListAdditionalContent]", usesInheritance: true, ngImport: i0 });
|
|
80
|
+
}
|
|
81
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListAdditionalContentDirective, decorators: [{
|
|
82
|
+
type: Directive,
|
|
83
|
+
args: [{
|
|
84
|
+
selector: '[siAutoCollapsableListAdditionalContent]'
|
|
85
|
+
}]
|
|
86
|
+
}] });
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Copyright Siemens 2016 - 2025.
|
|
90
|
+
* SPDX-License-Identifier: MIT
|
|
91
|
+
*/
|
|
92
|
+
class SiAutoCollapsableListOverflowItemDirective extends SiAutoCollapsableListItemDirective {
|
|
93
|
+
/**
|
|
94
|
+
* Number of hidden items.
|
|
95
|
+
*
|
|
96
|
+
* @defaultValue 0
|
|
97
|
+
*/
|
|
98
|
+
hiddenItemCount = 0;
|
|
99
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListOverflowItemDirective, deps: null, target: i0.ɵɵFactoryTarget.Directive });
|
|
100
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "19.0.6", type: SiAutoCollapsableListOverflowItemDirective, isStandalone: true, selector: "[siAutoCollapsableListOverflowItem]", exportAs: ["siAutoCollapsableListOverflowItem"], usesInheritance: true, ngImport: i0 });
|
|
101
|
+
}
|
|
102
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListOverflowItemDirective, decorators: [{
|
|
103
|
+
type: Directive,
|
|
104
|
+
args: [{
|
|
105
|
+
selector: '[siAutoCollapsableListOverflowItem]',
|
|
106
|
+
exportAs: 'siAutoCollapsableListOverflowItem'
|
|
107
|
+
}]
|
|
108
|
+
}] });
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* Copyright Siemens 2016 - 2025.
|
|
112
|
+
* SPDX-License-Identifier: MIT
|
|
113
|
+
*/
|
|
114
|
+
class SiAutoCollapsableListDirective {
|
|
115
|
+
/**
|
|
116
|
+
* The items which are displayed in the siAutoCollapsableList.
|
|
117
|
+
*/
|
|
118
|
+
items;
|
|
119
|
+
overflowItem = contentChild(SiAutoCollapsableListOverflowItemDirective);
|
|
120
|
+
additionalContent;
|
|
121
|
+
/** @defaultValue true */
|
|
122
|
+
siAutoCollapsableList = input(true, { transform: booleanAttribute });
|
|
123
|
+
/**
|
|
124
|
+
* The (flex) gap in pixels, will automatically be set if a pixel value is used in CSS.
|
|
125
|
+
*/
|
|
126
|
+
gap = input();
|
|
127
|
+
/**
|
|
128
|
+
* The element which size is available for the content of the siAutoCollapsableList.
|
|
129
|
+
*
|
|
130
|
+
* @defaultValue undefined
|
|
131
|
+
*/
|
|
132
|
+
containerElement = input(undefined, {
|
|
133
|
+
alias: 'siAutoCollapsableListContainerElement'
|
|
134
|
+
});
|
|
135
|
+
resizeSubscription;
|
|
136
|
+
disableInitSubscription;
|
|
137
|
+
elementRef = inject(ElementRef);
|
|
138
|
+
resizeObserverService = inject(ResizeObserverService);
|
|
139
|
+
changeDetectorRef = inject(ChangeDetectorRef);
|
|
140
|
+
containerElementSubject = new BehaviorSubject(this.elementRef.nativeElement);
|
|
141
|
+
/**
|
|
142
|
+
* The same as {@link gap}, but automatically read from the computed styles.
|
|
143
|
+
* Used if not set by user.
|
|
144
|
+
*/
|
|
145
|
+
computedGap = 0;
|
|
146
|
+
ngAfterViewInit() {
|
|
147
|
+
if (this.siAutoCollapsableList()) {
|
|
148
|
+
this.readGapSize();
|
|
149
|
+
this.setupResizeListener();
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
this.reset();
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
ngOnChanges(changes) {
|
|
156
|
+
if (changes.siAutoCollapsableList) {
|
|
157
|
+
const siAutoCollapsableList = this.siAutoCollapsableList();
|
|
158
|
+
if (!siAutoCollapsableList && this.resizeSubscription) {
|
|
159
|
+
this.reset();
|
|
160
|
+
}
|
|
161
|
+
else if (siAutoCollapsableList && !this.resizeSubscription && this.items) {
|
|
162
|
+
this.setupResizeListener();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
if (changes.containerElement) {
|
|
166
|
+
this.containerElementSubject.next(this.containerElement() ?? this.elementRef.nativeElement);
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
ngOnDestroy() {
|
|
170
|
+
this.resizeSubscription?.unsubscribe();
|
|
171
|
+
this.disableInitSubscription?.unsubscribe();
|
|
172
|
+
this.containerElementSubject.complete();
|
|
173
|
+
}
|
|
174
|
+
setupResizeListener() {
|
|
175
|
+
this.disableInitSubscription?.unsubscribe();
|
|
176
|
+
const containerSize$ = this.containerElementSubject.pipe(switchMap(element => this.resizeObserverService.observe(element, 0, true, true)), map(size => size.width), distinctUntilChanged(), map(size => {
|
|
177
|
+
const { paddingInlineStart, paddingInlineEnd } = getComputedStyle(this.containerElement() ?? this.elementRef.nativeElement);
|
|
178
|
+
return size - parseFloat(paddingInlineStart) - parseFloat(paddingInlineEnd);
|
|
179
|
+
}));
|
|
180
|
+
const itemSizes$ = this.items.changes.pipe(startWith(this.items), switchMap((items) => !items.length
|
|
181
|
+
? of([])
|
|
182
|
+
: combineLatest(items.map(item => item.size$.pipe(map(size => ({
|
|
183
|
+
size,
|
|
184
|
+
directive: item
|
|
185
|
+
})))))));
|
|
186
|
+
const additionalContentSizes$ = this.additionalContent.changes.pipe(startWith(this.additionalContent), switchMap((additionalContent) => combineLatest(additionalContent.map(item => item.size$))), startWith([]));
|
|
187
|
+
this.resizeSubscription = combineLatest([
|
|
188
|
+
containerSize$,
|
|
189
|
+
this.overflowItem()?.size$ ?? of(0),
|
|
190
|
+
itemSizes$,
|
|
191
|
+
additionalContentSizes$
|
|
192
|
+
])
|
|
193
|
+
.pipe(auditTime(0))
|
|
194
|
+
.subscribe(([containerSize, overflowItemSize, items, additionalContentSizes]) => this.updateItemVisibility(containerSize, overflowItemSize, items, additionalContentSizes));
|
|
195
|
+
}
|
|
196
|
+
updateItemVisibility(containerSize, overflowItemSize, items, additionalContent) {
|
|
197
|
+
let remainingSpace = containerSize - additionalContent.reduce((a, b) => a + b, 0);
|
|
198
|
+
const itemsRemaining = items.slice();
|
|
199
|
+
const gap = this.gap() ?? this.computedGap;
|
|
200
|
+
while (remainingSpace > 0 && itemsRemaining.length) {
|
|
201
|
+
const item = itemsRemaining.shift();
|
|
202
|
+
if (remainingSpace - item.size - gap - overflowItemSize >= 0) {
|
|
203
|
+
// There is space for the item and an overflow item.
|
|
204
|
+
item.directive.canBeVisible.set(true);
|
|
205
|
+
remainingSpace -= item.size + gap;
|
|
206
|
+
}
|
|
207
|
+
else if (!itemsRemaining.length &&
|
|
208
|
+
(remainingSpace - item.size >= 0 || overflowItemSize >= item.size)) {
|
|
209
|
+
// There are no other items remaining and there is enough space or the overflow item is biggger than the current one.
|
|
210
|
+
item.directive.canBeVisible.set(true);
|
|
211
|
+
remainingSpace = 0;
|
|
212
|
+
}
|
|
213
|
+
else {
|
|
214
|
+
// There is no space for the item.
|
|
215
|
+
remainingSpace = 0;
|
|
216
|
+
item.directive.canBeVisible.set(false);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
itemsRemaining.forEach(item => item.directive.canBeVisible.set(false));
|
|
220
|
+
const overflowItem = this.overflowItem();
|
|
221
|
+
if (overflowItem) {
|
|
222
|
+
overflowItem.hiddenItemCount = this.items.filter(item => !item.canBeVisible()).length;
|
|
223
|
+
overflowItem.canBeVisible.set(overflowItem.hiddenItemCount !== 0);
|
|
224
|
+
}
|
|
225
|
+
this.changeDetectorRef.markForCheck();
|
|
226
|
+
}
|
|
227
|
+
reset() {
|
|
228
|
+
this.resizeSubscription?.unsubscribe();
|
|
229
|
+
this.resizeSubscription = undefined;
|
|
230
|
+
this.disableInitSubscription = this.items.changes.subscribe((items) => queueMicrotask(() => {
|
|
231
|
+
items.forEach(item => item.canBeVisible.set(true));
|
|
232
|
+
}));
|
|
233
|
+
this.items.notifyOnChanges();
|
|
234
|
+
const overflowItem = this.overflowItem();
|
|
235
|
+
if (overflowItem) {
|
|
236
|
+
queueMicrotask(() => {
|
|
237
|
+
overflowItem.canBeVisible.set(false);
|
|
238
|
+
overflowItem.hiddenItemCount = 0;
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
readGapSize() {
|
|
243
|
+
const { gap } = getComputedStyle(this.containerElement() ?? this.elementRef.nativeElement);
|
|
244
|
+
if (gap.endsWith('px') || gap === '0') {
|
|
245
|
+
this.computedGap = parseFloat(gap);
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListDirective, deps: [], target: i0.ɵɵFactoryTarget.Directive });
|
|
249
|
+
static ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.2.0", version: "19.0.6", type: SiAutoCollapsableListDirective, isStandalone: true, selector: "[siAutoCollapsableList]", inputs: { siAutoCollapsableList: { classPropertyName: "siAutoCollapsableList", publicName: "siAutoCollapsableList", isSignal: true, isRequired: false, transformFunction: null }, gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, containerElement: { classPropertyName: "containerElement", publicName: "siAutoCollapsableListContainerElement", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "style.overflow": "siAutoCollapsableList() ? \"hidden\" : \"\"" }, styleAttribute: "position: relative" }, queries: [{ propertyName: "overflowItem", first: true, predicate: SiAutoCollapsableListOverflowItemDirective, descendants: true, isSignal: true }, { propertyName: "items", predicate: SiAutoCollapsableListItemDirective }, { propertyName: "additionalContent", predicate: SiAutoCollapsableListAdditionalContentDirective }], exportAs: ["siAutoCollapsableList"], usesOnChanges: true, ngImport: i0 });
|
|
250
|
+
}
|
|
251
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListDirective, decorators: [{
|
|
252
|
+
type: Directive,
|
|
253
|
+
args: [{
|
|
254
|
+
selector: '[siAutoCollapsableList]',
|
|
255
|
+
exportAs: 'siAutoCollapsableList',
|
|
256
|
+
host: {
|
|
257
|
+
style: 'position: relative',
|
|
258
|
+
'[style.overflow]': 'siAutoCollapsableList() ? "hidden" : ""'
|
|
259
|
+
}
|
|
260
|
+
}]
|
|
261
|
+
}], propDecorators: { items: [{
|
|
262
|
+
type: ContentChildren,
|
|
263
|
+
args: [SiAutoCollapsableListItemDirective]
|
|
264
|
+
}], additionalContent: [{
|
|
265
|
+
type: ContentChildren,
|
|
266
|
+
args: [SiAutoCollapsableListAdditionalContentDirective]
|
|
267
|
+
}] } });
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Copyright Siemens 2016 - 2025.
|
|
271
|
+
* SPDX-License-Identifier: MIT
|
|
272
|
+
*/
|
|
273
|
+
class SiAutoCollapsableListModule {
|
|
274
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule });
|
|
275
|
+
static ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListModule, imports: [SiAutoCollapsableListAdditionalContentDirective,
|
|
276
|
+
SiAutoCollapsableListDirective,
|
|
277
|
+
SiAutoCollapsableListItemDirective,
|
|
278
|
+
SiAutoCollapsableListOverflowItemDirective], exports: [SiAutoCollapsableListAdditionalContentDirective,
|
|
279
|
+
SiAutoCollapsableListDirective,
|
|
280
|
+
SiAutoCollapsableListItemDirective,
|
|
281
|
+
SiAutoCollapsableListOverflowItemDirective] });
|
|
282
|
+
static ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListModule });
|
|
283
|
+
}
|
|
284
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiAutoCollapsableListModule, decorators: [{
|
|
285
|
+
type: NgModule,
|
|
286
|
+
args: [{
|
|
287
|
+
imports: [
|
|
288
|
+
SiAutoCollapsableListAdditionalContentDirective,
|
|
289
|
+
SiAutoCollapsableListDirective,
|
|
290
|
+
SiAutoCollapsableListItemDirective,
|
|
291
|
+
SiAutoCollapsableListOverflowItemDirective
|
|
292
|
+
],
|
|
293
|
+
exports: [
|
|
294
|
+
SiAutoCollapsableListAdditionalContentDirective,
|
|
295
|
+
SiAutoCollapsableListDirective,
|
|
296
|
+
SiAutoCollapsableListItemDirective,
|
|
297
|
+
SiAutoCollapsableListOverflowItemDirective
|
|
298
|
+
]
|
|
299
|
+
}]
|
|
300
|
+
}] });
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Copyright Siemens 2016 - 2025.
|
|
304
|
+
* SPDX-License-Identifier: MIT
|
|
305
|
+
*/
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Generated bundle index. Do not edit.
|
|
309
|
+
*/
|
|
310
|
+
|
|
311
|
+
export { SiAutoCollapsableListAdditionalContentDirective, SiAutoCollapsableListDirective, SiAutoCollapsableListItemDirective, SiAutoCollapsableListMeasurable, SiAutoCollapsableListModule, SiAutoCollapsableListOverflowItemDirective };
|
|
312
|
+
//# sourceMappingURL=siemens-element-ng-auto-collapsable-list.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-auto-collapsable-list.mjs","sources":["../../../../projects/element-ng/auto-collapsable-list/si-auto-collapsable-list-measurable.class.ts","../../../../projects/element-ng/auto-collapsable-list/si-auto-collapsable-list-item.directive.ts","../../../../projects/element-ng/auto-collapsable-list/si-auto-collapsable-list-additional-content.directive.ts","../../../../projects/element-ng/auto-collapsable-list/si-auto-collapsable-list-overflow-item.directive.ts","../../../../projects/element-ng/auto-collapsable-list/si-auto-collapsable-list.directive.ts","../../../../projects/element-ng/auto-collapsable-list/si-auto-collapsable-list.module.ts","../../../../projects/element-ng/auto-collapsable-list/index.ts","../../../../projects/element-ng/auto-collapsable-list/siemens-element-ng-auto-collapsable-list.ts"],"sourcesContent":["/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { AfterViewInit, Directive, ElementRef, inject } from '@angular/core';\nimport { ResizeObserverService } from '@siemens/element-ng/resize-observer';\nimport { Observable } from 'rxjs';\nimport { distinctUntilChanged, map, shareReplay } from 'rxjs/operators';\n\n@Directive()\nexport class SiAutoCollapsableListMeasurable implements AfterViewInit {\n /** Emits on element width changes. */\n size$!: Observable<number>;\n\n protected readonly elementRef = inject(ElementRef<HTMLElement>);\n private readonly resizeObserverService = inject(ResizeObserverService);\n\n ngAfterViewInit(): void {\n this.size$ = this.resizeObserverService\n .observe(this.elementRef.nativeElement, 0, true, true)\n .pipe(\n map(size => size.width),\n distinctUntilChanged(),\n shareReplay(1)\n );\n }\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { AfterViewInit, booleanAttribute, computed, Directive, input, signal } from '@angular/core';\n\nimport { SiAutoCollapsableListMeasurable } from './si-auto-collapsable-list-measurable.class';\n\n@Directive({\n selector: '[siAutoCollapsableListItem]',\n exportAs: 'siAutoCollapsableListItem',\n host: {\n '[style.visibility]': 'isVisible() ? \"visible\" : \"hidden\"',\n '[style.position]': 'isVisible() ? \"\" : \"absolute\"',\n // Ensure hidden items are behind the visible ones. Otherwise, the visible ones are not clickable\n '[style.z-index]': 'isVisible() ? \"\" : \"-1\"'\n }\n})\nexport class SiAutoCollapsableListItemDirective\n extends SiAutoCollapsableListMeasurable\n implements AfterViewInit\n{\n /**\n * Hide this item even if enough space is available.\n * When calculating the overall available size, this item is still considered when forceHide=true\n *\n * @defaultValue false\n */\n readonly forceHide = input(false, { transform: booleanAttribute });\n\n /**\n * True if enough space is available for this item.\n *\n * @defaultValue false\n */\n readonly canBeVisible = signal<boolean>(false);\n\n /**\n * True if this item is actually visible to the user\n */\n readonly isVisible = computed(() => this.canBeVisible() && !this.forceHide());\n\n override ngAfterViewInit(): void {\n if (getComputedStyle(this.elementRef.nativeElement).display === 'inline') {\n console.error('siAutoCollapsibleListItem does not work on items with display=\"inline\"');\n }\n super.ngAfterViewInit();\n }\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { Directive } from '@angular/core';\n\nimport { SiAutoCollapsableListMeasurable } from './si-auto-collapsable-list-measurable.class';\n\n@Directive({\n selector: '[siAutoCollapsableListAdditionalContent]'\n})\nexport class SiAutoCollapsableListAdditionalContentDirective extends SiAutoCollapsableListMeasurable {}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { Directive } from '@angular/core';\n\nimport { SiAutoCollapsableListItemDirective } from './si-auto-collapsable-list-item.directive';\n\n@Directive({\n selector: '[siAutoCollapsableListOverflowItem]',\n exportAs: 'siAutoCollapsableListOverflowItem'\n})\nexport class SiAutoCollapsableListOverflowItemDirective extends SiAutoCollapsableListItemDirective {\n /**\n * Number of hidden items.\n *\n * @defaultValue 0\n */\n hiddenItemCount = 0;\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport {\n AfterViewInit,\n booleanAttribute,\n ChangeDetectorRef,\n contentChild,\n ContentChildren,\n Directive,\n ElementRef,\n inject,\n input,\n OnChanges,\n OnDestroy,\n QueryList,\n SimpleChanges\n} from '@angular/core';\nimport { ResizeObserverService } from '@siemens/element-ng/resize-observer';\nimport { BehaviorSubject, combineLatest, of, Subscription } from 'rxjs';\nimport { auditTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators';\n\nimport { SiAutoCollapsableListAdditionalContentDirective } from './si-auto-collapsable-list-additional-content.directive';\nimport { SiAutoCollapsableListItemDirective } from './si-auto-collapsable-list-item.directive';\nimport { SiAutoCollapsableListOverflowItemDirective } from './si-auto-collapsable-list-overflow-item.directive';\n\n@Directive({\n selector: '[siAutoCollapsableList]',\n exportAs: 'siAutoCollapsableList',\n host: {\n style: 'position: relative',\n '[style.overflow]': 'siAutoCollapsableList() ? \"hidden\" : \"\"'\n }\n})\nexport class SiAutoCollapsableListDirective implements AfterViewInit, OnChanges, OnDestroy {\n /**\n * The items which are displayed in the siAutoCollapsableList.\n */\n @ContentChildren(SiAutoCollapsableListItemDirective)\n items!: QueryList<SiAutoCollapsableListItemDirective>;\n\n private readonly overflowItem = contentChild(SiAutoCollapsableListOverflowItemDirective);\n\n @ContentChildren(SiAutoCollapsableListAdditionalContentDirective)\n private additionalContent!: QueryList<SiAutoCollapsableListAdditionalContentDirective>;\n\n /** @defaultValue true */\n readonly siAutoCollapsableList = input(true, { transform: booleanAttribute });\n\n /**\n * The (flex) gap in pixels, will automatically be set if a pixel value is used in CSS.\n */\n readonly gap = input<number>();\n\n /**\n * The element which size is available for the content of the siAutoCollapsableList.\n *\n * @defaultValue undefined\n */\n readonly containerElement = input<HTMLElement | undefined | null>(undefined, {\n alias: 'siAutoCollapsableListContainerElement'\n });\n\n private resizeSubscription?: Subscription;\n private disableInitSubscription?: Subscription;\n private readonly elementRef = inject(ElementRef);\n private readonly resizeObserverService = inject(ResizeObserverService);\n private readonly changeDetectorRef = inject(ChangeDetectorRef);\n private readonly containerElementSubject = new BehaviorSubject<HTMLElement | null>(\n this.elementRef.nativeElement\n );\n\n /**\n * The same as {@link gap}, but automatically read from the computed styles.\n * Used if not set by user.\n */\n private computedGap = 0;\n\n ngAfterViewInit(): void {\n if (this.siAutoCollapsableList()) {\n this.readGapSize();\n this.setupResizeListener();\n } else {\n this.reset();\n }\n }\n\n ngOnChanges(changes: SimpleChanges): void {\n if (changes.siAutoCollapsableList) {\n const siAutoCollapsableList = this.siAutoCollapsableList();\n if (!siAutoCollapsableList && this.resizeSubscription) {\n this.reset();\n } else if (siAutoCollapsableList && !this.resizeSubscription && this.items) {\n this.setupResizeListener();\n }\n }\n\n if (changes.containerElement) {\n this.containerElementSubject.next(this.containerElement() ?? this.elementRef.nativeElement);\n }\n }\n\n ngOnDestroy(): void {\n this.resizeSubscription?.unsubscribe();\n this.disableInitSubscription?.unsubscribe();\n this.containerElementSubject.complete();\n }\n\n private setupResizeListener(): void {\n this.disableInitSubscription?.unsubscribe();\n const containerSize$ = this.containerElementSubject.pipe(\n switchMap(element => this.resizeObserverService.observe(element!, 0, true, true)),\n map(size => size.width),\n distinctUntilChanged(),\n map(size => {\n const { paddingInlineStart, paddingInlineEnd } = getComputedStyle(\n this.containerElement() ?? this.elementRef.nativeElement\n );\n return size - parseFloat(paddingInlineStart) - parseFloat(paddingInlineEnd);\n })\n );\n\n const itemSizes$ = this.items.changes.pipe(\n startWith(this.items),\n switchMap((items: QueryList<SiAutoCollapsableListItemDirective>) =>\n !items.length\n ? of([])\n : combineLatest(\n items.map(item =>\n item.size$.pipe(\n map(size => ({\n size,\n directive: item\n }))\n )\n )\n )\n )\n );\n const additionalContentSizes$ = this.additionalContent.changes.pipe(\n startWith(this.additionalContent),\n switchMap((additionalContent: QueryList<SiAutoCollapsableListAdditionalContentDirective>) =>\n combineLatest(additionalContent.map(item => item.size$))\n ),\n startWith([])\n );\n\n this.resizeSubscription = combineLatest([\n containerSize$,\n this.overflowItem()?.size$ ?? of(0),\n itemSizes$,\n additionalContentSizes$\n ])\n .pipe(auditTime(0))\n .subscribe(([containerSize, overflowItemSize, items, additionalContentSizes]) =>\n this.updateItemVisibility(containerSize, overflowItemSize, items, additionalContentSizes)\n );\n }\n\n private updateItemVisibility(\n containerSize: number,\n overflowItemSize: number,\n items: { size: number; directive: SiAutoCollapsableListItemDirective }[],\n additionalContent: number[]\n ): void {\n let remainingSpace = containerSize - additionalContent.reduce((a, b) => a + b, 0);\n\n const itemsRemaining = items.slice();\n\n const gap = this.gap() ?? this.computedGap;\n\n while (remainingSpace > 0 && itemsRemaining.length) {\n const item = itemsRemaining.shift()!;\n if (remainingSpace - item.size - gap - overflowItemSize >= 0) {\n // There is space for the item and an overflow item.\n item.directive.canBeVisible.set(true);\n remainingSpace -= item.size + gap;\n } else if (\n !itemsRemaining.length &&\n (remainingSpace - item.size >= 0 || overflowItemSize >= item.size)\n ) {\n // There are no other items remaining and there is enough space or the overflow item is biggger than the current one.\n item.directive.canBeVisible.set(true);\n remainingSpace = 0;\n } else {\n // There is no space for the item.\n remainingSpace = 0;\n item.directive.canBeVisible.set(false);\n }\n }\n itemsRemaining.forEach(item => item.directive.canBeVisible.set(false));\n\n const overflowItem = this.overflowItem();\n if (overflowItem) {\n overflowItem.hiddenItemCount = this.items.filter(item => !item.canBeVisible()).length;\n overflowItem.canBeVisible.set(overflowItem.hiddenItemCount !== 0);\n }\n this.changeDetectorRef.markForCheck();\n }\n\n private reset(): void {\n this.resizeSubscription?.unsubscribe();\n this.resizeSubscription = undefined;\n this.disableInitSubscription = this.items.changes.subscribe(\n (items: QueryList<SiAutoCollapsableListItemDirective>) =>\n queueMicrotask(() => {\n items.forEach(item => item.canBeVisible.set(true));\n })\n );\n this.items.notifyOnChanges();\n\n const overflowItem = this.overflowItem();\n if (overflowItem) {\n queueMicrotask(() => {\n overflowItem!.canBeVisible.set(false);\n overflowItem!.hiddenItemCount = 0;\n });\n }\n }\n\n private readGapSize(): void {\n const { gap } = getComputedStyle(this.containerElement() ?? this.elementRef.nativeElement);\n if (gap.endsWith('px') || gap === '0') {\n this.computedGap = parseFloat(gap);\n }\n }\n}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { NgModule } from '@angular/core';\n\nimport { SiAutoCollapsableListAdditionalContentDirective } from './si-auto-collapsable-list-additional-content.directive';\nimport { SiAutoCollapsableListItemDirective } from './si-auto-collapsable-list-item.directive';\nimport { SiAutoCollapsableListOverflowItemDirective } from './si-auto-collapsable-list-overflow-item.directive';\nimport { SiAutoCollapsableListDirective } from './si-auto-collapsable-list.directive';\n\n@NgModule({\n imports: [\n SiAutoCollapsableListAdditionalContentDirective,\n SiAutoCollapsableListDirective,\n SiAutoCollapsableListItemDirective,\n SiAutoCollapsableListOverflowItemDirective\n ],\n exports: [\n SiAutoCollapsableListAdditionalContentDirective,\n SiAutoCollapsableListDirective,\n SiAutoCollapsableListItemDirective,\n SiAutoCollapsableListOverflowItemDirective\n ]\n})\nexport class SiAutoCollapsableListModule {}\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-auto-collapsable-list-item.directive';\nexport * from './si-auto-collapsable-list.directive';\nexport * from './si-auto-collapsable-list-overflow-item.directive';\nexport * from './si-auto-collapsable-list-measurable.class';\nexport * from './si-auto-collapsable-list-additional-content.directive';\nexport * from './si-auto-collapsable-list.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;AAAA;;;AAGG;MAOU,+BAA+B,CAAA;;AAE1C,IAAA,KAAK;AAEc,IAAA,UAAU,GAAG,MAAM,EAAC,UAAuB,EAAC;AAC9C,IAAA,qBAAqB,GAAG,MAAM,CAAC,qBAAqB,CAAC;IAEtE,eAAe,GAAA;AACb,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;AACf,aAAA,OAAO,CAAC,IAAI,C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iB,EAAA,CAAA;sBADxB,eAAe;uBAAC,+CAA+C;;;AC5ClE;;;AAGG;MAsBU,2BAA2B,CAAA;uGAA3B,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,QAAA,EAAA,CAAA;AAA3B,IAAA,OAAA,IAAA,GAAA,EAAA,CAAA,mBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,YAZpC,+CAA+C;YAC/C,8BAA8B;YAC9B,kCAAkC;AAClC,YAAA,0CAA0C,aAG1C,+CAA+C;YAC/C,8BAA8B;YAC9B,kCAAkC;YAClC,0CAA0C,CAAA,EAAA,CAAA;wGAGjC,2BAA2B,EAAA,CAAA;;2FAA3B,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBAdvC,QAAQ;AAAC,YAAA,IAAA,EAAA,CAAA;AACR,oBAAA,OAAO,EAAE;wBACP,+CAA+C;wBAC/C,8BAA8B;wBAC9B,kCAAkC;wBAClC;AACD,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP,+CAA+C;wBAC/C,8BAA8B;wBAC9B,kCAAkC;wBAClC;AACD;AACF,iBAAA;;;ACxBD;;;AAGG;;ACHH;;AAEG;;;;"}
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';
|
|
2
|
+
import * as i0 from '@angular/core';
|
|
3
|
+
import { input, model, booleanAttribute, viewChild, signal, computed, ChangeDetectionStrategy, Component } from '@angular/core';
|
|
4
|
+
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
5
|
+
import { isRTL } from '@siemens/element-ng/common';
|
|
6
|
+
import { addIcons, elementOk, SiIconNextComponent } from '@siemens/element-ng/icon';
|
|
7
|
+
import * as i1 from '@siemens/element-translate-ng/translate';
|
|
8
|
+
import { SiTranslateModule } from '@siemens/element-translate-ng/translate';
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Copyright Siemens 2016 - 2025.
|
|
12
|
+
* SPDX-License-Identifier: MIT
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* The Element data color palette is used as default.
|
|
16
|
+
* Note: This array needs to be kept in sync with the design system data color tokens.
|
|
17
|
+
*/
|
|
18
|
+
const defaultDataColors = [
|
|
19
|
+
'element-data-1',
|
|
20
|
+
'element-data-2',
|
|
21
|
+
'element-data-3',
|
|
22
|
+
'element-data-4',
|
|
23
|
+
'element-data-5',
|
|
24
|
+
'element-data-6',
|
|
25
|
+
'element-data-7',
|
|
26
|
+
'element-data-8',
|
|
27
|
+
'element-data-9',
|
|
28
|
+
'element-data-10',
|
|
29
|
+
'element-data-11',
|
|
30
|
+
'element-data-12',
|
|
31
|
+
'element-data-13',
|
|
32
|
+
'element-data-14',
|
|
33
|
+
'element-data-15',
|
|
34
|
+
'element-data-16'
|
|
35
|
+
];
|
|
36
|
+
class SiColorPickerComponent {
|
|
37
|
+
// eslint-disable-next-line defaultValue/tsdoc-defaultValue-annotation
|
|
38
|
+
/**
|
|
39
|
+
* The color palette to choose the colors from. As colors, only valid CSS
|
|
40
|
+
* variable names omitting the `--` prefix or Element color tokens omitting
|
|
41
|
+
* the `$` prefix are supported.
|
|
42
|
+
*
|
|
43
|
+
* Note: If custom CSS variables are provided, they need to be defined for
|
|
44
|
+
* both light and dark mode.
|
|
45
|
+
*
|
|
46
|
+
* @defaultValue The first 16 colors of the Element data color palette.
|
|
47
|
+
*/
|
|
48
|
+
colorPalette = input(defaultDataColors);
|
|
49
|
+
/**
|
|
50
|
+
* The selected color.
|
|
51
|
+
*/
|
|
52
|
+
color = model();
|
|
53
|
+
/**
|
|
54
|
+
* Specifies whether the color popup should automatically close on a color selection.
|
|
55
|
+
*
|
|
56
|
+
* @defaultValue false
|
|
57
|
+
*/
|
|
58
|
+
autoClose = input(false, { transform: booleanAttribute });
|
|
59
|
+
/**
|
|
60
|
+
* Specifies whether the color picker component is disabled.
|
|
61
|
+
*
|
|
62
|
+
* @defaultValue false
|
|
63
|
+
*/
|
|
64
|
+
// eslint-disable-next-line @angular-eslint/no-input-rename
|
|
65
|
+
disabledInput = input(false, { alias: 'disabled' });
|
|
66
|
+
/**
|
|
67
|
+
* Aria label for the color input button.
|
|
68
|
+
*/
|
|
69
|
+
ariaLabel = input();
|
|
70
|
+
onChange = () => { };
|
|
71
|
+
onTouched = () => { };
|
|
72
|
+
colorInputRef = viewChild.required('colorInputBox');
|
|
73
|
+
colorPaletteRef = viewChild('colorPaletteRef');
|
|
74
|
+
disabledNgControl = signal(false);
|
|
75
|
+
numberOfColumns = 4;
|
|
76
|
+
disabled = computed(() => this.disabledInput() || this.disabledNgControl());
|
|
77
|
+
isOverlayOpen = signal(false);
|
|
78
|
+
icons = addIcons({ elementOk });
|
|
79
|
+
blur() {
|
|
80
|
+
if (!this.autoClose()) {
|
|
81
|
+
this.onTouched();
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
arrowDown(index, event) {
|
|
85
|
+
const nextIndex = index + this.numberOfColumns;
|
|
86
|
+
this.focusLabel(nextIndex);
|
|
87
|
+
event.preventDefault();
|
|
88
|
+
}
|
|
89
|
+
arrowUp(index, event) {
|
|
90
|
+
const prevIndex = index - this.numberOfColumns;
|
|
91
|
+
this.focusLabel(prevIndex);
|
|
92
|
+
event.preventDefault();
|
|
93
|
+
}
|
|
94
|
+
arrowLeft(index, event) {
|
|
95
|
+
const prevIndex = index + (isRTL() ? 1 : -1);
|
|
96
|
+
this.focusLabel(prevIndex);
|
|
97
|
+
event.preventDefault();
|
|
98
|
+
}
|
|
99
|
+
arrowRight(index, event) {
|
|
100
|
+
const prevIndex = index + (isRTL() ? -1 : +1);
|
|
101
|
+
this.focusLabel(prevIndex);
|
|
102
|
+
event.preventDefault();
|
|
103
|
+
}
|
|
104
|
+
focusLabel(index) {
|
|
105
|
+
const labels = this.colorPaletteRef().nativeElement.querySelectorAll('input');
|
|
106
|
+
const totalSwatches = labels.length;
|
|
107
|
+
const normalizedIndex = (index + totalSwatches) % totalSwatches;
|
|
108
|
+
labels[normalizedIndex].focus();
|
|
109
|
+
}
|
|
110
|
+
openOverlay() {
|
|
111
|
+
this.isOverlayOpen.set(true);
|
|
112
|
+
this.focusSelectedColor();
|
|
113
|
+
}
|
|
114
|
+
overlayDetach() {
|
|
115
|
+
this.isOverlayOpen.set(false);
|
|
116
|
+
setTimeout(() => {
|
|
117
|
+
this.colorInputRef().nativeElement?.focus();
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
focusSelectedColor() {
|
|
121
|
+
setTimeout(() => {
|
|
122
|
+
this.colorPaletteRef()
|
|
123
|
+
?.nativeElement.querySelector('input:checked')
|
|
124
|
+
?.focus();
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
selectColor(color) {
|
|
128
|
+
this.color.set(color);
|
|
129
|
+
this.onChange(color);
|
|
130
|
+
if (this.autoClose()) {
|
|
131
|
+
this.overlayDetach();
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
writeValue(value) {
|
|
135
|
+
this.color.set(value);
|
|
136
|
+
}
|
|
137
|
+
registerOnChange(fn) {
|
|
138
|
+
this.onChange = fn;
|
|
139
|
+
}
|
|
140
|
+
registerOnTouched(fn) {
|
|
141
|
+
this.onTouched = fn;
|
|
142
|
+
}
|
|
143
|
+
setDisabledState(isDisabled) {
|
|
144
|
+
this.disabledNgControl.set(isDisabled);
|
|
145
|
+
}
|
|
146
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColorPickerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
147
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.0.6", type: SiColorPickerComponent, isStandalone: true, selector: "si-color-picker", inputs: { colorPalette: { classPropertyName: "colorPalette", publicName: "colorPalette", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, autoClose: { classPropertyName: "autoClose", publicName: "autoClose", isSignal: true, isRequired: false, transformFunction: null }, disabledInput: { classPropertyName: "disabledInput", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { color: "colorChange" }, providers: [
|
|
148
|
+
{
|
|
149
|
+
provide: NG_VALUE_ACCESSOR,
|
|
150
|
+
useExisting: SiColorPickerComponent,
|
|
151
|
+
multi: true
|
|
152
|
+
}
|
|
153
|
+
], viewQueries: [{ propertyName: "colorInputRef", first: true, predicate: ["colorInputBox"], descendants: true, isSignal: true }, { propertyName: "colorPaletteRef", first: true, predicate: ["colorPaletteRef"], descendants: true, isSignal: true }], ngImport: i0, template: "<button\n #colorInputBox\n #trigger=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"input-color-box\"\n type=\"button\"\n [class.is-open]=\"isOverlayOpen()\"\n [attr.aria-label]=\"(ariaLabel() | translate) + ' ' + color()\"\n [disabled]=\"disabled()\"\n (keydown.arrowDown)=\"openOverlay()\"\n (blur)=\"blur()\"\n (click)=\"openOverlay()\"\n>\n <div class=\"inside-box\" [style.background-color]=\"'var(--' + color() + ')'\"></div>\n</button>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isOverlayOpen()\"\n [cdkConnectedOverlayFlexibleDimensions]=\"true\"\n (backdropClick)=\"overlayDetach()\"\n (detach)=\"overlayDetach()\"\n>\n <div #colorPaletteRef role=\"grid\" class=\"colors elevation-1 rounded-2 bg-base-1 p-4 mt-1\">\n <div role=\"row\" class=\"d-flex flex-wrap gap-4\">\n @for (paint of colorPalette(); track $index) {\n <div role=\"gridcell\" class=\"swatch\">\n <input\n type=\"radio\"\n name=\"color\"\n class=\"btn-check\"\n [id]=\"paint\"\n [attr.aria-label]=\"paint\"\n [value]=\"paint\"\n [checked]=\"color() === paint\"\n (change)=\"selectColor(paint)\"\n (keydown.enter)=\"selectColor(paint)\"\n (keydown.arrowUp)=\"arrowUp($index, $event)\"\n (keydown.arrowDown)=\"arrowDown($index, $event)\"\n (keydown.arrowLeft)=\"arrowLeft($index, $event)\"\n (keydown.arrowRight)=\"arrowRight($index, $event)\"\n (keydown.tab)=\"overlayDetach()\"\n />\n <label\n class=\"color-box swatch-label\"\n [attr.for]=\"paint\"\n [style.background]=\"'var(--' + paint + ')'\"\n >\n @if (color() === paint) {\n <si-icon-next class=\"icon text-inverse\" [icon]=\"icons.elementOk\" />\n }\n </label>\n </div>\n }\n </div>\n </div>\n</ng-template>\n", styles: [".color-box{position:relative;block-size:24px;inline-size:24px}input:focus~.color-box{outline:var(--element-button-focus-width) solid var(--element-focus-default);outline-offset:var(--element-button-focus-overlay-width)}.input-color-box{cursor:pointer;position:relative;block-size:32px;inline-size:32px;padding:7px;border-radius:var(--element-radius-1);border-width:1px;border-style:solid;border-color:var(--element-ui-2);background-color:var(--element-base-1)}.input-color-box:hover{border-color:var(--element-ui-1)}.input-color-box:not(:hover){border-color:var(--element-ui-2)}.input-color-box:not(:hover).is-open{border-color:var(--element-ui-1)}.input-color-box:disabled{cursor:default;border-color:var(--element-ui-3)}.swatch{block-size:24px}.swatch-label{cursor:pointer}.swatch-label:hover{box-shadow:0 0 0 1px var(--element-button-focus-overlay-color),0 0 0 2px var(--element-ui-3)}.inside-box{block-size:16px;inline-size:16px}.colors{cursor:pointer;inline-size:136px;min-block-size:40px}\n"], dependencies: [{ kind: "component", type: SiIconNextComponent, selector: "si-icon-next", inputs: ["icon"] }, { kind: "ngmodule", type: SiTranslateModule }, { kind: "pipe", type: i1.SiTranslatePipe, name: "translate" }, { kind: "directive", type: CdkConnectedOverlay, selector: "[cdk-connected-overlay], [connected-overlay], [cdkConnectedOverlay]", inputs: ["cdkConnectedOverlayOrigin", "cdkConnectedOverlayPositions", "cdkConnectedOverlayPositionStrategy", "cdkConnectedOverlayOffsetX", "cdkConnectedOverlayOffsetY", "cdkConnectedOverlayWidth", "cdkConnectedOverlayHeight", "cdkConnectedOverlayMinWidth", "cdkConnectedOverlayMinHeight", "cdkConnectedOverlayBackdropClass", "cdkConnectedOverlayPanelClass", "cdkConnectedOverlayViewportMargin", "cdkConnectedOverlayScrollStrategy", "cdkConnectedOverlayOpen", "cdkConnectedOverlayDisableClose", "cdkConnectedOverlayTransformOriginOn", "cdkConnectedOverlayHasBackdrop", "cdkConnectedOverlayLockPosition", "cdkConnectedOverlayFlexibleDimensions", "cdkConnectedOverlayGrowAfterOpen", "cdkConnectedOverlayPush", "cdkConnectedOverlayDisposeOnNavigation"], outputs: ["backdropClick", "positionChange", "attach", "detach", "overlayKeydown", "overlayOutsideClick"], exportAs: ["cdkConnectedOverlay"] }, { kind: "directive", type: CdkOverlayOrigin, selector: "[cdk-overlay-origin], [overlay-origin], [cdkOverlayOrigin]", exportAs: ["cdkOverlayOrigin"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
154
|
+
}
|
|
155
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: SiColorPickerComponent, decorators: [{
|
|
156
|
+
type: Component,
|
|
157
|
+
args: [{ selector: 'si-color-picker', imports: [SiIconNextComponent, SiTranslateModule, CdkConnectedOverlay, CdkOverlayOrigin], providers: [
|
|
158
|
+
{
|
|
159
|
+
provide: NG_VALUE_ACCESSOR,
|
|
160
|
+
useExisting: SiColorPickerComponent,
|
|
161
|
+
multi: true
|
|
162
|
+
}
|
|
163
|
+
], changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n #colorInputBox\n #trigger=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"input-color-box\"\n type=\"button\"\n [class.is-open]=\"isOverlayOpen()\"\n [attr.aria-label]=\"(ariaLabel() | translate) + ' ' + color()\"\n [disabled]=\"disabled()\"\n (keydown.arrowDown)=\"openOverlay()\"\n (blur)=\"blur()\"\n (click)=\"openOverlay()\"\n>\n <div class=\"inside-box\" [style.background-color]=\"'var(--' + color() + ')'\"></div>\n</button>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isOverlayOpen()\"\n [cdkConnectedOverlayFlexibleDimensions]=\"true\"\n (backdropClick)=\"overlayDetach()\"\n (detach)=\"overlayDetach()\"\n>\n <div #colorPaletteRef role=\"grid\" class=\"colors elevation-1 rounded-2 bg-base-1 p-4 mt-1\">\n <div role=\"row\" class=\"d-flex flex-wrap gap-4\">\n @for (paint of colorPalette(); track $index) {\n <div role=\"gridcell\" class=\"swatch\">\n <input\n type=\"radio\"\n name=\"color\"\n class=\"btn-check\"\n [id]=\"paint\"\n [attr.aria-label]=\"paint\"\n [value]=\"paint\"\n [checked]=\"color() === paint\"\n (change)=\"selectColor(paint)\"\n (keydown.enter)=\"selectColor(paint)\"\n (keydown.arrowUp)=\"arrowUp($index, $event)\"\n (keydown.arrowDown)=\"arrowDown($index, $event)\"\n (keydown.arrowLeft)=\"arrowLeft($index, $event)\"\n (keydown.arrowRight)=\"arrowRight($index, $event)\"\n (keydown.tab)=\"overlayDetach()\"\n />\n <label\n class=\"color-box swatch-label\"\n [attr.for]=\"paint\"\n [style.background]=\"'var(--' + paint + ')'\"\n >\n @if (color() === paint) {\n <si-icon-next class=\"icon text-inverse\" [icon]=\"icons.elementOk\" />\n }\n </label>\n </div>\n }\n </div>\n </div>\n</ng-template>\n", styles: [".color-box{position:relative;block-size:24px;inline-size:24px}input:focus~.color-box{outline:var(--element-button-focus-width) solid var(--element-focus-default);outline-offset:var(--element-button-focus-overlay-width)}.input-color-box{cursor:pointer;position:relative;block-size:32px;inline-size:32px;padding:7px;border-radius:var(--element-radius-1);border-width:1px;border-style:solid;border-color:var(--element-ui-2);background-color:var(--element-base-1)}.input-color-box:hover{border-color:var(--element-ui-1)}.input-color-box:not(:hover){border-color:var(--element-ui-2)}.input-color-box:not(:hover).is-open{border-color:var(--element-ui-1)}.input-color-box:disabled{cursor:default;border-color:var(--element-ui-3)}.swatch{block-size:24px}.swatch-label{cursor:pointer}.swatch-label:hover{box-shadow:0 0 0 1px var(--element-button-focus-overlay-color),0 0 0 2px var(--element-ui-3)}.inside-box{block-size:16px;inline-size:16px}.colors{cursor:pointer;inline-size:136px;min-block-size:40px}\n"] }]
|
|
164
|
+
}] });
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Copyright Siemens 2016 - 2025.
|
|
168
|
+
* SPDX-License-Identifier: MIT
|
|
169
|
+
*/
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Generated bundle index. Do not edit.
|
|
173
|
+
*/
|
|
174
|
+
|
|
175
|
+
export { SiColorPickerComponent };
|
|
176
|
+
//# sourceMappingURL=siemens-element-ng-color-picker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"siemens-element-ng-color-picker.mjs","sources":["../../../../projects/element-ng/color-picker/si-color-picker.component.ts","../../../../projects/element-ng/color-picker/si-color-picker.component.html","../../../../projects/element-ng/color-picker/index.ts","../../../../projects/element-ng/color-picker/siemens-element-ng-color-picker.ts"],"sourcesContent":["/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nimport { CdkConnectedOverlay, CdkOverlayOrigin } from '@angular/cdk/overlay';\nimport {\n booleanAttribute,\n ChangeDetectionStrategy,\n Component,\n computed,\n ElementRef,\n input,\n model,\n signal,\n viewChild\n} from '@angular/core';\nimport { ControlValueAccessor, NG_VALUE_ACCESSOR } from '@angular/forms';\nimport { isRTL } from '@siemens/element-ng/common';\nimport { addIcons, elementOk, SiIconNextComponent } from '@siemens/element-ng/icon';\nimport { SiTranslateModule, TranslatableString } from '@siemens/element-translate-ng/translate';\n\n/**\n * The Element data color palette is used as default.\n * Note: This array needs to be kept in sync with the design system data color tokens.\n */\nconst defaultDataColors: string[] = [\n 'element-data-1',\n 'element-data-2',\n 'element-data-3',\n 'element-data-4',\n 'element-data-5',\n 'element-data-6',\n 'element-data-7',\n 'element-data-8',\n 'element-data-9',\n 'element-data-10',\n 'element-data-11',\n 'element-data-12',\n 'element-data-13',\n 'element-data-14',\n 'element-data-15',\n 'element-data-16'\n];\n@Component({\n selector: 'si-color-picker',\n templateUrl: './si-color-picker.component.html',\n styleUrl: './si-color-picker.component.scss',\n imports: [SiIconNextComponent, SiTranslateModule, CdkConnectedOverlay, CdkOverlayOrigin],\n providers: [\n {\n provide: NG_VALUE_ACCESSOR,\n useExisting: SiColorPickerComponent,\n multi: true\n }\n ],\n changeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class SiColorPickerComponent implements ControlValueAccessor {\n // eslint-disable-next-line defaultValue/tsdoc-defaultValue-annotation\n /**\n * The color palette to choose the colors from. As colors, only valid CSS\n * variable names omitting the `--` prefix or Element color tokens omitting\n * the `$` prefix are supported.\n *\n * Note: If custom CSS variables are provided, they need to be defined for\n * both light and dark mode.\n *\n * @defaultValue The first 16 colors of the Element data color palette.\n */\n readonly colorPalette = input<string[]>(defaultDataColors);\n\n /**\n * The selected color.\n */\n readonly color = model<string>();\n\n /**\n * Specifies whether the color popup should automatically close on a color selection.\n *\n * @defaultValue false\n */\n readonly autoClose = input(false, { transform: booleanAttribute });\n\n /**\n * Specifies whether the color picker component is disabled.\n *\n * @defaultValue false\n */\n // eslint-disable-next-line @angular-eslint/no-input-rename\n readonly disabledInput = input(false, { alias: 'disabled' });\n\n /**\n * Aria label for the color input button.\n */\n readonly ariaLabel = input<TranslatableString>();\n\n private onChange: (value: string) => void = () => {};\n private onTouched: () => void = () => {};\n\n private readonly colorInputRef =\n viewChild.required<ElementRef<HTMLInputElement>>('colorInputBox');\n private readonly colorPaletteRef = viewChild<ElementRef<HTMLDivElement>>('colorPaletteRef');\n private readonly disabledNgControl = signal(false);\n private readonly numberOfColumns = 4;\n protected readonly disabled = computed(() => this.disabledInput() || this.disabledNgControl());\n protected readonly isOverlayOpen = signal(false);\n protected readonly icons = addIcons({ elementOk });\n\n protected blur(): void {\n if (!this.autoClose()) {\n this.onTouched();\n }\n }\n\n protected arrowDown(index: number, event: Event): void {\n const nextIndex = index + this.numberOfColumns;\n this.focusLabel(nextIndex);\n event.preventDefault();\n }\n\n protected arrowUp(index: number, event: Event): void {\n const prevIndex = index - this.numberOfColumns;\n this.focusLabel(prevIndex);\n event.preventDefault();\n }\n\n protected arrowLeft(index: number, event: Event): void {\n const prevIndex = index + (isRTL() ? 1 : -1);\n this.focusLabel(prevIndex);\n event.preventDefault();\n }\n\n protected arrowRight(index: number, event: Event): void {\n const prevIndex = index + (isRTL() ? -1 : +1);\n this.focusLabel(prevIndex);\n event.preventDefault();\n }\n\n private focusLabel(index: number): void {\n const labels = this.colorPaletteRef()!.nativeElement.querySelectorAll('input');\n const totalSwatches = labels.length;\n const normalizedIndex = (index + totalSwatches) % totalSwatches;\n labels[normalizedIndex].focus();\n }\n\n protected openOverlay(): void {\n this.isOverlayOpen.set(true);\n this.focusSelectedColor();\n }\n\n protected overlayDetach(): void {\n this.isOverlayOpen.set(false);\n setTimeout(() => {\n this.colorInputRef().nativeElement?.focus();\n });\n }\n\n private focusSelectedColor(): void {\n setTimeout(() => {\n this.colorPaletteRef()\n ?.nativeElement.querySelector<HTMLInputElement>('input:checked')\n ?.focus();\n });\n }\n\n protected selectColor(color: string): void {\n this.color.set(color);\n this.onChange(color!);\n if (this.autoClose()) {\n this.overlayDetach();\n }\n }\n\n writeValue(value: string): void {\n this.color.set(value);\n }\n\n registerOnChange(fn: (value: string) => void): void {\n this.onChange = fn;\n }\n\n registerOnTouched(fn: () => void): void {\n this.onTouched = fn;\n }\n\n setDisabledState(isDisabled: boolean): void {\n this.disabledNgControl.set(isDisabled);\n }\n}\n","<button\n #colorInputBox\n #trigger=\"cdkOverlayOrigin\"\n cdkOverlayOrigin\n class=\"input-color-box\"\n type=\"button\"\n [class.is-open]=\"isOverlayOpen()\"\n [attr.aria-label]=\"(ariaLabel() | translate) + ' ' + color()\"\n [disabled]=\"disabled()\"\n (keydown.arrowDown)=\"openOverlay()\"\n (blur)=\"blur()\"\n (click)=\"openOverlay()\"\n>\n <div class=\"inside-box\" [style.background-color]=\"'var(--' + color() + ')'\"></div>\n</button>\n\n<ng-template\n cdkConnectedOverlay\n cdkConnectedOverlayBackdropClass=\"cdk-overlay-transparent-backdrop\"\n [cdkConnectedOverlayHasBackdrop]=\"true\"\n [cdkConnectedOverlayOrigin]=\"trigger\"\n [cdkConnectedOverlayOpen]=\"isOverlayOpen()\"\n [cdkConnectedOverlayFlexibleDimensions]=\"true\"\n (backdropClick)=\"overlayDetach()\"\n (detach)=\"overlayDetach()\"\n>\n <div #colorPaletteRef role=\"grid\" class=\"colors elevation-1 rounded-2 bg-base-1 p-4 mt-1\">\n <div role=\"row\" class=\"d-flex flex-wrap gap-4\">\n @for (paint of colorPalette(); track $index) {\n <div role=\"gridcell\" class=\"swatch\">\n <input\n type=\"radio\"\n name=\"color\"\n class=\"btn-check\"\n [id]=\"paint\"\n [attr.aria-label]=\"paint\"\n [value]=\"paint\"\n [checked]=\"color() === paint\"\n (change)=\"selectColor(paint)\"\n (keydown.enter)=\"selectColor(paint)\"\n (keydown.arrowUp)=\"arrowUp($index, $event)\"\n (keydown.arrowDown)=\"arrowDown($index, $event)\"\n (keydown.arrowLeft)=\"arrowLeft($index, $event)\"\n (keydown.arrowRight)=\"arrowRight($index, $event)\"\n (keydown.tab)=\"overlayDetach()\"\n />\n <label\n class=\"color-box swatch-label\"\n [attr.for]=\"paint\"\n [style.background]=\"'var(--' + paint + ')'\"\n >\n @if (color() === paint) {\n <si-icon-next class=\"icon text-inverse\" [icon]=\"icons.elementOk\" />\n }\n </label>\n </div>\n }\n </div>\n </div>\n</ng-template>\n","/**\n * Copyright Siemens 2016 - 2025.\n * SPDX-License-Identifier: MIT\n */\nexport * from './si-color-picker.component';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;AAAA;;;AAGG;AAkBH;;;AAGG;AACH,MAAM,iBAAiB,GAAa;IAClC,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,gBAAgB;IAChB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB,iBAAiB;IACjB;CACD;MAeY,sBAAsB,CAAA;;AAEjC;;;;;;;;;AASG;AACM,IAAA,YAAY,GAAG,KAAK,CAAW,iBAAiB,CAAC;AAE1D;;AAEG;IACM,KAAK,GAAG,KAAK,EAAU;AAEhC;;;;AAIG;IACM,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;AAElE;;;;AAIG;;IAEM,aAAa,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,KAAK,EAAE,UAAU,EAAE,CAAC;AAE5D;;AAEG;IACM,SAAS,GAAG,KAAK,EAAsB;AAExC,IAAA,QAAQ,GAA4B,MAAK,GAAG;AAC5C,IAAA,SAAS,GAAe,MAAK,GAAG;AAEvB,IAAA,aAAa,GAC5B,SAAS,CAAC,QAAQ,CAA+B,eAAe,CAAC;AAClD,IAAA,eAAe,GAAG,SAAS,CAA6B,iBAAiB,CAAC;AAC1E,IAAA,iBAAiB,GAAG,MAAM,CAAC,KAAK,CAAC;IACjC,eAAe,GAAG,CAAC;AACjB,IAAA,QAAQ,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,aAAa,EAAE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