codexly-ui 0.9.0 → 0.10.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.
- package/fesm2022/codexly-ui.mjs +67 -30
- package/fesm2022/codexly-ui.mjs.map +1 -1
- package/package.json +1 -1
- package/types/codexly-ui.d.ts +44 -5
package/fesm2022/codexly-ui.mjs
CHANGED
|
@@ -2491,17 +2491,32 @@ class ClxTooltipService {
|
|
|
2491
2491
|
this._animate.animate(el, { animation: 'fadeIn', duration: 160, trigger: 'manual', fillMode: 'both' });
|
|
2492
2492
|
}
|
|
2493
2493
|
/** Hides the bubble, but only if `trigger` is the element that currently owns it — a hover-out
|
|
2494
|
-
* from an element that already lost ownership (a newer hover-in interrupted it) is a no-op.
|
|
2494
|
+
* from an element that already lost ownership (a newer hover-in interrupted it) is a no-op.
|
|
2495
|
+
* Relies on the 'animationend' DOM event to know when the fade-out finished — but that event
|
|
2496
|
+
* can simply never fire (backgrounded tab throttling animations, layout thrashing from a route
|
|
2497
|
+
* change interrupting the transition, etc.), which would leave the promise unresolved forever
|
|
2498
|
+
* and _owner never cleared — since this bubble lives outside any component's lifecycle (a
|
|
2499
|
+
* singleton appended straight to document.body), nothing else would ever hide it again. A hard
|
|
2500
|
+
* fallback timeout guarantees the bubble is actually hidden and ownership released regardless of
|
|
2501
|
+
* whether the CSS event cooperates. */
|
|
2495
2502
|
hide(trigger) {
|
|
2496
2503
|
if (!this._isBrowser || this._owner !== trigger || !this._ref)
|
|
2497
2504
|
return;
|
|
2498
2505
|
this._hiding = true;
|
|
2499
2506
|
trigger.removeAttribute('aria-describedby');
|
|
2500
2507
|
const el = this._ref.location.nativeElement;
|
|
2508
|
+
const settle = () => {
|
|
2509
|
+
if (this._owner !== trigger || !this._hiding)
|
|
2510
|
+
return;
|
|
2511
|
+
el.style.visibility = 'hidden';
|
|
2512
|
+
this._owner = null;
|
|
2513
|
+
this._hiding = false;
|
|
2514
|
+
};
|
|
2515
|
+
const fallback = setTimeout(settle, 400);
|
|
2501
2516
|
this._animate.animate(el, { animation: 'fadeOut', duration: 120, trigger: 'manual', fillMode: 'forwards' })
|
|
2502
2517
|
.then(() => {
|
|
2503
|
-
|
|
2504
|
-
|
|
2518
|
+
clearTimeout(fallback);
|
|
2519
|
+
settle();
|
|
2505
2520
|
});
|
|
2506
2521
|
}
|
|
2507
2522
|
/** Synchronous, no fade — used on touchend/click so the bubble can't linger over UI the
|
|
@@ -8028,6 +8043,16 @@ class ClxNativeOverlayService {
|
|
|
8028
8043
|
_injector = inject(Injector);
|
|
8029
8044
|
/** Block body scroll like CDK used to */
|
|
8030
8045
|
_scrollBlocked = 0;
|
|
8046
|
+
// Overlays (modals, drawers, …) mount straight to document.body, outside the router-outlet
|
|
8047
|
+
// tree — a route navigation never tears them down on its own. Tracked here so callers (e.g. an
|
|
8048
|
+
// auth interceptor forcing sign-out on session expiry) can close whatever's open instead of
|
|
8049
|
+
// leaving a modal visually stuck on top of the page the user gets redirected to.
|
|
8050
|
+
_active = new Set();
|
|
8051
|
+
/** Force-closes every currently mounted overlay — no exit animation, immediate DOM removal. */
|
|
8052
|
+
destroyAll() {
|
|
8053
|
+
for (const ref of [...this._active])
|
|
8054
|
+
ref.destroy();
|
|
8055
|
+
}
|
|
8031
8056
|
mount(component, injector, options) {
|
|
8032
8057
|
// ── backdrop ────────────────────────────────────────────────────────────
|
|
8033
8058
|
let backdropEl = null;
|
|
@@ -8062,12 +8087,14 @@ class ClxNativeOverlayService {
|
|
|
8062
8087
|
backdrop: backdropEl,
|
|
8063
8088
|
container,
|
|
8064
8089
|
destroy: () => {
|
|
8090
|
+
this._active.delete(overlayRef);
|
|
8065
8091
|
compRef.destroy();
|
|
8066
8092
|
backdropEl?.remove();
|
|
8067
8093
|
container.remove();
|
|
8068
8094
|
this._unblockScroll();
|
|
8069
8095
|
},
|
|
8070
8096
|
};
|
|
8097
|
+
this._active.add(overlayRef);
|
|
8071
8098
|
return { compRef, overlayRef };
|
|
8072
8099
|
}
|
|
8073
8100
|
_blockScroll() {
|
|
@@ -11013,6 +11040,7 @@ class ClxToastComponent {
|
|
|
11013
11040
|
_colorClass = computed(() => TOAST_COLOR_MAP[this.entry().type], ...(ngDevMode ? [{ debugName: "_colorClass" }] : /* istanbul ignore next */ []));
|
|
11014
11041
|
_progressColor = computed(() => TOAST_PROGRESS_MAP[this.entry().type], ...(ngDevMode ? [{ debugName: "_progressColor" }] : /* istanbul ignore next */ []));
|
|
11015
11042
|
_buttonColor = computed(() => this.entry().type, ...(ngDevMode ? [{ debugName: "_buttonColor" }] : /* istanbul ignore next */ []));
|
|
11043
|
+
_actions = computed(() => this.entry().actions ?? (this.entry().action ? [this.entry().action] : []), ...(ngDevMode ? [{ debugName: "_actions" }] : /* istanbul ignore next */ []));
|
|
11016
11044
|
get _card() {
|
|
11017
11045
|
return this._el.nativeElement.querySelector('.clx-toast-card');
|
|
11018
11046
|
}
|
|
@@ -11042,8 +11070,8 @@ class ClxToastComponent {
|
|
|
11042
11070
|
this._paused = false;
|
|
11043
11071
|
}
|
|
11044
11072
|
// ─── Action ────────────────────────────────────────────────────────────────
|
|
11045
|
-
_onAction() {
|
|
11046
|
-
|
|
11073
|
+
_onAction(action) {
|
|
11074
|
+
action.onClick();
|
|
11047
11075
|
this.dismiss.emit(this.entry().id);
|
|
11048
11076
|
}
|
|
11049
11077
|
// ─── Animated exit (called by container before removal) ───────────────────
|
|
@@ -11113,18 +11141,22 @@ class ClxToastComponent {
|
|
|
11113
11141
|
<p class="text-sm text-clx-text-muted leading-snug wrap-break-word">
|
|
11114
11142
|
{{ entry().message }}
|
|
11115
11143
|
</p>
|
|
11116
|
-
@if (
|
|
11117
|
-
<
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11121
|
-
|
|
11122
|
-
|
|
11123
|
-
|
|
11124
|
-
|
|
11125
|
-
|
|
11126
|
-
|
|
11127
|
-
|
|
11144
|
+
@if (_actions().length) {
|
|
11145
|
+
<div class="flex items-center gap-3 mt-2">
|
|
11146
|
+
@for (a of _actions(); track a.label) {
|
|
11147
|
+
<button
|
|
11148
|
+
clx-button
|
|
11149
|
+
type="button"
|
|
11150
|
+
[variant]="a.variant ?? 'link'"
|
|
11151
|
+
[color]="_buttonColor()"
|
|
11152
|
+
size="xs"
|
|
11153
|
+
[class]="a.variant && a.variant !== 'link' ? '' : '-ml-1 h-auto p-0'"
|
|
11154
|
+
(click)="_onAction(a)"
|
|
11155
|
+
>
|
|
11156
|
+
{{ a.label }}
|
|
11157
|
+
</button>
|
|
11158
|
+
}
|
|
11159
|
+
</div>
|
|
11128
11160
|
}
|
|
11129
11161
|
</div>
|
|
11130
11162
|
|
|
@@ -11184,18 +11216,22 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
11184
11216
|
<p class="text-sm text-clx-text-muted leading-snug wrap-break-word">
|
|
11185
11217
|
{{ entry().message }}
|
|
11186
11218
|
</p>
|
|
11187
|
-
@if (
|
|
11188
|
-
<
|
|
11189
|
-
|
|
11190
|
-
|
|
11191
|
-
|
|
11192
|
-
|
|
11193
|
-
|
|
11194
|
-
|
|
11195
|
-
|
|
11196
|
-
|
|
11197
|
-
|
|
11198
|
-
|
|
11219
|
+
@if (_actions().length) {
|
|
11220
|
+
<div class="flex items-center gap-3 mt-2">
|
|
11221
|
+
@for (a of _actions(); track a.label) {
|
|
11222
|
+
<button
|
|
11223
|
+
clx-button
|
|
11224
|
+
type="button"
|
|
11225
|
+
[variant]="a.variant ?? 'link'"
|
|
11226
|
+
[color]="_buttonColor()"
|
|
11227
|
+
size="xs"
|
|
11228
|
+
[class]="a.variant && a.variant !== 'link' ? '' : '-ml-1 h-auto p-0'"
|
|
11229
|
+
(click)="_onAction(a)"
|
|
11230
|
+
>
|
|
11231
|
+
{{ a.label }}
|
|
11232
|
+
</button>
|
|
11233
|
+
}
|
|
11234
|
+
</div>
|
|
11199
11235
|
}
|
|
11200
11236
|
</div>
|
|
11201
11237
|
|
|
@@ -15844,6 +15880,7 @@ class ClxToastService {
|
|
|
15844
15880
|
animationOut: options.animationOut ?? TOAST_DEFAULTS.animationOut,
|
|
15845
15881
|
animationDuration: options.animationDuration ?? TOAST_DEFAULTS.animationDuration,
|
|
15846
15882
|
action: options.action,
|
|
15883
|
+
actions: options.actions,
|
|
15847
15884
|
removing: false,
|
|
15848
15885
|
};
|
|
15849
15886
|
const isBottom = position.startsWith('bottom');
|
|
@@ -15904,5 +15941,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.15", ngImpo
|
|
|
15904
15941
|
* Generated bundle index. Do not edit.
|
|
15905
15942
|
*/
|
|
15906
15943
|
|
|
15907
|
-
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxModalComponent, ClxModalService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
|
|
15944
|
+
export { CLX_ADDON_BORDER, CLX_ADDON_TEXT, CLX_ALERT_OPTIONS, CLX_ALERT_RESOLVE, CLX_BG_ADDON, CLX_BG_DISABLED, CLX_BG_ICON_WRAP, CLX_BG_SECTION, CLX_BG_SURFACE, CLX_BORDER_DEFAULT, CLX_BORDER_DISABLED, CLX_BORDER_MEDIUM, CLX_COLOR_HEX, CLX_COLOR_HEX_100, CLX_COLOR_MAP, CLX_FONT_CATALOG, CLX_MODAL_ANIM_CONFIG, CLX_MODAL_DATA, CLX_MODAL_REF, CLX_OPTION_DISABLED, CLX_PLACEHOLDER, CLX_RADIO_GROUP, CLX_RADIUS_MAP, CLX_TEXT_BODY, CLX_TEXT_DISABLED, CLX_TEXT_HEADING, CLX_TEXT_HINT, CLX_TEXT_IDLE, CLX_TEXT_INPUT, CLX_TEXT_LABEL, CLX_TEXT_OPTION, CLX_TEXT_SUBTITLE, CLX_TEXT_TITLE, CLX_THEME_CONFIG, CLX_THEME_DEFAULTS, CLX_TOAST_DEFAULTS, ClxAlertComponent, ClxAlertService, ClxAnimateDirective, ClxAnimateGroupDirective, ClxAnimateService, ClxAppLayoutComponent, ClxAvatarComponent, ClxBadgeComponent, ClxBrandComponent, ClxButtonComponent, ClxButtonGroupComponent, ClxCardBodyDirective, ClxCardComponent, ClxCardFooterDirective, ClxCardHeaderActionsDirective, ClxCardHeaderDirective, ClxCarouselComponent, ClxCarouselDirective, ClxCartComponent, ClxCartSummaryDrawer, ClxCellDirective, ClxCheckboxComponent, ClxColorPickerComponent, ClxColumnDefDirective, ClxDateRangePickerComponent, ClxDatepickerComponent, ClxDrawerComponent, ClxDrawerService, ClxEditorComponent, ClxEditorLinkModalComponent, ClxFabComponent, ClxFilterPanelComponent, ClxHeaderCellDirective, ClxIconComponent, ClxInputComponent, ClxListComponent, ClxListItemComponent, ClxMenuComponent, ClxMenuItemComponent, ClxModalComponent, ClxModalService, ClxNativeOverlayService, ClxNavGroupComponent, ClxNumberComponent, ClxPageEmptyComponent, ClxPageHeaderComponent, ClxPageHeaderTitleDirective, ClxPageNotFoundComponent, ClxPageServerErrorComponent, ClxPageUnauthorizedComponent, ClxPaginationComponent, ClxProductComponent, ClxProductDetailComponent, ClxProfileComponent, ClxProgressBarComponent, ClxRadioComponent, ClxRadioGroupComponent, ClxRatingComponent, ClxSelectComponent, ClxSkeletonComponent, ClxSliderComponent, ClxSpinnerComponent, ClxStatCardComponent, ClxStepComponent, ClxStepperComponent, ClxSwitchComponent, ClxTabDirective, ClxTableComponent, ClxTabsComponent, ClxTagComponent, ClxTextareaComponent, ClxThemeService, ClxTimelineComponent, ClxTimelineItemComponent, ClxTimepickerComponent, ClxToastComponent, ClxToastContainerComponent, ClxToastService, ClxTooltipComponent, ClxTooltipDirective, ClxTreeComponent, ClxUploadComponent, ClxWishlistComponent, ClxWizardComponent, TIMEPICKER_SIZE_MAP, parseColorInput, provideCodexlyTheme, resolveColor, resolveContainerRadius, resolveRadius };
|
|
15908
15945
|
//# sourceMappingURL=codexly-ui.mjs.map
|