@eui/eds 23.0.0-alpha.11 → 23.0.0-alpha.13
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/docs/changelog.html +79 -0
- package/docs/index.html +1 -1
- package/docs/js/search/search_index.js +2 -2
- package/docs/llms.txt +1 -1
- package/docs/properties.html +1 -1
- package/fesm2022/eui-eds-charts-eds-chart-legend.mjs +6 -6
- package/fesm2022/eui-eds-charts-eds-chart.mjs +3 -3
- package/fesm2022/eui-eds-charts-eds-gauge-chart.mjs +3 -3
- package/fesm2022/eui-eds-charts-eds-geo-chart.mjs +3 -3
- package/fesm2022/eui-eds-charts-eds-sparkline.mjs +3 -3
- package/fesm2022/eui-eds-eds-accordion.mjs +9 -9
- package/fesm2022/eui-eds-eds-alert.mjs +6 -6
- package/fesm2022/eui-eds-eds-autocomplete.mjs +21 -17
- package/fesm2022/eui-eds-eds-autocomplete.mjs.map +1 -1
- package/fesm2022/eui-eds-eds-avatar.mjs +27 -27
- package/fesm2022/eui-eds-eds-badge.mjs +5 -4
- package/fesm2022/eui-eds-eds-badge.mjs.map +1 -1
- package/fesm2022/eui-eds-eds-banner.mjs +21 -21
- package/fesm2022/eui-eds-eds-block-content.mjs +3 -3
- package/fesm2022/eui-eds-eds-block-document.mjs +3 -3
- package/fesm2022/eui-eds-eds-blockquote.mjs +3 -3
- package/fesm2022/eui-eds-eds-breadcrumb.mjs +6 -6
- package/fesm2022/eui-eds-eds-button-group.mjs +3 -3
- package/fesm2022/eui-eds-eds-button.mjs +3 -3
- package/fesm2022/eui-eds-eds-calendar.mjs +33 -33
- package/fesm2022/eui-eds-eds-card.mjs +30 -30
- package/fesm2022/eui-eds-eds-carousel.mjs +6 -6
- package/fesm2022/eui-eds-eds-chip-list.mjs +9 -9
- package/fesm2022/eui-eds-eds-chip.mjs +5 -4
- package/fesm2022/eui-eds-eds-chip.mjs.map +1 -1
- package/fesm2022/eui-eds-eds-dashboard-card.mjs +72 -72
- package/fesm2022/eui-eds-eds-date-block.mjs +3 -3
- package/fesm2022/eui-eds-eds-datepicker.mjs +3 -3
- package/fesm2022/eui-eds-eds-dialog.mjs +15 -15
- package/fesm2022/eui-eds-eds-dimmer.mjs +3 -3
- package/fesm2022/eui-eds-eds-disable-content.mjs +3 -3
- package/fesm2022/eui-eds-eds-discussion-thread.mjs +6 -6
- package/fesm2022/eui-eds-eds-dropdown.mjs +9 -9
- package/fesm2022/eui-eds-eds-fab-button.mjs +6 -6
- package/fesm2022/eui-eds-eds-feedback-message.mjs +3 -3
- package/fesm2022/eui-eds-eds-fieldset.mjs +15 -15
- package/fesm2022/eui-eds-eds-file-upload.mjs +12 -12
- package/fesm2022/eui-eds-eds-growl.mjs +6 -6
- package/fesm2022/eui-eds-eds-icon-button.mjs +3 -3
- package/fesm2022/eui-eds-eds-icon-state.mjs +3 -3
- package/fesm2022/eui-eds-eds-icon-toggle.mjs +3 -3
- package/fesm2022/eui-eds-eds-icon.mjs +6 -6
- package/fesm2022/eui-eds-eds-input-button.mjs +3 -3
- package/fesm2022/eui-eds-eds-input-checkbox.mjs +3 -3
- package/fesm2022/eui-eds-eds-input-group.mjs +9 -9
- package/fesm2022/eui-eds-eds-input-icon.mjs +3 -3
- package/fesm2022/eui-eds-eds-input-number.mjs +3 -3
- package/fesm2022/eui-eds-eds-input-radio.mjs +3 -3
- package/fesm2022/eui-eds-eds-input-text.mjs +3 -3
- package/fesm2022/eui-eds-eds-label.mjs +3 -3
- package/fesm2022/eui-eds-eds-language-selector.mjs +6 -6
- package/fesm2022/eui-eds-eds-link.mjs +4 -4
- package/fesm2022/eui-eds-eds-link.mjs.map +1 -1
- package/fesm2022/eui-eds-eds-list-items.mjs +6 -6
- package/fesm2022/eui-eds-eds-menu.mjs +6 -6
- package/fesm2022/eui-eds-eds-message-box.mjs +9 -9
- package/fesm2022/eui-eds-eds-multiselect.mjs +6 -6
- package/fesm2022/eui-eds-eds-navbar.mjs +6 -6
- package/fesm2022/eui-eds-eds-overlay.mjs +21 -21
- package/fesm2022/eui-eds-eds-page.mjs +51 -51
- package/fesm2022/eui-eds-eds-paginator.mjs +3 -3
- package/fesm2022/eui-eds-eds-popover.mjs +8 -7
- package/fesm2022/eui-eds-eds-popover.mjs.map +1 -1
- package/fesm2022/eui-eds-eds-progress-bar.mjs +3 -3
- package/fesm2022/eui-eds-eds-progress-circle.mjs +3 -3
- package/fesm2022/eui-eds-eds-rating.mjs +3 -3
- package/fesm2022/eui-eds-eds-select.mjs +15 -15
- package/fesm2022/eui-eds-eds-shell.mjs +69 -69
- package/fesm2022/eui-eds-eds-skeleton.mjs +3 -3
- package/fesm2022/eui-eds-eds-slider.mjs +3 -3
- package/fesm2022/eui-eds-eds-snc.mjs +3 -3
- package/fesm2022/eui-eds-eds-split-button.mjs +3 -3
- package/fesm2022/eui-eds-eds-table.mjs +33 -33
- package/fesm2022/eui-eds-eds-tabs.mjs +39 -33
- package/fesm2022/eui-eds-eds-tabs.mjs.map +1 -1
- package/fesm2022/eui-eds-eds-tag-group.mjs +3 -3
- package/fesm2022/eui-eds-eds-tag.mjs +3 -3
- package/fesm2022/eui-eds-eds-textarea.mjs +6 -6
- package/fesm2022/eui-eds-eds-timeline.mjs +6 -6
- package/fesm2022/eui-eds-eds-timepicker.mjs +3 -3
- package/fesm2022/eui-eds-eds-toggle-group.mjs +6 -6
- package/fesm2022/eui-eds-eds-toggle.mjs +3 -3
- package/fesm2022/eui-eds-eds-tooltip.mjs +6 -6
- package/fesm2022/eui-eds-eds-tree-list.mjs +21 -21
- package/fesm2022/eui-eds-eds-tree.mjs +9 -9
- package/fesm2022/eui-eds-eds-user-profile.mjs +9 -9
- package/fesm2022/eui-eds-eds-wizard.mjs +6 -6
- package/fesm2022/eui-eds-shared.mjs +27 -27
- package/package.json +1 -1
|
@@ -32,10 +32,10 @@ class EdsChipList {
|
|
|
32
32
|
this.hostClasses = computed(() => 'eds-chip-list', /* @ts-ignore */
|
|
33
33
|
...(ngDevMode ? [{ debugName: "hostClasses" }] : /* istanbul ignore next */ []));
|
|
34
34
|
}
|
|
35
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
36
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.
|
|
35
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChipList, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
36
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.2", type: EdsChipList, isStandalone: true, selector: "eds-chip-list", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, e2eAttr: { classPropertyName: "e2eAttr", publicName: "e2eAttr", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "hostClasses()", "attr.data-e2e": "e2eAttr()" } }, ngImport: i0, template: "<div role=\"list\" [attr.aria-label]=\"ariaLabel()\" class=\"eds-chip-list__chip-container\">\n <ng-content></ng-content>\n</div>\n\n<ng-content select=\"eds-chip-list-additional-content\"></ng-content>\n\n<ng-content select=\"eds-chip-list-append-content\"></ng-content>\n", styles: ["@keyframes eds-spin{0%{transform:translateY(-50%) rotate(0)}to{transform:translateY(-50%) rotate(360deg)}}.eui-21 :host.eds-chip-list{display:flex;gap:var(--eds-sp-xs)}.eui-21 :host.eds-chip-list .eds-chip-list__chip-container{align-items:center;display:flex;flex-wrap:wrap;gap:var(--eds-sp-xs)}.eui-21 :host.eds-chip-list .eds-chip-list__chip-container:empty{display:none}.eui-21 :host.eds-chip-list eds-chip-list-additional-content:empty,.eui-21 :host.eds-chip-list eds-chip-list-append-content:empty{display:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
37
37
|
}
|
|
38
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
38
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChipList, decorators: [{
|
|
39
39
|
type: Component,
|
|
40
40
|
args: [{ selector: 'eds-chip-list', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
41
41
|
'[class]': 'hostClasses()',
|
|
@@ -50,10 +50,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
50
50
|
* Used within autocomplete-like components for flexible chip placement.
|
|
51
51
|
*/
|
|
52
52
|
class EdsChipListAppendContent {
|
|
53
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
54
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.
|
|
53
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChipListAppendContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
54
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.2", type: EdsChipListAppendContent, isStandalone: true, selector: "eds-chip-list-append-content", ngImport: i0, template: '<ng-content/>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
55
55
|
}
|
|
56
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
56
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChipListAppendContent, decorators: [{
|
|
57
57
|
type: Component,
|
|
58
58
|
args: [{
|
|
59
59
|
selector: 'eds-chip-list-append-content',
|
|
@@ -69,10 +69,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.5", ngImpor
|
|
|
69
69
|
* Used to include additional elements alongside chips without affecting semantic list structure.
|
|
70
70
|
*/
|
|
71
71
|
class EdsChipListAdditionalContent {
|
|
72
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
73
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.
|
|
72
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChipListAdditionalContent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
73
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.1.2", type: EdsChipListAdditionalContent, isStandalone: true, selector: "eds-chip-list-additional-content", ngImport: i0, template: '<ng-content/>', isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
74
74
|
}
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChipListAdditionalContent, decorators: [{
|
|
76
76
|
type: Component,
|
|
77
77
|
args: [{
|
|
78
78
|
selector: 'eds-chip-list-additional-content',
|
|
@@ -98,7 +98,8 @@ class EdsChip {
|
|
|
98
98
|
/**
|
|
99
99
|
* Icon declares by user in the chip
|
|
100
100
|
*/
|
|
101
|
-
this.chipLabel = viewChild.required('chipLabel'
|
|
101
|
+
this.chipLabel = viewChild.required('chipLabel', /* @ts-ignore */
|
|
102
|
+
...(ngDevMode ? [{ debugName: "chipLabel" }] : /* istanbul ignore next */ []));
|
|
102
103
|
this.sizeDirective = inject(EdsSizeDirective);
|
|
103
104
|
this.colorDirective = inject(EdsColorDirective);
|
|
104
105
|
this._renderer = inject(Renderer2);
|
|
@@ -177,10 +178,10 @@ class EdsChip {
|
|
|
177
178
|
onClick(event) {
|
|
178
179
|
this.chipClick.emit(this.data());
|
|
179
180
|
}
|
|
180
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.
|
|
181
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.
|
|
181
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChip, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
182
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: EdsChip, isStandalone: true, selector: "eds-chip, span[edsChip], li[edsChip]", inputs: { ariaLabel: { classPropertyName: "ariaLabel", publicName: "ariaLabel", isSignal: true, isRequired: false, transformFunction: null }, e2eAttr: { classPropertyName: "e2eAttr", publicName: "e2eAttr", isSignal: true, isRequired: false, transformFunction: null }, edsInternalId: { classPropertyName: "edsInternalId", publicName: "edsInternalId", isSignal: true, isRequired: false, transformFunction: null }, tooltipMessage: { classPropertyName: "tooltipMessage", publicName: "tooltipMessage", isSignal: true, isRequired: false, transformFunction: null }, id: { classPropertyName: "id", publicName: "id", isSignal: true, isRequired: false, transformFunction: null }, data: { classPropertyName: "data", publicName: "data", isSignal: true, isRequired: false, transformFunction: null }, isRemovable: { classPropertyName: "isRemovable", publicName: "isRemovable", isSignal: true, isRequired: false, transformFunction: null }, isActive: { classPropertyName: "isActive", publicName: "isActive", isSignal: true, isRequired: false, transformFunction: null }, edsDisabled: { classPropertyName: "edsDisabled", publicName: "edsDisabled", isSignal: false, isRequired: false, transformFunction: null } }, outputs: { chipRemove: "chipRemove", chipClick: "chipClick" }, host: { listeners: { "click": "onHostClick($event)", "keydown.enter": "onHostClick($event)", "keydown.space": "onHostKeyActivate($event)", "keydown.delete": "onKeyRemove($event)", "keydown.backspace": "onKeyRemove($event)" }, properties: { "class": "hostClasses()", "attr.tabindex": "edsDisabled ? \"-1\" : \"0\"", "attr.role": "role", "attr.aria-pressed": "isActive() ? \"true\" : null", "attr.aria-label": "ariaLabel()", "attr.data-e2e": "e2eAttr()" } }, viewQueries: [{ propertyName: "chipLabel", first: true, predicate: ["chipLabel"], descendants: true, isSignal: true }], hostDirectives: [{ directive: i1.EdsSizeDirective, inputs: ["edsSizeM", "edsSizeM", "edsSizeL", "edsSizeL", "edsSizeVariant", "edsSizeVariant"] }, { directive: i1.EdsColorDirective, inputs: ["edsNeutral", "edsNeutral", "edsSuccess", "edsSuccess", "edsInfo", "edsInfo", "edsWarning", "edsWarning", "edsCritical", "edsCritical", "edsColorVariant", "edsColorVariant"] }], ngImport: i0, template: "<div class=\"eds-chip__content\" #chipLabel>\n <ng-content></ng-content>\n</div>\n@if (isRemovable()) {\n <eds-icon ariaLabel=\"Remove {{ chipLabel.textContent }} chip\" icon=\"x:core\" edsSizeXS/>\n}\n", styles: ["@keyframes eds-spin{0%{transform:translateY(-50%) rotate(0)}to{transform:translateY(-50%) rotate(360deg)}}.eui-21 :host.eds-chip.eds-chip--size-m{--_font: var(--eds-f-paragraph-s);--_chip-padding: var(--eds-sp-4xs) var(--eds-sp-2xs);--_icon-size: var(--eds-is-s);--_height: var(--eds-sp-xl)}.eui-21 :host.eds-chip.eds-chip--size-l{--_font: var(--eds-f-paragraph-s);--_chip-padding: var(--eds-sp-3xs) var(--eds-sp-2xs);--_icon-size: var(--eds-is-m);--_height: var(--eds-sp-2xl)}.eui-21 :host.eds-chip.eds-chip{--_surface: transparent;--_on-surface: var(--eds-c-foreground-primary);--_border-color: var(--eds-c-border-primary-subtle);--_surface-hover: var(--eds-c-surface-primary-subtle);--_on-surface-hover: var(--eds-c-on-surface-primary-subtle);--_surface-active: var(--eds-c-surface-primary-subtle);--_on-surface-active: var(--eds-c-on-surface-primary-subtle)}.eui-21 :host.eds-chip.eds-chip--active{--_surface: var(--eds-c-surface-primary);--_on-surface: var(--eds-c-on-surface-primary);--_border-color: transparent;--_surface-hover: var(--eds-c-surface-primary--hover);--_on-surface-hover: var(--eds-c-on-surface-primary--hover);--_surface-active: var(--eds-c-surface-primary--pressed);--_on-surface-active: var(--eds-c-on-surface-primary--pressed)}.eui-21 :host.eds-chip.eds-chip--disabled{--_surface: var(--eds-c-surface-disabled-subtle);--_on-surface: var(--eds-c-foreground-disabled);--_border-color: var(--eds-c-border-disabled);--_surface-hover: var(--eds-c-surface-disabled-subtle);--_on-surface-hover: var(--eds-c-foreground-disabled);--_surface-active: var(--eds-c-surface-disabled-subtle);--_on-surface-active: var(--eds-c-foreground-disabled)}.eui-21 :host.eds-chip{border-radius:var(--eds-br-full);display:inline-flex;border:var(--eds-bw-xs) solid var(--_border-color);padding:var(--_chip-padding);font:var(--_font);background-color:var(--_surface);color:var(--_on-surface);height:var(--_height);cursor:pointer;gap:var(--eds-sp-2xs);align-items:center}.eui-21 :host.eds-chip:not(.eds-chip--disabled):focus-visible:not([readonly]){outline:var(--eds-bw-s) solid var(--eds-c-border-primary)!important;outline-offset:1px!important;border-radius:var(--eds-br-full)!important}.eui-21 :host.eds-chip.eds-chip--disabled{cursor:default}.eui-21 :host.eds-chip:hover{background-color:var(--_surface-hover);color:var(--_on-surface-hover)}.eui-21 :host.eds-chip:active{background-color:var(--_surface-active);color:var(--_on-surface-active)}.eui-21 :host.eds-chip .eds-chip__content{display:inline-flex;align-items:center;background:transparent;gap:var(--eds-sp-2xs)}.eui-21 :host.eds-chip .eds-chip__close{margin-left:var(--eds-sp-xs)}\n"], dependencies: [{ kind: "component", type: i2.EdsIcon, selector: "eds-icon, span[edsIcon]", inputs: ["icon", "set", "ariaLabel", "ariaHidden", "edsRounded"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
182
183
|
}
|
|
183
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.
|
|
184
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: EdsChip, decorators: [{
|
|
184
185
|
type: Component,
|
|
185
186
|
args: [{ selector: 'eds-chip, span[edsChip], li[edsChip]', changeDetection: ChangeDetectionStrategy.OnPush, imports: [
|
|
186
187
|
...EDS_ICON_BUTTON,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eui-eds-eds-chip.mjs","sources":["../../eds-chip/eds-chip.ts","../../eds-chip/eds-chip.html","../../eds-chip/models/eui-chip.model.ts","../../eds-chip/index.ts","../../eds-chip/eui-eds-eds-chip.ts"],"sourcesContent":["import {\n Component,\n Input,\n ChangeDetectionStrategy,\n AfterContentInit,\n viewChild,\n ElementRef,\n booleanAttribute,\n inject,\n input,\n output,\n computed,\n Renderer2,\n} from '@angular/core';\n\nimport { EdsColorDirective, EdsSizeDirective } from '@eui/eds/shared';\nimport { EDS_ICON_BUTTON } from '@eui/eds/eds-icon-button';\nimport { EDS_ICON } from '@eui/eds/eds-icon';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\n@Component({\n templateUrl: './eds-chip.html',\n selector: 'eds-chip, span[edsChip], li[edsChip]',\n styleUrl: './eds-chip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n ...EDS_ICON_BUTTON,\n ...EDS_ICON,\n ],\n host: {\n '[class]': 'hostClasses()',\n '[attr.tabindex]': 'edsDisabled ? \"-1\" : \"0\"',\n '[attr.role]': 'role',\n '[attr.aria-pressed]': 'isActive() ? \"true\" : null',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-e2e]': 'e2eAttr()',\n '(click)': 'onHostClick($event)',\n '(keydown.enter)': 'onHostClick($event)',\n '(keydown.space)': 'onHostKeyActivate($event)',\n '(keydown.delete)': 'onKeyRemove($event)',\n '(keydown.backspace)': 'onKeyRemove($event)',\n },\n hostDirectives: [\n {\n directive: EdsSizeDirective,\n inputs: [\n 'edsSizeM',\n 'edsSizeL',\n 'edsSizeVariant',\n ],\n },\n {\n directive: EdsColorDirective,\n inputs: [\n 'edsNeutral',\n 'edsSuccess',\n 'edsInfo',\n 'edsWarning',\n 'edsCritical',\n 'edsColorVariant',\n ],\n },\n ],\n})\nexport class EdsChip implements AfterContentInit {\n /**\n * @description\n * Computes and returns the CSS classes for the component based on its current state.\n */\n hostClasses = computed(() => {\n const sizeClass = this.sizeDirective.getCssClass('eds-chip');\n const colorClass = this.colorDirective.getCssClass('eds-chip');\n\n return [\n 'eds-chip',\n sizeClass || 'eds-chip--size-m',\n colorClass || 'eds-chip--neutral',\n this.isRemovable() ? 'eds-chip--removable' : '',\n this.isActive() ? 'eds-chip--active' : '',\n this.edsDisabled ? 'eds-chip--disabled' : '',\n ].join(' ').trim();\n });\n\n /**\n * Sets the `aria-label` attribute for the host element.\n * When not set, assistive technology will use the text content of the chip.\n *\n * @default undefined\n */\n ariaLabel = input<string | undefined>(undefined);\n\n /**\n * Sets the `role` attribute for the host element.\n * Defaults to 'button' per WAI-ARIA APG Button Pattern.\n * Overridden to 'listitem' when inside an eds-chip-list.\n *\n * @default 'button'\n */\n role = 'button';\n\n /**\n * Sets the `data-e2e` attribute for the host element.\n *\n * @default 'eds-chip'\n */\n e2eAttr = input('eds-chip');\n\n /**\n * Sets the edsInternalId of the chip.\n *\n * @default null\n */\n edsInternalId = input<string>('');\n /**\n * Sets the label of the tooltip to diaply on hover.\n */\n tooltipMessage = input<string>('');\n /**\n * Sets the id of the chip.\n */\n id = input<string | number>('');\n /**\n * Sets the data of the chip like tooltip configuration.\n */\n // TODO: type should be specific\n // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = input<any>({\n id: crypto.randomUUID(),\n tooltip: {\n color: 'edsTooltipPrimary',\n contentAlignment: null,\n position: 'above',\n },\n });\n\n /**\n * Wether the chip can be removed.\n *\n * @default false\n */\n isRemovable = input(false, { transform: booleanAttribute });\n\n isActive = input(false, { transform: booleanAttribute });\n\n /**\n * @description\n * Controls the disabled state of the button\n * When true, adds the disabled attribute and prevents interaction\n */\n @Input()\n public get edsDisabled(): boolean {\n return this._edsDisabled;\n }\n public set edsDisabled(value: BooleanInput) {\n this._edsDisabled = coerceBooleanProperty(value);\n if (this._edsDisabled) {\n this._renderer.setAttribute(this._elementRef.nativeElement, 'disabled', 'true');\n } else {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'disabled');\n }\n }\n\n /**\n * Event emitted when the chip is removed.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n chipRemove = output<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n chipClick = output<any>();\n\n /**\n * Icon declares by user in the chip\n */\n readonly chipLabel = viewChild.required<ElementRef<HTMLInputElement>>('chipLabel');\nprotected sizeDirective = inject(EdsSizeDirective);\n protected colorDirective = inject(EdsColorDirective);\n\n protected _renderer: Renderer2 = inject(Renderer2);\n private _elementRef = inject(ElementRef);\n private _edsDisabled = false;\n onHostClick(event?: Event): void {\n if (this.edsDisabled) {\n return;\n }\n\n if (this.isRemovable()) {\n this.onRemove(event);\n } else {\n this.onClick(event);\n }\n }\n\n /**\n * Handles Space key activation — prevents page scroll and triggers click.\n */\n onHostKeyActivate(event: Event): void {\n event.preventDefault();\n this.onHostClick(event);\n }\n\n /**\n * Handles Delete/Backspace key to remove chip (WAI-ARIA APG convention).\n */\n onKeyRemove(event: Event): void {\n if (this.edsDisabled || !this.isRemovable()) {\n return;\n }\n event.preventDefault();\n this.chipRemove.emit(this.data());\n }\n\n ngAfterContentInit(): void {\n if (!this.data().id && this.id()) {\n // Note: input signals are read-only, so we work with the value\n const currentData = this.data();\n Object.assign(currentData, { id: this.id() });\n }\n // checks if the parent element is an eds-chip-list to set role listitem or if a parent above in case cdkdroplist interferes\n if (this._elementRef.nativeElement.parentElement?.classList.contains('eds-chip-list__chip-container') || this._elementRef.nativeElement.parentElement?.parentElement?.classList.contains('eds-chip-list__chip-container')) {\n this.role = 'listitem';\n }\n }\n\n /**\n * Remove chip handler\n *\n * @param event Click event\n */\n private onRemove(event?: Event): void {\n if (event instanceof KeyboardEvent && (event as KeyboardEvent).code === 'Backspace') {\n this.chipRemove.emit({ chip: this.data(), event });\n } else {\n this.chipRemove.emit(this.data());\n }\n }\n\n private onClick(event?: Event): void {\n this.chipClick.emit(this.data());\n }\n}\n","<div class=\"eds-chip__content\" #chipLabel>\n <ng-content></ng-content>\n</div>\n@if (isRemovable()) {\n <eds-icon ariaLabel=\"Remove {{ chipLabel.textContent }} chip\" icon=\"x:core\" edsSizeXS/>\n}\n","export class EdsChipModel {\n id!: string | number;\n edsInternalId!: string;\n label!: string;\n isRemovable = false;\n isOutline = false;\n isRounded = false;\n isDisabled = false;\n variant: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'accent' = 'primary';\n tooltip: EdsChipTooltip = new EdsChipTooltip();\n iconClass?: string;\n iconSvgName?: string;\n\n constructor(values = {}) {\n Object.assign(this, values);\n }\n}\n\nexport class EdsChipTooltip {\n tooltipMessage!: string;\n position?: 'above' | 'below' | 'left' | 'right' | 'before' | 'after' = 'above';\n contentAlignment?: 'center' | 'left' | 'right' | 'justify' = 'center';\n delay? = 0;\n\n constructor(values = {}) {\n Object.assign(this, values);\n }\n}\n","import { EdsChip } from './eds-chip';\n\nexport * from './models/eui-chip.model';\nexport * from './eds-chip';\n\nexport const EDS_CHIP = [\n EdsChip,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAgEa,OAAO,CAAA;AA5CpB,IAAA,WAAA,GAAA;AA6CI;;;AAGG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;YACxB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC;YAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU,CAAC;YAE9D,OAAO;gBACH,UAAU;AACV,gBAAA,SAAS,IAAI,kBAAkB;AAC/B,gBAAA,UAAU,IAAI,mBAAmB;gBACjC,IAAI,CAAC,WAAW,EAAE,GAAG,qBAAqB,GAAG,EAAE;gBAC/C,IAAI,CAAC,QAAQ,EAAE,GA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,gBAAgB;AACnB,6BAAA;AACJ,yBAAA;AACD,wBAAA;AACI,4BAAA,SAAS,EAAE,iBAAiB;AAC5B,4BAAA,MAAM,EAAE;gCACJ,YAAY;gCACZ,YAAY;gCACZ,SAAS;gCACT,YAAY;gCACZ,aAAa;gCACb,iBAAiB;AACpB,6BAAA;AACJ,yBAAA;AACJ,qBAAA,EAAA,QAAA,EAAA,kNAAA,EAAA,MAAA,EAAA,CAAA,mlFAAA,CAAA,EAAA;;sBAwFA;yKAwBqE,WAAW,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;ME9KxE,YAAY,CAAA;IAarB,WAAA,CAAY,MAAM,GAAG,EAAE,EAAA;QATvB,IAAA,CAAA,WAAW,GAAG,KAAK;QACnB,IAAA,CAAA,SAAS,GAAG,KAAK;QACjB,IAAA,CAAA,SAAS,GAAG,KAAK;QACjB,IAAA,CAAA,UAAU,GAAG,KAAK;QAClB,IAAA,CAAA,OAAO,GAAmF,SAAS;AACnG,QAAA,IAAA,CAAA,OAAO,GAAmB,IAAI,cAAc,EAAE;AAK1C,QAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAC/B;AACH;MAEY,cAAc,CAAA;IAMvB,WAAA,CAAY,MAAM,GAAG,EAAE,EAAA;QAJvB,IAAA,CAAA,QAAQ,GAA+D,OAAO;QAC9E,IAAA,CAAA,gBAAgB,GAA6C,QAAQ;QACrE,IAAA,CAAA,KAAK,GAAI,CAAC;AAGN,QAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC;IAC/B;AACH;;ACtBM,MAAM,QAAQ,GAAG;IACpB,OAAO;;;ACNX;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"eui-eds-eds-chip.mjs","sources":["../../eds-chip/eds-chip.ts","../../eds-chip/eds-chip.html","../../eds-chip/models/eui-chip.model.ts","../../eds-chip/index.ts","../../eds-chip/eui-eds-eds-chip.ts"],"sourcesContent":["import {\n Component,\n Input,\n ChangeDetectionStrategy,\n AfterContentInit,\n viewChild,\n ElementRef,\n booleanAttribute,\n inject,\n input,\n output,\n computed,\n Renderer2,\n} from '@angular/core';\n\nimport { EdsColorDirective, EdsSizeDirective } from '@eui/eds/shared';\nimport { EDS_ICON_BUTTON } from '@eui/eds/eds-icon-button';\nimport { EDS_ICON } from '@eui/eds/eds-icon';\nimport { BooleanInput, coerceBooleanProperty } from '@angular/cdk/coercion';\n\n@Component({\n templateUrl: './eds-chip.html',\n selector: 'eds-chip, span[edsChip], li[edsChip]',\n styleUrl: './eds-chip.scss',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [\n ...EDS_ICON_BUTTON,\n ...EDS_ICON,\n ],\n host: {\n '[class]': 'hostClasses()',\n '[attr.tabindex]': 'edsDisabled ? \"-1\" : \"0\"',\n '[attr.role]': 'role',\n '[attr.aria-pressed]': 'isActive() ? \"true\" : null',\n '[attr.aria-label]': 'ariaLabel()',\n '[attr.data-e2e]': 'e2eAttr()',\n '(click)': 'onHostClick($event)',\n '(keydown.enter)': 'onHostClick($event)',\n '(keydown.space)': 'onHostKeyActivate($event)',\n '(keydown.delete)': 'onKeyRemove($event)',\n '(keydown.backspace)': 'onKeyRemove($event)',\n },\n hostDirectives: [\n {\n directive: EdsSizeDirective,\n inputs: [\n 'edsSizeM',\n 'edsSizeL',\n 'edsSizeVariant',\n ],\n },\n {\n directive: EdsColorDirective,\n inputs: [\n 'edsNeutral',\n 'edsSuccess',\n 'edsInfo',\n 'edsWarning',\n 'edsCritical',\n 'edsColorVariant',\n ],\n },\n ],\n})\nexport class EdsChip implements AfterContentInit {\n /**\n * @description\n * Computes and returns the CSS classes for the component based on its current state.\n */\n hostClasses = computed(() => {\n const sizeClass = this.sizeDirective.getCssClass('eds-chip');\n const colorClass = this.colorDirective.getCssClass('eds-chip');\n\n return [\n 'eds-chip',\n sizeClass || 'eds-chip--size-m',\n colorClass || 'eds-chip--neutral',\n this.isRemovable() ? 'eds-chip--removable' : '',\n this.isActive() ? 'eds-chip--active' : '',\n this.edsDisabled ? 'eds-chip--disabled' : '',\n ].join(' ').trim();\n });\n\n /**\n * Sets the `aria-label` attribute for the host element.\n * When not set, assistive technology will use the text content of the chip.\n *\n * @default undefined\n */\n ariaLabel = input<string | undefined>(undefined);\n\n /**\n * Sets the `role` attribute for the host element.\n * Defaults to 'button' per WAI-ARIA APG Button Pattern.\n * Overridden to 'listitem' when inside an eds-chip-list.\n *\n * @default 'button'\n */\n role = 'button';\n\n /**\n * Sets the `data-e2e` attribute for the host element.\n *\n * @default 'eds-chip'\n */\n e2eAttr = input('eds-chip');\n\n /**\n * Sets the edsInternalId of the chip.\n *\n * @default null\n */\n edsInternalId = input<string>('');\n /**\n * Sets the label of the tooltip to diaply on hover.\n */\n tooltipMessage = input<string>('');\n /**\n * Sets the id of the chip.\n */\n id = input<string | number>('');\n /**\n * Sets the data of the chip like tooltip configuration.\n */\n // TODO: type should be specific\n // TODO: find the correct type or turn into a generic, https://www.typescriptlang.org/docs/handbook/2/generics.html\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n data = input<any>({\n id: crypto.randomUUID(),\n tooltip: {\n color: 'edsTooltipPrimary',\n contentAlignment: null,\n position: 'above',\n },\n });\n\n /**\n * Wether the chip can be removed.\n *\n * @default false\n */\n isRemovable = input(false, { transform: booleanAttribute });\n\n isActive = input(false, { transform: booleanAttribute });\n\n /**\n * @description\n * Controls the disabled state of the button\n * When true, adds the disabled attribute and prevents interaction\n */\n @Input()\n public get edsDisabled(): boolean {\n return this._edsDisabled;\n }\n public set edsDisabled(value: BooleanInput) {\n this._edsDisabled = coerceBooleanProperty(value);\n if (this._edsDisabled) {\n this._renderer.setAttribute(this._elementRef.nativeElement, 'disabled', 'true');\n } else {\n this._renderer.removeAttribute(this._elementRef.nativeElement, 'disabled');\n }\n }\n\n /**\n * Event emitted when the chip is removed.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n chipRemove = output<any>();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n chipClick = output<any>();\n\n /**\n * Icon declares by user in the chip\n */\n readonly chipLabel = viewChild.required<ElementRef<HTMLInputElement>>('chipLabel');\nprotected sizeDirective = inject(EdsSizeDirective);\n protected colorDirective = inject(EdsColorDirective);\n\n protected _renderer: Renderer2 = inject(Renderer2);\n private _elementRef = inject(ElementRef);\n private _edsDisabled = false;\n onHostClick(event?: Event): void {\n if (this.edsDisabled) {\n return;\n }\n\n if (this.isRemovable()) {\n this.onRemove(event);\n } else {\n this.onClick(event);\n }\n }\n\n /**\n * Handles Space key activation — prevents page scroll and triggers click.\n */\n onHostKeyActivate(event: Event): void {\n event.preventDefault();\n this.onHostClick(event);\n }\n\n /**\n * Handles Delete/Backspace key to remove chip (WAI-ARIA APG convention).\n */\n onKeyRemove(event: Event): void {\n if (this.edsDisabled || !this.isRemovable()) {\n return;\n }\n event.preventDefault();\n this.chipRemove.emit(this.data());\n }\n\n ngAfterContentInit(): void {\n if (!this.data().id && this.id()) {\n // Note: input signals are read-only, so we work with the value\n const currentData = this.data();\n Object.assign(currentData, { id: this.id() });\n }\n // checks if the parent element is an eds-chip-list to set role listitem or if a parent above in case cdkdroplist interferes\n if (this._elementRef.nativeElement.parentElement?.classList.contains('eds-chip-list__chip-container') || this._elementRef.nativeElement.parentElement?.parentElement?.classList.contains('eds-chip-list__chip-container')) {\n this.role = 'listitem';\n }\n }\n\n /**\n * Remove chip handler\n *\n * @param event Click event\n */\n private onRemove(event?: Event): void {\n if (event instanceof KeyboardEvent && (event as KeyboardEvent).code === 'Backspace') {\n this.chipRemove.emit({ chip: this.data(), event });\n } else {\n this.chipRemove.emit(this.data());\n }\n }\n\n private onClick(event?: Event): void {\n this.chipClick.emit(this.data());\n }\n}\n","<div class=\"eds-chip__content\" #chipLabel>\n <ng-content></ng-content>\n</div>\n@if (isRemovable()) {\n <eds-icon ariaLabel=\"Remove {{ chipLabel.textContent }} chip\" icon=\"x:core\" edsSizeXS/>\n}\n","export class EdsChipModel {\n id!: string | number;\n edsInternalId!: string;\n label!: string;\n isRemovable = false;\n isOutline = false;\n isRounded = false;\n isDisabled = false;\n variant: 'primary' | 'secondary' | 'info' | 'success' | 'warning' | 'danger' | 'accent' = 'primary';\n tooltip: EdsChipTooltip = new EdsChipTooltip();\n iconClass?: string;\n iconSvgName?: string;\n\n constructor(values = {}) {\n Object.assign(this, values);\n }\n}\n\nexport class EdsChipTooltip {\n tooltipMessage!: string;\n position?: 'above' | 'below' | 'left' | 'right' | 'before' | 'after' = 'above';\n contentAlignment?: 'center' | 'left' | 'right' | 'justify' = 'center';\n delay? = 0;\n\n constructor(values = {}) {\n Object.assign(this, values);\n }\n}\n","import { EdsChip } from './eds-chip';\n\nexport * from './models/eui-chip.model';\nexport * from './eds-chip';\n\nexport const EDS_CHIP = [\n EdsChip,\n] as const;\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './index';\n"],"names":[],"mappings":";;;;;;;;;MAgEa,OAAO,CAAA;AA5CpB,IAAA,WAAA,GAAA;AA6CI;;;AAGG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,QAAQ,CAAC,MAAK;YACxB,MAAM,SAAS,GAAG,IAAI,CAAC,aAAa,CAAC,WAAW,CAAC,UAAU,CAAC;YAC5D,MAAM,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,UAAU,CAAC;YAE9D,OAAO;gBACH,UAAU;AACV,gBAAA,SAAS,IAAI,kBAAkB;AAC/B,gBAAA,UAAU,IAAI,mBAAmB;gBACjC,IAAI,CAAC,WAAW,EAAE,GAAG,qBAAqB,GAAG,EAAE;gBAC/C,IAAI,CAAC,QAAQ,EAAE,GAAG,kBAAkB,GAAG,EAAE;gBACzC,IAAI,CAAC,WAAW,GAAG,oBAAoB,GAAG,EAAE;AAC/C,aAAA,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE;QACtB,CAAC;wFAAC;AAEF;;;;;AAKG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