@ckui/core 0.1.0-next.1 → 0.1.0-next.3
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/README.md +337 -4
- package/fesm2022/ckui-core-badge.mjs +169 -0
- package/fesm2022/ckui-core-badge.mjs.map +1 -0
- package/fesm2022/ckui-core-chip.mjs +300 -0
- package/fesm2022/ckui-core-chip.mjs.map +1 -0
- package/fesm2022/ckui-core-dialog.mjs +18 -286
- package/fesm2022/ckui-core-dialog.mjs.map +1 -1
- package/fesm2022/ckui-core-drawer.mjs +342 -0
- package/fesm2022/ckui-core-drawer.mjs.map +1 -0
- package/fesm2022/ckui-core-internal-dialog.mjs +296 -0
- package/fesm2022/ckui-core-internal-dialog.mjs.map +1 -0
- package/fesm2022/ckui-core-internal-overlay.mjs +479 -0
- package/fesm2022/ckui-core-internal-overlay.mjs.map +1 -0
- package/fesm2022/ckui-core-internal.mjs +2 -463
- package/fesm2022/ckui-core-internal.mjs.map +1 -1
- package/fesm2022/ckui-core-progress.mjs +165 -0
- package/fesm2022/ckui-core-progress.mjs.map +1 -0
- package/fesm2022/ckui-core-segmented.mjs +184 -8
- package/fesm2022/ckui-core-segmented.mjs.map +1 -1
- package/fesm2022/ckui-core-stepper.mjs +842 -0
- package/fesm2022/ckui-core-stepper.mjs.map +1 -0
- package/fesm2022/ckui-core-switch.mjs +327 -0
- package/fesm2022/ckui-core-switch.mjs.map +1 -0
- package/fesm2022/ckui-core-tabs.mjs +678 -0
- package/fesm2022/ckui-core-tabs.mjs.map +1 -0
- package/fesm2022/ckui-core.mjs +2 -0
- package/fesm2022/ckui-core.mjs.map +1 -1
- package/package.json +37 -1
- package/types/ckui-core-badge.d.ts +44 -0
- package/types/ckui-core-chip.d.ts +62 -0
- package/types/ckui-core-dialog.d.ts +5 -40
- package/types/ckui-core-drawer.d.ts +153 -0
- package/types/ckui-core-internal-dialog.d.ts +102 -0
- package/types/ckui-core-internal-overlay.d.ts +83 -0
- package/types/ckui-core-internal.d.ts +2 -75
- package/types/ckui-core-progress.d.ts +43 -0
- package/types/ckui-core-segmented.d.ts +26 -0
- package/types/ckui-core-stepper.d.ts +186 -0
- package/types/ckui-core-switch.d.ts +90 -0
- package/types/ckui-core-tabs.d.ts +212 -0
- package/types/ckui-core.d.ts +2 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
|
-
import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, InjectionToken, ViewEncapsulation, afterNextRender, booleanAttribute, computed, contentChildren, forwardRef, inject, input } from "@angular/core";
|
|
3
|
-
import { CkValueControl, hasAccessibleName, provideCkValueAccessor } from "@ckui/core/internal";
|
|
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";
|
|
4
5
|
import { CK_CONFIG } from "@ckui/core";
|
|
5
6
|
const CK_SEGMENTED_CONTEXT = new InjectionToken("CK_SEGMENTED_CONTEXT");
|
|
6
7
|
const UNBOUND = Symbol("unbound");
|
|
@@ -137,6 +138,105 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
137
138
|
}]
|
|
138
139
|
}
|
|
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
|
+
}
|
|
140
240
|
function stepOf(key, rtl) {
|
|
141
241
|
switch (key) {
|
|
142
242
|
case "ArrowUp": return -1;
|
|
@@ -161,6 +261,19 @@ var CkSegmented = class CkSegmented extends CkValueControl {
|
|
|
161
261
|
modifierClasses = computed(() => `ck-segmented--${this.size() ?? this.config.size}`, ...ngDevMode ? [{ debugName: "modifierClasses" }] : /* istanbul ignore next */ []);
|
|
162
262
|
current = computed(() => this.value() ?? null, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
|
|
163
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;
|
|
164
277
|
groupDisabled = computed(() => this.isDisabled(), ...ngDevMode ? [{ debugName: "groupDisabled" }] : /* istanbul ignore next */ []);
|
|
165
278
|
tabStop = computed(() => {
|
|
166
279
|
if (this.isDisabled()) return null;
|
|
@@ -169,6 +282,21 @@ var CkSegmented = class CkSegmented extends CkValueControl {
|
|
|
169
282
|
}, ...ngDevMode ? [{ debugName: "tabStop" }] : /* istanbul ignore next */ []);
|
|
170
283
|
constructor() {
|
|
171
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
|
+
});
|
|
172
300
|
if (typeof ngDevMode !== "undefined" && ngDevMode) {
|
|
173
301
|
let destroyed = false;
|
|
174
302
|
inject(DestroyRef).onDestroy(() => destroyed = true);
|
|
@@ -180,6 +308,54 @@ var CkSegmented = class CkSegmented extends CkValueControl {
|
|
|
180
308
|
});
|
|
181
309
|
}
|
|
182
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
|
+
}
|
|
183
359
|
isChecked(value) {
|
|
184
360
|
const current = this.current();
|
|
185
361
|
return current !== null && Object.is(current, value);
|
|
@@ -262,9 +438,9 @@ var CkSegmented = class CkSegmented extends CkValueControl {
|
|
|
262
438
|
"class.ck-segmented--has-value": "checkedIndex() >= 0",
|
|
263
439
|
"class.ck-segmented--disabled": "isDisabled()",
|
|
264
440
|
"class.ck-segmented--full-width": "fullWidth()",
|
|
441
|
+
"class.ck-segmented--compact": "compact()",
|
|
265
442
|
"attr.aria-disabled": "isDisabled() ? \"true\" : null",
|
|
266
|
-
"style.--_ck-segmented-
|
|
267
|
-
"style.--_ck-segmented-index": "checkedIndex()"
|
|
443
|
+
"style.--_ck-segmented-column": "column()"
|
|
268
444
|
},
|
|
269
445
|
classAttribute: "ck-segmented"
|
|
270
446
|
},
|
|
@@ -282,7 +458,7 @@ var CkSegmented = class CkSegmented extends CkValueControl {
|
|
|
282
458
|
ngImport: i0,
|
|
283
459
|
template: `<span class="ck-segmented__indicator" aria-hidden="true"></span><ng-content />`,
|
|
284
460
|
isInline: true,
|
|
285
|
-
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))
|
|
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"],
|
|
286
462
|
changeDetection: i0.ChangeDetectionStrategy.OnPush,
|
|
287
463
|
encapsulation: i0.ViewEncapsulation.None
|
|
288
464
|
});
|
|
@@ -309,14 +485,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
309
485
|
"[class.ck-segmented--has-value]": "checkedIndex() >= 0",
|
|
310
486
|
"[class.ck-segmented--disabled]": "isDisabled()",
|
|
311
487
|
"[class.ck-segmented--full-width]": "fullWidth()",
|
|
488
|
+
"[class.ck-segmented--compact]": "compact()",
|
|
312
489
|
"[attr.aria-disabled]": "isDisabled() ? \"true\" : null",
|
|
313
|
-
"[style.--_ck-segmented-
|
|
314
|
-
"[style.--_ck-segmented-index]": "checkedIndex()",
|
|
490
|
+
"[style.--_ck-segmented-column]": "column()",
|
|
315
491
|
"(keydown)": "onKeydown($event)",
|
|
316
492
|
"(focusout)": "onFocusOut($event)"
|
|
317
493
|
},
|
|
318
494
|
template: `<span class="ck-segmented__indicator" aria-hidden="true"></span><ng-content />`,
|
|
319
|
-
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))
|
|
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"]
|
|
320
496
|
}]
|
|
321
497
|
}],
|
|
322
498
|
ctorParameters: () => [],
|
|
@@ -1 +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.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","import {\n ChangeDetectionStrategy,\n Component,\n DestroyRef,\n ElementRef,\n ViewEncapsulation,\n afterNextRender,\n booleanAttribute,\n computed,\n contentChildren,\n forwardRef,\n inject,\n input,\n} from '@angular/core';\nimport { CK_CONFIG, CkSize } from '@ckui/core';\nimport { CkValueControl, hasAccessibleName, provideCkValueAccessor } from '@ckui/core/internal';\nimport { CK_SEGMENTED_CONTEXT, CkSegmentRef, CkSegmentedContext } from './context';\nimport { CkSegment } from './segment';\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@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 '[attr.aria-disabled]': 'isDisabled() ? \"true\" : null',\n '[style.--_ck-segmented-count]': 'segments().length',\n '[style.--_ck-segmented-index]': 'checkedIndex()',\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 /** @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 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 /** @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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b,cAAc;GACf;GAAA,UACS;GAAgF,QAAA,CAAA,ytJAAA;EAAA,CAAA;CAc9C,CAAA;CAAA,sBAAA,CAAA;CAAA,gBAAA;EAAA,MAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,WAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,SAAS,GAAA;IAAI,aAAa;IAAM,UAAA;GAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA;ACtE9E,MAAa,uBAAuB,CAAC,aAAa,SAAS"}
|
|
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,YAA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