@ckui/core 0.1.0-next.0 → 0.1.0-next.2

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.
Files changed (36) hide show
  1. package/README.md +239 -0
  2. package/fesm2022/ckui-core-badge.mjs +169 -0
  3. package/fesm2022/ckui-core-badge.mjs.map +1 -0
  4. package/fesm2022/ckui-core-button.mjs +5 -13
  5. package/fesm2022/ckui-core-button.mjs.map +1 -1
  6. package/fesm2022/ckui-core-dialog.mjs +908 -0
  7. package/fesm2022/ckui-core-dialog.mjs.map +1 -0
  8. package/fesm2022/ckui-core-field.mjs +6 -10
  9. package/fesm2022/ckui-core-field.mjs.map +1 -1
  10. package/fesm2022/ckui-core-internal-overlay.mjs +468 -0
  11. package/fesm2022/ckui-core-internal-overlay.mjs.map +1 -0
  12. package/fesm2022/ckui-core-internal.mjs +271 -8
  13. package/fesm2022/ckui-core-internal.mjs.map +1 -1
  14. package/fesm2022/ckui-core-progress.mjs +165 -0
  15. package/fesm2022/ckui-core-progress.mjs.map +1 -0
  16. package/fesm2022/ckui-core-segmented.mjs +528 -0
  17. package/fesm2022/ckui-core-segmented.mjs.map +1 -0
  18. package/fesm2022/ckui-core-stepper.mjs +842 -0
  19. package/fesm2022/ckui-core-stepper.mjs.map +1 -0
  20. package/fesm2022/ckui-core-toast.mjs +883 -0
  21. package/fesm2022/ckui-core-toast.mjs.map +1 -0
  22. package/fesm2022/ckui-core.mjs +5 -1
  23. package/fesm2022/ckui-core.mjs.map +1 -1
  24. package/package.json +29 -1
  25. package/styles/tokens.css +3 -0
  26. package/types/ckui-core-badge.d.ts +44 -0
  27. package/types/ckui-core-button.d.ts +0 -1
  28. package/types/ckui-core-dialog.d.ts +219 -0
  29. package/types/ckui-core-field.d.ts +0 -1
  30. package/types/ckui-core-internal-overlay.d.ts +76 -0
  31. package/types/ckui-core-internal.d.ts +115 -8
  32. package/types/ckui-core-progress.d.ts +43 -0
  33. package/types/ckui-core-segmented.d.ts +124 -0
  34. package/types/ckui-core-stepper.d.ts +186 -0
  35. package/types/ckui-core-toast.d.ts +97 -0
  36. package/types/ckui-core.d.ts +4 -0
@@ -0,0 +1,528 @@
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, InjectionToken, PLATFORM_ID, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChildren, forwardRef, inject, input, signal, untracked } from "@angular/core";
3
+ import { CkMedia, CkValueControl, hasAccessibleName, provideCkValueAccessor } from "@ckui/core/internal";
4
+ import { isPlatformBrowser } from "@angular/common";
5
+ import { CK_CONFIG } from "@ckui/core";
6
+ const CK_SEGMENTED_CONTEXT = new InjectionToken("CK_SEGMENTED_CONTEXT");
7
+ const UNBOUND = Symbol("unbound");
8
+ var CkSegment = class CkSegment {
9
+ value = input.required(...ngDevMode ? [{ debugName: "value" }] : /* istanbul ignore next */ []);
10
+ disabled = input(false, {
11
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
12
+ transform: booleanAttribute
13
+ });
14
+ element = inject(ElementRef).nativeElement;
15
+ group = inject(CK_SEGMENTED_CONTEXT);
16
+ checked = computed(() => {
17
+ const value = this.bound();
18
+ return value !== UNBOUND && this.group.isChecked(value);
19
+ }, ...ngDevMode ? [{ debugName: "checked" }] : /* istanbul ignore next */ []);
20
+ unavailable = computed(() => this.disabled() || this.group.groupDisabled(), ...ngDevMode ? [{ debugName: "unavailable" }] : /* istanbul ignore next */ []);
21
+ bound = computed(() => {
22
+ try {
23
+ return this.value();
24
+ } catch {
25
+ return UNBOUND;
26
+ }
27
+ }, ...ngDevMode ? [{ debugName: "bound" }] : /* istanbul ignore next */ []);
28
+ tabIndex = computed(() => {
29
+ if (this.unavailable()) return null;
30
+ return this.group.tabStop() === this ? 0 : -1;
31
+ }, ...ngDevMode ? [{ debugName: "tabIndex" }] : /* istanbul ignore next */ []);
32
+ constructor() {
33
+ if (typeof ngDevMode !== "undefined" && ngDevMode) {
34
+ let destroyed = false;
35
+ inject(DestroyRef).onDestroy(() => destroyed = true);
36
+ afterNextRender(() => {
37
+ if (!destroyed && !hasAccessibleName(this.element, {
38
+ title: true,
39
+ text: true
40
+ })) console.warn("[ckui] ck-segment has no accessible name. An icon-only segment needs an aria-label.", this.element);
41
+ });
42
+ }
43
+ }
44
+ static ɵfac = i0.ɵɵngDeclareFactory({
45
+ minVersion: "12.0.0",
46
+ version: "22.2.4",
47
+ ngImport: i0,
48
+ type: CkSegment,
49
+ deps: [],
50
+ target: i0.ɵɵFactoryTarget.Component
51
+ });
52
+ static ɵcmp = i0.ɵɵngDeclareComponent({
53
+ minVersion: "17.1.0",
54
+ version: "22.2.4",
55
+ type: CkSegment,
56
+ isStandalone: true,
57
+ selector: "ck-segment",
58
+ inputs: {
59
+ value: {
60
+ classPropertyName: "value",
61
+ publicName: "value",
62
+ isSignal: true,
63
+ isRequired: true,
64
+ transformFunction: null
65
+ },
66
+ disabled: {
67
+ classPropertyName: "disabled",
68
+ publicName: "disabled",
69
+ isSignal: true,
70
+ isRequired: false,
71
+ transformFunction: null
72
+ }
73
+ },
74
+ host: {
75
+ attributes: { "role": "radio" },
76
+ listeners: { "click": "group.select(this)" },
77
+ properties: {
78
+ "class.ck-segment--checked": "checked()",
79
+ "class.ck-segment--disabled": "unavailable()",
80
+ "attr.aria-checked": "checked()",
81
+ "attr.aria-disabled": "unavailable() ? \"true\" : null",
82
+ "attr.tabindex": "tabIndex()"
83
+ },
84
+ classAttribute: "ck-segment"
85
+ },
86
+ ngImport: i0,
87
+ template: `<span class="ck-segment__content"
88
+ ><ng-content select="svg, ck-icon" /><span class="ck-segment__label"><ng-content /></span
89
+ ></span>`,
90
+ isInline: true,
91
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
92
+ encapsulation: i0.ViewEncapsulation.None
93
+ });
94
+ };
95
+ i0.ɵɵngDeclareClassMetadata({
96
+ minVersion: "12.0.0",
97
+ version: "22.2.4",
98
+ ngImport: i0,
99
+ type: CkSegment,
100
+ decorators: [{
101
+ type: Component,
102
+ args: [{
103
+ selector: "ck-segment",
104
+ changeDetection: ChangeDetectionStrategy.OnPush,
105
+ encapsulation: ViewEncapsulation.None,
106
+ host: {
107
+ class: "ck-segment",
108
+ role: "radio",
109
+ "[class.ck-segment--checked]": "checked()",
110
+ "[class.ck-segment--disabled]": "unavailable()",
111
+ "[attr.aria-checked]": "checked()",
112
+ "[attr.aria-disabled]": "unavailable() ? \"true\" : null",
113
+ "[attr.tabindex]": "tabIndex()",
114
+ "(click)": "group.select(this)"
115
+ },
116
+ template: `<span class="ck-segment__content"
117
+ ><ng-content select="svg, ck-icon" /><span class="ck-segment__label"><ng-content /></span
118
+ ></span>`
119
+ }]
120
+ }],
121
+ ctorParameters: () => [],
122
+ propDecorators: {
123
+ value: [{
124
+ type: i0.Input,
125
+ args: [{
126
+ isSignal: true,
127
+ alias: "value",
128
+ required: true
129
+ }]
130
+ }],
131
+ disabled: [{
132
+ type: i0.Input,
133
+ args: [{
134
+ isSignal: true,
135
+ alias: "disabled",
136
+ required: false
137
+ }]
138
+ }]
139
+ }
140
+ });
141
+ const SCALE_NOISE = .005;
142
+ function scaleOf(group) {
143
+ const layout = group.offsetWidth;
144
+ const scale = layout > 0 ? group.getBoundingClientRect().width / layout : 1;
145
+ return Math.abs(scale - 1) < SCALE_NOISE ? 1 : scale;
146
+ }
147
+ function naturalWidth(segment, scale) {
148
+ const view = segment.ownerDocument.defaultView;
149
+ const style = view.getComputedStyle(segment);
150
+ let width = parseFloat(style.paddingInlineStart) + parseFloat(style.paddingInlineEnd);
151
+ const content = segment.querySelector(".ck-segment__content");
152
+ if (content === null) return width;
153
+ const gap = parseFloat(view.getComputedStyle(content).columnGap) || 0;
154
+ let shown = 0;
155
+ for (const child of Array.from(content.children)) {
156
+ if (view.getComputedStyle(child).display === "none") continue;
157
+ let childWidth = child.getBoundingClientRect().width;
158
+ if (child.classList.contains("ck-segment__label")) {
159
+ const range = child.ownerDocument.createRange();
160
+ range.selectNodeContents(child);
161
+ childWidth = range.getBoundingClientRect().width;
162
+ }
163
+ width += childWidth / scale + (shown > 0 ? gap : 0);
164
+ shown += 1;
165
+ }
166
+ return width;
167
+ }
168
+ function overflows(group, segments) {
169
+ const rendered = group.getBoundingClientRect().width;
170
+ if (rendered === 0) return null;
171
+ const scale = scaleOf(group);
172
+ return segments.reduce((sum, segment) => sum + naturalWidth(segment, scale), 0) > rendered / scale + .5;
173
+ }
174
+ const FALLBACK_DURATION_MS = 200;
175
+ function parseDuration(text) {
176
+ const match = /^([\d.]+)(ms|s)?$/.exec(text.trim());
177
+ if (match === null) return null;
178
+ const amount = Number(match[1]);
179
+ return Number.isFinite(amount) ? match[2] === "s" ? amount * 1e3 : amount : null;
180
+ }
181
+ function relative(box, group) {
182
+ return {
183
+ left: box.left - group.left,
184
+ width: box.width
185
+ };
186
+ }
187
+ function drawn(slide) {
188
+ const progress = slide.animation.effect?.getComputedTiming().progress ?? 1;
189
+ return {
190
+ left: slide.from.left + (slide.to.left - slide.from.left) * progress,
191
+ width: slide.from.width + (slide.to.width - slide.from.width) * progress
192
+ };
193
+ }
194
+ function slideIndicator(indicator, group, previous, current, running) {
195
+ const shown = running !== null && ["running", "paused"].includes(running.animation.playState) ? drawn(running) : null;
196
+ for (const animation of indicator.getAnimations()) animation.cancel();
197
+ const style = indicator.ownerDocument.defaultView.getComputedStyle(indicator);
198
+ const duration = parseDuration(style.getPropertyValue("--ck-duration-normal")) ?? FALLBACK_DURATION_MS;
199
+ if (typeof indicator.animate !== "function" || duration <= 0) return null;
200
+ const groupBox = group.getBoundingClientRect();
201
+ const to = relative(indicator.getBoundingClientRect(), groupBox);
202
+ if (to.width === 0) return null;
203
+ let from = shown;
204
+ if (from === null) {
205
+ const inset = (current.getBoundingClientRect().width - to.width) / 2;
206
+ const old = relative(previous.getBoundingClientRect(), groupBox);
207
+ from = {
208
+ left: old.left + inset,
209
+ width: old.width - 2 * inset
210
+ };
211
+ }
212
+ if (from.width <= 0) return null;
213
+ const offset = indicator.matches(":dir(rtl)") ? from.left + from.width - (to.left + to.width) : from.left - to.left;
214
+ const easing = style.getPropertyValue("--ck-ease-standard").trim() || "ease";
215
+ const keyframes = [{
216
+ transform: `translateX(${offset}px)`,
217
+ inlineSize: `${from.width}px`
218
+ }, {
219
+ transform: "translateX(0)",
220
+ inlineSize: `${to.width}px`
221
+ }];
222
+ let animation;
223
+ try {
224
+ animation = indicator.animate(keyframes, {
225
+ duration,
226
+ easing
227
+ });
228
+ } catch {
229
+ animation = indicator.animate(keyframes, {
230
+ duration,
231
+ easing: "ease"
232
+ });
233
+ }
234
+ return {
235
+ animation,
236
+ from,
237
+ to
238
+ };
239
+ }
240
+ function stepOf(key, rtl) {
241
+ switch (key) {
242
+ case "ArrowUp": return -1;
243
+ case "ArrowDown": return 1;
244
+ case "ArrowLeft": return rtl ? 1 : -1;
245
+ case "ArrowRight": return rtl ? -1 : 1;
246
+ default: return 0;
247
+ }
248
+ }
249
+ var CkSegmented = class CkSegmented extends CkValueControl {
250
+ size = input(void 0, ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
251
+ fullWidth = input(false, {
252
+ ...ngDevMode ? { debugName: "fullWidth" } : /* istanbul ignore next */ {},
253
+ transform: booleanAttribute
254
+ });
255
+ config = inject(CK_CONFIG);
256
+ element = inject(ElementRef).nativeElement;
257
+ segments = contentChildren(CkSegment, {
258
+ ...ngDevMode ? { debugName: "segments" } : /* istanbul ignore next */ {},
259
+ descendants: true
260
+ });
261
+ modifierClasses = computed(() => `ck-segmented--${this.size() ?? this.config.size}`, ...ngDevMode ? [{ debugName: "modifierClasses" }] : /* istanbul ignore next */ []);
262
+ current = computed(() => this.value() ?? null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
263
+ checkedIndex = computed(() => this.segments().findIndex((segment) => segment.checked()), ...ngDevMode ? [{ debugName: "checkedIndex" }] : /* istanbul ignore next */ []);
264
+ column = computed(() => {
265
+ const index = this.checkedIndex();
266
+ return index >= 0 ? index + 1 : null;
267
+ }, ...ngDevMode ? [{ debugName: "column" }] : /* istanbul ignore next */ []);
268
+ compact = signal(false, ...ngDevMode ? [{ debugName: "compact" }] : /* istanbul ignore next */ []);
269
+ media = inject(CkMedia);
270
+ browser = isPlatformBrowser(inject(PLATFORM_ID));
271
+ destroyed = false;
272
+ shownSegment = null;
273
+ slide = null;
274
+ observer = null;
275
+ mutations = null;
276
+ fonts = null;
277
+ groupDisabled = computed(() => this.isDisabled(), ...ngDevMode ? [{ debugName: "groupDisabled" }] : /* istanbul ignore next */ []);
278
+ tabStop = computed(() => {
279
+ if (this.isDisabled()) return null;
280
+ const usable = this.segments().filter((segment) => !segment.unavailable());
281
+ return usable.find((segment) => segment.checked()) ?? usable[0] ?? null;
282
+ }, ...ngDevMode ? [{ debugName: "tabStop" }] : /* istanbul ignore next */ []);
283
+ constructor() {
284
+ super();
285
+ inject(DestroyRef).onDestroy(() => {
286
+ this.destroyed = true;
287
+ this.slide?.animation.cancel();
288
+ this.observer?.disconnect();
289
+ this.observer = null;
290
+ this.mutations?.disconnect();
291
+ this.mutations = null;
292
+ this.fonts?.removeEventListener("loadingdone", this.onFontsLoaded);
293
+ this.fonts = null;
294
+ });
295
+ afterRenderEffect(() => this.slideTo(this.segments()[this.checkedIndex()]?.element ?? null));
296
+ afterRenderEffect(() => {
297
+ this.modifierClasses();
298
+ this.fit(this.segments());
299
+ });
300
+ if (typeof ngDevMode !== "undefined" && ngDevMode) {
301
+ let destroyed = false;
302
+ inject(DestroyRef).onDestroy(() => destroyed = true);
303
+ afterNextRender(() => {
304
+ if (!destroyed && !hasAccessibleName(this.element, {
305
+ title: false,
306
+ text: false
307
+ })) console.warn("[ckui] ck-segmented has no accessible name. Add an aria-label or aria-labelledby.", this.element);
308
+ });
309
+ }
310
+ }
311
+ slideTo(selected) {
312
+ if (!this.browser || this.destroyed) return;
313
+ const previous = this.shownSegment;
314
+ this.shownSegment = selected;
315
+ const reduced = untracked(this.media.reducedMotion);
316
+ const indicator = this.element.querySelector(".ck-segmented__indicator");
317
+ if (indicator === null || selected === null || previous === null || previous === selected) return;
318
+ if (reduced || !previous.isConnected) {
319
+ this.slide?.animation.cancel();
320
+ this.slide = null;
321
+ return;
322
+ }
323
+ this.slide = slideIndicator(indicator, this.element, previous, selected, this.slide);
324
+ }
325
+ fit(segments) {
326
+ if (!this.browser || this.destroyed) return;
327
+ const Observer = this.element.ownerDocument.defaultView?.ResizeObserver;
328
+ if (Observer !== void 0 && this.observer === null) this.observer = new Observer(() => this.measure());
329
+ this.observer?.disconnect();
330
+ this.observer?.observe(this.element);
331
+ for (const segment of segments) this.observer?.observe(segment.element);
332
+ this.watchContent(segments);
333
+ this.measure();
334
+ }
335
+ watchContent(segments) {
336
+ const document = this.element.ownerDocument;
337
+ const Mutation = document.defaultView?.MutationObserver;
338
+ this.mutations?.disconnect();
339
+ if (Mutation !== void 0) {
340
+ this.mutations = new Mutation(() => this.measure());
341
+ for (const segment of segments) this.mutations.observe(segment.element, {
342
+ childList: true,
343
+ characterData: true,
344
+ subtree: true
345
+ });
346
+ }
347
+ if (this.fonts === null && document.fonts !== void 0) {
348
+ this.fonts = document.fonts;
349
+ this.fonts.addEventListener("loadingdone", this.onFontsLoaded);
350
+ }
351
+ }
352
+ onFontsLoaded = () => this.measure();
353
+ measure() {
354
+ if (this.destroyed) return;
355
+ const elements = untracked(this.segments).map((segment) => segment.element);
356
+ const overflow = overflows(this.element, elements);
357
+ if (overflow !== null) this.compact.set(overflow);
358
+ }
359
+ isChecked(value) {
360
+ const current = this.current();
361
+ return current !== null && Object.is(current, value);
362
+ }
363
+ select(segment) {
364
+ if (!segment.unavailable()) this.commit(segment.value());
365
+ }
366
+ onKeydown(event) {
367
+ if (this.isDisabled() || event.ctrlKey || event.metaKey || event.altKey) return;
368
+ const target = event.target;
369
+ const segments = this.segments();
370
+ const focused = segments.find((segment) => segment.element.contains(target));
371
+ if (focused === void 0) return;
372
+ const usable = segments.filter((segment) => !segment.unavailable());
373
+ if (usable.length === 0) return;
374
+ if (event.key === " " || event.key === "Spacebar") {
375
+ event.preventDefault();
376
+ this.select(focused);
377
+ return;
378
+ }
379
+ const next = this.targetOf(event.key, focused, usable);
380
+ if (next === null) return;
381
+ event.preventDefault();
382
+ this.select(next);
383
+ next.element.focus();
384
+ }
385
+ targetOf(key, focused, usable) {
386
+ const last = usable.length - 1;
387
+ if (key === "Home") return usable[0];
388
+ if (key === "End") return usable[last];
389
+ const step = stepOf(key, this.element.matches(":dir(rtl)"));
390
+ if (step === 0) return null;
391
+ const from = usable.indexOf(focused);
392
+ if (from < 0) return step > 0 ? usable[0] : usable[last];
393
+ return usable[(from + step + usable.length) % usable.length];
394
+ }
395
+ onFocusOut(event) {
396
+ const entering = event.relatedTarget;
397
+ if (this.isDisabled()) return;
398
+ if (!(entering instanceof Node) || !this.element.contains(entering)) this.markTouched();
399
+ }
400
+ static ɵfac = i0.ɵɵngDeclareFactory({
401
+ minVersion: "12.0.0",
402
+ version: "22.2.4",
403
+ ngImport: i0,
404
+ type: CkSegmented,
405
+ deps: [],
406
+ target: i0.ɵɵFactoryTarget.Component
407
+ });
408
+ static ɵcmp = i0.ɵɵngDeclareComponent({
409
+ minVersion: "17.2.0",
410
+ version: "22.2.4",
411
+ type: CkSegmented,
412
+ isStandalone: true,
413
+ selector: "ck-segmented",
414
+ inputs: {
415
+ size: {
416
+ classPropertyName: "size",
417
+ publicName: "size",
418
+ isSignal: true,
419
+ isRequired: false,
420
+ transformFunction: null
421
+ },
422
+ fullWidth: {
423
+ classPropertyName: "fullWidth",
424
+ publicName: "fullWidth",
425
+ isSignal: true,
426
+ isRequired: false,
427
+ transformFunction: null
428
+ }
429
+ },
430
+ host: {
431
+ attributes: { "role": "radiogroup" },
432
+ listeners: {
433
+ "keydown": "onKeydown($event)",
434
+ "focusout": "onFocusOut($event)"
435
+ },
436
+ properties: {
437
+ "class": "modifierClasses()",
438
+ "class.ck-segmented--has-value": "checkedIndex() >= 0",
439
+ "class.ck-segmented--disabled": "isDisabled()",
440
+ "class.ck-segmented--full-width": "fullWidth()",
441
+ "class.ck-segmented--compact": "compact()",
442
+ "attr.aria-disabled": "isDisabled() ? \"true\" : null",
443
+ "style.--_ck-segmented-column": "column()"
444
+ },
445
+ classAttribute: "ck-segmented"
446
+ },
447
+ providers: [provideCkValueAccessor(CkSegmented), {
448
+ provide: CK_SEGMENTED_CONTEXT,
449
+ useExisting: forwardRef(() => CkSegmented)
450
+ }],
451
+ queries: [{
452
+ propertyName: "segments",
453
+ predicate: CkSegment,
454
+ descendants: true,
455
+ isSignal: true
456
+ }],
457
+ usesInheritance: true,
458
+ ngImport: i0,
459
+ template: `<span class="ck-segmented__indicator" aria-hidden="true"></span><ng-content />`,
460
+ isInline: true,
461
+ styles: ["@layer ckui{.ck-segmented{--_ck-segmented-gap: var(--ck-segmented-padding, var(--ck-space-1));--_ck-segmented-radius: var(--ck-segmented-radius, var(--ck-control-radius));position:relative;display:inline-grid;grid-auto-flow:column;grid-auto-columns:minmax(auto,1fr);box-sizing:border-box;max-inline-size:100%;block-size:var(--_ck-segmented-height);border-radius:var(--_ck-segmented-radius);background:var(--ck-segmented-bg, var(--ck-color-control));box-shadow:inset 0 0 0 1px var(--ck-segmented-border-color, var(--ck-color-control-border));color-scheme:var(--ck-color-scheme);font-family:inherit;font-variant-numeric:var(--ck-font-variant-numeric);line-height:var(--ck-line-height-tight);vertical-align:middle;isolation:isolate}.ck-segmented:dir(ltr){direction:ltr}.ck-segmented--full-width{display:grid;inline-size:100%}.ck-segmented--sm{--_ck-segmented-height: var(--ck-control-height-sm);--_ck-segmented-font-size: var(--ck-control-font-size-sm);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-sm) )}.ck-segmented--md{--_ck-segmented-height: var(--ck-control-height-md);--_ck-segmented-font-size: var(--ck-control-font-size-md);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-md) )}.ck-segmented--lg{--_ck-segmented-height: var(--ck-control-height-lg);--_ck-segmented-font-size: var(--ck-control-font-size-lg);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-lg) )}.ck-segmented--xl{--_ck-segmented-height: var(--ck-control-height-xl);--_ck-segmented-font-size: var(--ck-control-font-size-xl);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-xl) )}.ck-segmented__indicator{position:absolute;display:none;box-sizing:border-box;grid-row:1 / span 1;grid-column:var(--_ck-segmented-column, 1) / span 1;inset:var(--_ck-segmented-gap);border:1px solid var(--ck-segmented-border-color, var(--ck-color-control-border));border-radius:max(0px,calc(var(--_ck-segmented-radius) - var(--_ck-segmented-gap)));background:var(--ck-segmented-indicator-bg, var(--ck-color-surface-raised));box-shadow:var(--ck-shadow-sm);pointer-events:none}.ck-segmented--has-value .ck-segmented__indicator{display:block}.ck-segment{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding-inline:var(--_ck-segmented-padding-inline);color:var(--ck-segmented-fg, var(--ck-color-fg-muted));font-size:var(--_ck-segmented-font-size);font-weight:var(--ck-font-weight-medium);text-align:center;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ck-segment:before{content:\"\";position:absolute;inset:var(--_ck-segmented-gap);border-radius:max(0px,calc(var(--_ck-segmented-radius) - var(--_ck-segmented-gap)));pointer-events:none}.ck-segmented--compact{grid-auto-columns:minmax(0,1fr)}.ck-segmented--compact .ck-segment{min-inline-size:0}.ck-segment__content{position:relative;display:flex;align-items:center;justify-content:center;gap:var(--ck-space-2);min-inline-size:0;max-inline-size:100%}.ck-segment__content>svg{flex:none;inline-size:1em;block-size:1em}.ck-segment__content>ck-icon{flex:none}.ck-segment__label{min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck-segment__label:empty{display:none}.ck-segment--checked{color:var(--ck-segmented-indicator-fg, var(--ck-color-fg))}@media(hover:hover){.ck-segment:not(.ck-segment--checked,.ck-segment--disabled):hover:before{background:var(--ck-color-surface-hover)}}.ck-segment:after{content:\"\";position:absolute;inset:0;border-radius:var(--_ck-segmented-radius);pointer-events:none}.ck-segment:focus-visible{outline:none}.ck-segment:focus-visible:after{outline:var(--ck-focus-ring);outline-offset:calc(var(--ck-focus-ring-width) * -1)}.ck-segmented--disabled,.ck-segment--disabled{cursor:not-allowed}.ck-segment--disabled,.ck-segment--disabled.ck-segment--checked{color:var(--ck-color-fg-disabled)}@media(forced-colors:active){.ck-segmented{box-shadow:none;outline:1px solid ButtonText;outline-offset:-1px}.ck-segmented__indicator{border-color:Highlight;background:Highlight;box-shadow:none}.ck-segment--checked{forced-color-adjust:none;color:HighlightText}.ck-segment:focus-visible:after{outline-color:Highlight}.ck-segment--disabled,.ck-segment--disabled.ck-segment--checked{color:GrayText}.ck-segmented--disabled .ck-segmented__indicator,.ck-segmented:has(.ck-segment--checked.ck-segment--disabled) .ck-segmented__indicator{border-color:GrayText;background:Canvas}}}\n"],
462
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
463
+ encapsulation: i0.ViewEncapsulation.None
464
+ });
465
+ };
466
+ i0.ɵɵngDeclareClassMetadata({
467
+ minVersion: "12.0.0",
468
+ version: "22.2.4",
469
+ ngImport: i0,
470
+ type: CkSegmented,
471
+ decorators: [{
472
+ type: Component,
473
+ args: [{
474
+ selector: "ck-segmented",
475
+ changeDetection: ChangeDetectionStrategy.OnPush,
476
+ encapsulation: ViewEncapsulation.None,
477
+ providers: [provideCkValueAccessor(CkSegmented), {
478
+ provide: CK_SEGMENTED_CONTEXT,
479
+ useExisting: forwardRef(() => CkSegmented)
480
+ }],
481
+ host: {
482
+ class: "ck-segmented",
483
+ role: "radiogroup",
484
+ "[class]": "modifierClasses()",
485
+ "[class.ck-segmented--has-value]": "checkedIndex() >= 0",
486
+ "[class.ck-segmented--disabled]": "isDisabled()",
487
+ "[class.ck-segmented--full-width]": "fullWidth()",
488
+ "[class.ck-segmented--compact]": "compact()",
489
+ "[attr.aria-disabled]": "isDisabled() ? \"true\" : null",
490
+ "[style.--_ck-segmented-column]": "column()",
491
+ "(keydown)": "onKeydown($event)",
492
+ "(focusout)": "onFocusOut($event)"
493
+ },
494
+ template: `<span class="ck-segmented__indicator" aria-hidden="true"></span><ng-content />`,
495
+ styles: ["@layer ckui{.ck-segmented{--_ck-segmented-gap: var(--ck-segmented-padding, var(--ck-space-1));--_ck-segmented-radius: var(--ck-segmented-radius, var(--ck-control-radius));position:relative;display:inline-grid;grid-auto-flow:column;grid-auto-columns:minmax(auto,1fr);box-sizing:border-box;max-inline-size:100%;block-size:var(--_ck-segmented-height);border-radius:var(--_ck-segmented-radius);background:var(--ck-segmented-bg, var(--ck-color-control));box-shadow:inset 0 0 0 1px var(--ck-segmented-border-color, var(--ck-color-control-border));color-scheme:var(--ck-color-scheme);font-family:inherit;font-variant-numeric:var(--ck-font-variant-numeric);line-height:var(--ck-line-height-tight);vertical-align:middle;isolation:isolate}.ck-segmented:dir(ltr){direction:ltr}.ck-segmented--full-width{display:grid;inline-size:100%}.ck-segmented--sm{--_ck-segmented-height: var(--ck-control-height-sm);--_ck-segmented-font-size: var(--ck-control-font-size-sm);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-sm) )}.ck-segmented--md{--_ck-segmented-height: var(--ck-control-height-md);--_ck-segmented-font-size: var(--ck-control-font-size-md);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-md) )}.ck-segmented--lg{--_ck-segmented-height: var(--ck-control-height-lg);--_ck-segmented-font-size: var(--ck-control-font-size-lg);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-lg) )}.ck-segmented--xl{--_ck-segmented-height: var(--ck-control-height-xl);--_ck-segmented-font-size: var(--ck-control-font-size-xl);--_ck-segmented-padding-inline: var( --ck-segmented-padding-inline, var(--ck-control-padding-inline-xl) )}.ck-segmented__indicator{position:absolute;display:none;box-sizing:border-box;grid-row:1 / span 1;grid-column:var(--_ck-segmented-column, 1) / span 1;inset:var(--_ck-segmented-gap);border:1px solid var(--ck-segmented-border-color, var(--ck-color-control-border));border-radius:max(0px,calc(var(--_ck-segmented-radius) - var(--_ck-segmented-gap)));background:var(--ck-segmented-indicator-bg, var(--ck-color-surface-raised));box-shadow:var(--ck-shadow-sm);pointer-events:none}.ck-segmented--has-value .ck-segmented__indicator{display:block}.ck-segment{position:relative;display:flex;align-items:center;justify-content:center;box-sizing:border-box;padding-inline:var(--_ck-segmented-padding-inline);color:var(--ck-segmented-fg, var(--ck-color-fg-muted));font-size:var(--_ck-segmented-font-size);font-weight:var(--ck-font-weight-medium);text-align:center;cursor:pointer;touch-action:manipulation;-webkit-user-select:none;user-select:none;-webkit-tap-highlight-color:transparent}.ck-segment:before{content:\"\";position:absolute;inset:var(--_ck-segmented-gap);border-radius:max(0px,calc(var(--_ck-segmented-radius) - var(--_ck-segmented-gap)));pointer-events:none}.ck-segmented--compact{grid-auto-columns:minmax(0,1fr)}.ck-segmented--compact .ck-segment{min-inline-size:0}.ck-segment__content{position:relative;display:flex;align-items:center;justify-content:center;gap:var(--ck-space-2);min-inline-size:0;max-inline-size:100%}.ck-segment__content>svg{flex:none;inline-size:1em;block-size:1em}.ck-segment__content>ck-icon{flex:none}.ck-segment__label{min-inline-size:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.ck-segment__label:empty{display:none}.ck-segment--checked{color:var(--ck-segmented-indicator-fg, var(--ck-color-fg))}@media(hover:hover){.ck-segment:not(.ck-segment--checked,.ck-segment--disabled):hover:before{background:var(--ck-color-surface-hover)}}.ck-segment:after{content:\"\";position:absolute;inset:0;border-radius:var(--_ck-segmented-radius);pointer-events:none}.ck-segment:focus-visible{outline:none}.ck-segment:focus-visible:after{outline:var(--ck-focus-ring);outline-offset:calc(var(--ck-focus-ring-width) * -1)}.ck-segmented--disabled,.ck-segment--disabled{cursor:not-allowed}.ck-segment--disabled,.ck-segment--disabled.ck-segment--checked{color:var(--ck-color-fg-disabled)}@media(forced-colors:active){.ck-segmented{box-shadow:none;outline:1px solid ButtonText;outline-offset:-1px}.ck-segmented__indicator{border-color:Highlight;background:Highlight;box-shadow:none}.ck-segment--checked{forced-color-adjust:none;color:HighlightText}.ck-segment:focus-visible:after{outline-color:Highlight}.ck-segment--disabled,.ck-segment--disabled.ck-segment--checked{color:GrayText}.ck-segmented--disabled .ck-segmented__indicator,.ck-segmented:has(.ck-segment--checked.ck-segment--disabled) .ck-segmented__indicator{border-color:GrayText;background:Canvas}}}\n"]
496
+ }]
497
+ }],
498
+ ctorParameters: () => [],
499
+ propDecorators: {
500
+ size: [{
501
+ type: i0.Input,
502
+ args: [{
503
+ isSignal: true,
504
+ alias: "size",
505
+ required: false
506
+ }]
507
+ }],
508
+ fullWidth: [{
509
+ type: i0.Input,
510
+ args: [{
511
+ isSignal: true,
512
+ alias: "fullWidth",
513
+ required: false
514
+ }]
515
+ }],
516
+ segments: [{
517
+ type: i0.ContentChildren,
518
+ args: [i0.forwardRef(() => CkSegment), {
519
+ descendants: true,
520
+ isSignal: true
521
+ }]
522
+ }]
523
+ }
524
+ });
525
+ const CK_SEGMENTED_IMPORTS = [CkSegmented, CkSegment];
526
+ export { CK_SEGMENTED_IMPORTS, CkSegment, CkSegmented };
527
+
528
+ //# sourceMappingURL=ckui-core-segmented.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ckui-core-segmented.mjs","names":[],"sources":["../../../../projects/core/segmented/context.ts","../../../../projects/core/segmented/segment.ts","../../../../projects/core/segmented/segmented-fit.ts","../../../../projects/core/segmented/segmented-motion.ts","../../../../projects/core/segmented/segmented.ts","../../../../projects/core/segmented/index.ts"],"sourcesContent":["import { InjectionToken, Signal } from '@angular/core';\n\n/** The part of a `ck-segment` its group reads, so the two files need not import each other's classes. */\nexport interface CkSegmentRef {\n readonly element: HTMLElement;\n readonly value: () => unknown;\n readonly unavailable: Signal<boolean>;\n}\n\n/** What a `ck-segment` needs from its group. */\nexport interface CkSegmentedContext {\n /** The group is disabled by its input or by the forms API. */\n readonly groupDisabled: Signal<boolean>;\n /** The group's one tab stop, or `null` when nothing can take focus. */\n readonly tabStop: Signal<CkSegmentRef | null>;\n isChecked(value: unknown): boolean;\n select(segment: CkSegmentRef): void;\n}\n\nexport const CK_SEGMENTED_CONTEXT = new InjectionToken<CkSegmentedContext>('CK_SEGMENTED_CONTEXT');\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n inject,\n input,\n} from '@angular/core';\nimport { hasAccessibleName } from '@ckui/core/internal';\nimport { CK_SEGMENTED_CONTEXT } from './context';\n\ndeclare const ngDevMode: unknown;\n\nconst UNBOUND = Symbol('unbound');\n\n/**\n * One option of a `ck-segmented`. Its content is projected: text, an icon (a direct `svg` child, always shown before the text), or both. An icon-only\n * segment needs an `aria-label`.\n */\n@Component({\n selector: 'ck-segment',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n host: {\n class: 'ck-segment',\n role: 'radio',\n '[class.ck-segment--checked]': 'checked()',\n '[class.ck-segment--disabled]': 'unavailable()',\n '[attr.aria-checked]': 'checked()',\n '[attr.aria-disabled]': 'unavailable() ? \"true\" : null',\n '[attr.tabindex]': 'tabIndex()',\n '(click)': 'group.select(this)',\n },\n template: `<span class=\"ck-segment__content\"\n ><ng-content select=\"svg, ck-icon\" /><span class=\"ck-segment__label\"><ng-content /></span\n ></span>`,\n})\nexport class CkSegment<T = unknown> {\n readonly value = input.required<T>();\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /** @internal Used by `ck-segmented`. */\n readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n protected readonly group = inject(CK_SEGMENTED_CONTEXT);\n\n /** @internal Used by `ck-segmented`. */\n readonly checked = computed(() => {\n const value = this.bound();\n return value !== UNBOUND && this.group.isChecked(value);\n });\n /** @internal Used by `ck-segmented`: disabled by itself or by its group. */\n readonly unavailable = computed(() => this.disabled() || this.group.groupDisabled());\n /** A segment the template has just created has no value yet, though its group already reads it. */\n private readonly bound = computed<unknown>(() => {\n try {\n return this.value();\n } catch {\n return UNBOUND;\n }\n });\n /** An unavailable segment has no tabindex at all, so a click cannot focus it either. */\n protected readonly tabIndex = computed(() => {\n if (this.unavailable()) {\n return null;\n }\n return this.group.tabStop() === this ? 0 : -1;\n });\n\n constructor() {\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n let destroyed = false;\n inject(DestroyRef).onDestroy(() => (destroyed = true));\n afterNextRender(() => {\n if (!destroyed && !hasAccessibleName(this.element, { title: true, text: true })) {\n console.warn(\n '[ckui] ck-segment has no accessible name. An icon-only segment needs an aria-label.',\n this.element,\n );\n }\n });\n }\n }\n}\n","/** Pixel sizes below this scale difference from 1 are rounding noise, not an ancestor transform. */\nconst SCALE_NOISE = 0.005;\n\n/** How much an ancestor transform (a dialog opening with `scale(0.96)`) scales what rects report. */\nfunction scaleOf(group: HTMLElement): number {\n const layout = group.offsetWidth;\n const scale = layout > 0 ? group.getBoundingClientRect().width / layout : 1;\n return Math.abs(scale - 1) < SCALE_NOISE ? 1 : scale;\n}\n\n/** The width a segment needs to show its whole content: padding, icon, gap and untruncated text. */\nfunction naturalWidth(segment: HTMLElement, scale: number): number {\n const view = segment.ownerDocument.defaultView!;\n const style = view.getComputedStyle(segment);\n let width = parseFloat(style.paddingInlineStart) + parseFloat(style.paddingInlineEnd);\n const content = segment.querySelector<HTMLElement>('.ck-segment__content');\n if (content === null) {\n return width;\n }\n const gap = parseFloat(view.getComputedStyle(content).columnGap) || 0;\n let shown = 0;\n for (const child of Array.from(content.children)) {\n if (view.getComputedStyle(child).display === 'none') {\n continue;\n }\n let childWidth = child.getBoundingClientRect().width;\n if (child.classList.contains('ck-segment__label')) {\n // A truncated label is clipped, but its text keeps its full box.\n const range = child.ownerDocument.createRange();\n range.selectNodeContents(child);\n childWidth = range.getBoundingClientRect().width;\n }\n width += childWidth / scale + (shown > 0 ? gap : 0);\n shown += 1;\n }\n return width;\n}\n\n/**\n * Whether the segments, each at its natural width, no longer fit in the group; `null` while the\n * group has no size (not rendered). All sizes are in layout pixels, whatever transform surrounds it.\n */\nexport function overflows(group: HTMLElement, segments: readonly HTMLElement[]): boolean | null {\n const rendered = group.getBoundingClientRect().width;\n if (rendered === 0) {\n return null;\n }\n const scale = scaleOf(group);\n const needed = segments.reduce((sum, segment) => sum + naturalWidth(segment, scale), 0);\n return needed > rendered / scale + 0.5;\n}\n","const FALLBACK_DURATION_MS = 200;\n\n/** `200ms`, `.2s` or a bare number of milliseconds; anything else is `null`. */\nfunction parseDuration(text: string): number | null {\n const match = /^([\\d.]+)(ms|s)?$/.exec(text.trim());\n if (match === null) {\n return null;\n }\n const amount = Number(match[1]);\n return Number.isFinite(amount) ? (match[2] === 's' ? amount * 1000 : amount) : null;\n}\n\n/** Horizontal extent in pixels, from the left edge of the group. */\nexport interface SlideBox {\n readonly left: number;\n readonly width: number;\n}\n\n/** A slide in progress, remembered so a change in mid-slide can continue from where it is drawn. */\nexport interface Slide {\n readonly animation: Animation;\n readonly from: SlideBox;\n readonly to: SlideBox;\n}\n\nfunction relative(box: DOMRect, group: DOMRect): SlideBox {\n return { left: box.left - group.left, width: box.width };\n}\n\n/** Where a running slide is drawn now, following the eased progress of its animation. */\nfunction drawn(slide: Slide): SlideBox {\n const progress = slide.animation.effect?.getComputedTiming().progress ?? 1;\n return {\n left: slide.from.left + (slide.to.left - slide.from.left) * progress,\n width: slide.from.width + (slide.to.width - slide.from.width) * progress,\n };\n}\n\n/**\n * Slides the indicator from where it is shown to the segment it now sits in (FLIP): the layout has\n * already moved it, so the animation starts from the old box and ends at no offset. Width is\n * animated too, since the segments can differ in width. Returns `null` when nothing was started.\n */\nexport function slideIndicator(\n indicator: HTMLElement,\n group: HTMLElement,\n previous: HTMLElement,\n current: HTMLElement,\n running: Slide | null,\n): Slide | null {\n // The running slide was built for the old segment: its offsets mean nothing after the layout move.\n const wasRunning =\n running !== null && ['running', 'paused'].includes(running.animation.playState);\n const shown = wasRunning ? drawn(running) : null;\n for (const animation of indicator.getAnimations()) {\n animation.cancel();\n }\n const style = indicator.ownerDocument.defaultView!.getComputedStyle(indicator);\n const duration =\n parseDuration(style.getPropertyValue('--ck-duration-normal')) ?? FALLBACK_DURATION_MS;\n if (typeof indicator.animate !== 'function' || duration <= 0) {\n return null;\n }\n const groupBox = group.getBoundingClientRect();\n const to = relative(indicator.getBoundingClientRect(), groupBox);\n if (to.width === 0) {\n return null;\n }\n\n let from = shown;\n if (from === null) {\n // The old box is the previous segment's, inset the way the indicator is inside its own.\n const inset = (current.getBoundingClientRect().width - to.width) / 2;\n const old = relative(previous.getBoundingClientRect(), groupBox);\n from = { left: old.left + inset, width: old.width - 2 * inset };\n }\n if (from.width <= 0) {\n return null;\n }\n\n // The inline-size override keeps the box on its inline-start edge, which is the right one in RTL.\n const rtl = indicator.matches(':dir(rtl)');\n const offset = rtl ? from.left + from.width - (to.left + to.width) : from.left - to.left;\n const easing = style.getPropertyValue('--ck-ease-standard').trim() || 'ease';\n const keyframes = [\n { transform: `translateX(${offset}px)`, inlineSize: `${from.width}px` },\n { transform: 'translateX(0)', inlineSize: `${to.width}px` },\n ];\n let animation: Animation;\n try {\n animation = indicator.animate(keyframes, { duration, easing });\n } catch {\n // A custom easing the browser rejects: the standard curve is not worth losing the slide.\n animation = indicator.animate(keyframes, { duration, easing: 'ease' });\n }\n return { animation, from, to };\n}\n","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n PLATFORM_ID,\n ViewEncapsulation,\n afterNextRender,\n afterRenderEffect,\n booleanAttribute,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n signal,\n untracked,\n} from '@angular/core';\nimport { isPlatformBrowser } from '@angular/common';\nimport { CK_CONFIG, CkSize } from '@ckui/core';\nimport {\n CkMedia,\n CkValueControl,\n hasAccessibleName,\n provideCkValueAccessor,\n} from '@ckui/core/internal';\nimport { CK_SEGMENTED_CONTEXT, CkSegmentRef, CkSegmentedContext } from './context';\nimport { CkSegment } from './segment';\nimport { overflows } from './segmented-fit';\nimport { Slide, slideIndicator } from './segmented-motion';\n\ndeclare const ngDevMode: unknown;\n\n/** -1 for the previous segment, 1 for the next one, 0 for a key that does not move. */\nfunction stepOf(key: string, rtl: boolean): -1 | 0 | 1 {\n switch (key) {\n case 'ArrowUp':\n return -1;\n case 'ArrowDown':\n return 1;\n case 'ArrowLeft':\n return rtl ? 1 : -1;\n case 'ArrowRight':\n return rtl ? -1 : 1;\n default:\n return 0;\n }\n}\n\n/**\n * A group of mutually exclusive options that behaves as one radio group: one tab stop, the arrow\n * keys move and select. Direction comes from the `dir` attribute (`:dir(rtl)`), not from the CSS\n * `direction` property. The value is the `value` of the selected `ck-segment`, or `null`.\n *\n * Segments are as wide as an equal share or their label, whichever is larger. Only when the labels\n * cannot fit at all do they share the width equally and truncate with an ellipsis.\n */\n@Component({\n selector: 'ck-segmented',\n changeDetection: ChangeDetectionStrategy.OnPush,\n encapsulation: ViewEncapsulation.None,\n providers: [\n provideCkValueAccessor(CkSegmented),\n { provide: CK_SEGMENTED_CONTEXT, useExisting: forwardRef(() => CkSegmented) },\n ],\n host: {\n class: 'ck-segmented',\n role: 'radiogroup',\n '[class]': 'modifierClasses()',\n '[class.ck-segmented--has-value]': 'checkedIndex() >= 0',\n '[class.ck-segmented--disabled]': 'isDisabled()',\n '[class.ck-segmented--full-width]': 'fullWidth()',\n '[class.ck-segmented--compact]': 'compact()',\n '[attr.aria-disabled]': 'isDisabled() ? \"true\" : null',\n '[style.--_ck-segmented-column]': 'column()',\n '(keydown)': 'onKeydown($event)',\n '(focusout)': 'onFocusOut($event)',\n },\n template: `<span class=\"ck-segmented__indicator\" aria-hidden=\"true\"></span><ng-content />`,\n styleUrl: './segmented.css',\n})\nexport class CkSegmented<T = unknown>\n extends CkValueControl<T | null>\n implements CkSegmentedContext\n{\n /** `undefined` uses the size from `provideCkui`. */\n readonly size = input<CkSize | undefined>(undefined);\n /** Stretches the group to the width of its container; by default it is as wide as its segments. */\n readonly fullWidth = input(false, { transform: booleanAttribute });\n\n private readonly config = inject(CK_CONFIG);\n private readonly element = inject<ElementRef<HTMLElement>>(ElementRef).nativeElement;\n private readonly segments = contentChildren(CkSegment, { descendants: true });\n\n protected readonly modifierClasses = computed(\n () => `ck-segmented--${this.size() ?? this.config.size}`,\n );\n\n private readonly current = computed(() => this.value() ?? null);\n protected readonly checkedIndex = computed(() =>\n this.segments().findIndex((segment) => segment.checked()),\n );\n\n /** The grid column of the checked segment, which the indicator is placed in. */\n protected readonly column = computed(() => {\n const index = this.checkedIndex();\n return index >= 0 ? index + 1 : null;\n });\n\n /** Equal columns with truncated labels: the labels do not fit at their natural width. */\n protected readonly compact = signal(false);\n\n private readonly media = inject(CkMedia);\n private readonly browser = isPlatformBrowser(inject(PLATFORM_ID));\n private destroyed = false;\n private shownSegment: HTMLElement | null = null;\n private slide: Slide | null = null;\n private observer: ResizeObserver | null = null;\n private mutations: MutationObserver | null = null;\n private fonts: FontFaceSet | null = null;\n\n /** @internal Used by `ck-segment`. */\n readonly groupDisabled = computed(() => this.isDisabled());\n\n /** @internal Used by `ck-segment`. The checked segment, else the first one that can be used. */\n readonly tabStop = computed<CkSegmentRef | null>(() => {\n if (this.isDisabled()) {\n return null;\n }\n const usable = this.segments().filter((segment) => !segment.unavailable());\n return usable.find((segment) => segment.checked()) ?? usable[0] ?? null;\n });\n\n constructor() {\n super();\n inject(DestroyRef).onDestroy(() => {\n this.destroyed = true;\n this.slide?.animation.cancel();\n this.observer?.disconnect();\n this.observer = null;\n this.mutations?.disconnect();\n this.mutations = null;\n this.fonts?.removeEventListener('loadingdone', this.onFontsLoaded);\n this.fonts = null;\n });\n afterRenderEffect(() => this.slideTo(this.segments()[this.checkedIndex()]?.element ?? null));\n afterRenderEffect(() => {\n // The size changes the font, so it counts as content here.\n this.modifierClasses();\n this.fit(this.segments());\n });\n if (typeof ngDevMode !== 'undefined' && ngDevMode) {\n let destroyed = false;\n inject(DestroyRef).onDestroy(() => (destroyed = true));\n afterNextRender(() => {\n if (!destroyed && !hasAccessibleName(this.element, { title: false, text: false })) {\n console.warn(\n '[ckui] ck-segmented has no accessible name. Add an aria-label or aria-labelledby.',\n this.element,\n );\n }\n });\n }\n }\n\n /** Slides the indicator after the layout moved it, unless it appears or motion is reduced. */\n private slideTo(selected: HTMLElement | null): void {\n if (!this.browser || this.destroyed) {\n return;\n }\n const previous = this.shownSegment;\n this.shownSegment = selected;\n const reduced = untracked(this.media.reducedMotion);\n const indicator = this.element.querySelector<HTMLElement>('.ck-segmented__indicator');\n if (indicator === null || selected === null || previous === null || previous === selected) {\n return;\n }\n if (reduced || !previous.isConnected) {\n this.slide?.animation.cancel();\n this.slide = null;\n return;\n }\n this.slide = slideIndicator(indicator, this.element, previous, selected, this.slide);\n }\n\n /** Watches the group, its segments and their content, and switches the compact layout. */\n private fit(segments: readonly CkSegment[]): void {\n if (!this.browser || this.destroyed) {\n return;\n }\n const Observer = this.element.ownerDocument.defaultView?.ResizeObserver;\n if (Observer !== undefined && this.observer === null) {\n this.observer = new Observer(() => this.measure());\n }\n this.observer?.disconnect();\n this.observer?.observe(this.element);\n for (const segment of segments) {\n this.observer?.observe(segment.element);\n }\n this.watchContent(segments);\n this.measure();\n }\n\n /**\n * A label that changes (text, language, font) moves no box once the group is compact, so the\n * resize observer is blind to it: watch the text itself and the fonts that finish loading.\n */\n private watchContent(segments: readonly CkSegment[]): void {\n const document = this.element.ownerDocument;\n const Mutation = document.defaultView?.MutationObserver;\n this.mutations?.disconnect();\n if (Mutation !== undefined) {\n this.mutations = new Mutation(() => this.measure());\n for (const segment of segments) {\n this.mutations.observe(segment.element, {\n childList: true,\n characterData: true,\n subtree: true,\n });\n }\n }\n if (this.fonts === null && document.fonts !== undefined) {\n this.fonts = document.fonts;\n this.fonts.addEventListener('loadingdone', this.onFontsLoaded);\n }\n }\n\n private readonly onFontsLoaded = (): void => this.measure();\n\n private measure(): void {\n if (this.destroyed) {\n return;\n }\n const elements = untracked(this.segments).map((segment) => segment.element);\n const overflow = overflows(this.element, elements);\n if (overflow !== null) {\n this.compact.set(overflow);\n }\n }\n\n /** @internal Used by `ck-segment`. */\n isChecked(value: unknown): boolean {\n const current = this.current();\n return current !== null && Object.is(current, value);\n }\n\n /** @internal Used by `ck-segment`. */\n select(segment: CkSegmentRef): void {\n if (!segment.unavailable()) {\n this.commit(segment.value() as T);\n }\n }\n\n protected onKeydown(event: KeyboardEvent): void {\n if (this.isDisabled() || event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n const target = event.target as Node;\n const segments = this.segments();\n const focused = segments.find((segment) => segment.element.contains(target));\n if (focused === undefined) {\n return;\n }\n const usable = segments.filter((segment) => !segment.unavailable());\n if (usable.length === 0) {\n return;\n }\n\n if (event.key === ' ' || event.key === 'Spacebar') {\n event.preventDefault();\n this.select(focused);\n return;\n }\n\n const next = this.targetOf(event.key, focused, usable);\n if (next === null) {\n return;\n }\n event.preventDefault();\n this.select(next);\n next.element.focus();\n }\n\n /** The segment a navigation key leads to, or `null` for a key that does not navigate. */\n private targetOf(key: string, focused: CkSegment, usable: CkSegment[]): CkSegment | null {\n const last = usable.length - 1;\n if (key === 'Home') {\n return usable[0];\n }\n if (key === 'End') {\n return usable[last];\n }\n const step = stepOf(key, this.element.matches(':dir(rtl)'));\n if (step === 0) {\n return null;\n }\n const from = usable.indexOf(focused);\n if (from < 0) {\n return step > 0 ? usable[0] : usable[last];\n }\n return usable[(from + step + usable.length) % usable.length];\n }\n\n protected onFocusOut(event: FocusEvent): void {\n const entering = event.relatedTarget;\n if (this.isDisabled()) {\n return;\n }\n if (!(entering instanceof Node) || !this.element.contains(entering)) {\n this.markTouched();\n }\n }\n}\n","import { CkSegment } from './segment';\nimport { CkSegmented } from './segmented';\n\nexport { CkSegment } from './segment';\nexport { CkSegmented } from './segmented';\n\n/** Everything a template needs for a segmented control: `imports: [CK_SEGMENTED_IMPORTS]`. */\nexport const CK_SEGMENTED_IMPORTS = [CkSegmented, CkSegment] as const;\n"],"mappings":";;;;;AAmBA,MAAa,uBAAuB,IAAI,eAAmC,sBAAsB;ACFjG,MAAM,UAAU,OAAO,SAAS;AAwBhC,IAAa,YAAb,MAAa,UAAS;CACX,QAAQ,MAAM,SAAa,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAC3B,WAAW,MAAM,OAAK;EAAA,GAAA,YAAA,EAAA,WAAA,WAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAGrD,UAAU,OAAgC,UAAU,CAAC,CAAC;CAC5C,QAAQ,OAAO,oBAAoB;CAG7C,UAAU,eAAc;EAC/B,MAAM,QAAQ,KAAK,MAAK;EACxB,OAAO,UAAU,WAAW,KAAK,MAAM,UAAU,KAAK;CACxD,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,UAAA,CAAA,+BAAA,CAAA,CAAA;CAEO,cAAc,eAAe,KAAK,SAAQ,KAAM,KAAK,MAAM,cAAa,GAAG,GAAA,YAAA,CAAA,EAAA,WAAA,cAAA,CAAA,+BAAA,CAAA,CAAA;CAEnE,QAAQ,eAAuB;EAC9C,IAAI;GACF,OAAO,KAAK,MAAK;EACnB,QAAQ;GACN,OAAO;EACT;CACF,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEiB,WAAW,eAAc;EAC1C,IAAI,KAAK,YAAW,GAClB,OAAO;EAET,OAAO,KAAK,MAAM,QAAO,MAAO,OAAO,IAAI;CAC7C,GAAE,GAAA,YAAA,CAAA,EAAA,WAAA,WAAA,CAAA,+BAAA,CAAA,CAAA;CAEF,cAAA;EACE,IAAI,OAAO,cAAc,eAAe,WAAW;GACjD,IAAI,YAAY;GAChB,OAAO,UAAU,CAAC,CAAC,gBAAiB,Y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