@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/card/README.md +2 -1
- package/command/README.md +29 -0
- package/data/README.md +15 -3
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +517 -184
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +62 -17
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +301 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1221 -479
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +97 -16
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1496 -499
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +236 -61
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +364 -93
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2040 -1046
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +955 -125
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +1293 -89
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +997 -453
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1794 -1265
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +151 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +37 -1
- package/package.json +20 -7
- package/popover/README.md +58 -2
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +11 -8
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +28 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +205 -28
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +345 -48
- package/types/cngx-common-command.d.ts +50 -10
- package/types/cngx-common-data.d.ts +743 -92
- package/types/cngx-common-dialog.d.ts +161 -10
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +910 -226
- package/types/cngx-common-layout.d.ts +603 -32
- package/types/cngx-common-popover.d.ts +612 -49
- package/types/cngx-common-stepper.d.ts +526 -237
- package/types/cngx-common-tabs.d.ts +358 -75
- package/types/cngx-common-timeline.d.ts +108 -22
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component, computed, Directive,
|
|
3
|
-
import {
|
|
2
|
+
import { input, ViewEncapsulation, ChangeDetectionStrategy, Component, InjectionToken, inject, computed, Directive, linkedSignal, ElementRef, contentChildren, afterRenderEffect, Renderer2, effect, DestroyRef, output, booleanAttribute, afterNextRender, TemplateRef, contentChild, makeEnvironmentProviders, untracked } from '@angular/core';
|
|
3
|
+
import { formatMessage, createNestedLanguageSection, createSectionBundle } from '@cngx/core/i18n';
|
|
4
|
+
import { createOverrideMerge, injectLocale, numberFormatterFor, nextUid, memoize, dateTimeFormatterFor } from '@cngx/core/utils';
|
|
5
|
+
import { cngxDevWarn } from '@cngx/utils';
|
|
4
6
|
import { NgTemplateOutlet } from '@angular/common';
|
|
5
7
|
|
|
6
8
|
/**
|
|
@@ -56,6 +58,131 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
56
58
|
}, styles: ["@layer cngx.tokens{@property --cngx-icon-size{syntax: \"*\"; inherits: false; initial-value: 1.25em;}@property --cngx-icon-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-icon-size-xs{syntax: \"*\"; inherits: false; initial-value: .75em;}@property --cngx-icon-size-sm{syntax: \"*\"; inherits: false; initial-value: 1em;}@property --cngx-icon-size-md{syntax: \"*\"; inherits: false; initial-value: 1.25em;}@property --cngx-icon-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.5em;}@property --cngx-icon-size-xl{syntax: \"*\"; inherits: false; initial-value: 2em;}}@layer cngx.components{@scope(.cngx-icon){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;font-size:var(--cngx-icon-size, var(--cngx-icon-size-md, 1.25em));color:var(--cngx-icon-color, currentColor)}:scope.cngx-icon--xs{--cngx-icon-size: var(--cngx-icon-size-xs, .75em)}:scope.cngx-icon--sm{--cngx-icon-size: var(--cngx-icon-size-sm, 1em)}:scope.cngx-icon--md{--cngx-icon-size: var(--cngx-icon-size-md, 1.25em)}:scope.cngx-icon--lg{--cngx-icon-size: var(--cngx-icon-size-lg, 1.5em)}:scope.cngx-icon--xl{--cngx-icon-size: var(--cngx-icon-size-xl, 2em)}:scope>svg{width:1em;height:1em;fill:currentColor;display:block}}}\n"] }]
|
|
57
59
|
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }] } });
|
|
58
60
|
|
|
61
|
+
/**
|
|
62
|
+
* The English display section: the single source of the display atoms'
|
|
63
|
+
* English copy. `CNGX_DISPLAY_I18N` defaults to it.
|
|
64
|
+
*
|
|
65
|
+
* @category common/display/i18n
|
|
66
|
+
* @since 0.1.0
|
|
67
|
+
* @relatedTo CNGX_DISPLAY_I18N
|
|
68
|
+
*/
|
|
69
|
+
const CNGX_DISPLAY_LANGUAGE_EN = {
|
|
70
|
+
avatarStatus: { online: 'online', offline: 'offline', busy: 'busy', away: 'away' },
|
|
71
|
+
avatarGroupNoun: 'avatars',
|
|
72
|
+
avatarGroupLabel: '{count} {noun}',
|
|
73
|
+
avatarGroupLabelHidden: '{count} {noun}, {hidden} not shown',
|
|
74
|
+
avatarGroupOverflow: '+{count}',
|
|
75
|
+
segmentedProgressValueText: '{now} of {max}',
|
|
76
|
+
chipRemove: 'Remove',
|
|
77
|
+
badgeOverflow: '{max}+',
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* @internal Marks an `avatarGroupLabel` built from a language section, not by
|
|
82
|
+
* a consumer. The mark travels on the function itself, non-enumerable, so no
|
|
83
|
+
* global registry is written.
|
|
84
|
+
*/
|
|
85
|
+
const SECTION_AVATAR_GROUP_LABEL = Symbol('cngxSectionAvatarGroupLabel');
|
|
86
|
+
/**
|
|
87
|
+
* @internal Whether an `avatarGroupLabel` came from a language section. Such a
|
|
88
|
+
* formatter composes from `avatarGroupLabelFor` and the resolved noun, so a
|
|
89
|
+
* noun-only override still reaches AT; a consumer formatter owns the phrase.
|
|
90
|
+
*/
|
|
91
|
+
function isSectionAvatarGroupLabel(format) {
|
|
92
|
+
return SECTION_AVATAR_GROUP_LABEL in format;
|
|
93
|
+
}
|
|
94
|
+
/** @internal Turns a display section into the token's keys for a locale. */
|
|
95
|
+
function displayBundleFrom(section, locale) {
|
|
96
|
+
const avatarGroupLabelFor = (count, hidden, noun) => formatMessage(hidden > 0 ? section.avatarGroupLabelHidden : section.avatarGroupLabel, { count, hidden, noun }, locale);
|
|
97
|
+
const avatarGroupLabel = (total, hidden) => avatarGroupLabelFor(total, hidden, section.avatarGroupNoun);
|
|
98
|
+
Object.defineProperty(avatarGroupLabel, SECTION_AVATAR_GROUP_LABEL, { value: true });
|
|
99
|
+
return {
|
|
100
|
+
avatarStatus: (status) => section.avatarStatus[status],
|
|
101
|
+
avatarGroupNoun: section.avatarGroupNoun,
|
|
102
|
+
avatarGroupLabel,
|
|
103
|
+
avatarGroupLabelFor,
|
|
104
|
+
avatarGroupOverflow: (count) => formatMessage(section.avatarGroupOverflow, { count }, locale),
|
|
105
|
+
segmentedProgressValueText: (now, max) => formatMessage(section.segmentedProgressValueText, { now, max }, locale),
|
|
106
|
+
chipRemove: section.chipRemove,
|
|
107
|
+
badgeOverflow: (max) => formatMessage(section.badgeOverflow, { max }, locale),
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
/** @internal The display section of the active pack over English. */
|
|
111
|
+
const injectDisplaySection = createNestedLanguageSection('display', CNGX_DISPLAY_LANGUAGE_EN, 'avatarStatus');
|
|
112
|
+
/** @internal Builds and reads the token, formatted for the reading locale. */
|
|
113
|
+
const displayBundle = createSectionBundle({
|
|
114
|
+
section: injectDisplaySection,
|
|
115
|
+
toBundle: displayBundleFrom,
|
|
116
|
+
});
|
|
117
|
+
/**
|
|
118
|
+
* DI token for the display i18n bundle. `providedIn: 'root'`: the display
|
|
119
|
+
* section of the active language pack over the English defaults, formatted
|
|
120
|
+
* for the app locale; the value is a `Signal`, shared by every reader under
|
|
121
|
+
* one injector.
|
|
122
|
+
*
|
|
123
|
+
* @category common/display/i18n
|
|
124
|
+
* @wcag AA
|
|
125
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/display/i18n/display-i18n.ts
|
|
126
|
+
* @since 0.1.0
|
|
127
|
+
* @relatedTo CngxAvatar, CngxAvatarGroup, CngxSegmentedProgress, CngxChip
|
|
128
|
+
*/
|
|
129
|
+
const CNGX_DISPLAY_I18N = new InjectionToken('CngxDisplayI18n', {
|
|
130
|
+
providedIn: 'root',
|
|
131
|
+
factory: () => displayBundle.build(),
|
|
132
|
+
});
|
|
133
|
+
/** @internal */
|
|
134
|
+
function defineDisplayI18nFeature(fn) {
|
|
135
|
+
return Object.assign(fn, { _target: 'i18n' });
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* Override display labels via a partial bundle - unset keys keep the
|
|
139
|
+
* language pack's copy, or the English default. Pass a `Signal` of a partial
|
|
140
|
+
* bundle to switch languages at runtime.
|
|
141
|
+
*
|
|
142
|
+
* @category common/display/i18n
|
|
143
|
+
* @since 0.1.0
|
|
144
|
+
*/
|
|
145
|
+
function withDisplayI18nLabels(overrides) {
|
|
146
|
+
return defineDisplayI18nFeature((bundle) => createOverrideMerge(bundle, overrides));
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Provider for the display i18n bundle. Returns a plain `Provider`, so it also
|
|
150
|
+
* scopes a subtree through `viewProviders`. The features apply on top of the
|
|
151
|
+
* active language pack.
|
|
152
|
+
*
|
|
153
|
+
* ```ts
|
|
154
|
+
* bootstrapApplication(AppComponent, {
|
|
155
|
+
* providers: [
|
|
156
|
+
* provideDisplayI18n(
|
|
157
|
+
* withDisplayI18nLabels({
|
|
158
|
+
* avatarStatus: (status) => ({ online: 'online', offline: 'offline', busy: 'beschaeftigt', away: 'abwesend' })[status],
|
|
159
|
+
* chipRemove: 'Entfernen',
|
|
160
|
+
* }),
|
|
161
|
+
* ),
|
|
162
|
+
* ],
|
|
163
|
+
* });
|
|
164
|
+
* ```
|
|
165
|
+
*
|
|
166
|
+
* @category common/display/i18n
|
|
167
|
+
* @since 0.1.0
|
|
168
|
+
*/
|
|
169
|
+
function provideDisplayI18n(...features) {
|
|
170
|
+
return {
|
|
171
|
+
provide: CNGX_DISPLAY_I18N,
|
|
172
|
+
useFactory: () => displayBundle.build(features),
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Inject the resolved display i18n bundle signal. Read it inside a
|
|
177
|
+
* `computed()` or template so a runtime override flip re-derives.
|
|
178
|
+
*
|
|
179
|
+
* @category common/display/i18n
|
|
180
|
+
* @since 0.1.0
|
|
181
|
+
*/
|
|
182
|
+
function injectDisplayI18n() {
|
|
183
|
+
return displayBundle.resolve(inject(CNGX_DISPLAY_I18N));
|
|
184
|
+
}
|
|
185
|
+
|
|
59
186
|
const segmentsEqual = (a, b) => a.length === b.length && a.every((s, i) => s === b[i]);
|
|
60
187
|
/**
|
|
61
188
|
* Generic segmented position indicator - a discrete progress bar split
|
|
@@ -85,6 +212,7 @@ const segmentsEqual = (a, b) => a.length === b.length && a.every((s, i) => s ===
|
|
|
85
212
|
* <example-url>http://localhost:4200/#/common/display/segmented-progress/error-segment</example-url>
|
|
86
213
|
*/
|
|
87
214
|
class CngxSegmentedProgress {
|
|
215
|
+
i18n = injectDisplayI18n();
|
|
88
216
|
/** Number of completed positions (0-based count). Drives derivation. */
|
|
89
217
|
value = input(0, ...(ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []));
|
|
90
218
|
/** Total number of segments when deriving from `[value]`. */
|
|
@@ -97,9 +225,10 @@ class CngxSegmentedProgress {
|
|
|
97
225
|
/**
|
|
98
226
|
* Override the `aria-valuetext` string. Receives `(now, max)` - the
|
|
99
227
|
* completed-segment count and the total segment count. Mirrors
|
|
100
|
-
* `CngxStepperCount.format`;
|
|
101
|
-
*
|
|
102
|
-
*
|
|
228
|
+
* `CngxStepperCount.format`; wins over the app-wide
|
|
229
|
+
* `CNGX_DISPLAY_I18N.segmentedProgressValueText` (English default
|
|
230
|
+
* `(now, max) => \`${now} of ${max}\``). Supply a closure for per-instance
|
|
231
|
+
* position text (e.g. `(n, m) => \`Schritt ${n} von ${m}\``).
|
|
103
232
|
*/
|
|
104
233
|
valueTextFormat = input(undefined, ...(ngDevMode ? [{ debugName: "valueTextFormat" }] : /* istanbul ignore next */ []));
|
|
105
234
|
/** Segments actually rendered: explicit when supplied, else derived. */
|
|
@@ -124,7 +253,7 @@ class CngxSegmentedProgress {
|
|
|
124
253
|
}, ...(ngDevMode ? [{ debugName: "now" }] : /* istanbul ignore next */ []));
|
|
125
254
|
/** `aria-valuetext` - human-readable position via the resolved format closure. */
|
|
126
255
|
valueText = computed(() => {
|
|
127
|
-
const fmt = this.valueTextFormat() ?? (
|
|
256
|
+
const fmt = this.valueTextFormat() ?? this.i18n().segmentedProgressValueText;
|
|
128
257
|
return fmt(this.now(), this.max());
|
|
129
258
|
}, ...(ngDevMode ? [{ debugName: "valueText" }] : /* istanbul ignore next */ []));
|
|
130
259
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSegmentedProgress, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
@@ -136,7 +265,7 @@ class CngxSegmentedProgress {
|
|
|
136
265
|
aria-hidden="true"
|
|
137
266
|
></span>
|
|
138
267
|
}
|
|
139
|
-
`, isInline: true, styles: [".cngx-segmented-progress{--cngx-segmented-progress-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-segmented-progress-gap, .25rem);inline-size:var(--cngx-segmented-progress-inline-size, 100%)}.cngx-segmented-progress__segment{flex:1 1 0;block-size:var(--cngx-segmented-progress-thickness, .375rem);border-radius:var(--cngx-segmented-progress-radius, 999px);background:var(--cngx-segmented-progress-todo-color, var(--
|
|
268
|
+
`, isInline: true, styles: [".cngx-segmented-progress{--cngx-segmented-progress-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-segmented-progress-gap, .25rem);inline-size:var(--cngx-segmented-progress-inline-size, 100%)}.cngx-segmented-progress__segment{flex:1 1 0;block-size:var(--cngx-segmented-progress-thickness, .375rem);border-radius:var(--cngx-segmented-progress-radius, 999px);background:var(--cngx-segmented-progress-todo-color, var(--cngx-color-border, oklch(.88 .005 250)));transition:background var(--cngx-segmented-progress-transition, var(--cngx-duration-fast, .15s) ease)}.cngx-segmented-progress__segment[data-state=done]{background:var(--cngx-segmented-progress-done-color, var(--cngx-color-primary, oklch(.66 .19 50)))}.cngx-segmented-progress__segment[data-state=active]{background:color-mix(in oklab,var(--cngx-segmented-progress-active-color, var(--cngx-color-primary, oklch(.66 .19 50))) 60%,var(--cngx-color-surface, oklch(1 0 0)))}.cngx-segmented-progress__segment[data-state=error]{background:var(--cngx-segmented-progress-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}@media(forced-colors:active){.cngx-segmented-progress__segment{forced-color-adjust:none;background:Canvas;outline:1px solid CanvasText;outline-offset:-1px}.cngx-segmented-progress__segment[data-state=done]{background:Highlight;outline-color:Highlight}.cngx-segmented-progress__segment[data-state=active]{background:Canvas;outline:2px solid Highlight;outline-offset:-2px}.cngx-segmented-progress__segment[data-state=error]{background:Mark}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
140
269
|
}
|
|
141
270
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxSegmentedProgress, decorators: [{
|
|
142
271
|
type: Component,
|
|
@@ -155,7 +284,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
155
284
|
aria-hidden="true"
|
|
156
285
|
></span>
|
|
157
286
|
}
|
|
158
|
-
`, styles: [".cngx-segmented-progress{--cngx-segmented-progress-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-segmented-progress-gap, .25rem);inline-size:var(--cngx-segmented-progress-inline-size, 100%)}.cngx-segmented-progress__segment{flex:1 1 0;block-size:var(--cngx-segmented-progress-thickness, .375rem);border-radius:var(--cngx-segmented-progress-radius, 999px);background:var(--cngx-segmented-progress-todo-color, var(--
|
|
287
|
+
`, styles: [".cngx-segmented-progress{--cngx-segmented-progress-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-segmented-progress-gap, .25rem);inline-size:var(--cngx-segmented-progress-inline-size, 100%)}.cngx-segmented-progress__segment{flex:1 1 0;block-size:var(--cngx-segmented-progress-thickness, .375rem);border-radius:var(--cngx-segmented-progress-radius, 999px);background:var(--cngx-segmented-progress-todo-color, var(--cngx-color-border, oklch(.88 .005 250)));transition:background var(--cngx-segmented-progress-transition, var(--cngx-duration-fast, .15s) ease)}.cngx-segmented-progress__segment[data-state=done]{background:var(--cngx-segmented-progress-done-color, var(--cngx-color-primary, oklch(.66 .19 50)))}.cngx-segmented-progress__segment[data-state=active]{background:color-mix(in oklab,var(--cngx-segmented-progress-active-color, var(--cngx-color-primary, oklch(.66 .19 50))) 60%,var(--cngx-color-surface, oklch(1 0 0)))}.cngx-segmented-progress__segment[data-state=error]{background:var(--cngx-segmented-progress-error-color, var(--cngx-color-danger, oklch(.6 .18 25)))}@media(forced-colors:active){.cngx-segmented-progress__segment{forced-color-adjust:none;background:Canvas;outline:1px solid CanvasText;outline-offset:-1px}.cngx-segmented-progress__segment[data-state=done]{background:Highlight;outline-color:Highlight}.cngx-segmented-progress__segment[data-state=active]{background:Canvas;outline:2px solid Highlight;outline-offset:-2px}.cngx-segmented-progress__segment[data-state=error]{background:Mark}}\n"] }]
|
|
159
288
|
}], propDecorators: { value: [{ type: i0.Input, args: [{ isSignal: true, alias: "value", required: false }] }], total: [{ type: i0.Input, args: [{ isSignal: true, alias: "total", required: false }] }], segments: [{ type: i0.Input, args: [{ isSignal: true, alias: "segments", required: false }] }], valueTextFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "valueTextFormat", required: false }] }] } });
|
|
160
289
|
|
|
161
290
|
/**
|
|
@@ -222,6 +351,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
222
351
|
* <example-url>http://localhost:4200/#/common/display/avatar/sizes</example-url>
|
|
223
352
|
*/
|
|
224
353
|
class CngxAvatar {
|
|
354
|
+
i18n = injectDisplayI18n();
|
|
225
355
|
/** Image URL. When set and loads successfully, the image is shown. */
|
|
226
356
|
src = input(undefined, ...(ngDevMode ? [{ debugName: "src" }] : /* istanbul ignore next */ []));
|
|
227
357
|
/** Alternate text for the image. Required when `src` is used. */
|
|
@@ -234,8 +364,27 @@ class CngxAvatar {
|
|
|
234
364
|
shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
235
365
|
/** Optional user-presence status indicator. */
|
|
236
366
|
status = input(undefined, ...(ngDevMode ? [{ debugName: "status" }] : /* istanbul ignore next */ []));
|
|
237
|
-
|
|
238
|
-
|
|
367
|
+
/**
|
|
368
|
+
* Format closure for the status dot's accessible label. When set, it wins
|
|
369
|
+
* over the app-wide `CNGX_DISPLAY_I18N.avatarStatus` (English default: the
|
|
370
|
+
* status word). Mirrors the `labelFormat` closure on `CngxAvatarGroup`.
|
|
371
|
+
*/
|
|
372
|
+
statusLabel = input(undefined, ...(ngDevMode ? [{ debugName: "statusLabel" }] : /* istanbul ignore next */ []));
|
|
373
|
+
/** Accessible label of the status dot - the closure's output when set, else `CNGX_DISPLAY_I18N.avatarStatus`. */
|
|
374
|
+
statusAriaLabel = computed(() => {
|
|
375
|
+
const status = this.status();
|
|
376
|
+
if (!status) {
|
|
377
|
+
return null;
|
|
378
|
+
}
|
|
379
|
+
const format = this.statusLabel() ?? this.i18n().avatarStatus;
|
|
380
|
+
return format(status);
|
|
381
|
+
}, ...(ngDevMode ? [{ debugName: "statusAriaLabel" }] : /* istanbul ignore next */ []));
|
|
382
|
+
// Keyed on src(): a new URL resets both flags, so a failed image recovers
|
|
383
|
+
// when the consumer rebinds [src].
|
|
384
|
+
imageLoadedState = linkedSignal({ ...(ngDevMode ? { debugName: "imageLoadedState" } : /* istanbul ignore next */ {}), source: this.src,
|
|
385
|
+
computation: () => false });
|
|
386
|
+
imageErroredState = linkedSignal({ ...(ngDevMode ? { debugName: "imageErroredState" } : /* istanbul ignore next */ {}), source: this.src,
|
|
387
|
+
computation: () => false });
|
|
239
388
|
/** Whether the image loaded successfully. */
|
|
240
389
|
imageLoaded = this.imageLoadedState.asReadonly();
|
|
241
390
|
/** Whether the fallback path (initials or ng-content) is currently rendered. */
|
|
@@ -251,7 +400,7 @@ class CngxAvatar {
|
|
|
251
400
|
this.imageErroredState.set(true);
|
|
252
401
|
}
|
|
253
402
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxAvatar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
254
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxAvatar, isStandalone: true, selector: "cngx-avatar", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-avatar--xs": "size() === \"xs\"", "class.cngx-avatar--sm": "size() === \"sm\"", "class.cngx-avatar--md": "size() === \"md\"", "class.cngx-avatar--lg": "size() === \"lg\"", "class.cngx-avatar--xl": "size() === \"xl\"", "class.cngx-avatar--square": "shape() === \"square\"", "class.cngx-avatar--circle": "shape() === \"circle\"" }, classAttribute: "cngx-avatar" }, exportAs: ["cngxAvatar"], ngImport: i0, template: `
|
|
403
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxAvatar, isStandalone: true, selector: "cngx-avatar", inputs: { src: { classPropertyName: "src", publicName: "src", isSignal: true, isRequired: false, transformFunction: null }, alt: { classPropertyName: "alt", publicName: "alt", isSignal: true, isRequired: false, transformFunction: null }, initials: { classPropertyName: "initials", publicName: "initials", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: false, transformFunction: null }, statusLabel: { classPropertyName: "statusLabel", publicName: "statusLabel", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-avatar--xs": "size() === \"xs\"", "class.cngx-avatar--sm": "size() === \"sm\"", "class.cngx-avatar--md": "size() === \"md\"", "class.cngx-avatar--lg": "size() === \"lg\"", "class.cngx-avatar--xl": "size() === \"xl\"", "class.cngx-avatar--square": "shape() === \"square\"", "class.cngx-avatar--circle": "shape() === \"circle\"" }, classAttribute: "cngx-avatar" }, exportAs: ["cngxAvatar"], ngImport: i0, template: `
|
|
255
404
|
@if (showImage()) {
|
|
256
405
|
<img
|
|
257
406
|
class="cngx-avatar__img"
|
|
@@ -272,10 +421,11 @@ class CngxAvatar {
|
|
|
272
421
|
[class.cngx-avatar__status--offline]="status() === 'offline'"
|
|
273
422
|
[class.cngx-avatar__status--busy]="status() === 'busy'"
|
|
274
423
|
[class.cngx-avatar__status--away]="status() === 'away'"
|
|
275
|
-
|
|
424
|
+
role="img"
|
|
425
|
+
[attr.aria-label]="statusAriaLabel()"
|
|
276
426
|
></span>
|
|
277
427
|
}
|
|
278
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));height:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));font-size:var(--cngx-avatar-font-size, var(--cngx-avatar-font-size-md, 1rem));background:var(--cngx-avatar-bg, var(--cngx-color-border, oklch(.92 .01 240)));color:var(--cngx-avatar-color, var(--cngx-color-text, oklch(.28 0 0)))}:scope.cngx-avatar--circle{border-radius:var(--cngx-avatar-circle-radius, var(--cngx-radius-pill, 999px))}:scope.cngx-avatar--square{border-radius:var(--cngx-avatar-square-radius, 6px)}:scope.cngx-avatar--xs{--cngx-avatar-size: var(--cngx-avatar-size-xs, 1.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xs, .625rem)}:scope.cngx-avatar--sm{--cngx-avatar-size: var(--cngx-avatar-size-sm, 2rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-sm, .75rem)}:scope.cngx-avatar--md{--cngx-avatar-size: var(--cngx-avatar-size-md, 2.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-md, 1rem)}:scope.cngx-avatar--lg{--cngx-avatar-size: var(--cngx-avatar-size-lg, 3rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-lg, 1.125rem)}:scope.cngx-avatar--xl{--cngx-avatar-size: var(--cngx-avatar-size-xl, 4rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xl, 1.5rem)}.cngx-avatar__img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.cngx-avatar__initials{text-transform:uppercase}.cngx-avatar__status{position:absolute;inset-inline-end:-2px;bottom:-2px;width:var(--cngx-avatar-status-size, .65em);height:var(--cngx-avatar-status-size, .65em);border-radius:var(--cngx-radius-pill, 999px);border:2px solid var(--cngx-avatar-status-border, var(--cngx-color-surface, oklch(1 0 0)));background:var(--cngx-avatar-status-bg, oklch(.68 .01 240))}.cngx-avatar__status--online{background:var(--cngx-avatar-status-online, var(--cngx-color-success, oklch(.68 .18 145)))}.cngx-avatar__status--offline{background:var(--cngx-avatar-status-offline, oklch(.68 .01 240))}.cngx-avatar__status--busy{background:var(--cngx-avatar-status-busy, var(--cngx-color-danger, oklch(.62 .22 25)))}.cngx-avatar__status--away{background:var(--cngx-avatar-status-away, var(--cngx-color-warning, oklch(.72 .18 70)))}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
428
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));height:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));font-size:var(--cngx-avatar-font-size, var(--cngx-avatar-font-size-md, 1rem));background:var(--cngx-avatar-bg, var(--cngx-color-border, oklch(.92 .01 240)));color:var(--cngx-avatar-color, var(--cngx-color-text, oklch(.28 0 0)))}:scope.cngx-avatar--circle{border-radius:var(--cngx-avatar-circle-radius, var(--cngx-radius-pill, 999px))}:scope.cngx-avatar--square{border-radius:var(--cngx-avatar-square-radius, 6px)}:scope.cngx-avatar--xs{--cngx-avatar-size: var(--cngx-avatar-size-xs, 1.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xs, .625rem)}:scope.cngx-avatar--sm{--cngx-avatar-size: var(--cngx-avatar-size-sm, 2rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-sm, .75rem)}:scope.cngx-avatar--md{--cngx-avatar-size: var(--cngx-avatar-size-md, 2.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-md, 1rem)}:scope.cngx-avatar--lg{--cngx-avatar-size: var(--cngx-avatar-size-lg, 3rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-lg, 1.125rem)}:scope.cngx-avatar--xl{--cngx-avatar-size: var(--cngx-avatar-size-xl, 4rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xl, 1.5rem)}.cngx-avatar__img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.cngx-avatar__initials{text-transform:uppercase}.cngx-avatar__status{position:absolute;inset-inline-end:-2px;bottom:-2px;width:var(--cngx-avatar-status-size, .65em);height:var(--cngx-avatar-status-size, .65em);border-radius:var(--cngx-radius-pill, 999px);border:2px solid var(--cngx-avatar-status-border, var(--cngx-color-surface, oklch(1 0 0)));background:var(--cngx-avatar-status-bg, oklch(.68 .01 240))}.cngx-avatar__status--online{background:var(--cngx-avatar-status-online, var(--cngx-color-success, oklch(.68 .18 145)))}.cngx-avatar__status--offline{background:var(--cngx-avatar-status-offline, oklch(.68 .01 240))}.cngx-avatar__status--busy{background:var(--cngx-avatar-status-busy, var(--cngx-color-danger, oklch(.62 .22 25)))}.cngx-avatar__status--away{background:var(--cngx-avatar-status-away, var(--cngx-color-warning, oklch(.72 .18 70)))}}}@media(forced-colors:active){.cngx-avatar{outline:1px solid CanvasText;outline-offset:-1px}.cngx-avatar .cngx-avatar__status{width:max(var(--cngx-avatar-status-size, .65em),.8em);height:max(var(--cngx-avatar-status-size, .65em),.8em);forced-color-adjust:none;border-color:Canvas;background:CanvasText}.cngx-avatar .cngx-avatar__status--offline{background:Canvas;box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--away{background:linear-gradient(90deg,CanvasText 50%,Canvas 50%);box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--busy{background:linear-gradient(Canvas 0 0) center / 60% 22% no-repeat,CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
279
429
|
}
|
|
280
430
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxAvatar, decorators: [{
|
|
281
431
|
type: Component,
|
|
@@ -309,11 +459,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
309
459
|
[class.cngx-avatar__status--offline]="status() === 'offline'"
|
|
310
460
|
[class.cngx-avatar__status--busy]="status() === 'busy'"
|
|
311
461
|
[class.cngx-avatar__status--away]="status() === 'away'"
|
|
312
|
-
|
|
462
|
+
role="img"
|
|
463
|
+
[attr.aria-label]="statusAriaLabel()"
|
|
313
464
|
></span>
|
|
314
465
|
}
|
|
315
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));height:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));font-size:var(--cngx-avatar-font-size, var(--cngx-avatar-font-size-md, 1rem));background:var(--cngx-avatar-bg, var(--cngx-color-border, oklch(.92 .01 240)));color:var(--cngx-avatar-color, var(--cngx-color-text, oklch(.28 0 0)))}:scope.cngx-avatar--circle{border-radius:var(--cngx-avatar-circle-radius, var(--cngx-radius-pill, 999px))}:scope.cngx-avatar--square{border-radius:var(--cngx-avatar-square-radius, 6px)}:scope.cngx-avatar--xs{--cngx-avatar-size: var(--cngx-avatar-size-xs, 1.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xs, .625rem)}:scope.cngx-avatar--sm{--cngx-avatar-size: var(--cngx-avatar-size-sm, 2rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-sm, .75rem)}:scope.cngx-avatar--md{--cngx-avatar-size: var(--cngx-avatar-size-md, 2.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-md, 1rem)}:scope.cngx-avatar--lg{--cngx-avatar-size: var(--cngx-avatar-size-lg, 3rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-lg, 1.125rem)}:scope.cngx-avatar--xl{--cngx-avatar-size: var(--cngx-avatar-size-xl, 4rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xl, 1.5rem)}.cngx-avatar__img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.cngx-avatar__initials{text-transform:uppercase}.cngx-avatar__status{position:absolute;inset-inline-end:-2px;bottom:-2px;width:var(--cngx-avatar-status-size, .65em);height:var(--cngx-avatar-status-size, .65em);border-radius:var(--cngx-radius-pill, 999px);border:2px solid var(--cngx-avatar-status-border, var(--cngx-color-surface, oklch(1 0 0)));background:var(--cngx-avatar-status-bg, oklch(.68 .01 240))}.cngx-avatar__status--online{background:var(--cngx-avatar-status-online, var(--cngx-color-success, oklch(.68 .18 145)))}.cngx-avatar__status--offline{background:var(--cngx-avatar-status-offline, oklch(.68 .01 240))}.cngx-avatar__status--busy{background:var(--cngx-avatar-status-busy, var(--cngx-color-danger, oklch(.62 .22 25)))}.cngx-avatar__status--away{background:var(--cngx-avatar-status-away, var(--cngx-color-warning, oklch(.72 .18 70)))}}}\n"] }]
|
|
316
|
-
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }] } });
|
|
466
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-avatar-size{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .01 240);}@property --cngx-avatar-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.28 0 0);}@property --cngx-avatar-circle-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-avatar-square-radius{syntax: \"<length>\"; inherits: false; initial-value: 6px;}@property --cngx-avatar-size-xs{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-size-sm{syntax: \"*\"; inherits: false; initial-value: 2rem;}@property --cngx-avatar-size-md{syntax: \"*\"; inherits: false; initial-value: 2.5rem;}@property --cngx-avatar-size-lg{syntax: \"*\"; inherits: false; initial-value: 3rem;}@property --cngx-avatar-size-xl{syntax: \"*\"; inherits: false; initial-value: 4rem;}@property --cngx-avatar-font-size-xs{syntax: \"*\"; inherits: false; initial-value: .625rem;}@property --cngx-avatar-font-size-sm{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-avatar-font-size-md{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-avatar-font-size-lg{syntax: \"*\"; inherits: false; initial-value: 1.125rem;}@property --cngx-avatar-font-size-xl{syntax: \"*\"; inherits: false; initial-value: 1.5rem;}@property --cngx-avatar-status-size{syntax: \"*\"; inherits: false; initial-value: .65em;}@property --cngx-avatar-status-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-avatar-status-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-online{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .18 145);}@property --cngx-avatar-status-offline{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 240);}@property --cngx-avatar-status-busy{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .22 25);}@property --cngx-avatar-status-away{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}}[data-color-scheme=dark],.dark{--cngx-avatar-bg: oklch(.36 .01 250);--cngx-avatar-color: oklch(.92 .01 250);--cngx-avatar-status-border: oklch(.2 .01 250)}[data-color-scheme=light],.light{--cngx-avatar-bg: oklch(.92 .01 240);--cngx-avatar-color: oklch(.28 0 0);--cngx-avatar-status-border: oklch(1 0 0)}}@layer cngx.components{@scope(.cngx-avatar){:scope{display:inline-flex;align-items:center;justify-content:center;position:relative;flex:0 0 auto;-webkit-user-select:none;user-select:none;overflow:visible;line-height:1;font-weight:600;width:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));height:var(--cngx-avatar-size, var(--cngx-avatar-size-md, 2.5rem));font-size:var(--cngx-avatar-font-size, var(--cngx-avatar-font-size-md, 1rem));background:var(--cngx-avatar-bg, var(--cngx-color-border, oklch(.92 .01 240)));color:var(--cngx-avatar-color, var(--cngx-color-text, oklch(.28 0 0)))}:scope.cngx-avatar--circle{border-radius:var(--cngx-avatar-circle-radius, var(--cngx-radius-pill, 999px))}:scope.cngx-avatar--square{border-radius:var(--cngx-avatar-square-radius, 6px)}:scope.cngx-avatar--xs{--cngx-avatar-size: var(--cngx-avatar-size-xs, 1.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xs, .625rem)}:scope.cngx-avatar--sm{--cngx-avatar-size: var(--cngx-avatar-size-sm, 2rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-sm, .75rem)}:scope.cngx-avatar--md{--cngx-avatar-size: var(--cngx-avatar-size-md, 2.5rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-md, 1rem)}:scope.cngx-avatar--lg{--cngx-avatar-size: var(--cngx-avatar-size-lg, 3rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-lg, 1.125rem)}:scope.cngx-avatar--xl{--cngx-avatar-size: var(--cngx-avatar-size-xl, 4rem);--cngx-avatar-font-size: var(--cngx-avatar-font-size-xl, 1.5rem)}.cngx-avatar__img{width:100%;height:100%;object-fit:cover;border-radius:inherit}.cngx-avatar__initials{text-transform:uppercase}.cngx-avatar__status{position:absolute;inset-inline-end:-2px;bottom:-2px;width:var(--cngx-avatar-status-size, .65em);height:var(--cngx-avatar-status-size, .65em);border-radius:var(--cngx-radius-pill, 999px);border:2px solid var(--cngx-avatar-status-border, var(--cngx-color-surface, oklch(1 0 0)));background:var(--cngx-avatar-status-bg, oklch(.68 .01 240))}.cngx-avatar__status--online{background:var(--cngx-avatar-status-online, var(--cngx-color-success, oklch(.68 .18 145)))}.cngx-avatar__status--offline{background:var(--cngx-avatar-status-offline, oklch(.68 .01 240))}.cngx-avatar__status--busy{background:var(--cngx-avatar-status-busy, var(--cngx-color-danger, oklch(.62 .22 25)))}.cngx-avatar__status--away{background:var(--cngx-avatar-status-away, var(--cngx-color-warning, oklch(.72 .18 70)))}}}@media(forced-colors:active){.cngx-avatar{outline:1px solid CanvasText;outline-offset:-1px}.cngx-avatar .cngx-avatar__status{width:max(var(--cngx-avatar-status-size, .65em),.8em);height:max(var(--cngx-avatar-status-size, .65em),.8em);forced-color-adjust:none;border-color:Canvas;background:CanvasText}.cngx-avatar .cngx-avatar__status--offline{background:Canvas;box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--away{background:linear-gradient(90deg,CanvasText 50%,Canvas 50%);box-shadow:inset 0 0 0 1.5px CanvasText}.cngx-avatar .cngx-avatar__status--busy{background:linear-gradient(Canvas 0 0) center / 60% 22% no-repeat,CanvasText}}\n"] }]
|
|
467
|
+
}], propDecorators: { src: [{ type: i0.Input, args: [{ isSignal: true, alias: "src", required: false }] }], alt: [{ type: i0.Input, args: [{ isSignal: true, alias: "alt", required: false }] }], initials: [{ type: i0.Input, args: [{ isSignal: true, alias: "initials", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], status: [{ type: i0.Input, args: [{ isSignal: true, alias: "status", required: false }] }], statusLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "statusLabel", required: false }] }] } });
|
|
317
468
|
|
|
318
469
|
/**
|
|
319
470
|
* Stacked avatar group with an overflow pill. Project `<cngx-avatar>` children;
|
|
@@ -341,32 +492,62 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
341
492
|
* @relatedTo CngxAvatar
|
|
342
493
|
*/
|
|
343
494
|
class CngxAvatarGroup {
|
|
495
|
+
i18n = injectDisplayI18n();
|
|
344
496
|
/** Maximum avatars to show before collapsing the rest into the pill. Unset = show all. */
|
|
345
497
|
max = input(undefined, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
346
498
|
/** Size preset for the overflow pill and stacking overlap (mirrors `CngxAvatar`). */
|
|
347
499
|
size = input('md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
348
500
|
/** Pill shape (mirrors `CngxAvatar`). */
|
|
349
501
|
shape = input('circle', ...(ngDevMode ? [{ debugName: "shape" }] : /* istanbul ignore next */ []));
|
|
350
|
-
/**
|
|
351
|
-
|
|
502
|
+
/**
|
|
503
|
+
* Entity noun used in the `aria-label` summary. Unbound, it follows
|
|
504
|
+
* `CNGX_DISPLAY_I18N.avatarGroupNoun` (or its `avatarGroupLabel`
|
|
505
|
+
* formatter); a bound noun goes into the language's summary message.
|
|
506
|
+
*/
|
|
507
|
+
label = input(undefined, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
508
|
+
/**
|
|
509
|
+
* Format closure for the accessible summary. When set, it wins over
|
|
510
|
+
* `CNGX_DISPLAY_I18N.avatarGroupLabel` and the bound `label` noun.
|
|
511
|
+
* `hidden` is `0` when nothing is collapsed.
|
|
512
|
+
*/
|
|
513
|
+
labelFormat = input(undefined, ...(ngDevMode ? [{ debugName: "labelFormat" }] : /* istanbul ignore next */ []));
|
|
352
514
|
el = inject((ElementRef)).nativeElement;
|
|
353
515
|
avatars = contentChildren(CngxAvatar, ...(ngDevMode ? [{ debugName: "avatars" }] : /* istanbul ignore next */ []));
|
|
354
516
|
/** Total number of projected avatars. */
|
|
355
517
|
total = computed(() => this.avatars().length, ...(ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []));
|
|
356
|
-
/** How many avatars are actually shown (capped by `max`). */
|
|
518
|
+
/** How many avatars are actually shown (capped by `max`). `max=0` collapses all; negatives clamp to `0`. */
|
|
357
519
|
visibleCount = computed(() => {
|
|
358
520
|
const cap = this.max();
|
|
359
521
|
const count = this.total();
|
|
360
|
-
|
|
522
|
+
if (cap == null) {
|
|
523
|
+
return count;
|
|
524
|
+
}
|
|
525
|
+
const clamped = Math.max(0, cap);
|
|
526
|
+
return clamped < count ? clamped : count;
|
|
361
527
|
}, ...(ngDevMode ? [{ debugName: "visibleCount" }] : /* istanbul ignore next */ []));
|
|
362
528
|
/** How many avatars are collapsed into the `+N` pill. */
|
|
363
529
|
hiddenCount = computed(() => this.total() - this.visibleCount(), ...(ngDevMode ? [{ debugName: "hiddenCount" }] : /* istanbul ignore next */ []));
|
|
530
|
+
/** Visible `+N` pill text, with the count in the app locale. */
|
|
531
|
+
overflowText = computed(() => this.i18n().avatarGroupOverflow(this.hiddenCount()), ...(ngDevMode ? [{ debugName: "overflowText" }] : /* istanbul ignore next */ []));
|
|
364
532
|
/** Accessible summary of total and hidden counts. */
|
|
365
533
|
ariaLabel = computed(() => {
|
|
366
534
|
const total = this.total();
|
|
367
535
|
const hidden = this.hiddenCount();
|
|
536
|
+
const format = this.labelFormat();
|
|
537
|
+
if (format) {
|
|
538
|
+
return format(total, hidden);
|
|
539
|
+
}
|
|
540
|
+
const i18n = this.i18n();
|
|
368
541
|
const noun = this.label();
|
|
369
|
-
|
|
542
|
+
if (noun !== undefined) {
|
|
543
|
+
return i18n.avatarGroupLabelFor(total, hidden, noun);
|
|
544
|
+
}
|
|
545
|
+
// A consumer formatter owns word order and plurals; otherwise the resolved
|
|
546
|
+
// noun composes, so a noun-only override still reaches AT.
|
|
547
|
+
if (!isSectionAvatarGroupLabel(i18n.avatarGroupLabel)) {
|
|
548
|
+
return i18n.avatarGroupLabel(total, hidden);
|
|
549
|
+
}
|
|
550
|
+
return i18n.avatarGroupLabelFor(total, hidden, i18n.avatarGroupNoun);
|
|
370
551
|
}, ...(ngDevMode ? [{ debugName: "ariaLabel" }] : /* istanbul ignore next */ []));
|
|
371
552
|
constructor() {
|
|
372
553
|
// Cap the visible avatars by toggling `hidden` on the overflow hosts. Runs
|
|
@@ -379,10 +560,10 @@ class CngxAvatarGroup {
|
|
|
379
560
|
});
|
|
380
561
|
}
|
|
381
562
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxAvatarGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
382
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxAvatarGroup, isStandalone: true, selector: "cngx-avatar-group", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "ariaLabel()", "class.cngx-avatar-group--xs": "size() === \"xs\"", "class.cngx-avatar-group--sm": "size() === \"sm\"", "class.cngx-avatar-group--md": "size() === \"md\"", "class.cngx-avatar-group--lg": "size() === \"lg\"", "class.cngx-avatar-group--xl": "size() === \"xl\"", "class.cngx-avatar-group--square": "shape() === \"square\"" }, classAttribute: "cngx-avatar-group" }, queries: [{ propertyName: "avatars", predicate: CngxAvatar, isSignal: true }], exportAs: ["cngxAvatarGroup"], ngImport: i0, template: `
|
|
563
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxAvatarGroup, isStandalone: true, selector: "cngx-avatar-group", inputs: { max: { classPropertyName: "max", publicName: "max", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, shape: { classPropertyName: "shape", publicName: "shape", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labelFormat: { classPropertyName: "labelFormat", publicName: "labelFormat", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "group" }, properties: { "attr.aria-label": "ariaLabel()", "class.cngx-avatar-group--xs": "size() === \"xs\"", "class.cngx-avatar-group--sm": "size() === \"sm\"", "class.cngx-avatar-group--md": "size() === \"md\"", "class.cngx-avatar-group--lg": "size() === \"lg\"", "class.cngx-avatar-group--xl": "size() === \"xl\"", "class.cngx-avatar-group--square": "shape() === \"square\"" }, classAttribute: "cngx-avatar-group" }, queries: [{ propertyName: "avatars", predicate: CngxAvatar, isSignal: true }], exportAs: ["cngxAvatarGroup"], ngImport: i0, template: `
|
|
383
564
|
<ng-content select="cngx-avatar" />
|
|
384
565
|
@if (hiddenCount() > 0) {
|
|
385
|
-
<span class="cngx-avatar-group__overflow" aria-hidden="true"
|
|
566
|
+
<span class="cngx-avatar-group__overflow" aria-hidden="true">{{ overflowText() }}</span>
|
|
386
567
|
}
|
|
387
568
|
`, isInline: true, styles: [".cngx-avatar-group{display:inline-flex;align-items:center}.cngx-avatar-group>.cngx-avatar,.cngx-avatar-group__overflow{border:var(--cngx-avatar-group-ring-width, 2px) solid var(--cngx-avatar-group-ring-color, var(--cngx-color-surface, oklch(1 0 0)))}.cngx-avatar-group>.cngx-avatar:not(:first-child),.cngx-avatar-group__overflow{margin-inline-start:var(--cngx-avatar-group-overlap, -.5rem)}.cngx-avatar-group__overflow{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;inline-size:var(--cngx-avatar-group-pill-size, 2.5rem);block-size:var(--cngx-avatar-group-pill-size, 2.5rem);border-radius:50%;background:var(--cngx-avatar-group-pill-bg, var(--cngx-color-muted, oklch(.92 .005 250)));color:var(--cngx-avatar-group-pill-color, var(--cngx-color-text, oklch(.2 .01 250)));font-size:var(--cngx-avatar-group-pill-font-size, .8125rem);font-weight:600;line-height:1;unicode-bidi:var(--cngx-avatar-group-overflow-bidi, isolate);direction:var(--cngx-avatar-group-overflow-direction, ltr)}.cngx-avatar-group--square .cngx-avatar-group__overflow{border-radius:var(--cngx-radius-md, .375rem)}.cngx-avatar-group--xs{--cngx-avatar-group-pill-size: 1.5rem;--cngx-avatar-group-overlap: -.375rem;--cngx-avatar-group-pill-font-size: .625rem}.cngx-avatar-group--sm{--cngx-avatar-group-pill-size: 2rem;--cngx-avatar-group-overlap: -.5rem;--cngx-avatar-group-pill-font-size: .75rem}.cngx-avatar-group--md{--cngx-avatar-group-pill-size: 2.5rem;--cngx-avatar-group-overlap: -.625rem;--cngx-avatar-group-pill-font-size: .8125rem}.cngx-avatar-group--lg{--cngx-avatar-group-pill-size: 3rem;--cngx-avatar-group-overlap: -.75rem;--cngx-avatar-group-pill-font-size: .875rem}.cngx-avatar-group--xl{--cngx-avatar-group-pill-size: 4rem;--cngx-avatar-group-overlap: -1rem;--cngx-avatar-group-pill-font-size: 1rem}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
388
569
|
}
|
|
@@ -401,11 +582,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
401
582
|
}, template: `
|
|
402
583
|
<ng-content select="cngx-avatar" />
|
|
403
584
|
@if (hiddenCount() > 0) {
|
|
404
|
-
<span class="cngx-avatar-group__overflow" aria-hidden="true"
|
|
585
|
+
<span class="cngx-avatar-group__overflow" aria-hidden="true">{{ overflowText() }}</span>
|
|
405
586
|
}
|
|
406
587
|
`, styles: [".cngx-avatar-group{display:inline-flex;align-items:center}.cngx-avatar-group>.cngx-avatar,.cngx-avatar-group__overflow{border:var(--cngx-avatar-group-ring-width, 2px) solid var(--cngx-avatar-group-ring-color, var(--cngx-color-surface, oklch(1 0 0)))}.cngx-avatar-group>.cngx-avatar:not(:first-child),.cngx-avatar-group__overflow{margin-inline-start:var(--cngx-avatar-group-overlap, -.5rem)}.cngx-avatar-group__overflow{display:inline-flex;align-items:center;justify-content:center;box-sizing:border-box;inline-size:var(--cngx-avatar-group-pill-size, 2.5rem);block-size:var(--cngx-avatar-group-pill-size, 2.5rem);border-radius:50%;background:var(--cngx-avatar-group-pill-bg, var(--cngx-color-muted, oklch(.92 .005 250)));color:var(--cngx-avatar-group-pill-color, var(--cngx-color-text, oklch(.2 .01 250)));font-size:var(--cngx-avatar-group-pill-font-size, .8125rem);font-weight:600;line-height:1;unicode-bidi:var(--cngx-avatar-group-overflow-bidi, isolate);direction:var(--cngx-avatar-group-overflow-direction, ltr)}.cngx-avatar-group--square .cngx-avatar-group__overflow{border-radius:var(--cngx-radius-md, .375rem)}.cngx-avatar-group--xs{--cngx-avatar-group-pill-size: 1.5rem;--cngx-avatar-group-overlap: -.375rem;--cngx-avatar-group-pill-font-size: .625rem}.cngx-avatar-group--sm{--cngx-avatar-group-pill-size: 2rem;--cngx-avatar-group-overlap: -.5rem;--cngx-avatar-group-pill-font-size: .75rem}.cngx-avatar-group--md{--cngx-avatar-group-pill-size: 2.5rem;--cngx-avatar-group-overlap: -.625rem;--cngx-avatar-group-pill-font-size: .8125rem}.cngx-avatar-group--lg{--cngx-avatar-group-pill-size: 3rem;--cngx-avatar-group-overlap: -.75rem;--cngx-avatar-group-pill-font-size: .875rem}.cngx-avatar-group--xl{--cngx-avatar-group-pill-size: 4rem;--cngx-avatar-group-overlap: -1rem;--cngx-avatar-group-pill-font-size: 1rem}\n"] }]
|
|
407
|
-
}], ctorParameters: () => [], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], avatars: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxAvatar), { isSignal: true }] }] } });
|
|
588
|
+
}], ctorParameters: () => [], propDecorators: { max: [{ type: i0.Input, args: [{ isSignal: true, alias: "max", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], shape: [{ type: i0.Input, args: [{ isSignal: true, alias: "shape", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labelFormat: [{ type: i0.Input, args: [{ isSignal: true, alias: "labelFormat", required: false }] }], avatars: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => CngxAvatar), { isSignal: true }] }] } });
|
|
408
589
|
|
|
590
|
+
const NUMBER_FORMAT = {};
|
|
409
591
|
/**
|
|
410
592
|
* Generic counter / dot indicator that attaches a small floating element to
|
|
411
593
|
* any host. Purely presentational (`aria-hidden="true"`) - semantic meaning
|
|
@@ -427,7 +609,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
427
609
|
* <example-url>http://localhost:4200/#/common/display/badge/inline-and-hidden</example-url>
|
|
428
610
|
*/
|
|
429
611
|
class CngxBadge {
|
|
430
|
-
/**
|
|
612
|
+
/**
|
|
613
|
+
* Raw value. Numbers show as text (respecting `max`); booleans flip dot
|
|
614
|
+
* mode; strings render verbatim. Numbers at or below `0` count as empty -
|
|
615
|
+
* a negative count never renders, mirroring the `0` behaviour.
|
|
616
|
+
*/
|
|
431
617
|
cngxBadge = input.required(...(ngDevMode ? [{ debugName: "cngxBadge" }] : /* istanbul ignore next */ []));
|
|
432
618
|
/** Color variant. */
|
|
433
619
|
color = input('primary', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
@@ -435,8 +621,13 @@ class CngxBadge {
|
|
|
435
621
|
position = input('above-end', ...(ngDevMode ? [{ debugName: "position" }] : /* istanbul ignore next */ []));
|
|
436
622
|
/** Whether the indicator is hidden regardless of value. */
|
|
437
623
|
hidden = input(false, ...(ngDevMode ? [{ debugName: "hidden" }] : /* istanbul ignore next */ []));
|
|
438
|
-
/**
|
|
624
|
+
/**
|
|
625
|
+
* Cap for numeric values - anything over renders through
|
|
626
|
+
* `CNGX_DISPLAY_I18N.badgeOverflow` (English `"99+"`).
|
|
627
|
+
*/
|
|
439
628
|
max = input(99, ...(ngDevMode ? [{ debugName: "max" }] : /* istanbul ignore next */ []));
|
|
629
|
+
i18n = injectDisplayI18n();
|
|
630
|
+
locale = injectLocale();
|
|
440
631
|
hostEl = inject((ElementRef));
|
|
441
632
|
renderer = inject(Renderer2);
|
|
442
633
|
badgeEl = null;
|
|
@@ -446,7 +637,7 @@ class CngxBadge {
|
|
|
446
637
|
isEmpty = computed(() => {
|
|
447
638
|
const v = this.cngxBadge();
|
|
448
639
|
if (typeof v === 'number') {
|
|
449
|
-
return v
|
|
640
|
+
return v <= 0;
|
|
450
641
|
}
|
|
451
642
|
if (typeof v === 'boolean') {
|
|
452
643
|
return v === false;
|
|
@@ -461,7 +652,9 @@ class CngxBadge {
|
|
|
461
652
|
}
|
|
462
653
|
if (typeof v === 'number') {
|
|
463
654
|
const m = this.max();
|
|
464
|
-
return v > m
|
|
655
|
+
return v > m
|
|
656
|
+
? this.i18n().badgeOverflow(m)
|
|
657
|
+
: numberFormatterFor(this.locale(), NUMBER_FORMAT).format(v);
|
|
465
658
|
}
|
|
466
659
|
return v;
|
|
467
660
|
}, ...(ngDevMode ? [{ debugName: "displayValue" }] : /* istanbul ignore next */ []));
|
|
@@ -596,6 +789,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
596
789
|
* <example-url>http://localhost:4200/#/common/interactive/chip/multi-group/multi-select-chips-with-selection-count</example-url>
|
|
597
790
|
*/
|
|
598
791
|
class CngxChip {
|
|
792
|
+
i18n = injectDisplayI18n();
|
|
599
793
|
/**
|
|
600
794
|
* Whether the close button is rendered. Typed as `boolean` - bind a
|
|
601
795
|
* signal getter (`[removable]="!select.disabled()"`) if the flag
|
|
@@ -609,12 +803,14 @@ class CngxChip {
|
|
|
609
803
|
*/
|
|
610
804
|
id = input(null, ...(ngDevMode ? [{ debugName: "id" }] : /* istanbul ignore next */ []));
|
|
611
805
|
/**
|
|
612
|
-
* A11y label for the close button.
|
|
613
|
-
* consumers with option
|
|
806
|
+
* A11y label for the close button. Unbound, it follows
|
|
807
|
+
* `CNGX_DISPLAY_I18N.chipRemove` (English "Remove"); consumers with option
|
|
808
|
+
* labels on hand should supply something more
|
|
614
809
|
* specific (e.g. `"Remove Red"`) so screen readers know which chip
|
|
615
810
|
* the button removes.
|
|
616
811
|
*/
|
|
617
|
-
removeAriaLabel = input(
|
|
812
|
+
removeAriaLabel = input(undefined, ...(ngDevMode ? [{ debugName: "removeAriaLabel" }] : /* istanbul ignore next */ []));
|
|
813
|
+
resolvedRemoveAriaLabel = computed(() => this.removeAriaLabel() ?? this.i18n().chipRemove, ...(ngDevMode ? [{ debugName: "resolvedRemoveAriaLabel" }] : /* istanbul ignore next */ []));
|
|
618
814
|
/** Fires when the user clicks the close button. */
|
|
619
815
|
remove = output();
|
|
620
816
|
autoId = nextUid('cngx-chip');
|
|
@@ -633,7 +829,7 @@ class CngxChip {
|
|
|
633
829
|
<button
|
|
634
830
|
type="button"
|
|
635
831
|
class="cngx-chip__remove"
|
|
636
|
-
[attr.aria-label]="
|
|
832
|
+
[attr.aria-label]="resolvedRemoveAriaLabel()"
|
|
637
833
|
(click)="handleRemoveClick($event)"
|
|
638
834
|
>
|
|
639
835
|
<!--
|
|
@@ -655,7 +851,7 @@ class CngxChip {
|
|
|
655
851
|
</ng-content>
|
|
656
852
|
</button>
|
|
657
853
|
}
|
|
658
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false; initial-value: .875em;}@property --cngx-chip-transition{syntax: \"*\"; inherits: false; initial-value: background-color .15s ease,color .15s ease,border-color .15s ease;}@property --cngx-chip-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .2);}@property --cngx-chip-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-focus-outline{syntax: \"*\"; inherits: false; initial-value: 2px solid oklch(.66 .19 50);}@property --cngx-chip-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-
|
|
854
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false; initial-value: .875em;}@property --cngx-chip-transition{syntax: \"*\"; inherits: false; initial-value: background-color .15s ease,color .15s ease,border-color .15s ease;}:where(.cngx-chip){--cngx-chip-transition: background-color var(--cngx-duration-fast) ease, color var(--cngx-duration-fast) ease, border-color var(--cngx-duration-fast) ease}@property --cngx-chip-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .2);}@property --cngx-chip-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-focus-outline{syntax: \"*\"; inherits: false; initial-value: 2px solid oklch(.66 .19 50);}@property --cngx-chip-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-selected-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .32);}@property --cngx-chip-selected-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .12 240 / .16);}@property --cngx-chip-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 240);}@property --cngx-chip-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 145 / .16);}@property --cngx-chip-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 145);}@property --cngx-chip-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .15 75 / .18);}@property --cngx-chip-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 75);}@property --cngx-chip-danger-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25 / .18);}@property --cngx-chip-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .2 25);}@property --cngx-chip-remove-radius{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-remove-focus-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-remove-focus-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-chip-remove-focus-offset{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25)}}[data-color-scheme=dark],.dark{--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25)}[data-color-scheme=light],.light{--cngx-chip-info-color: oklch(.45 .12 240);--cngx-chip-success-color: oklch(.45 .15 145);--cngx-chip-warning-color: oklch(.5 .15 75);--cngx-chip-danger-color: oklch(.5 .2 25)}}@layer cngx.components{@scope(.cngx-chip){:scope{display:inline-flex;align-items:center;line-height:1.25;max-width:100%;box-sizing:border-box;--cngx-chip-inner-gap: var(--cngx-space-xs);--cngx-chip-padding-block: var(--cngx-space-xs);--cngx-chip-padding-inline: var(--cngx-space-sm);gap:var(--cngx-chip-inner-gap, var(--cngx-space-xs, 4px));padding-block:var(--cngx-chip-padding-block, 2px);padding-inline:var(--cngx-chip-padding-inline, var(--cngx-space-sm, 8px));border-radius:var(--cngx-chip-radius, var(--cngx-radius-pill, 999px));background:var(--cngx-chip-bg, oklch(.66 .19 50 / .12));color:var(--cngx-chip-color, inherit);border:var(--cngx-chip-border, 0 solid transparent);font-size:var(--cngx-chip-font-size, var(--cngx-font-size-sm, .8125rem));transition:var( --cngx-chip-transition, background-color .15s ease, color .15s ease, border-color .15s ease )}:scope[role=button],:scope[tabindex],:scope:has(.cngx-chip__remove){cursor:pointer;justify-content:center;min-block-size:var(--cngx-target-min, 0px);min-inline-size:var(--cngx-target-min, 0px)}:scope[role=button]:hover,:scope[tabindex]:hover,:scope:has(.cngx-chip__remove):hover{background:var(--cngx-chip-hover-bg, oklch(.66 .19 50 / .2));color:var(--cngx-chip-hover-color, inherit)}:scope:focus-visible{outline:var( --cngx-chip-focus-outline, 2px solid var(--cngx-color-primary, oklch(.66 .19 50)) );outline-offset:var(--cngx-chip-focus-outline-offset, 2px)}:scope[aria-selected=true],:scope[aria-pressed=true]{background:var(--cngx-chip-selected-bg, oklch(.66 .19 50 / .32));color:var(--cngx-chip-selected-color, inherit)}:scope[data-color=info]{background:var(--cngx-chip-info-bg);color:var(--cngx-chip-info-color)}:scope[data-color=success]{background:var(--cngx-chip-success-bg);color:var(--cngx-chip-success-color)}:scope[data-color=warning]{background:var(--cngx-chip-warning-bg);color:var(--cngx-chip-warning-color)}:scope[data-color=danger]{background:var(--cngx-chip-danger-bg);color:var(--cngx-chip-danger-color)}:scope[aria-disabled=true],:scope:disabled{background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 6%,transparent);color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent);cursor:not-allowed;pointer-events:none}:scope:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 16%,transparent)}.cngx-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.cngx-chip__remove{appearance:none;border:0;background:transparent;color:inherit;cursor:pointer;padding:0 2px;font:inherit;line-height:1;flex:0 0 auto;color:color-mix(in oklab,currentColor 70%,transparent);border-radius:var(--cngx-chip-remove-radius, var(--cngx-radius-sm, 2px));display:inline-flex;align-items:center;justify-content:center;min-inline-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));min-block-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));margin:calc(-.5*max(0px,var(--cngx-chip-remove-target, 1.5rem) - max(1em,var(--cngx-target-min, 0px))))}.cngx-chip__remove:hover{color:inherit}.cngx-chip__remove:focus-visible{outline:var(--cngx-chip-remove-focus-width, 2px) solid var(--cngx-chip-remove-focus-color, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:var(--cngx-chip-remove-focus-offset, 1px)}}}@media(forced-colors:active){.cngx-chip{border:1px solid ButtonBorder}.cngx-chip[aria-selected=true],.cngx-chip[aria-pressed=true]{background:Highlight!important;color:HighlightText!important;border-color:Highlight!important;forced-color-adjust:none;--_cngx-forced-ink: HighlightText}.cngx-chip:is([aria-disabled=true],:disabled){color:GrayText;border-color:GrayText}.cngx-chip:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:GrayText!important;color:Canvas!important;border-color:GrayText!important}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
659
855
|
}
|
|
660
856
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxChip, decorators: [{
|
|
661
857
|
type: Component,
|
|
@@ -670,7 +866,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
670
866
|
<button
|
|
671
867
|
type="button"
|
|
672
868
|
class="cngx-chip__remove"
|
|
673
|
-
[attr.aria-label]="
|
|
869
|
+
[attr.aria-label]="resolvedRemoveAriaLabel()"
|
|
674
870
|
(click)="handleRemoveClick($event)"
|
|
675
871
|
>
|
|
676
872
|
<!--
|
|
@@ -692,7 +888,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
692
888
|
</ng-content>
|
|
693
889
|
</button>
|
|
694
890
|
}
|
|
695
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false; initial-value: .875em;}@property --cngx-chip-transition{syntax: \"*\"; inherits: false; initial-value: background-color .15s ease,color .15s ease,border-color .15s ease;}@property --cngx-chip-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .2);}@property --cngx-chip-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-focus-outline{syntax: \"*\"; inherits: false; initial-value: 2px solid oklch(.66 .19 50);}@property --cngx-chip-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-
|
|
891
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-chip-inner-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-chip-padding-block{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-padding-inline{syntax: \"<length>\"; inherits: false; initial-value: 8px;}@property --cngx-chip-radius{syntax: \"<length>\"; inherits: false; initial-value: 999px;}@property --cngx-chip-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .12);}@property --cngx-chip-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-border{syntax: \"*\"; inherits: false; initial-value: 0 solid transparent;}@property --cngx-chip-font-size{syntax: \"*\"; inherits: false; initial-value: .875em;}@property --cngx-chip-transition{syntax: \"*\"; inherits: false; initial-value: background-color .15s ease,color .15s ease,border-color .15s ease;}:where(.cngx-chip){--cngx-chip-transition: background-color var(--cngx-duration-fast) ease, color var(--cngx-duration-fast) ease, border-color var(--cngx-duration-fast) ease}@property --cngx-chip-hover-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .2);}@property --cngx-chip-hover-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-focus-outline{syntax: \"*\"; inherits: false; initial-value: 2px solid oklch(.66 .19 50);}@property --cngx-chip-focus-outline-offset{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-selected-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50 / .32);}@property --cngx-chip-selected-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-chip-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .12 240 / .16);}@property --cngx-chip-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 240);}@property --cngx-chip-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 145 / .16);}@property --cngx-chip-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .15 145);}@property --cngx-chip-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .15 75 / .18);}@property --cngx-chip-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .15 75);}@property --cngx-chip-danger-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25 / .18);}@property --cngx-chip-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.5 .2 25);}@property --cngx-chip-remove-radius{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-remove-focus-width{syntax: \"<length>\"; inherits: false; initial-value: 2px;}@property --cngx-chip-remove-focus-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-chip-remove-focus-offset{syntax: \"<length>\"; inherits: false; initial-value: 1px;}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25)}}[data-color-scheme=dark],.dark{--cngx-chip-info-color: oklch(.85 .13 250);--cngx-chip-success-color: oklch(.85 .13 145);--cngx-chip-warning-color: oklch(.88 .14 75);--cngx-chip-danger-color: oklch(.82 .15 25)}[data-color-scheme=light],.light{--cngx-chip-info-color: oklch(.45 .12 240);--cngx-chip-success-color: oklch(.45 .15 145);--cngx-chip-warning-color: oklch(.5 .15 75);--cngx-chip-danger-color: oklch(.5 .2 25)}}@layer cngx.components{@scope(.cngx-chip){:scope{display:inline-flex;align-items:center;line-height:1.25;max-width:100%;box-sizing:border-box;--cngx-chip-inner-gap: var(--cngx-space-xs);--cngx-chip-padding-block: var(--cngx-space-xs);--cngx-chip-padding-inline: var(--cngx-space-sm);gap:var(--cngx-chip-inner-gap, var(--cngx-space-xs, 4px));padding-block:var(--cngx-chip-padding-block, 2px);padding-inline:var(--cngx-chip-padding-inline, var(--cngx-space-sm, 8px));border-radius:var(--cngx-chip-radius, var(--cngx-radius-pill, 999px));background:var(--cngx-chip-bg, oklch(.66 .19 50 / .12));color:var(--cngx-chip-color, inherit);border:var(--cngx-chip-border, 0 solid transparent);font-size:var(--cngx-chip-font-size, var(--cngx-font-size-sm, .8125rem));transition:var( --cngx-chip-transition, background-color .15s ease, color .15s ease, border-color .15s ease )}:scope[role=button],:scope[tabindex],:scope:has(.cngx-chip__remove){cursor:pointer;justify-content:center;min-block-size:var(--cngx-target-min, 0px);min-inline-size:var(--cngx-target-min, 0px)}:scope[role=button]:hover,:scope[tabindex]:hover,:scope:has(.cngx-chip__remove):hover{background:var(--cngx-chip-hover-bg, oklch(.66 .19 50 / .2));color:var(--cngx-chip-hover-color, inherit)}:scope:focus-visible{outline:var( --cngx-chip-focus-outline, 2px solid var(--cngx-color-primary, oklch(.66 .19 50)) );outline-offset:var(--cngx-chip-focus-outline-offset, 2px)}:scope[aria-selected=true],:scope[aria-pressed=true]{background:var(--cngx-chip-selected-bg, oklch(.66 .19 50 / .32));color:var(--cngx-chip-selected-color, inherit)}:scope[data-color=info]{background:var(--cngx-chip-info-bg);color:var(--cngx-chip-info-color)}:scope[data-color=success]{background:var(--cngx-chip-success-bg);color:var(--cngx-chip-success-color)}:scope[data-color=warning]{background:var(--cngx-chip-warning-bg);color:var(--cngx-chip-warning-color)}:scope[data-color=danger]{background:var(--cngx-chip-danger-bg);color:var(--cngx-chip-danger-color)}:scope[aria-disabled=true],:scope:disabled{background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 6%,transparent);color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent);cursor:not-allowed;pointer-events:none}:scope:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 16%,transparent)}.cngx-chip__label{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}.cngx-chip__remove{appearance:none;border:0;background:transparent;color:inherit;cursor:pointer;padding:0 2px;font:inherit;line-height:1;flex:0 0 auto;color:color-mix(in oklab,currentColor 70%,transparent);border-radius:var(--cngx-chip-remove-radius, var(--cngx-radius-sm, 2px));display:inline-flex;align-items:center;justify-content:center;min-inline-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));min-block-size:max(var(--cngx-chip-remove-target, 1.5rem),var(--cngx-target-min, 0px));margin:calc(-.5*max(0px,var(--cngx-chip-remove-target, 1.5rem) - max(1em,var(--cngx-target-min, 0px))))}.cngx-chip__remove:hover{color:inherit}.cngx-chip__remove:focus-visible{outline:var(--cngx-chip-remove-focus-width, 2px) solid var(--cngx-chip-remove-focus-color, var(--cngx-color-primary, oklch(.66 .19 50)));outline-offset:var(--cngx-chip-remove-focus-offset, 1px)}}}@media(forced-colors:active){.cngx-chip{border:1px solid ButtonBorder}.cngx-chip[aria-selected=true],.cngx-chip[aria-pressed=true]{background:Highlight!important;color:HighlightText!important;border-color:Highlight!important;forced-color-adjust:none;--_cngx-forced-ink: HighlightText}.cngx-chip:is([aria-disabled=true],:disabled){color:GrayText;border-color:GrayText}.cngx-chip:is([aria-disabled=true],:disabled):is([aria-selected=true],[aria-pressed=true]){background:GrayText!important;color:Canvas!important;border-color:GrayText!important}}\n"] }]
|
|
696
892
|
}], propDecorators: { removable: [{ type: i0.Input, args: [{ isSignal: true, alias: "removable", required: false }] }], id: [{ type: i0.Input, args: [{ isSignal: true, alias: "id", required: false }] }], removeAriaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "removeAriaLabel", required: false }] }], remove: [{ type: i0.Output, args: ["remove"] }] } });
|
|
697
893
|
|
|
698
894
|
/** Tone glyph rendered inside the decorative dot - the non-colour signal. */
|
|
@@ -762,16 +958,16 @@ class CngxStatus {
|
|
|
762
958
|
/** @internal Tone glyph char bound into the decorative dot. */
|
|
763
959
|
glyphChar = computed(() => TONE_GLYPH[this.tone()], ...(ngDevMode ? [{ debugName: "glyphChar" }] : /* istanbul ignore next */ []));
|
|
764
960
|
constructor() {
|
|
765
|
-
if (
|
|
961
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
766
962
|
afterNextRender(() => {
|
|
767
963
|
const el = this.elRef.nativeElement;
|
|
768
|
-
if (!this.label() &&
|
|
769
|
-
|
|
770
|
-
'
|
|
771
|
-
'
|
|
964
|
+
if (!this.label() && el.getAttribute('aria-hidden') !== 'true') {
|
|
965
|
+
cngxDevWarn('CNGX1016', '[cngx-status] no `label`; the status has no accessible name and reads only as a ' +
|
|
966
|
+
'coloured dot. Set [label]: the host has no role, so an aria-label or ' +
|
|
967
|
+
'aria-labelledby on it is not a valid name.');
|
|
772
968
|
}
|
|
773
969
|
if (!this.glyph() && !this.label()) {
|
|
774
|
-
|
|
970
|
+
cngxDevWarn('CNGX1017', '[cngx-status] [glyph]="false" with no visible `label`; a bare coloured ' +
|
|
775
971
|
'dot is colour-only for a sighted colour-blind reader even with an ' +
|
|
776
972
|
'aria-label. Set [label] or show the glyph.');
|
|
777
973
|
}
|
|
@@ -784,7 +980,7 @@ class CngxStatus {
|
|
|
784
980
|
@if (label()) {
|
|
785
981
|
<span class="cngx-status__label">{{ label() }}</span>
|
|
786
982
|
}
|
|
787
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-glyph-size{syntax: \"*\"; inherits: true; initial-value: .7em;}@property --cngx-status-dot-fg{syntax: \"<color>\"; inherits: true; initial-value: white;}@property --cngx-status-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-status-weight{syntax: \"<number>\"; inherits: true; initial-value: 500;}@property --cngx-status-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .18 145);}@property --cngx-status-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.75 .15 85);}@property --cngx-status-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-status-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .14 250);}@property --cngx-status-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .02 290);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}}[data-color-scheme=dark],.dark{--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}[data-color-scheme=light],.light{--cngx-status-success-color: oklch(.65 .18 145);--cngx-status-warning-color: oklch(.75 .15 85);--cngx-status-danger-color: oklch(.65 .22 25);--cngx-status-info-color: oklch(.6 .14 250);--cngx-status-neutral-color: oklch(.6 .02 290)}}@layer cngx.components{@scope(.cngx-status){:scope{--cngx-status-gap: var(--cngx-space-sm);display:inline-flex;align-items:center;gap:var(--cngx-status-gap, 6px);font-size:var(--cngx-status-size, .8125rem);font-weight:var(--cngx-status-weight, 500)}.cngx-status__dot{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-status-dot-size, 16px);block-size:var(--cngx-status-dot-size, 16px);border-radius:50%;font-size:var(--cngx-status-glyph-size, .7em);line-height:1;color:var(--cngx-status-dot-fg, white);background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope.cngx-status--success .cngx-status__dot{background:var(--cngx-status-success-color, var(--cngx-color-success, oklch(.65 .18 145)))}:scope.cngx-status--warning .cngx-status__dot{background:var(--cngx-status-warning-color, oklch(.75 .15 85))}:scope.cngx-status--danger .cngx-status__dot{background:var(--cngx-status-danger-color, var(--cngx-color-danger, oklch(.65 .22 25)))}:scope.cngx-status--info .cngx-status__dot{background:var(--cngx-status-info-color, oklch(.6 .14 250))}:scope.cngx-status--neutral .cngx-status__dot{background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
983
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-glyph-size{syntax: \"*\"; inherits: true; initial-value: .7em;}@property --cngx-status-dot-fg{syntax: \"<color>\"; inherits: true; initial-value: white;}@property --cngx-status-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-status-weight{syntax: \"<number>\"; inherits: true; initial-value: 500;}@property --cngx-status-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .18 145);}@property --cngx-status-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.75 .15 85);}@property --cngx-status-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-status-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .14 250);}@property --cngx-status-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .02 290);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}}[data-color-scheme=dark],.dark{--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}[data-color-scheme=light],.light{--cngx-status-success-color: oklch(.65 .18 145);--cngx-status-warning-color: oklch(.75 .15 85);--cngx-status-danger-color: oklch(.65 .22 25);--cngx-status-info-color: oklch(.6 .14 250);--cngx-status-neutral-color: oklch(.6 .02 290)}}@layer cngx.components{@scope(.cngx-status){:scope{--cngx-status-gap: var(--cngx-space-sm);display:inline-flex;align-items:center;gap:var(--cngx-status-gap, 6px);font-size:var(--cngx-status-size, .8125rem);font-weight:var(--cngx-status-weight, 500)}.cngx-status__dot{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-status-dot-size, 16px);block-size:var(--cngx-status-dot-size, 16px);border-radius:50%;font-size:var(--cngx-status-glyph-size, .7em);line-height:1;color:var(--cngx-status-dot-fg, white);background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope.cngx-status--success .cngx-status__dot{background:var(--cngx-status-success-color, var(--cngx-color-success, oklch(.65 .18 145)))}:scope.cngx-status--warning .cngx-status__dot{background:var(--cngx-status-warning-color, oklch(.75 .15 85))}:scope.cngx-status--danger .cngx-status__dot{background:var(--cngx-status-danger-color, var(--cngx-color-danger, oklch(.65 .22 25)))}:scope.cngx-status--info .cngx-status__dot{background:var(--cngx-status-info-color, oklch(.6 .14 250))}:scope.cngx-status--neutral .cngx-status__dot{background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}}}@media(forced-colors:active){.cngx-status .cngx-status__dot:empty{background:CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
788
984
|
}
|
|
789
985
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxStatus, decorators: [{
|
|
790
986
|
type: Component,
|
|
@@ -801,7 +997,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
801
997
|
@if (label()) {
|
|
802
998
|
<span class="cngx-status__label">{{ label() }}</span>
|
|
803
999
|
}
|
|
804
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-glyph-size{syntax: \"*\"; inherits: true; initial-value: .7em;}@property --cngx-status-dot-fg{syntax: \"<color>\"; inherits: true; initial-value: white;}@property --cngx-status-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-status-weight{syntax: \"<number>\"; inherits: true; initial-value: 500;}@property --cngx-status-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .18 145);}@property --cngx-status-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.75 .15 85);}@property --cngx-status-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-status-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .14 250);}@property --cngx-status-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .02 290);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}}[data-color-scheme=dark],.dark{--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}[data-color-scheme=light],.light{--cngx-status-success-color: oklch(.65 .18 145);--cngx-status-warning-color: oklch(.75 .15 85);--cngx-status-danger-color: oklch(.65 .22 25);--cngx-status-info-color: oklch(.6 .14 250);--cngx-status-neutral-color: oklch(.6 .02 290)}}@layer cngx.components{@scope(.cngx-status){:scope{--cngx-status-gap: var(--cngx-space-sm);display:inline-flex;align-items:center;gap:var(--cngx-status-gap, 6px);font-size:var(--cngx-status-size, .8125rem);font-weight:var(--cngx-status-weight, 500)}.cngx-status__dot{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-status-dot-size, 16px);block-size:var(--cngx-status-dot-size, 16px);border-radius:50%;font-size:var(--cngx-status-glyph-size, .7em);line-height:1;color:var(--cngx-status-dot-fg, white);background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope.cngx-status--success .cngx-status__dot{background:var(--cngx-status-success-color, var(--cngx-color-success, oklch(.65 .18 145)))}:scope.cngx-status--warning .cngx-status__dot{background:var(--cngx-status-warning-color, oklch(.75 .15 85))}:scope.cngx-status--danger .cngx-status__dot{background:var(--cngx-status-danger-color, var(--cngx-color-danger, oklch(.65 .22 25)))}:scope.cngx-status--info .cngx-status__dot{background:var(--cngx-status-info-color, oklch(.6 .14 250))}:scope.cngx-status--neutral .cngx-status__dot{background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}}}\n"] }]
|
|
1000
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-status-gap{syntax: \"<length>\"; inherits: true; initial-value: 6px;}@property --cngx-status-dot-size{syntax: \"<length>\"; inherits: true; initial-value: 16px;}@property --cngx-status-glyph-size{syntax: \"*\"; inherits: true; initial-value: .7em;}@property --cngx-status-dot-fg{syntax: \"<color>\"; inherits: true; initial-value: white;}@property --cngx-status-size{syntax: \"*\"; inherits: true; initial-value: .8125rem;}@property --cngx-status-weight{syntax: \"<number>\"; inherits: true; initial-value: 500;}@property --cngx-status-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .18 145);}@property --cngx-status-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.75 .15 85);}@property --cngx-status-danger-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-status-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .14 250);}@property --cngx-status-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.6 .02 290);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}}[data-color-scheme=dark],.dark{--cngx-status-success-color: oklch(.78 .16 145);--cngx-status-warning-color: oklch(.82 .13 85);--cngx-status-danger-color: oklch(.75 .18 25);--cngx-status-info-color: oklch(.72 .12 250);--cngx-status-neutral-color: oklch(.7 .02 290)}[data-color-scheme=light],.light{--cngx-status-success-color: oklch(.65 .18 145);--cngx-status-warning-color: oklch(.75 .15 85);--cngx-status-danger-color: oklch(.65 .22 25);--cngx-status-info-color: oklch(.6 .14 250);--cngx-status-neutral-color: oklch(.6 .02 290)}}@layer cngx.components{@scope(.cngx-status){:scope{--cngx-status-gap: var(--cngx-space-sm);display:inline-flex;align-items:center;gap:var(--cngx-status-gap, 6px);font-size:var(--cngx-status-size, .8125rem);font-weight:var(--cngx-status-weight, 500)}.cngx-status__dot{display:inline-flex;align-items:center;justify-content:center;flex:none;inline-size:var(--cngx-status-dot-size, 16px);block-size:var(--cngx-status-dot-size, 16px);border-radius:50%;font-size:var(--cngx-status-glyph-size, .7em);line-height:1;color:var(--cngx-status-dot-fg, white);background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}:scope.cngx-status--success .cngx-status__dot{background:var(--cngx-status-success-color, var(--cngx-color-success, oklch(.65 .18 145)))}:scope.cngx-status--warning .cngx-status__dot{background:var(--cngx-status-warning-color, oklch(.75 .15 85))}:scope.cngx-status--danger .cngx-status__dot{background:var(--cngx-status-danger-color, var(--cngx-color-danger, oklch(.65 .22 25)))}:scope.cngx-status--info .cngx-status__dot{background:var(--cngx-status-info-color, oklch(.6 .14 250))}:scope.cngx-status--neutral .cngx-status__dot{background:var(--cngx-status-neutral-color, oklch(.6 .02 290))}}}@media(forced-colors:active){.cngx-status .cngx-status__dot:empty{background:CanvasText}}\n"] }]
|
|
805
1001
|
}], ctorParameters: () => [], propDecorators: { tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], live: [{ type: i0.Input, args: [{ isSignal: true, alias: "live", required: false }] }], glyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "glyph", required: false }] }] } });
|
|
806
1002
|
|
|
807
1003
|
/**
|
|
@@ -970,7 +1166,7 @@ class CngxCheckboxIndicator {
|
|
|
970
1166
|
<ng-container *ngTemplateOutlet="checkGlyph() ?? defaultCheckGlyph" />
|
|
971
1167
|
}
|
|
972
1168
|
}
|
|
973
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-
|
|
1169
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-checkbox-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-checkbox-checked-bg: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-checkbox-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-checkbox-color, currentColor);width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);box-sizing:border-box;overflow:hidden}:scope.cngx-checkbox-indicator--sm{--cngx-checkbox-size: var(--cngx-checkbox-size-sm, .875em)}:scope.cngx-checkbox-indicator--md{--cngx-checkbox-size: var(--cngx-checkbox-size-md, 1em)}:scope.cngx-checkbox-indicator--lg{--cngx-checkbox-size: var(--cngx-checkbox-size-lg, 1.25em)}.cngx-checkbox-indicator__box{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:1;box-sizing:border-box;width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);border:var(--cngx-checkbox-border, 1.5px solid currentColor);border-radius:var(--cngx-checkbox-radius, var(--cngx-radius-sm, 2px));background:var(--cngx-checkbox-bg, transparent)}:scope.cngx-checkbox-indicator--checked .cngx-checkbox-indicator__box,:scope.cngx-checkbox-indicator--indeterminate .cngx-checkbox-indicator__box{background:var(--cngx-checkbox-checked-bg, var(--cngx-color-primary, oklch(.66 .19 50)));border-color:var(--cngx-checkbox-checked-bg, var(--cngx-color-primary, oklch(.66 .19 50)));color:var(--cngx-checkbox-checked-color, oklch(1 0 0))}:scope.cngx-checkbox-indicator--disabled{--cngx-checkbox-checked-bg: color-mix(in oklab, var(--cngx-color-text, oklch(.2 .01 250)) 38%, transparent);--cngx-checkbox-checked-color: var(--cngx-color-surface, oklch(1 0 0));color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash{font-size:calc(var(--cngx-checkbox-size, 1em) * .75);line-height:1;font-weight:700;-webkit-user-select:none;user-select:none}:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__check,:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__dash{color:var(--cngx-checkbox-color, var(--cngx-color-primary, oklch(.66 .19 50)));font-size:var(--cngx-checkbox-size, 1em)}}}@media(forced-colors:active){.cngx-checkbox-indicator:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{background:transparent;border-color:currentColor;color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--checkmark :is(.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash){color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled{color:GrayText}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{forced-color-adjust:none;background:GrayText;border-color:GrayText;color:Canvas}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
974
1170
|
}
|
|
975
1171
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxCheckboxIndicator, decorators: [{
|
|
976
1172
|
type: Component,
|
|
@@ -1008,7 +1204,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1008
1204
|
<ng-container *ngTemplateOutlet="checkGlyph() ?? defaultCheckGlyph" />
|
|
1009
1205
|
}
|
|
1010
1206
|
}
|
|
1011
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-
|
|
1207
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-checkbox-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-checkbox-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-checkbox-border{syntax: \"*\"; inherits: true; initial-value: 1.5px solid currentColor;}@property --cngx-checkbox-radius{syntax: \"<length>\"; inherits: true; initial-value: 2px;}@property --cngx-checkbox-checked-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-checkbox-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(1 0 0);}@property --cngx-checkbox-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-checkbox-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-checkbox-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-checkbox-checked-bg: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-checkbox-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-checkbox-color, currentColor);width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);box-sizing:border-box;overflow:hidden}:scope.cngx-checkbox-indicator--sm{--cngx-checkbox-size: var(--cngx-checkbox-size-sm, .875em)}:scope.cngx-checkbox-indicator--md{--cngx-checkbox-size: var(--cngx-checkbox-size-md, 1em)}:scope.cngx-checkbox-indicator--lg{--cngx-checkbox-size: var(--cngx-checkbox-size-lg, 1.25em)}.cngx-checkbox-indicator__box{display:inline-flex;align-items:center;justify-content:center;color:inherit;line-height:1;box-sizing:border-box;width:var(--cngx-checkbox-size, 1em);height:var(--cngx-checkbox-size, 1em);border:var(--cngx-checkbox-border, 1.5px solid currentColor);border-radius:var(--cngx-checkbox-radius, var(--cngx-radius-sm, 2px));background:var(--cngx-checkbox-bg, transparent)}:scope.cngx-checkbox-indicator--checked .cngx-checkbox-indicator__box,:scope.cngx-checkbox-indicator--indeterminate .cngx-checkbox-indicator__box{background:var(--cngx-checkbox-checked-bg, var(--cngx-color-primary, oklch(.66 .19 50)));border-color:var(--cngx-checkbox-checked-bg, var(--cngx-color-primary, oklch(.66 .19 50)));color:var(--cngx-checkbox-checked-color, oklch(1 0 0))}:scope.cngx-checkbox-indicator--disabled{--cngx-checkbox-checked-bg: color-mix(in oklab, var(--cngx-color-text, oklch(.2 .01 250)) 38%, transparent);--cngx-checkbox-checked-color: var(--cngx-color-surface, oklch(1 0 0));color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash{font-size:calc(var(--cngx-checkbox-size, 1em) * .75);line-height:1;font-weight:700;-webkit-user-select:none;user-select:none}:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__check,:scope.cngx-checkbox-indicator--checkmark .cngx-checkbox-indicator__dash{color:var(--cngx-checkbox-color, var(--cngx-color-primary, oklch(.66 .19 50)));font-size:var(--cngx-checkbox-size, 1em)}}}@media(forced-colors:active){.cngx-checkbox-indicator:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{background:transparent;border-color:currentColor;color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--checkmark :is(.cngx-checkbox-indicator__check,.cngx-checkbox-indicator__dash){color:currentColor}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled{color:GrayText}.cngx-checkbox-indicator.cngx-checkbox-indicator--disabled:is(.cngx-checkbox-indicator--checked,.cngx-checkbox-indicator--indeterminate) .cngx-checkbox-indicator__box{forced-color-adjust:none;background:GrayText;border-color:GrayText;color:Canvas}}\n"] }]
|
|
1012
1208
|
}], propDecorators: { variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], indeterminate: [{ type: i0.Input, args: [{ isSignal: true, alias: "indeterminate", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], checkGlyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "checkGlyph", required: false }] }], dashGlyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "dashGlyph", required: false }] }] } });
|
|
1013
1209
|
|
|
1014
1210
|
/**
|
|
@@ -1091,7 +1287,7 @@ class CngxRadioIndicator {
|
|
|
1091
1287
|
<ng-container *ngTemplateOutlet="dotGlyph() ?? defaultDotGlyph" />
|
|
1092
1288
|
}
|
|
1093
1289
|
</span>
|
|
1094
|
-
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-radio-indicator-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-radio-indicator-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-radio-indicator-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1.5px;}@property --cngx-radio-indicator-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-radio-indicator-
|
|
1290
|
+
`, isInline: true, styles: ["@layer cngx.tokens{@property --cngx-radio-indicator-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-radio-indicator-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-radio-indicator-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1.5px;}@property --cngx-radio-indicator-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-radio-indicator-transition{syntax: \"*\"; inherits: false; initial-value: border-color .12s ease,background-color .12s ease;}:where(.cngx-radio-indicator,.cngx-radio-indicator *){--cngx-radio-indicator-transition: border-color var(--cngx-duration-fast) ease, background-color var(--cngx-duration-fast) ease}@property --cngx-radio-indicator-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-radio-indicator-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-radio-indicator-checked-color: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-radio-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-radio-indicator-color, currentColor)}:scope.cngx-radio-indicator--sm{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-sm, .875em)}:scope.cngx-radio-indicator--md{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-md, 1em)}:scope.cngx-radio-indicator--lg{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-lg, 1.25em)}.cngx-radio-indicator__circle{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:inherit;line-height:1;width:var(--cngx-radio-indicator-size, 1em);height:var(--cngx-radio-indicator-size, 1em);border:var(--cngx-radio-indicator-border-width, 1.5px) solid currentColor;background:var(--cngx-radio-indicator-bg, transparent);transition:var( --cngx-radio-indicator-transition, border-color .12s ease, background-color .12s ease )}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{border-color:var( --cngx-radio-indicator-checked-color, var(--cngx-color-primary, oklch(.66 .19 50)) )}.cngx-radio-indicator__dot{display:inline-block;border-radius:50%;width:var( --cngx-radio-indicator-dot-size, calc(var(--cngx-radio-indicator-size, 1em) * .5) );height:var( --cngx-radio-indicator-dot-size, calc(var(--cngx-radio-indicator-size, 1em) * .5) );background:var( --cngx-radio-indicator-checked-color, var(--cngx-color-primary, oklch(.66 .19 50)) );transition:var(--cngx-radio-indicator-transition, transform .12s ease)}:scope.cngx-radio-indicator--disabled{--cngx-radio-indicator-checked-color: currentColor;color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}@media(prefers-reduced-motion:reduce){.cngx-radio-indicator__circle,.cngx-radio-indicator__dot{transition:none}}}}@media(forced-colors:active){.cngx-radio-indicator__dot{background:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator.cngx-radio-indicator--checked .cngx-radio-indicator__circle{border-color:currentColor}.cngx-radio-indicator.cngx-radio-indicator--disabled{color:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__circle{border-color:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__dot{background:GrayText}}\n"], dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1095
1291
|
}
|
|
1096
1292
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxRadioIndicator, decorators: [{
|
|
1097
1293
|
type: Component,
|
|
@@ -1113,7 +1309,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1113
1309
|
<ng-container *ngTemplateOutlet="dotGlyph() ?? defaultDotGlyph" />
|
|
1114
1310
|
}
|
|
1115
1311
|
</span>
|
|
1116
|
-
`, styles: ["@layer cngx.tokens{@property --cngx-radio-indicator-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-radio-indicator-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-radio-indicator-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1.5px;}@property --cngx-radio-indicator-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-radio-indicator-
|
|
1312
|
+
`, styles: ["@layer cngx.tokens{@property --cngx-radio-indicator-size{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-radio-indicator-bg{syntax: \"*\"; inherits: true; initial-value: transparent;}@property --cngx-radio-indicator-border-width{syntax: \"<length>\"; inherits: true; initial-value: 1.5px;}@property --cngx-radio-indicator-checked-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.66 .19 50);}@property --cngx-radio-indicator-transition{syntax: \"*\"; inherits: false; initial-value: border-color .12s ease,background-color .12s ease;}:where(.cngx-radio-indicator,.cngx-radio-indicator *){--cngx-radio-indicator-transition: border-color var(--cngx-duration-fast) ease, background-color var(--cngx-duration-fast) ease}@property --cngx-radio-indicator-size-sm{syntax: \"*\"; inherits: true; initial-value: .875em;}@property --cngx-radio-indicator-size-md{syntax: \"*\"; inherits: true; initial-value: 1em;}@property --cngx-radio-indicator-size-lg{syntax: \"*\"; inherits: true; initial-value: 1.25em;}:root{--cngx-radio-indicator-checked-color: var(--cngx-color-primary)}}@layer cngx.components{@scope(.cngx-radio-indicator){:scope{display:inline-flex;align-items:center;justify-content:center;vertical-align:middle;line-height:1;flex:0 0 auto;color:var(--cngx-radio-indicator-color, currentColor)}:scope.cngx-radio-indicator--sm{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-sm, .875em)}:scope.cngx-radio-indicator--md{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-md, 1em)}:scope.cngx-radio-indicator--lg{--cngx-radio-indicator-size: var(--cngx-radio-indicator-size-lg, 1.25em)}.cngx-radio-indicator__circle{display:inline-flex;align-items:center;justify-content:center;border-radius:50%;color:inherit;line-height:1;width:var(--cngx-radio-indicator-size, 1em);height:var(--cngx-radio-indicator-size, 1em);border:var(--cngx-radio-indicator-border-width, 1.5px) solid currentColor;background:var(--cngx-radio-indicator-bg, transparent);transition:var( --cngx-radio-indicator-transition, border-color .12s ease, background-color .12s ease )}:scope.cngx-radio-indicator--checked .cngx-radio-indicator__circle{border-color:var( --cngx-radio-indicator-checked-color, var(--cngx-color-primary, oklch(.66 .19 50)) )}.cngx-radio-indicator__dot{display:inline-block;border-radius:50%;width:var( --cngx-radio-indicator-dot-size, calc(var(--cngx-radio-indicator-size, 1em) * .5) );height:var( --cngx-radio-indicator-dot-size, calc(var(--cngx-radio-indicator-size, 1em) * .5) );background:var( --cngx-radio-indicator-checked-color, var(--cngx-color-primary, oklch(.66 .19 50)) );transition:var(--cngx-radio-indicator-transition, transform .12s ease)}:scope.cngx-radio-indicator--disabled{--cngx-radio-indicator-checked-color: currentColor;color:color-mix(in oklab,var(--cngx-color-text, oklch(.2 .01 250)) 38%,transparent)}@media(prefers-reduced-motion:reduce){.cngx-radio-indicator__circle,.cngx-radio-indicator__dot{transition:none}}}}@media(forced-colors:active){.cngx-radio-indicator__dot{background:var(--_cngx-forced-ink, CanvasText)}.cngx-radio-indicator.cngx-radio-indicator--checked .cngx-radio-indicator__circle{border-color:currentColor}.cngx-radio-indicator.cngx-radio-indicator--disabled{color:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__circle{border-color:GrayText}.cngx-radio-indicator.cngx-radio-indicator--disabled .cngx-radio-indicator__dot{background:GrayText}}\n"] }]
|
|
1117
1313
|
}], propDecorators: { checked: [{ type: i0.Input, args: [{ isSignal: true, alias: "checked", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], dotGlyph: [{ type: i0.Input, args: [{ isSignal: true, alias: "dotGlyph", required: false }] }] } });
|
|
1118
1314
|
|
|
1119
1315
|
/**
|
|
@@ -1121,6 +1317,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1121
1317
|
* count of that unit in the next-larger one; anything past `months` falls
|
|
1122
1318
|
* through to the `years` return.
|
|
1123
1319
|
*/
|
|
1320
|
+
/**
|
|
1321
|
+
* Per-locale `Intl.RelativeTimeFormat` cache - the options are fixed, so the
|
|
1322
|
+
* locale alone keys the instance. Constructing Intl formatters is the
|
|
1323
|
+
* expensive half of formatting; the cache makes recomputes allocation-free.
|
|
1324
|
+
*/
|
|
1325
|
+
const relativeFormatterFor = memoize((locale) => new Intl.RelativeTimeFormat(locale, { numeric: 'auto' }));
|
|
1124
1326
|
const RELATIVE_DIVISIONS = [
|
|
1125
1327
|
{ amount: 60, unit: 'seconds' },
|
|
1126
1328
|
{ amount: 60, unit: 'minutes' },
|
|
@@ -1134,8 +1336,9 @@ const RELATIVE_DIVISIONS = [
|
|
|
1134
1336
|
* `datetime` attribute (ISO 8601) plus a human string in one of two modes:
|
|
1135
1337
|
* `absolute` (via `Intl.DateTimeFormat`) or `relative` (via
|
|
1136
1338
|
* `Intl.RelativeTimeFormat`, e.g. "3 days ago"). Formatting resolves against
|
|
1137
|
-
* the
|
|
1138
|
-
* provides one
|
|
1339
|
+
* the app locale (`CNGX_LOCALE`, falling back to the nearest `LOCALE_ID`) -
|
|
1340
|
+
* English out of the box, locale-driven when the app provides one, re-formatted
|
|
1341
|
+
* on a locale flip; no hardcoded strings.
|
|
1139
1342
|
*
|
|
1140
1343
|
* Relative mode is render-time, not live-ticking: it recomputes when `[date]`
|
|
1141
1344
|
* changes, not on a timer, so "2 minutes ago" does not self-update. A consumer
|
|
@@ -1155,7 +1358,7 @@ const RELATIVE_DIVISIONS = [
|
|
|
1155
1358
|
* @relatedTo CngxCardTimestamp
|
|
1156
1359
|
*/
|
|
1157
1360
|
class CngxTime {
|
|
1158
|
-
locale =
|
|
1361
|
+
locale = injectLocale();
|
|
1159
1362
|
/** Instant to render. Accepts a `Date`, an ISO string, or an epoch-ms number. */
|
|
1160
1363
|
date = input.required(...(ngDevMode ? [{ debugName: "date" }] : /* istanbul ignore next */ []));
|
|
1161
1364
|
/**
|
|
@@ -1169,29 +1372,55 @@ class CngxTime {
|
|
|
1169
1372
|
* Coerced instant. A `Date`; downstream reads its time value. The `equal` fn
|
|
1170
1373
|
* dedupes by time value so re-binding `[date]` to a fresh `Date` of the same
|
|
1171
1374
|
* instant (or the equivalent ISO string) does not cascade `iso`/`formatted` -
|
|
1172
|
-
* the object-computed equality rule.
|
|
1375
|
+
* the object-computed equality rule. NaN pairs compare equal - without the
|
|
1376
|
+
* arm, two Invalid Dates would defeat the dedupe (NaN !== NaN) and cascade
|
|
1377
|
+
* on every rebind.
|
|
1173
1378
|
*/
|
|
1174
1379
|
instant = computed(() => {
|
|
1175
1380
|
const value = this.date();
|
|
1176
1381
|
return value instanceof Date ? value : new Date(value);
|
|
1177
|
-
}, { ...(ngDevMode ? { debugName: "instant" } : /* istanbul ignore next */ {}), equal: (a, b) =>
|
|
1178
|
-
|
|
1179
|
-
|
|
1382
|
+
}, { ...(ngDevMode ? { debugName: "instant" } : /* istanbul ignore next */ {}), equal: (a, b) => {
|
|
1383
|
+
const ta = a.getTime();
|
|
1384
|
+
const tb = b.getTime();
|
|
1385
|
+
return ta === tb || (Number.isNaN(ta) && Number.isNaN(tb));
|
|
1386
|
+
} });
|
|
1387
|
+
/**
|
|
1388
|
+
* Invalid Date guard. `toISOString()` throws and `Intl.format` renders
|
|
1389
|
+
* garbage on an invalid instant - a bad ISO string must degrade to an
|
|
1390
|
+
* empty render, not crash change detection.
|
|
1391
|
+
*/
|
|
1392
|
+
isValidDate = computed(() => !Number.isNaN(this.instant().getTime()), ...(ngDevMode ? [{ debugName: "isValidDate" }] : /* istanbul ignore next */ []));
|
|
1393
|
+
/** Machine-readable ISO 8601 for the `datetime` attribute. `null` (attribute removed) when the instant is invalid. */
|
|
1394
|
+
iso = computed(() => (this.isValidDate() ? this.instant().toISOString() : null), ...(ngDevMode ? [{ debugName: "iso" }] : /* istanbul ignore next */ []));
|
|
1180
1395
|
/**
|
|
1181
1396
|
* Human string. Reads `Date.now()` in `relative` mode as a render-time
|
|
1182
1397
|
* snapshot - untracked by design, so the value recomputes only when `[date]`
|
|
1183
1398
|
* (or `mode`/`format`) changes, never on a timer.
|
|
1184
1399
|
*/
|
|
1185
1400
|
formatted = computed(() => {
|
|
1401
|
+
if (!this.isValidDate()) {
|
|
1402
|
+
return '';
|
|
1403
|
+
}
|
|
1186
1404
|
const instant = this.instant();
|
|
1405
|
+
const locale = this.locale();
|
|
1187
1406
|
if (this.mode() === 'relative') {
|
|
1188
|
-
return this.formatRelative(instant.getTime(), Date.now());
|
|
1407
|
+
return this.formatRelative(instant.getTime(), Date.now(), locale);
|
|
1189
1408
|
}
|
|
1190
1409
|
const format = this.format() ?? { year: 'numeric', month: 'short', day: 'numeric' };
|
|
1191
|
-
return
|
|
1410
|
+
return dateTimeFormatterFor(locale, format).format(instant);
|
|
1192
1411
|
}, ...(ngDevMode ? [{ debugName: "formatted" }] : /* istanbul ignore next */ []));
|
|
1193
|
-
|
|
1194
|
-
|
|
1412
|
+
constructor() {
|
|
1413
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
1414
|
+
effect(() => {
|
|
1415
|
+
if (!this.isValidDate()) {
|
|
1416
|
+
cngxDevWarn('CNGX1006', '[cngx-time] [date] resolved to an Invalid Date - rendering empty. ' +
|
|
1417
|
+
'Check the bound value (bad ISO string?).');
|
|
1418
|
+
}
|
|
1419
|
+
});
|
|
1420
|
+
}
|
|
1421
|
+
}
|
|
1422
|
+
formatRelative(target, now, locale) {
|
|
1423
|
+
const rtf = relativeFormatterFor(locale);
|
|
1195
1424
|
let delta = (target - now) / 1000;
|
|
1196
1425
|
for (const division of RELATIVE_DIVISIONS) {
|
|
1197
1426
|
if (Math.abs(delta) < division.amount) {
|
|
@@ -1209,7 +1438,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1209
1438
|
args: [{ selector: 'cngx-time', exportAs: 'cngxTime', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: {
|
|
1210
1439
|
class: 'cngx-time',
|
|
1211
1440
|
}, template: `<time [attr.datetime]="iso()">{{ formatted() }}</time>`, styles: [".cngx-time{display:inline;font-family:var(--cngx-time-font, inherit);font-size:var(--cngx-time-size, inherit);font-variant-numeric:var(--cngx-time-numeric, tabular-nums);color:var(--cngx-time-color, inherit);unicode-bidi:var(--cngx-time-bidi, isolate)}.cngx-time time{font:inherit;color:inherit}\n"] }]
|
|
1212
|
-
}], propDecorators: { date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }] } });
|
|
1441
|
+
}], ctorParameters: () => [], propDecorators: { date: [{ type: i0.Input, args: [{ isSignal: true, alias: "date", required: true }] }], mode: [{ type: i0.Input, args: [{ isSignal: true, alias: "mode", required: false }] }], format: [{ type: i0.Input, args: [{ isSignal: true, alias: "format", required: false }] }] } });
|
|
1213
1442
|
|
|
1214
1443
|
const SEGMENT_COUNT = 4;
|
|
1215
1444
|
const STRENGTH_LEVELS = ['none', 'weak', 'fair', 'good', 'strong'];
|
|
@@ -1257,7 +1486,7 @@ class CngxPasswordStrengthMeter {
|
|
|
1257
1486
|
aria-hidden="true"
|
|
1258
1487
|
></span>
|
|
1259
1488
|
}
|
|
1260
|
-
`, isInline: true, styles: [".cngx-password-strength-meter{--cngx-password-strength-meter-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-password-strength-meter-gap, .25rem);inline-size:var(--cngx-password-strength-meter-inline-size, 100%)}.cngx-password-strength-meter__segment{flex:1 1 0;block-size:var(--cngx-password-strength-meter-thickness, .375rem);border-radius:var(--cngx-password-strength-meter-radius, 999px);background:var(--cngx-password-strength-meter-empty-color, #e0e0e0);transition:background var(--cngx-password-strength-meter-transition, .15s ease)}.cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fill-color, #3f51b5)}.cngx-password-strength-meter[data-strength=weak] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-weak-color, #b3261e)}.cngx-password-strength-meter[data-strength=fair] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fair-color, #ed6c02)}.cngx-password-strength-meter[data-strength=good] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-good-color, #0288d1)}.cngx-password-strength-meter[data-strength=strong] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-strong-color, #2e7d32)}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1489
|
+
`, isInline: true, styles: [".cngx-password-strength-meter{--cngx-password-strength-meter-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-password-strength-meter-gap, .25rem);inline-size:var(--cngx-password-strength-meter-inline-size, 100%)}.cngx-password-strength-meter__segment{flex:1 1 0;block-size:var(--cngx-password-strength-meter-thickness, .375rem);border-radius:var(--cngx-password-strength-meter-radius, 999px);background:var(--cngx-password-strength-meter-empty-color, #e0e0e0);transition:background var(--cngx-password-strength-meter-transition, var(--cngx-duration-fast, .15s) ease)}.cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fill-color, #3f51b5)}.cngx-password-strength-meter[data-strength=weak] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-weak-color, #b3261e)}.cngx-password-strength-meter[data-strength=fair] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fair-color, #ed6c02)}.cngx-password-strength-meter[data-strength=good] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-good-color, #0288d1)}.cngx-password-strength-meter[data-strength=strong] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-strong-color, #2e7d32)}@media(forced-colors:active){.cngx-password-strength-meter .cngx-password-strength-meter__segment{background:Canvas;outline:1px solid CanvasText;outline-offset:-1px}.cngx-password-strength-meter .cngx-password-strength-meter__segment[data-filled=true],.cngx-password-strength-meter[data-strength] .cngx-password-strength-meter__segment[data-filled=true]{background:CanvasText}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1261
1490
|
}
|
|
1262
1491
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxPasswordStrengthMeter, decorators: [{
|
|
1263
1492
|
type: Component,
|
|
@@ -1273,7 +1502,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1273
1502
|
aria-hidden="true"
|
|
1274
1503
|
></span>
|
|
1275
1504
|
}
|
|
1276
|
-
`, styles: [".cngx-password-strength-meter{--cngx-password-strength-meter-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-password-strength-meter-gap, .25rem);inline-size:var(--cngx-password-strength-meter-inline-size, 100%)}.cngx-password-strength-meter__segment{flex:1 1 0;block-size:var(--cngx-password-strength-meter-thickness, .375rem);border-radius:var(--cngx-password-strength-meter-radius, 999px);background:var(--cngx-password-strength-meter-empty-color, #e0e0e0);transition:background var(--cngx-password-strength-meter-transition, .15s ease)}.cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fill-color, #3f51b5)}.cngx-password-strength-meter[data-strength=weak] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-weak-color, #b3261e)}.cngx-password-strength-meter[data-strength=fair] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fair-color, #ed6c02)}.cngx-password-strength-meter[data-strength=good] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-good-color, #0288d1)}.cngx-password-strength-meter[data-strength=strong] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-strong-color, #2e7d32)}\n"] }]
|
|
1505
|
+
`, styles: [".cngx-password-strength-meter{--cngx-password-strength-meter-gap: var(--cngx-space-xs, .25rem);display:flex;align-items:center;gap:var(--cngx-password-strength-meter-gap, .25rem);inline-size:var(--cngx-password-strength-meter-inline-size, 100%)}.cngx-password-strength-meter__segment{flex:1 1 0;block-size:var(--cngx-password-strength-meter-thickness, .375rem);border-radius:var(--cngx-password-strength-meter-radius, 999px);background:var(--cngx-password-strength-meter-empty-color, #e0e0e0);transition:background var(--cngx-password-strength-meter-transition, var(--cngx-duration-fast, .15s) ease)}.cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fill-color, #3f51b5)}.cngx-password-strength-meter[data-strength=weak] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-weak-color, #b3261e)}.cngx-password-strength-meter[data-strength=fair] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-fair-color, #ed6c02)}.cngx-password-strength-meter[data-strength=good] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-good-color, #0288d1)}.cngx-password-strength-meter[data-strength=strong] .cngx-password-strength-meter__segment[data-filled=true]{background:var(--cngx-password-strength-meter-strong-color, #2e7d32)}@media(forced-colors:active){.cngx-password-strength-meter .cngx-password-strength-meter__segment{background:Canvas;outline:1px solid CanvasText;outline-offset:-1px}.cngx-password-strength-meter .cngx-password-strength-meter__segment[data-filled=true],.cngx-password-strength-meter[data-strength] .cngx-password-strength-meter__segment[data-filled=true]{background:CanvasText}}\n"] }]
|
|
1277
1506
|
}], propDecorators: { score: [{ type: i0.Input, args: [{ isSignal: true, alias: "score", required: true }] }] } });
|
|
1278
1507
|
|
|
1279
1508
|
/**
|
|
@@ -1568,6 +1797,18 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1568
1797
|
}]
|
|
1569
1798
|
}] });
|
|
1570
1799
|
|
|
1800
|
+
/**
|
|
1801
|
+
* Colour keys whose `[data-color]` cascade ships in `tag.css`. A
|
|
1802
|
+
* `withTagColors()` entry under one of these keys stays a no-op - the
|
|
1803
|
+
* stylesheet cascade owns them.
|
|
1804
|
+
*/
|
|
1805
|
+
const PREDEFINED_TAG_COLORS = new Set([
|
|
1806
|
+
'neutral',
|
|
1807
|
+
'success',
|
|
1808
|
+
'warning',
|
|
1809
|
+
'error',
|
|
1810
|
+
'info',
|
|
1811
|
+
]);
|
|
1571
1812
|
/**
|
|
1572
1813
|
* Decorative tag / label / badge atom.
|
|
1573
1814
|
*
|
|
@@ -1650,6 +1891,28 @@ class CngxTag {
|
|
|
1650
1891
|
color = input(this.cfg.defaults?.color ?? 'neutral', ...(ngDevMode ? [{ debugName: "color" }] : /* istanbul ignore next */ []));
|
|
1651
1892
|
/** Density. `md` (default) | `sm` | `lg` | `xl`. */
|
|
1652
1893
|
size = input(this.cfg.defaults?.size ?? 'md', ...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
1894
|
+
/**
|
|
1895
|
+
* Registered `withTagColors` entry for the current colour key.
|
|
1896
|
+
* Consumer keys only - the five predefined keys resolve in
|
|
1897
|
+
* `tag.css`, so a config entry under a predefined key stays a
|
|
1898
|
+
* no-op per the `withTagColors` contract. The entry is emitted as
|
|
1899
|
+
* element-level `--cngx-tag-bg/-color/-border` values ONLY when
|
|
1900
|
+
* the config carries the key; an unregistered key emits nothing,
|
|
1901
|
+
* so the plain consumer CSS authoring path (`[data-color="..."]`
|
|
1902
|
+
* rules) is never shadowed by an element style.
|
|
1903
|
+
*/
|
|
1904
|
+
configColor = computed(() => {
|
|
1905
|
+
const key = this.color();
|
|
1906
|
+
if (PREDEFINED_TAG_COLORS.has(key)) {
|
|
1907
|
+
return undefined;
|
|
1908
|
+
}
|
|
1909
|
+
return this.cfg.colors?.[key];
|
|
1910
|
+
}, ...(ngDevMode ? [{ debugName: "configColor" }] : /* istanbul ignore next */ []));
|
|
1911
|
+
/** Border shorthand for the registered entry (mirrors the `1px solid <color>` shape of the predefined cascade). */
|
|
1912
|
+
configBorder = computed(() => {
|
|
1913
|
+
const entry = this.configColor();
|
|
1914
|
+
return entry ? `1px solid ${entry.border}` : null;
|
|
1915
|
+
}, ...(ngDevMode ? [{ debugName: "configBorder" }] : /* istanbul ignore next */ []));
|
|
1653
1916
|
/**
|
|
1654
1917
|
* When `true`, applies `text-overflow: ellipsis` + `white-space: nowrap`
|
|
1655
1918
|
* to the inner `.cngx-tag__label` span. Pair with `[maxWidth]` for a
|
|
@@ -1702,10 +1965,9 @@ class CngxTag {
|
|
|
1702
1965
|
suffixTpl = injectResolvedTagTemplate(this.suffixSlot, 'suffix');
|
|
1703
1966
|
/**
|
|
1704
1967
|
* Reactive bundle exposed to every slot's `*ngTemplateOutletContext`.
|
|
1705
|
-
*
|
|
1706
|
-
*
|
|
1707
|
-
*
|
|
1708
|
-
* injecting the directive.
|
|
1968
|
+
* All three slots share `CngxTagSlotContext`, so the same computed
|
|
1969
|
+
* source serves them. Consumer templates `let-variant="variant"` etc.
|
|
1970
|
+
* read the live state without injecting the directive.
|
|
1709
1971
|
*
|
|
1710
1972
|
* Explicit structural `equal` fn - without it, a fresh literal each
|
|
1711
1973
|
* CD cycle would force `ngTemplateOutlet` to rebind embedded views
|
|
@@ -1735,7 +1997,7 @@ class CngxTag {
|
|
|
1735
1997
|
*/
|
|
1736
1998
|
roleAttr = computed(() => this.group?.semanticList() ? 'listitem' : null, ...(ngDevMode ? [{ debugName: "roleAttr" }] : /* istanbul ignore next */ []));
|
|
1737
1999
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTag, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1738
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxTag, isStandalone: true, selector: "[cngxTag], cngx-tag", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, truncate: { classPropertyName: "truncate", publicName: "truncate", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-tag--filled": "variant() === 'filled'", "class.cngx-tag--outline": "variant() === 'outline'", "class.cngx-tag--subtle": "variant() === 'subtle'", "class.cngx-tag--sm": "size() === 'sm'", "class.cngx-tag--md": "size() === 'md'", "class.cngx-tag--lg": "size() === 'lg'", "class.cngx-tag--xl": "size() === 'xl'", "class.cngx-tag--truncate": "truncate()", "attr.data-color": "color()", "style.max-width": "maxWidth()", "attr.role": "roleAttr()" }, classAttribute: "cngx-tag" }, queries: [{ propertyName: "labelSlot", first: true, predicate: CngxTagLabel, descendants: true, isSignal: true }, { propertyName: "prefixSlot", first: true, predicate: CngxTagPrefix, descendants: true, isSignal: true }, { propertyName: "suffixSlot", first: true, predicate: CngxTagSuffix, descendants: true, isSignal: true }], exportAs: ["cngxTag"], ngImport: i0, template: `
|
|
2000
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxTag, isStandalone: true, selector: "[cngxTag], cngx-tag", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, color: { classPropertyName: "color", publicName: "color", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, truncate: { classPropertyName: "truncate", publicName: "truncate", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-tag--filled": "variant() === 'filled'", "class.cngx-tag--outline": "variant() === 'outline'", "class.cngx-tag--subtle": "variant() === 'subtle'", "class.cngx-tag--sm": "size() === 'sm'", "class.cngx-tag--md": "size() === 'md'", "class.cngx-tag--lg": "size() === 'lg'", "class.cngx-tag--xl": "size() === 'xl'", "class.cngx-tag--truncate": "truncate()", "attr.data-color": "color()", "style.--cngx-tag-bg": "configColor()?.bg ?? null", "style.--cngx-tag-color": "configColor()?.color ?? null", "style.--cngx-tag-border": "configBorder()", "style.max-width": "maxWidth()", "attr.role": "roleAttr()" }, classAttribute: "cngx-tag" }, queries: [{ propertyName: "labelSlot", first: true, predicate: CngxTagLabel, descendants: true, isSignal: true }, { propertyName: "prefixSlot", first: true, predicate: CngxTagPrefix, descendants: true, isSignal: true }, { propertyName: "suffixSlot", first: true, predicate: CngxTagSuffix, descendants: true, isSignal: true }], exportAs: ["cngxTag"], ngImport: i0, template: `
|
|
1739
2001
|
@if (prefixTpl(); as t) {
|
|
1740
2002
|
<ng-container *ngTemplateOutlet="t; context: slotContext()" />
|
|
1741
2003
|
}
|
|
@@ -1774,6 +2036,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
1774
2036
|
'[class.cngx-tag--xl]': "size() === 'xl'",
|
|
1775
2037
|
'[class.cngx-tag--truncate]': 'truncate()',
|
|
1776
2038
|
'[attr.data-color]': 'color()',
|
|
2039
|
+
'[style.--cngx-tag-bg]': 'configColor()?.bg ?? null',
|
|
2040
|
+
'[style.--cngx-tag-color]': 'configColor()?.color ?? null',
|
|
2041
|
+
'[style.--cngx-tag-border]': 'configBorder()',
|
|
1777
2042
|
'[style.max-width]': 'maxWidth()',
|
|
1778
2043
|
'[attr.role]': 'roleAttr()',
|
|
1779
2044
|
}, styles: ["@layer cngx.components{@scope(.cngx-tag){:scope{--cngx-tag-gap: var(--cngx-space-xs);--cngx-tag-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-sm-padding: 0 var(--cngx-space-xs);--cngx-tag-lg-padding: var(--cngx-space-xs) var(--cngx-space-sm);--cngx-tag-xl-padding: var(--cngx-space-xs) var(--cngx-space-sm);display:inline-flex;align-items:center;line-height:1.25;max-width:100%;gap:var(--cngx-tag-gap, var(--cngx-space-xs, 4px));padding:var(--cngx-tag-padding, 2px 8px);font-size:var(--cngx-tag-font-size, var(--cngx-font-size-sm, .75rem))}:scope.cngx-tag--sm{padding:var(--cngx-tag-sm-padding, 0 6px);font-size:var(--cngx-tag-sm-font-size, .6875rem)}:scope.cngx-tag--lg{padding:var(--cngx-tag-lg-padding, 4px 10px);font-size:var(--cngx-tag-lg-font-size, .875rem)}:scope.cngx-tag--xl{padding:var(--cngx-tag-xl-padding, 6px 12px);font-size:var(--cngx-tag-xl-font-size, 1rem)}.cngx-tag__label{min-width:0;overflow:hidden}:scope.cngx-tag--truncate .cngx-tag__label{text-overflow:ellipsis;white-space:nowrap}}@scope(.cngx-tag-group){:scope{--cngx-tag-group-stack-gap: var(--cngx-space-sm);display:flex;flex-direction:column;gap:var(--cngx-tag-group-stack-gap, var(--cngx-space-sm, 8px))}.cngx-tag-group__row{--cngx-tag-group-gap: var(--cngx-space-sm);display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-start;gap:var(--cngx-tag-group-gap, var(--cngx-space-sm, 8px))}:scope.cngx-tag-group--gap-xs>.cngx-tag-group__row{--cngx-tag-group-gap-xs: var(--cngx-space-xs);gap:var(--cngx-tag-group-gap-xs, var(--cngx-space-xs, 4px))}:scope.cngx-tag-group--gap-md>.cngx-tag-group__row{--cngx-tag-group-gap-md: var(--cngx-space-sm);gap:var(--cngx-tag-group-gap-md, 12px)}:scope.cngx-tag-group--align-start>.cngx-tag-group__row{justify-content:flex-start}:scope.cngx-tag-group--align-center>.cngx-tag-group__row{justify-content:center}:scope.cngx-tag-group--align-end>.cngx-tag-group__row{justify-content:flex-end}:scope.cngx-tag-group--align-between>.cngx-tag-group__row{justify-content:space-between}}}\n", "@layer cngx.tokens{@property --cngx-tag-radius{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-font-weight{syntax: \"*\"; inherits: false; initial-value: 500;}@property --cngx-tag-bg{syntax: \"*\"; inherits: false; initial-value: transparent;}@property --cngx-tag-color{syntax: \"*\"; inherits: true; initial-value: currentColor;}@property --cngx-tag-border{syntax: \"*\"; inherits: false; initial-value: 1px solid transparent;}@property --cngx-tag-gap{syntax: \"<length>\"; inherits: false; initial-value: 4px;}@property --cngx-tag-padding{syntax: \"*\"; inherits: false; initial-value: 2px 8px;}@property --cngx-tag-font-size{syntax: \"*\"; inherits: false; initial-value: .75rem;}@property --cngx-tag-sm-padding{syntax: \"*\"; inherits: false; initial-value: 0 6px;}@property --cngx-tag-sm-font-size{syntax: \"*\"; inherits: false; initial-value: .6875rem;}@property --cngx-tag-lg-padding{syntax: \"*\"; inherits: false; initial-value: 4px 10px;}@property --cngx-tag-lg-font-size{syntax: \"*\"; inherits: false; initial-value: .875rem;}@property --cngx-tag-xl-padding{syntax: \"*\"; inherits: false; initial-value: 6px 12px;}@property --cngx-tag-xl-font-size{syntax: \"*\"; inherits: false; initial-value: 1rem;}@property --cngx-tag-neutral-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.92 .005 250);}@property --cngx-tag-neutral-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.34 .015 250);}@property --cngx-tag-neutral-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.68 .01 250);}@property --cngx-tag-neutral-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.96 .005 250);}@property --cngx-tag-success-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 145);}@property --cngx-tag-success-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .1 160);}@property --cngx-tag-success-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .15 155);}@property --cngx-tag-success-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 145);}@property --cngx-tag-warning-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.95 .05 90);}@property --cngx-tag-warning-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.45 .12 60);}@property --cngx-tag-warning-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.72 .18 70);}@property --cngx-tag-warning-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .02 90);}@property --cngx-tag-error-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.94 .04 25);}@property --cngx-tag-error-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 25);}@property --cngx-tag-error-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.65 .22 25);}@property --cngx-tag-error-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.98 .015 25);}@property --cngx-tag-info-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.93 .04 240);}@property --cngx-tag-info-color{syntax: \"<color>\"; inherits: true; initial-value: oklch(.4 .15 250);}@property --cngx-tag-info-border{syntax: \"<color>\"; inherits: true; initial-value: oklch(.62 .2 250);}@property --cngx-tag-info-subtle-bg{syntax: \"<color>\"; inherits: true; initial-value: oklch(.97 .025 240);}@media(prefers-color-scheme:dark){:root:not([data-color-scheme=light]):not(.light){--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}}[data-color-scheme=dark],.dark{--cngx-tag-neutral-bg: oklch(.32 .005 250);--cngx-tag-neutral-color: oklch(.85 .005 250);--cngx-tag-neutral-subtle-bg: oklch(.28 .005 250);--cngx-tag-success-bg: oklch(.32 .06 145);--cngx-tag-success-color: oklch(.85 .13 145);--cngx-tag-success-subtle-bg: oklch(.28 .04 145);--cngx-tag-warning-bg: oklch(.32 .06 75);--cngx-tag-warning-color: oklch(.88 .14 75);--cngx-tag-warning-subtle-bg: oklch(.28 .04 75);--cngx-tag-error-bg: oklch(.32 .05 25);--cngx-tag-error-color: oklch(.82 .15 25);--cngx-tag-error-subtle-bg: oklch(.28 .04 25);--cngx-tag-info-bg: oklch(.32 .05 250);--cngx-tag-info-color: oklch(.85 .13 250);--cngx-tag-info-subtle-bg: oklch(.28 .04 250)}[data-color-scheme=light],.light{--cngx-tag-neutral-bg: oklch(.92 .005 250);--cngx-tag-neutral-color: oklch(.34 .015 250);--cngx-tag-neutral-subtle-bg: oklch(.96 .005 250);--cngx-tag-success-bg: oklch(.95 .05 145);--cngx-tag-success-color: oklch(.4 .1 160);--cngx-tag-success-subtle-bg: oklch(.97 .025 145);--cngx-tag-warning-bg: oklch(.95 .05 90);--cngx-tag-warning-color: oklch(.45 .12 60);--cngx-tag-warning-subtle-bg: oklch(.98 .02 90);--cngx-tag-error-bg: oklch(.94 .04 25);--cngx-tag-error-color: oklch(.4 .15 25);--cngx-tag-error-subtle-bg: oklch(.98 .015 25);--cngx-tag-info-bg: oklch(.93 .04 240);--cngx-tag-info-color: oklch(.4 .15 250);--cngx-tag-info-subtle-bg: oklch(.97 .025 240)}}@layer cngx.components{@scope(.cngx-tag){:scope{border-radius:var(--cngx-tag-radius, var(--cngx-radius-sm, 4px));font-weight:var(--cngx-tag-font-weight, 500);background:var(--cngx-tag-bg, transparent);color:var(--cngx-tag-color, inherit);border:var(--cngx-tag-border, 1px solid transparent)}:scope.cngx-tag--filled[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-border, transparent)}:scope.cngx-tag--filled[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-bg);--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid var(--cngx-tag-success-border, transparent)}:scope.cngx-tag--filled[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-bg);--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid var(--cngx-tag-warning-border, transparent)}:scope.cngx-tag--filled[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-bg);--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid var(--cngx-tag-error-border, transparent)}:scope.cngx-tag--filled[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-bg);--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid var(--cngx-tag-info-border, transparent)}:scope.cngx-tag--outline[data-color=neutral]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid var(--cngx-tag-neutral-color)}:scope.cngx-tag--outline[data-color=success]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid var(--cngx-tag-success-color, var(--cngx-color-success))}:scope.cngx-tag--outline[data-color=warning]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid var(--cngx-tag-warning-color, var(--cngx-color-warning))}:scope.cngx-tag--outline[data-color=error]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid var(--cngx-tag-error-color, var(--cngx-color-danger))}:scope.cngx-tag--outline[data-color=info]{--cngx-tag-bg: transparent;--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid var(--cngx-tag-info-color, var(--cngx-color-info))}:scope.cngx-tag--subtle[data-color=neutral]{--cngx-tag-bg: var(--cngx-tag-neutral-subtle-bg);--cngx-tag-color: var(--cngx-tag-neutral-color);--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=success]{--cngx-tag-bg: var(--cngx-tag-success-subtle-bg);--cngx-tag-color: var(--cngx-tag-success-color, var(--cngx-color-success));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=warning]{--cngx-tag-bg: var(--cngx-tag-warning-subtle-bg);--cngx-tag-color: var(--cngx-tag-warning-color, var(--cngx-color-warning));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=error]{--cngx-tag-bg: var(--cngx-tag-error-subtle-bg);--cngx-tag-color: var(--cngx-tag-error-color, var(--cngx-color-danger));--cngx-tag-border: 1px solid transparent}:scope.cngx-tag--subtle[data-color=info]{--cngx-tag-bg: var(--cngx-tag-info-subtle-bg);--cngx-tag-color: var(--cngx-tag-info-color, var(--cngx-color-info));--cngx-tag-border: 1px solid transparent}}}\n"] }]
|
|
@@ -1954,16 +2219,19 @@ function withTagGroupDefaults(payload) {
|
|
|
1954
2219
|
return { kind: 'groupDefaults', payload };
|
|
1955
2220
|
}
|
|
1956
2221
|
/**
|
|
1957
|
-
* Register consumer-defined colour entries.
|
|
1958
|
-
*
|
|
1959
|
-
* `--cngx-tag-bg
|
|
1960
|
-
*
|
|
2222
|
+
* Register consumer-defined colour entries. When a tag's `color`
|
|
2223
|
+
* resolves to a registered key, the directive emits the entry as
|
|
2224
|
+
* element-level `--cngx-tag-bg` / `--cngx-tag-color` /
|
|
2225
|
+
* `--cngx-tag-border` values (border wrapped as `1px solid <color>`
|
|
2226
|
+
* to mirror the predefined cascade). The entry applies uniformly
|
|
2227
|
+
* across variants - config colours carry no per-variant surfaces.
|
|
1961
2228
|
*
|
|
1962
2229
|
* The five predefined keys (`neutral`/`success`/`warning`/`error`/
|
|
1963
2230
|
* `info`) ship in `tag.css` and are NOT part of this map; passing
|
|
1964
|
-
* them here is a no-op against the predefined cascade.
|
|
1965
|
-
* keys
|
|
1966
|
-
*
|
|
2231
|
+
* them here is a no-op against the predefined cascade. Unregistered
|
|
2232
|
+
* consumer keys emit nothing, so authoring plain
|
|
2233
|
+
* `[data-color="my-brand"]` CSS remains a first-class alternative -
|
|
2234
|
+
* the emitter never shadows it with an element style.
|
|
1967
2235
|
*
|
|
1968
2236
|
* ```ts
|
|
1969
2237
|
* provideTagConfig(
|
|
@@ -2269,10 +2537,10 @@ class CngxTagGroup {
|
|
|
2269
2537
|
projectedTags = contentChildren(CngxTag, ...(ngDevMode ? [{ debugName: "projectedTags" }] : /* istanbul ignore next */ []));
|
|
2270
2538
|
/**
|
|
2271
2539
|
* Reactive bundle exposed to header / accessory slots'
|
|
2272
|
-
* `*ngTemplateOutletContext`.
|
|
2273
|
-
*
|
|
2274
|
-
*
|
|
2275
|
-
*
|
|
2540
|
+
* `*ngTemplateOutletContext`. Both slots share
|
|
2541
|
+
* `CngxTagGroupSlotContext`, so the same computed source serves
|
|
2542
|
+
* them. Consumer templates `let-count="count"` etc. read the live
|
|
2543
|
+
* state without injecting the directive.
|
|
2276
2544
|
*
|
|
2277
2545
|
* Explicit structural `equal` fn - without it, a fresh literal
|
|
2278
2546
|
* each CD cycle would force `ngTemplateOutlet` to rebind embedded
|
|
@@ -2294,20 +2562,23 @@ class CngxTagGroup {
|
|
|
2294
2562
|
a.count === b.count });
|
|
2295
2563
|
constructor() {
|
|
2296
2564
|
// Dev-mode advisory: `[label]` without `[semanticList]="true"` lands
|
|
2297
|
-
// `aria-label` on a
|
|
2298
|
-
//
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
semanticList
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
'[
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2565
|
+
// `aria-label` on a role-less host, where ARIA prohibits naming, so most
|
|
2566
|
+
// AT drops the label and no "list, N items" is announced. One-shot,
|
|
2567
|
+
// tree-shaken in prod.
|
|
2568
|
+
if (typeof ngDevMode !== 'undefined' && ngDevMode) {
|
|
2569
|
+
afterNextRender(() => {
|
|
2570
|
+
const { label, semanticList } = untracked(() => ({
|
|
2571
|
+
label: this.label(),
|
|
2572
|
+
semanticList: this.semanticList(),
|
|
2573
|
+
}));
|
|
2574
|
+
if (label && !semanticList) {
|
|
2575
|
+
cngxDevWarn('CNGX1018', '[cngx-tag-group] [label] is bound without [semanticList]="true"; ' +
|
|
2576
|
+
'the aria-label lands on a generic <div>. Add ' +
|
|
2577
|
+
'[semanticList]="true" to expose role="list" + aria-label, ' +
|
|
2578
|
+
'or remove [label].');
|
|
2579
|
+
}
|
|
2580
|
+
});
|
|
2581
|
+
}
|
|
2311
2582
|
}
|
|
2312
2583
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.4", ngImport: i0, type: CngxTagGroup, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
2313
2584
|
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.4", type: CngxTagGroup, isStandalone: true, selector: "cngx-tag-group", inputs: { gap: { classPropertyName: "gap", publicName: "gap", isSignal: true, isRequired: false, transformFunction: null }, align: { classPropertyName: "align", publicName: "align", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, semanticListInput: { classPropertyName: "semanticListInput", publicName: "semanticList", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class.cngx-tag-group--gap-xs": "gap() === 'xs'", "class.cngx-tag-group--gap-md": "gap() === 'md'", "class.cngx-tag-group--align-start": "align() === 'start'", "class.cngx-tag-group--align-center": "align() === 'center'", "class.cngx-tag-group--align-end": "align() === 'end'", "class.cngx-tag-group--align-between": "align() === 'between'", "attr.role": "semanticList() ? 'list' : null", "attr.aria-label": "label() ?? null" }, classAttribute: "cngx-tag-group" }, providers: [{ provide: CNGX_TAG_GROUP, useExisting: CngxTagGroup }], queries: [{ propertyName: "headerSlot", first: true, predicate: CngxTagGroupHeader, descendants: true, isSignal: true }, { propertyName: "accessorySlot", first: true, predicate: CngxTagGroupAccessory, descendants: true, isSignal: true }, { propertyName: "projectedTags", predicate: CngxTag, isSignal: true }], exportAs: ["cngxTagGroup"], ngImport: i0, template: `
|
|
@@ -2360,5 +2631,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.4", ngImpor
|
|
|
2360
2631
|
* Generated bundle index. Do not edit.
|
|
2361
2632
|
*/
|
|
2362
2633
|
|
|
2363
|
-
export { CNGX_TAG_CONFIG, CNGX_TAG_GROUP, CngxAvatar, CngxAvatarGroup, CngxBadge, CngxCheckboxIndicator, CngxChip, CngxDivider, CngxIcon, CngxMeta, CngxMetaList, CngxPasswordStrengthMeter, CngxRadioIndicator, CngxSegmentedProgress, CngxStatus, CngxTag, CngxTagGroup, CngxTagGroupAccessory, CngxTagGroupHeader, CngxTagLabel, CngxTagPrefix, CngxTagSuffix, CngxTime, injectTagConfig, provideTagConfig, provideTagConfigAt, withTagColors, withTagDefaults, withTagGroupDefaults, withTagSlots };
|
|
2634
|
+
export { CNGX_DISPLAY_I18N, CNGX_DISPLAY_LANGUAGE_EN, CNGX_TAG_CONFIG, CNGX_TAG_GROUP, CngxAvatar, CngxAvatarGroup, CngxBadge, CngxCheckboxIndicator, CngxChip, CngxDivider, CngxIcon, CngxMeta, CngxMetaList, CngxPasswordStrengthMeter, CngxRadioIndicator, CngxSegmentedProgress, CngxStatus, CngxTag, CngxTagGroup, CngxTagGroupAccessory, CngxTagGroupHeader, CngxTagLabel, CngxTagPrefix, CngxTagSuffix, CngxTime, injectDisplayI18n, injectTagConfig, provideDisplayI18n, provideTagConfig, provideTagConfigAt, withDisplayI18nLabels, withTagColors, withTagDefaults, withTagGroupDefaults, withTagSlots };
|
|
2364
2635
|
//# sourceMappingURL=cngx-common-display.mjs.map
|