@nanahoshi/mona-ui 0.18.1 → 0.18.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.
|
@@ -734,9 +734,10 @@ const listGroupHeaderTextThemeVariants = cva(`select-none text-muted-foreground`
|
|
|
734
734
|
}
|
|
735
735
|
});
|
|
736
736
|
const listItemBaseThemeVariants = cva(`flex h-full w-full items-center gap-2`);
|
|
737
|
-
const listItemContentThemeVariants = cva(`relative flex cursor-default select-none items-center px-3 py-1 text-foreground outline-none
|
|
737
|
+
const listItemContentThemeVariants = cva(`relative flex cursor-default select-none items-center px-3 py-1 text-foreground outline-none`, {
|
|
738
738
|
variants: {
|
|
739
739
|
checkboxes: { true: "gap-2", false: "" },
|
|
740
|
+
selectable: { true: "hover:bg-hover focus:bg-hover", false: "" },
|
|
740
741
|
highlighted: {
|
|
741
742
|
true: "bg-hover text-foreground inset-ring-1 inset-ring-focus-indicator/35",
|
|
742
743
|
false: ""
|
|
@@ -744,10 +745,15 @@ const listItemContentThemeVariants = cva(`relative flex cursor-default select-no
|
|
|
744
745
|
selected: { true: "bg-(--color-selected) text-(--color-selected-foreground)", false: "" },
|
|
745
746
|
disabled: {
|
|
746
747
|
true: "pointer-events-none cursor-default bg-(--mona-list-disabled-background) text-disabled-foreground",
|
|
747
|
-
false: "
|
|
748
|
+
false: ""
|
|
748
749
|
}
|
|
749
750
|
},
|
|
750
751
|
compoundVariants: [
|
|
752
|
+
{
|
|
753
|
+
selectable: true,
|
|
754
|
+
disabled: false,
|
|
755
|
+
class: "cursor-pointer"
|
|
756
|
+
},
|
|
751
757
|
{
|
|
752
758
|
selected: true,
|
|
753
759
|
checkboxes: false,
|
|
@@ -789,12 +795,14 @@ class ListItemDirective {
|
|
|
789
795
|
const disabled = this.disabled();
|
|
790
796
|
const highlighted = this.highlighted();
|
|
791
797
|
const selected = this.selected();
|
|
792
|
-
const
|
|
798
|
+
const selectableOptions = this.#listService.selectableOptions();
|
|
799
|
+
const checkboxes = selectableOptions.checkboxes;
|
|
793
800
|
const classes = listItemContentThemeVariants({
|
|
794
801
|
disabled,
|
|
795
802
|
highlighted,
|
|
796
803
|
selected,
|
|
797
|
-
checkboxes
|
|
804
|
+
checkboxes,
|
|
805
|
+
selectable: selectableOptions.enabled
|
|
798
806
|
});
|
|
799
807
|
return twMerge(classes);
|
|
800
808
|
}, /* @ts-ignore */
|
|
@@ -274,7 +274,7 @@ class ListViewComponent {
|
|
|
274
274
|
},
|
|
275
275
|
deps: [[new Optional(), new SkipSelf(), ListService]]
|
|
276
276
|
}
|
|
277
|
-
], queries: [{ propertyName: "footerTemplate", first: true, predicate: ListViewFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ListViewGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ListViewHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: ListViewItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: ListViewNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<mona-list\n [ariaLabel]=\"ariaLabel()\"\n [data]=\"viewItems()\"\n [height]=\"listHeight()\"\n [width]=\"listWidth()\"\n [maxHeight]=\"listMaxHeight()\"\n [maxWidth]=\"listMaxWidth()\"\n [listItemClass]=\"listItemClass()\"\n [listItemStyle]=\"listItemStyle()\"\n [listClass]=\"listClass()\"\n [listStyle]=\"listStyle()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-groupHeader>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: groupHeader }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n</mona-list>\n\n@let pageableOptions = listService.pageableOptions();\n@if (pageableOptions.enabled && !listService.virtualScrollOptions().enabled && viewItems().length > 0) {\n @let pageState = listService.pageState();\n <div class=\"mona-list-view-pager\">\n <mona-pager\n [firstLast]=\"pageableOptions.firstLast\"\n [pageSizeValues]=\"pageableOptions.pageSizeValues\"\n [visiblePages]=\"pageableOptions.visiblePages\"\n [total]=\"itemCount()\"\n [skip]=\"pageState.skip\"\n [responsive]=\"false\"\n [rounded]=\"rounded()\"\n [pageSize]=\"pageState.take\"\n [previousNext]=\"pageableOptions.previousNext\"\n [showInfo]=\"pageableOptions.showInfo\"\n (pageChange)=\"onPageChange($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n class=\"border-b-0 border-l-0 border-r-0 rounded-t-none\"></mona-pager>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PagerComponent, selector: "mona-pager", inputs: ["firstLast", "navigable", "pageInput", "pageSize", "pageSizeValues", "previousNext", "responsive", "rounded", "showInfo", "size", "skip", "total", "type", "class", "visiblePages"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }] }); }
|
|
277
|
+
], queries: [{ propertyName: "footerTemplate", first: true, predicate: ListViewFooterTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "groupHeaderTemplate", first: true, predicate: ListViewGroupHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "headerTemplate", first: true, predicate: ListViewHeaderTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "itemTemplate", first: true, predicate: ListViewItemTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }, { propertyName: "noDataTemplate", first: true, predicate: ListViewNoDataTemplateDirective, descendants: true, read: TemplateRef, isSignal: true }], ngImport: i0, template: "<mona-list\n [ariaLabel]=\"ariaLabel()\"\n [data]=\"viewItems()\"\n [height]=\"listHeight()\"\n [width]=\"listWidth()\"\n [maxHeight]=\"listMaxHeight()\"\n [maxWidth]=\"listMaxWidth()\"\n [listItemClass]=\"listItemClass()\"\n [listItemStyle]=\"listItemStyle()\"\n [listClass]=\"listClass()\"\n [listStyle]=\"listStyle()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-groupHeader>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: groupHeader }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n</mona-list>\n\n@let pageableOptions = listService.pageableOptions();\n@if (pageableOptions.enabled && !listService.virtualScrollOptions().enabled && viewItems().length > 0) {\n @let pageState = listService.pageState();\n <div class=\"mona-list-view-pager\">\n <mona-pager\n [firstLast]=\"pageableOptions.firstLast\"\n [pageSizeValues]=\"pageableOptions.pageSizeValues\"\n [visiblePages]=\"pageableOptions.visiblePages\"\n [total]=\"itemCount()\"\n [skip]=\"pageState.skip\"\n [responsive]=\"false\"\n [rounded]=\"rounded()\"\n [pageSize]=\"pageState.take\"\n [previousNext]=\"pageableOptions.previousNext\"\n [showInfo]=\"pageableOptions.showInfo\"\n [size]=\"size()\"\n (pageChange)=\"onPageChange($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n class=\"border-b-0 border-l-0 border-r-0 rounded-t-none\"></mona-pager>\n </div>\n}\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: PagerComponent, selector: "mona-pager", inputs: ["firstLast", "navigable", "pageInput", "pageSize", "pageSizeValues", "previousNext", "responsive", "rounded", "showInfo", "size", "skip", "total", "type", "class", "visiblePages"], outputs: ["pageChange", "pageSizeChange"] }, { kind: "component", type: ListComponent, selector: "mona-list", inputs: ["ariaLabel", "data", "focusOnMount", "height", "listClass", "listId", "listItemClass", "listItemStyle", "listStyle", "maxHeight", "maxWidth", "size", "textField", "width"], outputs: ["itemSelect"] }, { kind: "directive", type: ListHeaderTemplateDirective, selector: "ng-template[monaListHeaderTemplate]" }, { kind: "directive", type: ListFooterTemplateDirective, selector: "ng-template[monaListFooterTemplate]" }, { kind: "directive", type: ListGroupHeaderTemplateDirective, selector: "ng-template[monaListGroupHeaderTemplate]" }, { kind: "directive", type: ListItemTemplateDirective, selector: "ng-template[monaListItemTemplate]" }, { kind: "directive", type: ListNoDataTemplateDirective, selector: "ng-template[monaListNoDataTemplate]" }] }); }
|
|
278
278
|
}
|
|
279
279
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImport: i0, type: ListViewComponent, decorators: [{
|
|
280
280
|
type: Component,
|
|
@@ -298,7 +298,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.6", ngImpor
|
|
|
298
298
|
], host: {
|
|
299
299
|
"[class]": "baseClasses()",
|
|
300
300
|
"[attr.tabindex]": "-1"
|
|
301
|
-
}, template: "<mona-list\n [ariaLabel]=\"ariaLabel()\"\n [data]=\"viewItems()\"\n [height]=\"listHeight()\"\n [width]=\"listWidth()\"\n [maxHeight]=\"listMaxHeight()\"\n [maxWidth]=\"listMaxWidth()\"\n [listItemClass]=\"listItemClass()\"\n [listItemStyle]=\"listItemStyle()\"\n [listClass]=\"listClass()\"\n [listStyle]=\"listStyle()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-groupHeader>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: groupHeader }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n</mona-list>\n\n@let pageableOptions = listService.pageableOptions();\n@if (pageableOptions.enabled && !listService.virtualScrollOptions().enabled && viewItems().length > 0) {\n @let pageState = listService.pageState();\n <div class=\"mona-list-view-pager\">\n <mona-pager\n [firstLast]=\"pageableOptions.firstLast\"\n [pageSizeValues]=\"pageableOptions.pageSizeValues\"\n [visiblePages]=\"pageableOptions.visiblePages\"\n [total]=\"itemCount()\"\n [skip]=\"pageState.skip\"\n [responsive]=\"false\"\n [rounded]=\"rounded()\"\n [pageSize]=\"pageState.take\"\n [previousNext]=\"pageableOptions.previousNext\"\n [showInfo]=\"pageableOptions.showInfo\"\n (pageChange)=\"onPageChange($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n class=\"border-b-0 border-l-0 border-r-0 rounded-t-none\"></mona-pager>\n </div>\n}\n" }]
|
|
301
|
+
}, template: "<mona-list\n [ariaLabel]=\"ariaLabel()\"\n [data]=\"viewItems()\"\n [height]=\"listHeight()\"\n [width]=\"listWidth()\"\n [maxHeight]=\"listMaxHeight()\"\n [maxWidth]=\"listMaxWidth()\"\n [listItemClass]=\"listItemClass()\"\n [listItemStyle]=\"listItemStyle()\"\n [listClass]=\"listClass()\"\n [listStyle]=\"listStyle()\">\n @if (footerTemplate()) {\n <ng-template monaListFooterTemplate>\n <ng-container [ngTemplateOutlet]=\"footerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (groupHeaderTemplate()) {\n <ng-template monaListGroupHeaderTemplate let-groupHeader>\n <ng-container\n [ngTemplateOutlet]=\"groupHeaderTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: groupHeader }\"></ng-container>\n </ng-template>\n }\n @if (headerTemplate()) {\n <ng-template monaListHeaderTemplate>\n <ng-container [ngTemplateOutlet]=\"headerTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n @if (itemTemplate()) {\n <ng-template monaListItemTemplate let-dataItem>\n <ng-container\n [ngTemplateOutlet]=\"itemTemplate() ?? null\"\n [ngTemplateOutletContext]=\"{ $implicit: dataItem }\"></ng-container>\n </ng-template>\n }\n @if (noDataTemplate()) {\n <ng-template monaListNoDataTemplate>\n <ng-container [ngTemplateOutlet]=\"noDataTemplate() ?? null\"></ng-container>\n </ng-template>\n }\n</mona-list>\n\n@let pageableOptions = listService.pageableOptions();\n@if (pageableOptions.enabled && !listService.virtualScrollOptions().enabled && viewItems().length > 0) {\n @let pageState = listService.pageState();\n <div class=\"mona-list-view-pager\">\n <mona-pager\n [firstLast]=\"pageableOptions.firstLast\"\n [pageSizeValues]=\"pageableOptions.pageSizeValues\"\n [visiblePages]=\"pageableOptions.visiblePages\"\n [total]=\"itemCount()\"\n [skip]=\"pageState.skip\"\n [responsive]=\"false\"\n [rounded]=\"rounded()\"\n [pageSize]=\"pageState.take\"\n [previousNext]=\"pageableOptions.previousNext\"\n [showInfo]=\"pageableOptions.showInfo\"\n [size]=\"size()\"\n (pageChange)=\"onPageChange($event)\"\n (pageSizeChange)=\"onPageSizeChange($event)\"\n class=\"border-b-0 border-l-0 border-r-0 rounded-t-none\"></mona-pager>\n </div>\n}\n" }]
|
|
302
302
|
}], ctorParameters: () => [], propDecorators: { footerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewFooterTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], groupHeaderTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewGroupHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], headerTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewHeaderTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], itemTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewItemTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], noDataTemplate: [{ type: i0.ContentChild, args: [i0.forwardRef(() => ListViewNoDataTemplateDirective), { ...{ read: TemplateRef }, isSignal: true }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "aria-label", required: false }] }], height: [{ type: i0.Input, args: [{ isSignal: true, alias: "height", required: false }] }], listClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "listClass", required: false }] }], listItemClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemClass", required: false }] }], listItemStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "listItemStyle", required: false }] }], listStyle: [{ type: i0.Input, args: [{ isSignal: true, alias: "listStyle", required: false }] }], items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], maxHeight: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxHeight", required: false }] }], maxWidth: [{ type: i0.Input, args: [{ isSignal: true, alias: "maxWidth", required: false }] }], rounded: [{ type: i0.Input, args: [{ isSignal: true, alias: "rounded", required: false }] }], scrollBottom: [{ type: i0.Output, args: ["scrollBottom"] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], textField: [{ type: i0.Input, args: [{ isSignal: true, alias: "textField", required: false }] }], userClass: [{ type: i0.Input, args: [{ isSignal: true, alias: "class", required: false }] }], width: [{ type: i0.Input, args: [{ isSignal: true, alias: "width", required: false }] }] } });
|
|
303
303
|
|
|
304
304
|
class ListViewGroupableDirective {
|
|
@@ -285,7 +285,6 @@ class SegmentedComponent {
|
|
|
285
285
|
afterNextRender({
|
|
286
286
|
read: () => {
|
|
287
287
|
this.setupResizeObserver();
|
|
288
|
-
this.scheduleSettledGeometryUpdate();
|
|
289
288
|
}
|
|
290
289
|
});
|
|
291
290
|
this.#destroyRef.onDestroy(() => {
|
|
@@ -328,22 +327,6 @@ class SegmentedComponent {
|
|
|
328
327
|
}
|
|
329
328
|
this.#observedOptionElements = elements;
|
|
330
329
|
}
|
|
331
|
-
/**
|
|
332
|
-
* Guards against a stale indicator snapshot when the control mounts inside a container that is
|
|
333
|
-
* still transitioning in (e.g. a popup's enter animation): the host's own box may not change once
|
|
334
|
-
* that settles, so the ResizeObserver on it alone would never re-fire to correct the geometry.
|
|
335
|
-
*/
|
|
336
|
-
scheduleSettledGeometryUpdate() {
|
|
337
|
-
const win = this.#hostElementRef.nativeElement.ownerDocument.defaultView;
|
|
338
|
-
if (!win) {
|
|
339
|
-
return;
|
|
340
|
-
}
|
|
341
|
-
win.requestAnimationFrame(() => {
|
|
342
|
-
win.requestAnimationFrame(() => {
|
|
343
|
-
this.updateIndicatorGeometry({ suppressTransition: true });
|
|
344
|
-
});
|
|
345
|
-
});
|
|
346
|
-
}
|
|
347
330
|
setupResizeObserver() {
|
|
348
331
|
if (typeof ResizeObserver === "undefined") {
|
|
349
332
|
return;
|
|
@@ -370,14 +353,18 @@ class SegmentedComponent {
|
|
|
370
353
|
this.indicatorTransitionEnabled.set(false);
|
|
371
354
|
return;
|
|
372
355
|
}
|
|
373
|
-
const host = this.#hostElementRef.nativeElement;
|
|
374
356
|
const option = selectedElementRef.nativeElement;
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
357
|
+
// `offsetLeft`/`offsetTop`/`offsetWidth`/`offsetHeight` are pure layout values, relative to
|
|
358
|
+
// the nearest positioned ancestor (the host, which is `position: relative` and the option's
|
|
359
|
+
// direct parent). Unlike `getBoundingClientRect()`, they are unaffected by any CSS transform
|
|
360
|
+
// an ancestor applies — e.g. the scale animation `mona-popup` plays while opening. Measuring
|
|
361
|
+
// with `getBoundingClientRect()` there could capture a mid-transition (e.g. 95%-scaled)
|
|
362
|
+
// snapshot that never gets corrected once the animation settles, undersizing/misplacing the
|
|
363
|
+
// indicator relative to the option's real, final box.
|
|
364
|
+
const x = option.offsetLeft;
|
|
365
|
+
const y = option.offsetTop;
|
|
366
|
+
const width = option.offsetWidth;
|
|
367
|
+
const height = option.offsetHeight;
|
|
381
368
|
const shouldAnimate = !options?.suppressTransition &&
|
|
382
369
|
this.animate() &&
|
|
383
370
|
this.indicatorInitialized() &&
|
package/package.json
CHANGED
|
@@ -149,12 +149,6 @@ declare class SegmentedComponent<T extends SegmentedValue = SegmentedValue> impl
|
|
|
149
149
|
protected onOptionBlur(): void;
|
|
150
150
|
protected onOptionChange(option: SegmentedOption<T>): void;
|
|
151
151
|
private observeOptionElements;
|
|
152
|
-
/**
|
|
153
|
-
* Guards against a stale indicator snapshot when the control mounts inside a container that is
|
|
154
|
-
* still transitioning in (e.g. a popup's enter animation): the host's own box may not change once
|
|
155
|
-
* that settles, so the ResizeObserver on it alone would never re-fire to correct the geometry.
|
|
156
|
-
*/
|
|
157
|
-
private scheduleSettledGeometryUpdate;
|
|
158
152
|
private setupResizeObserver;
|
|
159
153
|
private updateIndicatorGeometry;
|
|
160
154
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SegmentedComponent<any>, never>;
|