@ferrlabs/ui-ng 1.52.5 → 1.53.1

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.
@@ -1,6 +1,6 @@
1
1
  import { DOCUMENT, Location, NgTemplateOutlet } from "@angular/common";
2
2
  import * as i0 from "@angular/core";
3
- import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, LOCALE_ID, ViewContainerRef, ViewEncapsulation, afterNextRender, afterRenderEffect, computed, contentChildren, effect, forwardRef, inject, input, linkedSignal, makeEnvironmentProviders, model, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
3
+ import { ChangeDetectionStrategy, Component, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, LOCALE_ID, ViewContainerRef, ViewEncapsulation, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChildren, effect, forwardRef, inject, input, linkedSignal, makeEnvironmentProviders, model, numberAttribute, output, signal, untracked, viewChild, viewChildren } from "@angular/core";
4
4
  import * as i1 from "@angular/forms";
5
5
  import { FormsModule, NG_VALUE_ACCESSOR } from "@angular/forms";
6
6
  import * as i1$2 from "@angular/cdk/overlay";
@@ -2578,7 +2578,7 @@ var InputComponent = class InputComponent {
2578
2578
  />
2579
2579
  `,
2580
2580
  isInline: true,
2581
- styles: [":host{display:contents}.flr-input{width:100%;box-sizing:border-box;font-family:var(--font-sans, \"Fraunces\", Georgia, ui-serif, serif);line-height:1.4;color:var(--color-ink, #1e293b);border-radius:var(--radius-control, 4px);outline:none;transition:border-color .14s,box-shadow .14s}\n"],
2581
+ styles: [":host{display:contents}.flr-input{width:100%;box-sizing:border-box;font-family:var(--font-sans, \"Fraunces\", Georgia, ui-serif, serif);line-height:1.4;color:var(--color-ink, #1e293b);border-radius:var(--radius-control, 4px);outline:none;transition:border-color .14s,box-shadow .14s}.flr-input::placeholder{color:var(--color-ink-3, #5d6b80);opacity:1}\n"],
2582
2582
  changeDetection: i0.ChangeDetectionStrategy.OnPush
2583
2583
  });
2584
2584
  }
@@ -2620,7 +2620,7 @@ i0.ɵɵngDeclareClassMetadata({
2620
2620
  (blur)="handleBlur()"
2621
2621
  />
2622
2622
  `,
2623
- styles: [":host{display:contents}.flr-input{width:100%;box-sizing:border-box;font-family:var(--font-sans, \"Fraunces\", Georgia, ui-serif, serif);line-height:1.4;color:var(--color-ink, #1e293b);border-radius:var(--radius-control, 4px);outline:none;transition:border-color .14s,box-shadow .14s}\n"]
2623
+ styles: [":host{display:contents}.flr-input{width:100%;box-sizing:border-box;font-family:var(--font-sans, \"Fraunces\", Georgia, ui-serif, serif);line-height:1.4;color:var(--color-ink, #1e293b);border-radius:var(--radius-control, 4px);outline:none;transition:border-color .14s,box-shadow .14s}.flr-input::placeholder{color:var(--color-ink-3, #5d6b80);opacity:1}\n"]
2624
2624
  }]
2625
2625
  }],
2626
2626
  propDecorators: {
@@ -13057,7 +13057,7 @@ const ICON = {
13057
13057
  function range(from, to) {
13058
13058
  return from > to ? [] : Array.from({ length: to - from + 1 }, (_, i) => from + i);
13059
13059
  }
13060
- function clamp(value, min, max) {
13060
+ function clamp$1(value, min, max) {
13061
13061
  return Math.min(Math.max(value, min), max);
13062
13062
  }
13063
13063
  function pageSlots(page, totalPages, siblings) {
@@ -13113,7 +13113,7 @@ var PaginationComponent = class PaginationComponent {
13113
13113
  if (total === null) return 1;
13114
13114
  return Math.max(1, Math.ceil(total / Math.max(1, this.pageSize())));
13115
13115
  }, ...ngDevMode ? [{ debugName: "resolvedTotalPages" }] : /* istanbul ignore next */ []);
13116
- this.currentPage = computed(() => clamp(Math.floor(this.page()), 1, this.resolvedTotalPages()), ...ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []);
13116
+ this.currentPage = computed(() => clamp$1(Math.floor(this.page()), 1, this.resolvedTotalPages()), ...ngDevMode ? [{ debugName: "currentPage" }] : /* istanbul ignore next */ []);
13117
13117
  this.visible = computed(() => !this.hideOnSinglePage() || this.resolvedTotalPages() > 1, ...ngDevMode ? [{ debugName: "visible" }] : /* istanbul ignore next */ []);
13118
13118
  this.summary = computed(() => {
13119
13119
  const total = this.totalItems();
@@ -13164,7 +13164,7 @@ var PaginationComponent = class PaginationComponent {
13164
13164
  }, ...ngDevMode ? [{ debugName: "items" }] : /* istanbul ignore next */ []);
13165
13165
  }
13166
13166
  goTo(page) {
13167
- const target = clamp(page, 1, this.resolvedTotalPages());
13167
+ const target = clamp$1(page, 1, this.resolvedTotalPages());
13168
13168
  if (this.disabled() || target === this.currentPage()) return;
13169
13169
  this.pageChange.emit(target);
13170
13170
  }
@@ -15084,7 +15084,7 @@ var SegmentedComponent = class SegmentedComponent {
15084
15084
  ],
15085
15085
  ngImport: i0,
15086
15086
  template: "<div #group class=\"flr-seg\" role=\"radiogroup\" [attr.aria-label]=\"ariaLabel()\">\n <span #thumb class=\"flr-seg__thumb\" aria-hidden=\"true\" hidden></span>\n @for (option of options(); track option.value; let i = $index) {\n @let selected = option.value === value();\n <button\n #optionButton\n type=\"button\"\n role=\"radio\"\n class=\"flr-seg__option\"\n [class.flr-seg__option--selected]=\"selected\"\n [class.flr-seg__option--icon-only]=\"iconOnly() && option.icon\"\n [attr.aria-checked]=\"selected\"\n [attr.aria-label]=\"iconOnly() && option.icon ? option.label : null\"\n [attr.title]=\"iconOnly() && option.icon ? option.label : null\"\n [tabindex]=\"selected ? 0 : -1\"\n (click)=\"select(option)\"\n (keydown)=\"handleKeydown($event, i)\"\n >\n @let icon = trustedIcon(option.icon);\n @if (icon) {\n <span class=\"flr-seg__icon\" aria-hidden=\"true\" [innerHTML]=\"icon\"></span>\n }\n @if (!iconOnly() || !icon) {\n <span>{{ option.label }}</span>\n }\n </button>\n }\n</div>\n",
15087
- styles: [":host{display:inline-block}.flr-seg{position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;border:1px solid var(--color-rule, rgba(30, 41, 59, .14));border-radius:var(--radius-card, 8px);background:var(--color-app-bg-2, #f1f5f9)}.flr-seg__thumb{position:absolute;top:3px;bottom:3px;left:0;border-radius:var(--radius-control, 4px);background:var(--color-card, #ffffff);box-shadow:0 1px 2px #1e293b1f;pointer-events:none}.flr-seg__thumb[hidden]{display:none}.flr-seg__thumb--animated{transition:transform .26s cubic-bezier(.3,0,0,1),width .26s cubic-bezier(.3,0,0,1)}@media(prefers-reduced-motion:reduce){.flr-seg__thumb--animated{transition:none}}.flr-seg__option{position:relative;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:var(--radius-control, 4px);background:transparent;color:var(--color-ink-3, #64748b);font:inherit;font-size:13px;cursor:pointer;transition:color .12s ease,background-color .12s ease}.flr-seg__option:hover{color:var(--color-ink, #1e293b)}.flr-seg__option:focus-visible{outline:2px solid var(--color-accent, currentColor);outline-offset:-2px}.flr-seg__option--selected{color:var(--color-ink, #1e293b)}.flr-seg__option--icon-only{width:30px;padding:0;justify-content:center}.flr-seg__icon{display:inline-flex}.flr-seg__icon ::ng-deep svg{width:16px;height:16px}\n"],
15087
+ styles: [":host{display:inline-block}.flr-seg{position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;border:1px solid var(--color-rule, rgba(30, 41, 59, .14));border-radius:var(--radius-card, 8px);background:var(--color-app-bg-2, #f1f5f9)}.flr-seg__thumb{position:absolute;top:3px;bottom:3px;left:0;box-sizing:border-box;border:1px solid var(--color-ink-3, #5d6b80);border-radius:var(--radius-control, 4px);background:var(--color-card, #ffffff);box-shadow:0 1px 2px #1e293b1f;pointer-events:none}.flr-seg__thumb[hidden]{display:none}.flr-seg__thumb--animated{transition:transform .26s cubic-bezier(.3,0,0,1),width .26s cubic-bezier(.3,0,0,1)}@media(prefers-reduced-motion:reduce){.flr-seg__thumb--animated{transition:none}}.flr-seg__option{position:relative;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:var(--radius-control, 4px);background:transparent;color:var(--color-ink-3, #64748b);font:inherit;font-size:13px;cursor:pointer;transition:color .12s ease,background-color .12s ease}.flr-seg__option:hover{color:var(--color-ink, #1e293b)}.flr-seg__option:focus-visible{outline:2px solid var(--color-accent, currentColor);outline-offset:-2px}.flr-seg__option--selected{color:var(--color-ink, #1e293b)}.flr-seg__option--icon-only{width:30px;padding:0;justify-content:center}.flr-seg__icon{display:inline-flex}.flr-seg__icon ::ng-deep svg{width:16px;height:16px}\n"],
15088
15088
  changeDetection: i0.ChangeDetectionStrategy.OnPush
15089
15089
  });
15090
15090
  }
@@ -15100,7 +15100,7 @@ i0.ɵɵngDeclareClassMetadata({
15100
15100
  selector: "flr-segmented",
15101
15101
  changeDetection: ChangeDetectionStrategy.OnPush,
15102
15102
  template: "<div #group class=\"flr-seg\" role=\"radiogroup\" [attr.aria-label]=\"ariaLabel()\">\n <span #thumb class=\"flr-seg__thumb\" aria-hidden=\"true\" hidden></span>\n @for (option of options(); track option.value; let i = $index) {\n @let selected = option.value === value();\n <button\n #optionButton\n type=\"button\"\n role=\"radio\"\n class=\"flr-seg__option\"\n [class.flr-seg__option--selected]=\"selected\"\n [class.flr-seg__option--icon-only]=\"iconOnly() && option.icon\"\n [attr.aria-checked]=\"selected\"\n [attr.aria-label]=\"iconOnly() && option.icon ? option.label : null\"\n [attr.title]=\"iconOnly() && option.icon ? option.label : null\"\n [tabindex]=\"selected ? 0 : -1\"\n (click)=\"select(option)\"\n (keydown)=\"handleKeydown($event, i)\"\n >\n @let icon = trustedIcon(option.icon);\n @if (icon) {\n <span class=\"flr-seg__icon\" aria-hidden=\"true\" [innerHTML]=\"icon\"></span>\n }\n @if (!iconOnly() || !icon) {\n <span>{{ option.label }}</span>\n }\n </button>\n }\n</div>\n",
15103
- styles: [":host{display:inline-block}.flr-seg{position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;border:1px solid var(--color-rule, rgba(30, 41, 59, .14));border-radius:var(--radius-card, 8px);background:var(--color-app-bg-2, #f1f5f9)}.flr-seg__thumb{position:absolute;top:3px;bottom:3px;left:0;border-radius:var(--radius-control, 4px);background:var(--color-card, #ffffff);box-shadow:0 1px 2px #1e293b1f;pointer-events:none}.flr-seg__thumb[hidden]{display:none}.flr-seg__thumb--animated{transition:transform .26s cubic-bezier(.3,0,0,1),width .26s cubic-bezier(.3,0,0,1)}@media(prefers-reduced-motion:reduce){.flr-seg__thumb--animated{transition:none}}.flr-seg__option{position:relative;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:var(--radius-control, 4px);background:transparent;color:var(--color-ink-3, #64748b);font:inherit;font-size:13px;cursor:pointer;transition:color .12s ease,background-color .12s ease}.flr-seg__option:hover{color:var(--color-ink, #1e293b)}.flr-seg__option:focus-visible{outline:2px solid var(--color-accent, currentColor);outline-offset:-2px}.flr-seg__option--selected{color:var(--color-ink, #1e293b)}.flr-seg__option--icon-only{width:30px;padding:0;justify-content:center}.flr-seg__icon{display:inline-flex}.flr-seg__icon ::ng-deep svg{width:16px;height:16px}\n"]
15103
+ styles: [":host{display:inline-block}.flr-seg{position:relative;display:inline-flex;overflow:hidden;gap:2px;padding:3px;border:1px solid var(--color-rule, rgba(30, 41, 59, .14));border-radius:var(--radius-card, 8px);background:var(--color-app-bg-2, #f1f5f9)}.flr-seg__thumb{position:absolute;top:3px;bottom:3px;left:0;box-sizing:border-box;border:1px solid var(--color-ink-3, #5d6b80);border-radius:var(--radius-control, 4px);background:var(--color-card, #ffffff);box-shadow:0 1px 2px #1e293b1f;pointer-events:none}.flr-seg__thumb[hidden]{display:none}.flr-seg__thumb--animated{transition:transform .26s cubic-bezier(.3,0,0,1),width .26s cubic-bezier(.3,0,0,1)}@media(prefers-reduced-motion:reduce){.flr-seg__thumb--animated{transition:none}}.flr-seg__option{position:relative;display:inline-flex;align-items:center;gap:6px;height:30px;padding:0 12px;border:0;border-radius:var(--radius-control, 4px);background:transparent;color:var(--color-ink-3, #64748b);font:inherit;font-size:13px;cursor:pointer;transition:color .12s ease,background-color .12s ease}.flr-seg__option:hover{color:var(--color-ink, #1e293b)}.flr-seg__option:focus-visible{outline:2px solid var(--color-accent, currentColor);outline-offset:-2px}.flr-seg__option--selected{color:var(--color-ink, #1e293b)}.flr-seg__option--icon-only{width:30px;padding:0;justify-content:center}.flr-seg__icon{display:inline-flex}.flr-seg__icon ::ng-deep svg{width:16px;height:16px}\n"]
15104
15104
  }]
15105
15105
  }],
15106
15106
  ctorParameters: () => [],
@@ -16697,6 +16697,841 @@ i0.ɵɵngDeclareClassMetadata({
16697
16697
  }]
16698
16698
  }
16699
16699
  });
16700
- export { ACCESS_PICKER_LABELS_EN, ACCESS_PICKER_LABELS_FR, ALL_SITE_LOCALES, AccessPickerComponent, AnnotatedTextareaComponent, AppRailComponent, AppSwitcherComponent, AvatarComponent, BannerComponent, BarChartComponent, BrandDropdownComponent, ButtonComponent, CONTACT_FORM_LABELS_EN, CONTACT_FORM_LABELS_FR, CONTACT_KINDS, CONTACT_PRODUCTS, CardComponent, CardHeaderComponent, CheckboxComponent, ComparisonTableComponent, ContactFormComponent, ContainerComponent, DEFAULT_APPS, DEFAULT_LOCALE, DEFAULT_PAGE_SIZE, DEFAULT_PAGINATION_LABELS, DividerComponent, DrawerComponent, EmptyStateComponent, ErrorStateComponent, FieldComponent, InputComponent, LOCALE_CATALOG, LoadingStateComponent, LogoMarkComponent, MenuComponent, MenuItemComponent, MenuLabelComponent, MenuSeparatorComponent, ModalComponent, MultiSelectComponent, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProjectSwitcherComponent, RadioComponent, RadioGroupComponent, RailToggleComponent, SHELL_CONTEXT, SITE_CHROME, SITE_LOCALES, SearchFieldComponent, SectionComponent, SegmentedComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarItemComponent, SidebarSectionComponent, SiteCardComponent, SiteFooterComponent, SiteLocaleBannerComponent, SiteLocalePickerComponent, SiteNavbarComponent, SiteShellComponent, SiteSwitcherComponent, SkeletonComponent, SpinnerComponent, StatComponent, StatusBarsComponent, SubmitComponent, SwitchComponent, TabComponent, TabsComponent, TagComponent, TextareaComponent, ToastContainerComponent, ToastService, TreeSelectComponent, UserMenuComponent, WAITLIST_FORM_LABELS_EN, WAITLIST_FORM_LABELS_FR, WaitlistFormComponent, accountUrl, brandApps, entitledApps, hiddenAppsFromPreferences, injectSitePath, isSiteLocale, localeBase, localeEntry, localeSwitchHref, marketingUrl, matchSiteLocale, orgCreateUrl, paged, provideSiteChrome, readContactPrefill, readRuntimeEnv, resolveLocale, resolveSiteLocale, runtimeUrl, siteLocales, stripLocalePrefix, switcherState, toLocaleOptions, userMenuItems, withHiddenApps, withLocaleBase };
16700
+ var DragTracker = class {
16701
+ constructor() {
16702
+ this.session = null;
16703
+ }
16704
+ get current() {
16705
+ return this.session;
16706
+ }
16707
+ begin(session) {
16708
+ this.session = session;
16709
+ }
16710
+ abort() {
16711
+ const session = this.session;
16712
+ this.session = null;
16713
+ return session;
16714
+ }
16715
+ end(pointerId) {
16716
+ const session = this.session;
16717
+ if (!session || session.pointerId !== pointerId) return null;
16718
+ this.session = null;
16719
+ return session;
16720
+ }
16721
+ };
16722
+ const SPLITTER_HOST = new InjectionToken("SPLITTER_HOST");
16723
+ const DEFAULT_STEP = 10;
16724
+ const EPSILON = .001;
16725
+ function coerceSize(value) {
16726
+ if (typeof value === "number") return Number.isFinite(value) && value >= 0 ? value : void 0;
16727
+ if (typeof value !== "string") return void 0;
16728
+ const trimmed = value.trim();
16729
+ const parsed = Number.parseFloat(trimmed);
16730
+ if (!Number.isFinite(parsed)) return void 0;
16731
+ if (/^\d+(\.\d+)?%$/.test(trimmed)) return trimmed;
16732
+ if (/^\d+(\.\d+)?(px)?$/.test(trimmed)) return parsed;
16733
+ }
16734
+ function coerceStackBelow(value) {
16735
+ if (value === null || value === void 0 || value === "") return null;
16736
+ const parsed = numberAttribute(value, NaN);
16737
+ return Number.isFinite(parsed) ? parsed : null;
16738
+ }
16739
+ function coerceStep(value) {
16740
+ const parsed = numberAttribute(value, NaN);
16741
+ return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_STEP;
16742
+ }
16743
+ function resolveSize(size, total) {
16744
+ const resolved = typeof size === "number" ? size : Number.parseFloat(size) / 100 * total;
16745
+ return Number.isFinite(resolved) ? resolved : 0;
16746
+ }
16747
+ function resolveBounds(limits, total) {
16748
+ if (limits.collapsed) return {
16749
+ min: 0,
16750
+ max: 0
16751
+ };
16752
+ const min = limits.minSize === void 0 ? 0 : resolveSize(limits.minSize, total);
16753
+ const max = limits.maxSize === void 0 ? Infinity : resolveSize(limits.maxSize, total);
16754
+ return {
16755
+ min: Math.max(0, min),
16756
+ max: Math.max(min, max)
16757
+ };
16758
+ }
16759
+ function clamp(value, min, max) {
16760
+ return Math.min(Math.max(value, min), max);
16761
+ }
16762
+ function sum(values) {
16763
+ return values.reduce((acc, value) => acc + value, 0);
16764
+ }
16765
+ function defaultRatios(defaults, total) {
16766
+ if (defaults.length === 0) return [];
16767
+ const explicit = defaults.map((size) => size === void 0 || total <= 0 ? void 0 : resolveSize(size, total) / total);
16768
+ const claimed = sum(explicit.map((ratio) => ratio ?? 0));
16769
+ const unset = explicit.filter((ratio) => ratio === void 0).length;
16770
+ const share = unset === 0 ? 0 : Math.max(0, 1 - claimed) / unset;
16771
+ return explicit.map((ratio) => ratio ?? share);
16772
+ }
16773
+ function fitSizes(sizes, bounds, total) {
16774
+ const result = sizes.map((size, i) => clamp(size, bounds[i].min, bounds[i].max));
16775
+ for (let pass = 0; pass <= result.length; pass++) {
16776
+ const diff = total - sum(result);
16777
+ if (Math.abs(diff) < EPSILON) break;
16778
+ const free = Array.from(result.keys()).filter((i) => diff > 0 ? result[i] < bounds[i].max - EPSILON : result[i] > bounds[i].min + EPSILON);
16779
+ if (free.length === 0) break;
16780
+ const weight = sum(free.map((i) => result[i]));
16781
+ for (const i of free) {
16782
+ const share = weight > 0 ? result[i] / weight : 1 / free.length;
16783
+ result[i] = clamp(result[i] + diff * share, bounds[i].min, bounds[i].max);
16784
+ }
16785
+ }
16786
+ return result;
16787
+ }
16788
+ function layoutSizes(ratios, collapsed, bounds, total) {
16789
+ return fitSizes(ratios.map((ratio, i) => collapsed[i] ? 0 : ratio * total), bounds, total);
16790
+ }
16791
+ function resizePair(sizes, index, delta, bounds) {
16792
+ const before = sizes[index];
16793
+ const after = sizes[index + 1];
16794
+ if (before === void 0 || after === void 0) return [...sizes];
16795
+ const shrinkable = Math.max(0, Math.min(before - bounds[index].min, bounds[index + 1].max - after));
16796
+ const growable = Math.max(0, Math.min(bounds[index].max - before, after - bounds[index + 1].min));
16797
+ const applied = clamp(delta, -shrinkable, growable);
16798
+ const result = [...sizes];
16799
+ result[index] = before + applied;
16800
+ result[index + 1] = after - applied;
16801
+ return result;
16802
+ }
16803
+ function ratiosAfterResize(previous, sizes, collapsed, total) {
16804
+ if (total <= 0) return [...previous];
16805
+ return sizes.map((size, i) => collapsed[i] ? previous[i] : size / total);
16806
+ }
16807
+ function toRatios(sizes, total) {
16808
+ return total > 0 ? sizes.map((size) => size / total) : sizes.map(() => 0);
16809
+ }
16810
+ function isRtl(direction) {
16811
+ return direction === "rtl";
16812
+ }
16813
+ function dragSign(orientation, rtl) {
16814
+ return orientation === "horizontal" && rtl ? -1 : 1;
16815
+ }
16816
+ function pointerDelta(orientation, rtl, start, current) {
16817
+ return (current - start) * dragSign(orientation, rtl);
16818
+ }
16819
+ function keyIntent(key, orientation, rtl, step) {
16820
+ if (key === "Home") return "min";
16821
+ if (key === "End") return "max";
16822
+ const forward = orientation === "horizontal" ? "ArrowRight" : "ArrowDown";
16823
+ if (key !== forward && key !== (orientation === "horizontal" ? "ArrowLeft" : "ArrowUp")) return null;
16824
+ return (key === forward ? 1 : -1) * dragSign(orientation, rtl) * step;
16825
+ }
16826
+ function intentDelta(intent) {
16827
+ if (intent === "min") return -Infinity;
16828
+ if (intent === "max") return Infinity;
16829
+ return intent;
16830
+ }
16831
+ function toggleTarget(index, collapsible, collapsed) {
16832
+ const neighbours = [index, index + 1].filter((i) => collapsible[i]);
16833
+ return neighbours.find((i) => collapsed[i]) ?? neighbours[0] ?? null;
16834
+ }
16835
+ function toPercent(size, total) {
16836
+ return total > 0 ? Math.round(size / total * 100) : 0;
16837
+ }
16838
+ const DEFAULT_RESET_ANNOUNCEMENT = "Panes reset to default sizes";
16839
+ const describeSize = (label, percent, collapsed) => collapsed ? `${label} collapsed` : `${label} ${percent} percent`;
16840
+ const describePane = (position) => `Pane ${position}`;
16841
+ const describeHandle = (paneLabel) => `Resize ${paneLabel}`;
16842
+ function resolvePaneLabel(label, index, labeller) {
16843
+ return label ?? labeller(index + 1);
16844
+ }
16845
+ function resolveHandleLabel(override, paneLabel, labeller) {
16846
+ return override ?? labeller(paneLabel);
16847
+ }
16848
+ let nextPaneId = 0;
16849
+ var SplitterPaneComponent = class SplitterPaneComponent {
16850
+ constructor() {
16851
+ this.host = inject(SPLITTER_HOST);
16852
+ this.defaultSize = input(void 0, {
16853
+ ...ngDevMode ? { debugName: "defaultSize" } : /* istanbul ignore next */ {},
16854
+ transform: coerceSize
16855
+ });
16856
+ this.minSize = input(void 0, {
16857
+ ...ngDevMode ? { debugName: "minSize" } : /* istanbul ignore next */ {},
16858
+ transform: coerceSize
16859
+ });
16860
+ this.maxSize = input(void 0, {
16861
+ ...ngDevMode ? { debugName: "maxSize" } : /* istanbul ignore next */ {},
16862
+ transform: coerceSize
16863
+ });
16864
+ this.collapsible = input(false, {
16865
+ ...ngDevMode ? { debugName: "collapsible" } : /* istanbul ignore next */ {},
16866
+ transform: booleanAttribute
16867
+ });
16868
+ this.collapsed = model(false, ...ngDevMode ? [{ debugName: "collapsed" }] : /* istanbul ignore next */ []);
16869
+ this.label = input(void 0, ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
16870
+ this.handleLabel = input(null, ...ngDevMode ? [{ debugName: "handleLabel" }] : /* istanbul ignore next */ []);
16871
+ this.paneId = `flr-splitter-pane-${nextPaneId++}`;
16872
+ this.isCollapsed = computed(() => this.collapsible() && this.collapsed(), ...ngDevMode ? [{ debugName: "isCollapsed" }] : /* istanbul ignore next */ []);
16873
+ this.displayLabel = computed(() => resolvePaneLabel(this.label(), this.index(), this.host.paneLabel()), ...ngDevMode ? [{ debugName: "displayLabel" }] : /* istanbul ignore next */ []);
16874
+ this.index = computed(() => this.host.indexOf(this), ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
16875
+ this.flex = computed(() => this.host.flexFor(this), ...ngDevMode ? [{ debugName: "flex" }] : /* istanbul ignore next */ []);
16876
+ this.handleState = computed(() => this.host.handleState(this), ...ngDevMode ? [{ debugName: "handleState" }] : /* istanbul ignore next */ []);
16877
+ this.showHandle = computed(() => !this.host.isStacked() && !this.host.isLast(this), ...ngDevMode ? [{ debugName: "showHandle" }] : /* istanbul ignore next */ []);
16878
+ this.handleOrientation = computed(() => this.host.orientation() === "horizontal" ? "vertical" : "horizontal", ...ngDevMode ? [{ debugName: "handleOrientation" }] : /* istanbul ignore next */ []);
16879
+ this.handleAriaLabel = computed(() => resolveHandleLabel(this.handleLabel(), this.displayLabel(), this.host.resizeLabel()), ...ngDevMode ? [{ debugName: "handleAriaLabel" }] : /* istanbul ignore next */ []);
16880
+ }
16881
+ static {
16882
+ this.ɵfac = i0.ɵɵngDeclareFactory({
16883
+ minVersion: "12.0.0",
16884
+ version: "22.2.6",
16885
+ ngImport: i0,
16886
+ type: SplitterPaneComponent,
16887
+ deps: [],
16888
+ target: i0.ɵɵFactoryTarget.Component
16889
+ });
16890
+ }
16891
+ static {
16892
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
16893
+ minVersion: "17.0.0",
16894
+ version: "22.2.6",
16895
+ type: SplitterPaneComponent,
16896
+ isStandalone: true,
16897
+ selector: "flr-splitter-pane",
16898
+ inputs: {
16899
+ defaultSize: {
16900
+ classPropertyName: "defaultSize",
16901
+ publicName: "defaultSize",
16902
+ isSignal: true,
16903
+ isRequired: false,
16904
+ transformFunction: null
16905
+ },
16906
+ minSize: {
16907
+ classPropertyName: "minSize",
16908
+ publicName: "minSize",
16909
+ isSignal: true,
16910
+ isRequired: false,
16911
+ transformFunction: null
16912
+ },
16913
+ maxSize: {
16914
+ classPropertyName: "maxSize",
16915
+ publicName: "maxSize",
16916
+ isSignal: true,
16917
+ isRequired: false,
16918
+ transformFunction: null
16919
+ },
16920
+ collapsible: {
16921
+ classPropertyName: "collapsible",
16922
+ publicName: "collapsible",
16923
+ isSignal: true,
16924
+ isRequired: false,
16925
+ transformFunction: null
16926
+ },
16927
+ collapsed: {
16928
+ classPropertyName: "collapsed",
16929
+ publicName: "collapsed",
16930
+ isSignal: true,
16931
+ isRequired: false,
16932
+ transformFunction: null
16933
+ },
16934
+ label: {
16935
+ classPropertyName: "label",
16936
+ publicName: "label",
16937
+ isSignal: true,
16938
+ isRequired: false,
16939
+ transformFunction: null
16940
+ },
16941
+ handleLabel: {
16942
+ classPropertyName: "handleLabel",
16943
+ publicName: "handleLabel",
16944
+ isSignal: true,
16945
+ isRequired: false,
16946
+ transformFunction: null
16947
+ }
16948
+ },
16949
+ outputs: { collapsed: "collapsedChange" },
16950
+ host: { properties: {
16951
+ "id": "paneId",
16952
+ "style.flex": "flex()",
16953
+ "class.flr-pane--inert": "host.dragging()",
16954
+ "class.flr-pane--collapsed": "isCollapsed()"
16955
+ } },
16956
+ ngImport: i0,
16957
+ template: "<div class=\"flr-pane__content\"><ng-content /></div>\n@if (showHandle()) {\n @let state = handleState();\n <div\n class=\"flr-pane__handle\"\n [class.flr-pane__handle--row]=\"host.orientation() === 'vertical'\"\n role=\"separator\"\n tabindex=\"0\"\n [attr.aria-orientation]=\"handleOrientation()\"\n [attr.aria-controls]=\"paneId\"\n [attr.aria-label]=\"handleAriaLabel()\"\n [attr.aria-valuenow]=\"state.valueNow\"\n [attr.aria-valuemin]=\"state.valueMin\"\n [attr.aria-valuemax]=\"state.valueMax\"\n (pointerdown)=\"host.startDrag(index(), $event)\"\n (pointermove)=\"host.moveDrag($event)\"\n (pointerup)=\"host.endDrag($event)\"\n (pointercancel)=\"host.endDrag($event)\"\n (lostpointercapture)=\"host.endDrag($event)\"\n (keydown)=\"host.handleKeydown(index(), $event)\"\n (dblclick)=\"host.reset()\"\n >\n <span class=\"flr-pane__line\" aria-hidden=\"true\"></span>\n <span class=\"flr-pane__grip\" aria-hidden=\"true\"></span>\n </div>\n}\n",
16958
+ styles: [":host{position:relative;display:flex;min-width:0;min-height:0}.flr-pane__content{flex:1 1 auto;min-width:0;min-height:0;overflow:auto}:host(.flr-pane--inert) .flr-pane__content{pointer-events:none;-webkit-user-select:none;user-select:none}:host(.flr-pane--collapsed) .flr-pane__content{visibility:hidden}.flr-pane__handle{position:absolute;z-index:1;inset-block:0;inset-inline-end:-12px;display:flex;align-items:center;justify-content:center;width:24px;min-width:24px;cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none;outline:none}.flr-pane__handle--row{inset-block:auto -12px;inset-inline:0;width:auto;min-width:0;height:24px;min-height:24px;flex-direction:column;cursor:row-resize}.flr-pane__line{position:absolute;inset-block:0;inset-inline-start:calc(50% - .5px);width:1px;background:var(--color-rule-strong, rgba(30, 41, 59, .28));pointer-events:none;transition:background-color .12s ease,width .12s ease,inset-inline-start .12s ease}.flr-pane__handle--row .flr-pane__line{inset-block:calc(50% - .5px) auto;inset-inline:0;width:auto;height:1px;transition:background-color .12s ease,height .12s ease,inset-block-start .12s ease}.flr-pane__grip{position:relative;width:4px;height:28px;border-radius:var(--radius-full, 999px);background:var(--color-ink-3, #5d6b80);pointer-events:none;transition:background-color .12s ease}.flr-pane__handle--row .flr-pane__grip{width:28px;height:4px}.flr-pane__handle:hover .flr-pane__line,.flr-pane__handle:active .flr-pane__line,.flr-pane__handle:focus-visible .flr-pane__line{inset-inline-start:calc(50% - 1.5px);width:3px;background:var(--color-accent, currentColor)}.flr-pane__handle--row:hover .flr-pane__line,.flr-pane__handle--row:active .flr-pane__line,.flr-pane__handle--row:focus-visible .flr-pane__line{inset-block-start:calc(50% - 1.5px);inset-inline-start:0;width:auto;height:3px}.flr-pane__handle:hover .flr-pane__grip,.flr-pane__handle:active .flr-pane__grip,.flr-pane__handle:focus-visible .flr-pane__grip{background:var(--color-accent, currentColor)}.flr-pane__handle:focus-visible{outline:2px solid var(--color-accent, currentColor);outline-offset:-2px;border-radius:var(--radius-control, 4px)}@media(prefers-reduced-motion:reduce){.flr-pane__line,.flr-pane__grip{transition:none}}\n"],
16959
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
16960
+ });
16961
+ }
16962
+ };
16963
+ i0.ɵɵngDeclareClassMetadata({
16964
+ minVersion: "12.0.0",
16965
+ version: "22.2.6",
16966
+ ngImport: i0,
16967
+ type: SplitterPaneComponent,
16968
+ decorators: [{
16969
+ type: Component,
16970
+ args: [{
16971
+ selector: "flr-splitter-pane",
16972
+ changeDetection: ChangeDetectionStrategy.OnPush,
16973
+ host: {
16974
+ "[id]": "paneId",
16975
+ "[style.flex]": "flex()",
16976
+ "[class.flr-pane--inert]": "host.dragging()",
16977
+ "[class.flr-pane--collapsed]": "isCollapsed()"
16978
+ },
16979
+ template: "<div class=\"flr-pane__content\"><ng-content /></div>\n@if (showHandle()) {\n @let state = handleState();\n <div\n class=\"flr-pane__handle\"\n [class.flr-pane__handle--row]=\"host.orientation() === 'vertical'\"\n role=\"separator\"\n tabindex=\"0\"\n [attr.aria-orientation]=\"handleOrientation()\"\n [attr.aria-controls]=\"paneId\"\n [attr.aria-label]=\"handleAriaLabel()\"\n [attr.aria-valuenow]=\"state.valueNow\"\n [attr.aria-valuemin]=\"state.valueMin\"\n [attr.aria-valuemax]=\"state.valueMax\"\n (pointerdown)=\"host.startDrag(index(), $event)\"\n (pointermove)=\"host.moveDrag($event)\"\n (pointerup)=\"host.endDrag($event)\"\n (pointercancel)=\"host.endDrag($event)\"\n (lostpointercapture)=\"host.endDrag($event)\"\n (keydown)=\"host.handleKeydown(index(), $event)\"\n (dblclick)=\"host.reset()\"\n >\n <span class=\"flr-pane__line\" aria-hidden=\"true\"></span>\n <span class=\"flr-pane__grip\" aria-hidden=\"true\"></span>\n </div>\n}\n",
16980
+ styles: [":host{position:relative;display:flex;min-width:0;min-height:0}.flr-pane__content{flex:1 1 auto;min-width:0;min-height:0;overflow:auto}:host(.flr-pane--inert) .flr-pane__content{pointer-events:none;-webkit-user-select:none;user-select:none}:host(.flr-pane--collapsed) .flr-pane__content{visibility:hidden}.flr-pane__handle{position:absolute;z-index:1;inset-block:0;inset-inline-end:-12px;display:flex;align-items:center;justify-content:center;width:24px;min-width:24px;cursor:col-resize;touch-action:none;-webkit-user-select:none;user-select:none;outline:none}.flr-pane__handle--row{inset-block:auto -12px;inset-inline:0;width:auto;min-width:0;height:24px;min-height:24px;flex-direction:column;cursor:row-resize}.flr-pane__line{position:absolute;inset-block:0;inset-inline-start:calc(50% - .5px);width:1px;background:var(--color-rule-strong, rgba(30, 41, 59, .28));pointer-events:none;transition:background-color .12s ease,width .12s ease,inset-inline-start .12s ease}.flr-pane__handle--row .flr-pane__line{inset-block:calc(50% - .5px) auto;inset-inline:0;width:auto;height:1px;transition:background-color .12s ease,height .12s ease,inset-block-start .12s ease}.flr-pane__grip{position:relative;width:4px;height:28px;border-radius:var(--radius-full, 999px);background:var(--color-ink-3, #5d6b80);pointer-events:none;transition:background-color .12s ease}.flr-pane__handle--row .flr-pane__grip{width:28px;height:4px}.flr-pane__handle:hover .flr-pane__line,.flr-pane__handle:active .flr-pane__line,.flr-pane__handle:focus-visible .flr-pane__line{inset-inline-start:calc(50% - 1.5px);width:3px;background:var(--color-accent, currentColor)}.flr-pane__handle--row:hover .flr-pane__line,.flr-pane__handle--row:active .flr-pane__line,.flr-pane__handle--row:focus-visible .flr-pane__line{inset-block-start:calc(50% - 1.5px);inset-inline-start:0;width:auto;height:3px}.flr-pane__handle:hover .flr-pane__grip,.flr-pane__handle:active .flr-pane__grip,.flr-pane__handle:focus-visible .flr-pane__grip{background:var(--color-accent, currentColor)}.flr-pane__handle:focus-visible{outline:2px solid var(--color-accent, currentColor);outline-offset:-2px;border-radius:var(--radius-control, 4px)}@media(prefers-reduced-motion:reduce){.flr-pane__line,.flr-pane__grip{transition:none}}\n"]
16981
+ }]
16982
+ }],
16983
+ propDecorators: {
16984
+ defaultSize: [{
16985
+ type: i0.Input,
16986
+ args: [{
16987
+ isSignal: true,
16988
+ alias: "defaultSize",
16989
+ required: false
16990
+ }]
16991
+ }],
16992
+ minSize: [{
16993
+ type: i0.Input,
16994
+ args: [{
16995
+ isSignal: true,
16996
+ alias: "minSize",
16997
+ required: false
16998
+ }]
16999
+ }],
17000
+ maxSize: [{
17001
+ type: i0.Input,
17002
+ args: [{
17003
+ isSignal: true,
17004
+ alias: "maxSize",
17005
+ required: false
17006
+ }]
17007
+ }],
17008
+ collapsible: [{
17009
+ type: i0.Input,
17010
+ args: [{
17011
+ isSignal: true,
17012
+ alias: "collapsible",
17013
+ required: false
17014
+ }]
17015
+ }],
17016
+ collapsed: [{
17017
+ type: i0.Input,
17018
+ args: [{
17019
+ isSignal: true,
17020
+ alias: "collapsed",
17021
+ required: false
17022
+ }]
17023
+ }, {
17024
+ type: i0.Output,
17025
+ args: ["collapsedChange"]
17026
+ }],
17027
+ label: [{
17028
+ type: i0.Input,
17029
+ args: [{
17030
+ isSignal: true,
17031
+ alias: "label",
17032
+ required: false
17033
+ }]
17034
+ }],
17035
+ handleLabel: [{
17036
+ type: i0.Input,
17037
+ args: [{
17038
+ isSignal: true,
17039
+ alias: "handleLabel",
17040
+ required: false
17041
+ }]
17042
+ }]
17043
+ }
17044
+ });
17045
+ const KEY_PREFIX = "flr-splitter:";
17046
+ function defaultStorage() {
17047
+ try {
17048
+ return globalThis.localStorage ?? null;
17049
+ } catch {
17050
+ return null;
17051
+ }
17052
+ }
17053
+ function parseStored(raw, paneCount) {
17054
+ if (raw === null) return null;
17055
+ let value;
17056
+ try {
17057
+ value = JSON.parse(raw);
17058
+ } catch {
17059
+ return null;
17060
+ }
17061
+ if (typeof value !== "object" || value === null) return null;
17062
+ const { ratios, collapsed } = value;
17063
+ if (!Array.isArray(ratios) || !Array.isArray(collapsed)) return null;
17064
+ if (ratios.length !== paneCount || collapsed.length !== paneCount) return null;
17065
+ const validRatios = ratios.every((r) => typeof r === "number" && Number.isFinite(r) && r >= 0);
17066
+ const validFlags = collapsed.every((c) => typeof c === "boolean");
17067
+ if (!validRatios || !validFlags) return null;
17068
+ if (ratios.every((r) => r === 0)) return null;
17069
+ return {
17070
+ ratios,
17071
+ collapsed
17072
+ };
17073
+ }
17074
+ function readStored(storage, key, paneCount) {
17075
+ if (!storage) return null;
17076
+ try {
17077
+ return parseStored(storage.getItem(KEY_PREFIX + key), paneCount);
17078
+ } catch {
17079
+ return null;
17080
+ }
17081
+ }
17082
+ function writeStored(storage, key, value) {
17083
+ if (!storage) return;
17084
+ try {
17085
+ storage.setItem(KEY_PREFIX + key, JSON.stringify(value));
17086
+ } catch {
17087
+ return;
17088
+ }
17089
+ }
17090
+ function needsRestore(restoredKey, key) {
17091
+ return restoredKey !== key;
17092
+ }
17093
+ const BIG_STEP_FACTOR = 5;
17094
+ const COLLAPSED_RESTORE_THRESHOLD = .001;
17095
+ var SplitterComponent = class SplitterComponent {
17096
+ constructor() {
17097
+ this.orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
17098
+ this.stacked = input(false, {
17099
+ ...ngDevMode ? { debugName: "stacked" } : /* istanbul ignore next */ {},
17100
+ transform: booleanAttribute
17101
+ });
17102
+ this.stackBelow = input(null, {
17103
+ ...ngDevMode ? { debugName: "stackBelow" } : /* istanbul ignore next */ {},
17104
+ transform: coerceStackBelow
17105
+ });
17106
+ this.storageKey = input(null, ...ngDevMode ? [{ debugName: "storageKey" }] : /* istanbul ignore next */ []);
17107
+ this.keyboardStep = input(10, {
17108
+ ...ngDevMode ? { debugName: "keyboardStep" } : /* istanbul ignore next */ {},
17109
+ transform: coerceStep
17110
+ });
17111
+ this.resetAnnouncement = input(DEFAULT_RESET_ANNOUNCEMENT, ...ngDevMode ? [{ debugName: "resetAnnouncement" }] : /* istanbul ignore next */ []);
17112
+ this.sizeAnnouncement = input(describeSize, ...ngDevMode ? [{ debugName: "sizeAnnouncement" }] : /* istanbul ignore next */ []);
17113
+ this.paneLabel = input(describePane, ...ngDevMode ? [{ debugName: "paneLabel" }] : /* istanbul ignore next */ []);
17114
+ this.resizeLabel = input(describeHandle, ...ngDevMode ? [{ debugName: "resizeLabel" }] : /* istanbul ignore next */ []);
17115
+ this.resizeEnd = output();
17116
+ this.element = inject(ElementRef).nativeElement;
17117
+ this.panes = contentChildren(SplitterPaneComponent, ...ngDevMode ? [{ debugName: "panes" }] : /* istanbul ignore next */ []);
17118
+ this.box = signal({
17119
+ width: 0,
17120
+ height: 0
17121
+ }, ...ngDevMode ? [{ debugName: "box" }] : /* istanbul ignore next */ []);
17122
+ this.userRatios = signal(null, ...ngDevMode ? [{ debugName: "userRatios" }] : /* istanbul ignore next */ []);
17123
+ this.drag = new DragTracker();
17124
+ this.restoredKey = null;
17125
+ this.draggingState = signal(false, ...ngDevMode ? [{ debugName: "draggingState" }] : /* istanbul ignore next */ []);
17126
+ this.dragging = this.draggingState.asReadonly();
17127
+ this.liveAnnouncer = inject(LiveAnnouncer);
17128
+ this.total = computed(() => this.orientation() === "horizontal" ? this.box().width : this.box().height, ...ngDevMode ? [{ debugName: "total" }] : /* istanbul ignore next */ []);
17129
+ this.isStacked = computed(() => {
17130
+ if (this.orientation() !== "horizontal") return false;
17131
+ const below = this.stackBelow();
17132
+ return this.stacked() || below !== null && this.box().width > 0 && this.box().width < below;
17133
+ }, ...ngDevMode ? [{ debugName: "isStacked" }] : /* istanbul ignore next */ []);
17134
+ this.collapsedFlags = computed(() => this.panes().map((pane) => pane.isCollapsed()), ...ngDevMode ? [{ debugName: "collapsedFlags" }] : /* istanbul ignore next */ []);
17135
+ this.openBounds = computed(() => this.panes().map((pane) => resolveBounds({
17136
+ minSize: pane.minSize(),
17137
+ maxSize: pane.maxSize(),
17138
+ collapsed: false
17139
+ }, this.total())), ...ngDevMode ? [{ debugName: "openBounds" }] : /* istanbul ignore next */ []);
17140
+ this.bounds = computed(() => this.openBounds().map((open, i) => this.collapsedFlags()[i] ? {
17141
+ min: 0,
17142
+ max: 0
17143
+ } : open), ...ngDevMode ? [{ debugName: "bounds" }] : /* istanbul ignore next */ []);
17144
+ this.defaults = computed(() => defaultRatios(this.panes().map((pane) => pane.defaultSize()), this.total()), ...ngDevMode ? [{ debugName: "defaults" }] : /* istanbul ignore next */ []);
17145
+ this.ratios = computed(() => {
17146
+ const user = this.userRatios();
17147
+ return user && user.length === this.panes().length ? user : this.defaults();
17148
+ }, ...ngDevMode ? [{ debugName: "ratios" }] : /* istanbul ignore next */ []);
17149
+ this.sizes = computed(() => this.total() > 0 && this.panes().length > 0 ? layoutSizes(this.ratios(), this.collapsedFlags(), this.bounds(), this.total()) : [], ...ngDevMode ? [{ debugName: "sizes" }] : /* istanbul ignore next */ []);
17150
+ const destroyRef = inject(DestroyRef);
17151
+ afterNextRender(() => {
17152
+ const observer = new ResizeObserver((entries) => {
17153
+ const { width, height } = entries[entries.length - 1].contentRect;
17154
+ this.box.set({
17155
+ width,
17156
+ height
17157
+ });
17158
+ });
17159
+ observer.observe(this.element);
17160
+ destroyRef.onDestroy(() => observer.disconnect());
17161
+ });
17162
+ destroyRef.onDestroy(() => this.cancelFrame(this.drag.current));
17163
+ effect(() => {
17164
+ const count = this.panes().length;
17165
+ const key = this.storageKey();
17166
+ if (count === 0 || key === null || !needsRestore(this.restoredKey, key)) return;
17167
+ untracked(() => this.restore(key, count));
17168
+ });
17169
+ effect(() => {
17170
+ this.isStacked();
17171
+ this.panes();
17172
+ untracked(() => this.abortDrag());
17173
+ });
17174
+ }
17175
+ indexOf(pane) {
17176
+ return this.panes().indexOf(pane);
17177
+ }
17178
+ isLast(pane) {
17179
+ return this.indexOf(pane) === this.panes().length - 1;
17180
+ }
17181
+ flexFor(pane) {
17182
+ if (this.isStacked()) return "1 1 auto";
17183
+ const index = this.indexOf(pane);
17184
+ const size = this.sizes()[index];
17185
+ return size === void 0 ? `${this.ratios()[index] ?? 1} 1 0%` : `0 0 ${size}px`;
17186
+ }
17187
+ handleState(pane) {
17188
+ const index = this.indexOf(pane);
17189
+ const total = this.total();
17190
+ const open = this.openBounds()[index];
17191
+ const collapsed = this.panes()[index]?.isCollapsed() ?? false;
17192
+ return {
17193
+ valueNow: toPercent(this.sizes()[index] ?? 0, total),
17194
+ valueMin: collapsed || !open ? 0 : toPercent(open.min, total),
17195
+ valueMax: !open || open.max === Infinity ? 100 : toPercent(open.max, total)
17196
+ };
17197
+ }
17198
+ startDrag(index, event) {
17199
+ if (event.button !== 0 || this.sizes().length === 0) return;
17200
+ const handle = event.currentTarget;
17201
+ handle.setPointerCapture(event.pointerId);
17202
+ handle.focus({ preventScroll: true });
17203
+ event.preventDefault();
17204
+ const position = this.axisPosition(event);
17205
+ this.drag.begin({
17206
+ index,
17207
+ pointerId: event.pointerId,
17208
+ startPosition: position,
17209
+ startSizes: this.sizes(),
17210
+ bounds: this.bounds(),
17211
+ rtl: this.readRtl(),
17212
+ position,
17213
+ frame: null
17214
+ });
17215
+ this.draggingState.set(true);
17216
+ }
17217
+ moveDrag(event) {
17218
+ const drag = this.drag.current;
17219
+ if (!drag || event.pointerId !== drag.pointerId) return;
17220
+ drag.position = this.axisPosition(event);
17221
+ drag.frame ??= requestAnimationFrame(() => this.applyDrag(drag));
17222
+ }
17223
+ endDrag(event) {
17224
+ const drag = this.drag.end(event.pointerId);
17225
+ if (!drag) return;
17226
+ this.cancelFrame(drag);
17227
+ this.applyDrag(drag);
17228
+ this.draggingState.set(false);
17229
+ const handle = event.currentTarget;
17230
+ if (handle.hasPointerCapture(event.pointerId)) handle.releasePointerCapture(event.pointerId);
17231
+ this.finish(drag.index);
17232
+ }
17233
+ handleKeydown(index, event) {
17234
+ if (event.altKey || event.ctrlKey || event.metaKey) return;
17235
+ if (event.key === "Enter") {
17236
+ this.toggleFromHandle(index, event);
17237
+ return;
17238
+ }
17239
+ const step = this.keyboardStep() * (event.shiftKey ? BIG_STEP_FACTOR : 1);
17240
+ const intent = keyIntent(event.key, this.orientation(), this.readRtl(), step);
17241
+ const sizes = this.sizes();
17242
+ if (intent === null || sizes.length === 0) return;
17243
+ event.preventDefault();
17244
+ this.commit(resizePair(sizes, index, intentDelta(intent), this.bounds()));
17245
+ this.finish(index);
17246
+ }
17247
+ reset() {
17248
+ this.panes().forEach((pane) => pane.collapsed.set(false));
17249
+ this.userRatios.set(null);
17250
+ this.finish(null);
17251
+ }
17252
+ toggleFromHandle(index, event) {
17253
+ const panes = this.panes();
17254
+ const target = toggleTarget(index, panes.map((pane) => pane.collapsible()), this.collapsedFlags());
17255
+ if (target === null) return;
17256
+ event.preventDefault();
17257
+ const pane = panes[target];
17258
+ if (pane.isCollapsed()) this.restoreRatio(target);
17259
+ pane.collapsed.set(!pane.isCollapsed());
17260
+ this.finish(target);
17261
+ }
17262
+ restoreRatio(index) {
17263
+ const ratios = this.ratios();
17264
+ if (ratios[index] > COLLAPSED_RESTORE_THRESHOLD) return;
17265
+ this.userRatios.set(ratios.map((ratio, i) => i === index ? this.defaults()[i] : ratio));
17266
+ }
17267
+ applyDrag(drag) {
17268
+ drag.frame = null;
17269
+ const delta = pointerDelta(this.orientation(), drag.rtl, drag.startPosition, drag.position);
17270
+ this.commit(resizePair(drag.startSizes, drag.index, delta, drag.bounds));
17271
+ }
17272
+ abortDrag() {
17273
+ const drag = this.drag.abort();
17274
+ if (!drag) return;
17275
+ this.cancelFrame(drag);
17276
+ this.draggingState.set(false);
17277
+ }
17278
+ cancelFrame(drag) {
17279
+ if (drag?.frame == null) return;
17280
+ cancelAnimationFrame(drag.frame);
17281
+ drag.frame = null;
17282
+ }
17283
+ commit(sizes) {
17284
+ this.userRatios.set(ratiosAfterResize(this.ratios(), sizes, this.collapsedFlags(), this.total()));
17285
+ }
17286
+ finish(announcedIndex) {
17287
+ const key = this.storageKey();
17288
+ if (key !== null) writeStored(defaultStorage(), key, {
17289
+ ratios: this.ratios(),
17290
+ collapsed: this.collapsedFlags()
17291
+ });
17292
+ this.resizeEnd.emit({
17293
+ sizes: this.sizes(),
17294
+ ratios: toRatios(this.sizes(), this.total()),
17295
+ collapsed: this.collapsedFlags()
17296
+ });
17297
+ this.announce(announcedIndex);
17298
+ }
17299
+ announce(index) {
17300
+ if (index === null) {
17301
+ this.liveAnnouncer.announce(this.resetAnnouncement(), "polite");
17302
+ return;
17303
+ }
17304
+ const pane = this.panes()[index];
17305
+ if (!pane) return;
17306
+ const percent = toPercent(this.sizes()[index] ?? 0, this.total());
17307
+ this.liveAnnouncer.announce(this.sizeAnnouncement()(pane.displayLabel(), percent, pane.isCollapsed()), "polite");
17308
+ }
17309
+ restore(key, count) {
17310
+ const stored = readStored(defaultStorage(), key, count);
17311
+ if (!stored) return;
17312
+ this.restoredKey = key;
17313
+ this.userRatios.set(stored.ratios);
17314
+ this.panes().forEach((pane, i) => {
17315
+ if (pane.collapsible()) pane.collapsed.set(stored.collapsed[i]);
17316
+ });
17317
+ }
17318
+ axisPosition(event) {
17319
+ return this.orientation() === "horizontal" ? event.clientX : event.clientY;
17320
+ }
17321
+ readRtl() {
17322
+ return isRtl(getComputedStyle(this.element).direction);
17323
+ }
17324
+ static {
17325
+ this.ɵfac = i0.ɵɵngDeclareFactory({
17326
+ minVersion: "12.0.0",
17327
+ version: "22.2.6",
17328
+ ngImport: i0,
17329
+ type: SplitterComponent,
17330
+ deps: [],
17331
+ target: i0.ɵɵFactoryTarget.Component
17332
+ });
17333
+ }
17334
+ static {
17335
+ this.ɵcmp = i0.ɵɵngDeclareComponent({
17336
+ minVersion: "17.2.0",
17337
+ version: "22.2.6",
17338
+ type: SplitterComponent,
17339
+ isStandalone: true,
17340
+ selector: "flr-splitter",
17341
+ inputs: {
17342
+ orientation: {
17343
+ classPropertyName: "orientation",
17344
+ publicName: "orientation",
17345
+ isSignal: true,
17346
+ isRequired: false,
17347
+ transformFunction: null
17348
+ },
17349
+ stacked: {
17350
+ classPropertyName: "stacked",
17351
+ publicName: "stacked",
17352
+ isSignal: true,
17353
+ isRequired: false,
17354
+ transformFunction: null
17355
+ },
17356
+ stackBelow: {
17357
+ classPropertyName: "stackBelow",
17358
+ publicName: "stackBelow",
17359
+ isSignal: true,
17360
+ isRequired: false,
17361
+ transformFunction: null
17362
+ },
17363
+ storageKey: {
17364
+ classPropertyName: "storageKey",
17365
+ publicName: "storageKey",
17366
+ isSignal: true,
17367
+ isRequired: false,
17368
+ transformFunction: null
17369
+ },
17370
+ keyboardStep: {
17371
+ classPropertyName: "keyboardStep",
17372
+ publicName: "keyboardStep",
17373
+ isSignal: true,
17374
+ isRequired: false,
17375
+ transformFunction: null
17376
+ },
17377
+ resetAnnouncement: {
17378
+ classPropertyName: "resetAnnouncement",
17379
+ publicName: "resetAnnouncement",
17380
+ isSignal: true,
17381
+ isRequired: false,
17382
+ transformFunction: null
17383
+ },
17384
+ sizeAnnouncement: {
17385
+ classPropertyName: "sizeAnnouncement",
17386
+ publicName: "sizeAnnouncement",
17387
+ isSignal: true,
17388
+ isRequired: false,
17389
+ transformFunction: null
17390
+ },
17391
+ paneLabel: {
17392
+ classPropertyName: "paneLabel",
17393
+ publicName: "paneLabel",
17394
+ isSignal: true,
17395
+ isRequired: false,
17396
+ transformFunction: null
17397
+ },
17398
+ resizeLabel: {
17399
+ classPropertyName: "resizeLabel",
17400
+ publicName: "resizeLabel",
17401
+ isSignal: true,
17402
+ isRequired: false,
17403
+ transformFunction: null
17404
+ }
17405
+ },
17406
+ outputs: { resizeEnd: "resizeEnd" },
17407
+ host: { properties: {
17408
+ "class.flr-splitter--vertical": "orientation() === 'vertical'",
17409
+ "class.flr-splitter--stacked": "isStacked()",
17410
+ "class.flr-splitter--dragging": "dragging()"
17411
+ } },
17412
+ providers: [{
17413
+ provide: SPLITTER_HOST,
17414
+ useExisting: forwardRef(() => SplitterComponent)
17415
+ }],
17416
+ queries: [{
17417
+ propertyName: "panes",
17418
+ predicate: SplitterPaneComponent,
17419
+ isSignal: true
17420
+ }],
17421
+ ngImport: i0,
17422
+ template: "<ng-content />\n",
17423
+ styles: [":host{position:relative;display:flex;flex-direction:row;width:100%;height:100%;min-width:0;min-height:0}:host(.flr-splitter--vertical),:host(.flr-splitter--stacked){flex-direction:column}:host(.flr-splitter--stacked){height:auto}:host(.flr-splitter--dragging){cursor:col-resize;-webkit-user-select:none;user-select:none}:host(.flr-splitter--vertical.flr-splitter--dragging){cursor:row-resize}\n"],
17424
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
17425
+ });
17426
+ }
17427
+ };
17428
+ i0.ɵɵngDeclareClassMetadata({
17429
+ minVersion: "12.0.0",
17430
+ version: "22.2.6",
17431
+ ngImport: i0,
17432
+ type: SplitterComponent,
17433
+ decorators: [{
17434
+ type: Component,
17435
+ args: [{
17436
+ selector: "flr-splitter",
17437
+ changeDetection: ChangeDetectionStrategy.OnPush,
17438
+ providers: [{
17439
+ provide: SPLITTER_HOST,
17440
+ useExisting: forwardRef(() => SplitterComponent)
17441
+ }],
17442
+ host: {
17443
+ "[class.flr-splitter--vertical]": "orientation() === 'vertical'",
17444
+ "[class.flr-splitter--stacked]": "isStacked()",
17445
+ "[class.flr-splitter--dragging]": "dragging()"
17446
+ },
17447
+ template: "<ng-content />\n",
17448
+ styles: [":host{position:relative;display:flex;flex-direction:row;width:100%;height:100%;min-width:0;min-height:0}:host(.flr-splitter--vertical),:host(.flr-splitter--stacked){flex-direction:column}:host(.flr-splitter--stacked){height:auto}:host(.flr-splitter--dragging){cursor:col-resize;-webkit-user-select:none;user-select:none}:host(.flr-splitter--vertical.flr-splitter--dragging){cursor:row-resize}\n"]
17449
+ }]
17450
+ }],
17451
+ ctorParameters: () => [],
17452
+ propDecorators: {
17453
+ orientation: [{
17454
+ type: i0.Input,
17455
+ args: [{
17456
+ isSignal: true,
17457
+ alias: "orientation",
17458
+ required: false
17459
+ }]
17460
+ }],
17461
+ stacked: [{
17462
+ type: i0.Input,
17463
+ args: [{
17464
+ isSignal: true,
17465
+ alias: "stacked",
17466
+ required: false
17467
+ }]
17468
+ }],
17469
+ stackBelow: [{
17470
+ type: i0.Input,
17471
+ args: [{
17472
+ isSignal: true,
17473
+ alias: "stackBelow",
17474
+ required: false
17475
+ }]
17476
+ }],
17477
+ storageKey: [{
17478
+ type: i0.Input,
17479
+ args: [{
17480
+ isSignal: true,
17481
+ alias: "storageKey",
17482
+ required: false
17483
+ }]
17484
+ }],
17485
+ keyboardStep: [{
17486
+ type: i0.Input,
17487
+ args: [{
17488
+ isSignal: true,
17489
+ alias: "keyboardStep",
17490
+ required: false
17491
+ }]
17492
+ }],
17493
+ resetAnnouncement: [{
17494
+ type: i0.Input,
17495
+ args: [{
17496
+ isSignal: true,
17497
+ alias: "resetAnnouncement",
17498
+ required: false
17499
+ }]
17500
+ }],
17501
+ sizeAnnouncement: [{
17502
+ type: i0.Input,
17503
+ args: [{
17504
+ isSignal: true,
17505
+ alias: "sizeAnnouncement",
17506
+ required: false
17507
+ }]
17508
+ }],
17509
+ paneLabel: [{
17510
+ type: i0.Input,
17511
+ args: [{
17512
+ isSignal: true,
17513
+ alias: "paneLabel",
17514
+ required: false
17515
+ }]
17516
+ }],
17517
+ resizeLabel: [{
17518
+ type: i0.Input,
17519
+ args: [{
17520
+ isSignal: true,
17521
+ alias: "resizeLabel",
17522
+ required: false
17523
+ }]
17524
+ }],
17525
+ resizeEnd: [{
17526
+ type: i0.Output,
17527
+ args: ["resizeEnd"]
17528
+ }],
17529
+ panes: [{
17530
+ type: i0.ContentChildren,
17531
+ args: [i0.forwardRef(() => SplitterPaneComponent), { isSignal: true }]
17532
+ }]
17533
+ }
17534
+ });
17535
+ export { ACCESS_PICKER_LABELS_EN, ACCESS_PICKER_LABELS_FR, ALL_SITE_LOCALES, AccessPickerComponent, AnnotatedTextareaComponent, AppRailComponent, AppSwitcherComponent, AvatarComponent, BannerComponent, BarChartComponent, BrandDropdownComponent, ButtonComponent, CONTACT_FORM_LABELS_EN, CONTACT_FORM_LABELS_FR, CONTACT_KINDS, CONTACT_PRODUCTS, CardComponent, CardHeaderComponent, CheckboxComponent, ComparisonTableComponent, ContactFormComponent, ContainerComponent, DEFAULT_APPS, DEFAULT_LOCALE, DEFAULT_PAGE_SIZE, DEFAULT_PAGINATION_LABELS, DividerComponent, DrawerComponent, EmptyStateComponent, ErrorStateComponent, FieldComponent, InputComponent, LOCALE_CATALOG, LoadingStateComponent, LogoMarkComponent, MenuComponent, MenuItemComponent, MenuLabelComponent, MenuSeparatorComponent, ModalComponent, MultiSelectComponent, PageHeaderComponent, PaginationComponent, ProgressBarComponent, ProjectSwitcherComponent, RadioComponent, RadioGroupComponent, RailToggleComponent, SHELL_CONTEXT, SITE_CHROME, SITE_LOCALES, SearchFieldComponent, SectionComponent, SegmentedComponent, SelectComponent, ShellComponent, SidebarComponent, SidebarItemComponent, SidebarSectionComponent, SiteCardComponent, SiteFooterComponent, SiteLocaleBannerComponent, SiteLocalePickerComponent, SiteNavbarComponent, SiteShellComponent, SiteSwitcherComponent, SkeletonComponent, SpinnerComponent, SplitterComponent, SplitterPaneComponent, StatComponent, StatusBarsComponent, SubmitComponent, SwitchComponent, TabComponent, TabsComponent, TagComponent, TextareaComponent, ToastContainerComponent, ToastService, TreeSelectComponent, UserMenuComponent, WAITLIST_FORM_LABELS_EN, WAITLIST_FORM_LABELS_FR, WaitlistFormComponent, accountUrl, brandApps, entitledApps, hiddenAppsFromPreferences, injectSitePath, isSiteLocale, localeBase, localeEntry, localeSwitchHref, marketingUrl, matchSiteLocale, orgCreateUrl, paged, provideSiteChrome, readContactPrefill, readRuntimeEnv, resolveLocale, resolveSiteLocale, runtimeUrl, siteLocales, stripLocalePrefix, switcherState, toLocaleOptions, userMenuItems, withHiddenApps, withLocaleBase };
16701
17536
 
16702
17537
  //# sourceMappingURL=ferrlabs-ui-ng.mjs.map