ngwr 10.1.0 → 10.2.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/alert/styles/_index.scss +7 -3
- package/breadcrumbs/styles/_index.scss +1 -1
- package/dialog/styles/_index.scss +31 -0
- package/fesm2022/ngwr-action-sheet.mjs +3 -3
- package/fesm2022/ngwr-affix.mjs +3 -3
- package/fesm2022/ngwr-alert.mjs +3 -3
- package/fesm2022/ngwr-anchor.mjs +3 -3
- package/fesm2022/ngwr-aurora.mjs +3 -3
- package/fesm2022/ngwr-avatar.mjs +3 -3
- package/fesm2022/ngwr-back-top.mjs +3 -3
- package/fesm2022/ngwr-badge.mjs +6 -6
- package/fesm2022/ngwr-bar-chart.mjs +3 -3
- package/fesm2022/ngwr-blur-text.mjs +3 -3
- package/fesm2022/ngwr-border-glow.mjs +4 -4
- package/fesm2022/ngwr-breadcrumbs.mjs +9 -8
- package/fesm2022/ngwr-breadcrumbs.mjs.map +1 -1
- package/fesm2022/ngwr-burger.mjs +3 -3
- package/fesm2022/ngwr-button.mjs +59 -11
- package/fesm2022/ngwr-button.mjs.map +1 -1
- package/fesm2022/ngwr-calendar-heatmap.mjs +3 -3
- package/fesm2022/ngwr-calendar.mjs +88 -8
- package/fesm2022/ngwr-calendar.mjs.map +1 -1
- package/fesm2022/ngwr-card.mjs +10 -10
- package/fesm2022/ngwr-carousel.mjs +6 -6
- package/fesm2022/ngwr-cascader.mjs +4 -4
- package/fesm2022/ngwr-checkbox.mjs +6 -6
- package/fesm2022/ngwr-circular-text.mjs +4 -4
- package/fesm2022/ngwr-click-spark.mjs +3 -3
- package/fesm2022/ngwr-clipboard.mjs +18 -4
- package/fesm2022/ngwr-clipboard.mjs.map +1 -1
- package/fesm2022/ngwr-collapse.mjs +9 -9
- package/fesm2022/ngwr-color-picker.mjs +6 -6
- package/fesm2022/ngwr-command-palette.mjs +3 -3
- package/fesm2022/ngwr-compare.mjs +3 -3
- package/fesm2022/ngwr-confetti.mjs +3 -3
- package/fesm2022/ngwr-context-menu.mjs +12 -12
- package/fesm2022/ngwr-cookie.mjs +3 -3
- package/fesm2022/ngwr-counter.mjs +6 -6
- package/fesm2022/ngwr-date-adapter-fns.mjs +3 -3
- package/fesm2022/ngwr-date-adapter-luxon.mjs +3 -3
- package/fesm2022/ngwr-date-adapter.mjs +3 -3
- package/fesm2022/ngwr-date-picker.mjs +336 -54
- package/fesm2022/ngwr-date-picker.mjs.map +1 -1
- package/fesm2022/ngwr-decrypt-text.mjs +3 -3
- package/fesm2022/ngwr-density.mjs +6 -6
- package/fesm2022/ngwr-descriptions.mjs +6 -6
- package/fesm2022/ngwr-dialog.mjs +33 -17
- package/fesm2022/ngwr-dialog.mjs.map +1 -1
- package/fesm2022/ngwr-directives.mjs +12 -12
- package/fesm2022/ngwr-divider.mjs +3 -3
- package/fesm2022/ngwr-donut-chart.mjs +3 -3
- package/fesm2022/ngwr-drag-drop.mjs +7 -7
- package/fesm2022/ngwr-drawer.mjs +37 -19
- package/fesm2022/ngwr-drawer.mjs.map +1 -1
- package/fesm2022/ngwr-dropdown.mjs +9 -9
- package/fesm2022/ngwr-empty.mjs +3 -3
- package/fesm2022/ngwr-event-calendar.mjs +6 -6
- package/fesm2022/ngwr-falling-text.mjs +4 -4
- package/fesm2022/ngwr-file-upload.mjs +3 -3
- package/fesm2022/ngwr-form.mjs +9 -9
- package/fesm2022/ngwr-fuzzy-text.mjs +3 -3
- package/fesm2022/ngwr-gauge.mjs +3 -3
- package/fesm2022/ngwr-glitch-text.mjs +4 -4
- package/fesm2022/ngwr-gradient-text.mjs +4 -4
- package/fesm2022/ngwr-hotkey.mjs +31 -10
- package/fesm2022/ngwr-hotkey.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-en.mjs +11 -0
- package/fesm2022/ngwr-i18n-en.mjs.map +1 -1
- package/fesm2022/ngwr-i18n-ru.mjs +11 -0
- package/fesm2022/ngwr-i18n-ru.mjs.map +1 -1
- package/fesm2022/ngwr-i18n.mjs +9 -9
- package/fesm2022/ngwr-icon.mjs +6 -6
- package/fesm2022/ngwr-image-cropper.mjs +3 -3
- package/fesm2022/ngwr-input-number.mjs +3 -3
- package/fesm2022/ngwr-input-otp.mjs +3 -3
- package/fesm2022/ngwr-input.mjs +15 -15
- package/fesm2022/ngwr-keyboard.mjs +3 -3
- package/fesm2022/ngwr-knob.mjs +3 -3
- package/fesm2022/ngwr-layout.mjs +15 -15
- package/fesm2022/ngwr-lightbox.mjs +4 -4
- package/fesm2022/ngwr-line-chart.mjs +3 -3
- package/fesm2022/ngwr-list.mjs +14 -9
- package/fesm2022/ngwr-list.mjs.map +1 -1
- package/fesm2022/ngwr-loading-bar.mjs +71 -31
- package/fesm2022/ngwr-loading-bar.mjs.map +1 -1
- package/fesm2022/ngwr-marquee.mjs +4 -4
- package/fesm2022/ngwr-media.mjs +3 -3
- package/fesm2022/ngwr-mention.mjs +6 -6
- package/fesm2022/ngwr-meta.mjs +6 -6
- package/fesm2022/ngwr-meter-group.mjs +3 -3
- package/fesm2022/ngwr-overlay.mjs +16 -7
- package/fesm2022/ngwr-overlay.mjs.map +1 -1
- package/fesm2022/ngwr-page-header.mjs +3 -3
- package/fesm2022/ngwr-pagination.mjs +13 -9
- package/fesm2022/ngwr-pagination.mjs.map +1 -1
- package/fesm2022/ngwr-pipes.mjs +21 -21
- package/fesm2022/ngwr-platform.mjs +9 -9
- package/fesm2022/ngwr-popconfirm.mjs +6 -6
- package/fesm2022/ngwr-popover.mjs +28 -8
- package/fesm2022/ngwr-popover.mjs.map +1 -1
- package/fesm2022/ngwr-progress.mjs +3 -3
- package/fesm2022/ngwr-pull-to-refresh.mjs +3 -3
- package/fesm2022/ngwr-qr.mjs +3 -3
- package/fesm2022/ngwr-radio.mjs +6 -6
- package/fesm2022/ngwr-rating.mjs +3 -3
- package/fesm2022/ngwr-result.mjs +12 -12
- package/fesm2022/ngwr-rotating-text.mjs +3 -3
- package/fesm2022/ngwr-scroll.mjs +3 -3
- package/fesm2022/ngwr-segmented.mjs +3 -3
- package/fesm2022/ngwr-select.mjs +9 -9
- package/fesm2022/ngwr-shiny-text.mjs +7 -7
- package/fesm2022/ngwr-sidebar.mjs +3 -3
- package/fesm2022/ngwr-skeleton.mjs +3 -3
- package/fesm2022/ngwr-slider.mjs +3 -3
- package/fesm2022/ngwr-sparkline.mjs +3 -3
- package/fesm2022/ngwr-speed-dial.mjs +3 -3
- package/fesm2022/ngwr-spinner.mjs +3 -3
- package/fesm2022/ngwr-splash-cursor.mjs +3 -3
- package/fesm2022/ngwr-split-text.mjs +3 -3
- package/fesm2022/ngwr-splitter.mjs +3 -3
- package/fesm2022/ngwr-spotlight-card.mjs +7 -7
- package/fesm2022/ngwr-squircle.mjs +6 -6
- package/fesm2022/ngwr-star-border.mjs +4 -4
- package/fesm2022/ngwr-statistic.mjs +9 -9
- package/fesm2022/ngwr-stepper.mjs +6 -6
- package/fesm2022/ngwr-storage.mjs +27 -17
- package/fesm2022/ngwr-storage.mjs.map +1 -1
- package/fesm2022/ngwr-switch.mjs +3 -3
- package/fesm2022/ngwr-table.mjs +19 -31
- package/fesm2022/ngwr-table.mjs.map +1 -1
- package/fesm2022/ngwr-tabs.mjs +6 -6
- package/fesm2022/ngwr-textarea.mjs +3 -3
- package/fesm2022/ngwr-theme.mjs +3 -3
- package/fesm2022/ngwr-tilt-card.mjs +7 -7
- package/fesm2022/ngwr-timeline.mjs +6 -6
- package/fesm2022/ngwr-toast.mjs +54 -20
- package/fesm2022/ngwr-toast.mjs.map +1 -1
- package/fesm2022/ngwr-toolbar.mjs +3 -3
- package/fesm2022/ngwr-tour.mjs +6 -6
- package/fesm2022/ngwr-transfer.mjs +3 -3
- package/fesm2022/ngwr-tree.mjs +3 -3
- package/fesm2022/ngwr-typewriter.mjs +4 -4
- package/fesm2022/ngwr-typography.mjs +3 -3
- package/fesm2022/ngwr-version.mjs +1 -1
- package/fesm2022/ngwr-version.mjs.map +1 -1
- package/fesm2022/ngwr-virtual-scroll.mjs +4 -4
- package/fesm2022/ngwr-waves.mjs +4 -4
- package/fesm2022/ngwr-window.mjs +80 -18
- package/fesm2022/ngwr-window.mjs.map +1 -1
- package/i18n/en.json +8 -0
- package/i18n/ru.json +8 -0
- package/package.json +1 -1
- package/sidebar/styles/_index.scss +3 -3
- package/stepper/styles/_index.scss +3 -3
- package/tabs/styles/_index.scss +1 -1
- package/theme/styles/_colors.scss +29 -8
- package/types/ngwr-button.d.ts +32 -0
- package/types/ngwr-calendar.d.ts +27 -1
- package/types/ngwr-clipboard.d.ts +8 -1
- package/types/ngwr-date-picker.d.ts +124 -8
- package/types/ngwr-dialog.d.ts +13 -0
- package/types/ngwr-drawer.d.ts +15 -0
- package/types/ngwr-hotkey.d.ts +2 -0
- package/types/ngwr-list.d.ts +7 -2
- package/types/ngwr-loading-bar.d.ts +4 -7
- package/types/ngwr-pagination.d.ts +6 -1
- package/types/ngwr-popover.d.ts +10 -2
- package/types/ngwr-storage.d.ts +10 -1
- package/types/ngwr-toast.d.ts +19 -4
- package/types/ngwr-version.d.ts +1 -1
- package/types/ngwr-window.d.ts +23 -2
- package/typography/styles/_index.scss +2 -2
package/fesm2022/ngwr-window.mjs
CHANGED
|
@@ -6,7 +6,7 @@ import { WR_OVERLAY } from 'ngwr/overlay';
|
|
|
6
6
|
import { WrStorage } from 'ngwr/storage';
|
|
7
7
|
import { randomId, clamp } from 'ngwr/utils';
|
|
8
8
|
import { coerceNumberProperty, coerceBooleanProperty } from '@angular/cdk/coercion';
|
|
9
|
-
import { Subject } from 'rxjs';
|
|
9
|
+
import { ReplaySubject, Subject } from 'rxjs';
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* @license
|
|
@@ -487,10 +487,10 @@ class WrWindow {
|
|
|
487
487
|
this.x_.set(clamp(this.x_(), MIN_ON_VIEWPORT - w, vw - MIN_ON_VIEWPORT));
|
|
488
488
|
this.y_.set(clamp(this.y_(), 0, vh - MIN_ON_VIEWPORT));
|
|
489
489
|
}
|
|
490
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
491
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
490
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindow, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
491
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrWindow, isStandalone: true, selector: "wr-window", inputs: { open: { classPropertyName: "open", publicName: "open", isSignal: true, isRequired: false, transformFunction: null }, state: { classPropertyName: "state", publicName: "state", isSignal: true, isRequired: false, transformFunction: null }, title: { classPropertyName: "title", publicName: "title", isSignal: true, isRequired: false, transformFunction: null }, initialX: { classPropertyName: "initialX", publicName: "initialX", isSignal: true, isRequired: false, transformFunction: null }, initialY: { classPropertyName: "initialY", publicName: "initialY", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, initialWidth: { classPropertyName: "initialWidth", publicName: "initialWidth", isSignal: true, isRequired: false, transformFunction: null }, initialHeight: { classPropertyName: "initialHeight", publicName: "initialHeight", isSignal: true, isRequired: false, transformFunction: null }, os: { classPropertyName: "os", publicName: "os", isSignal: true, isRequired: false, transformFunction: null }, chromeSize: { classPropertyName: "chromeSize", publicName: "chromeSize", isSignal: true, isRequired: false, transformFunction: null }, animations: { classPropertyName: "animations", publicName: "animations", isSignal: true, isRequired: false, transformFunction: null }, minWidth: { classPropertyName: "minWidth", publicName: "minWidth", isSignal: true, isRequired: false, transformFunction: null }, minHeight: { classPropertyName: "minHeight", publicName: "minHeight", isSignal: true, isRequired: false, transformFunction: null }, maxWidth: { classPropertyName: "maxWidth", publicName: "maxWidth", isSignal: true, isRequired: false, transformFunction: null }, maxHeight: { classPropertyName: "maxHeight", publicName: "maxHeight", isSignal: true, isRequired: false, transformFunction: null }, movable: { classPropertyName: "movable", publicName: "movable", isSignal: true, isRequired: false, transformFunction: null }, resizable: { classPropertyName: "resizable", publicName: "resizable", isSignal: true, isRequired: false, transformFunction: null }, keepInViewport: { classPropertyName: "keepInViewport", publicName: "keepInViewport", isSignal: true, isRequired: false, transformFunction: null }, snap: { classPropertyName: "snap", publicName: "snap", isSignal: true, isRequired: false, transformFunction: null }, dragHandle: { classPropertyName: "dragHandle", publicName: "dragHandle", isSignal: true, isRequired: false, transformFunction: null }, showMinimize: { classPropertyName: "showMinimize", publicName: "showMinimize", isSignal: true, isRequired: false, transformFunction: null }, showMaximize: { classPropertyName: "showMaximize", publicName: "showMaximize", isSignal: true, isRequired: false, transformFunction: null }, showClose: { classPropertyName: "showClose", publicName: "showClose", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { open: "openChange", state: "stateChange", closed: "closed", moved: "moved", resized: "resized" }, host: { attributes: { "role": "dialog" }, listeners: { "pointerdown": "focusWindow()" }, properties: { "class": "classes()", "style.left.px": "x()", "style.top.px": "y()", "style.width.px": "width()", "style.height.px": "height()", "style.z-index": "z()", "attr.aria-hidden": "!open()", "attr.aria-labelledby": "titleId" } }, ngImport: i0, template: "<div class=\"wr-window__chrome\" (pointerdown)=\"startMove($event)\" (dblclick)=\"showMaximize() && maximize()\">\n <div class=\"wr-window__title\" [attr.id]=\"titleId\">{{ title() }}</div>\n <div class=\"wr-window__title-extra\">\n <ng-content select=\"[wrWindowTitleExtra]\" />\n </div>\n\n <div class=\"wr-window__chrome-actions\">\n @if (resolvedOs() === 'macos') {\n <!-- macOS-style traffic-light cluster: close \u2192 minimize \u2192 maximize.\n Glyphs (\u00D7, \u2212, +) appear on cluster hover. -->\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"wr-window__chrome-action wr-window__chrome-action--close\"\n aria-label=\"Close\"\n (click)=\"close()\"\n >\n <svg class=\"wr-window__chrome-action-glyph\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path\n d=\"M2.2 2.2 L7.8 7.8 M7.8 2.2 L2.2 7.8\"\n stroke=\"currentColor\"\n stroke-width=\"1.4\"\n stroke-linecap=\"round\"\n />\n </svg>\n </button>\n }\n @if (showMinimize()) {\n <button\n type=\"button\"\n class=\"wr-window__chrome-action wr-window__chrome-action--minimize\"\n [attr.aria-label]=\"state() === 'minimized' ? 'Restore' : 'Minimize'\"\n (click)=\"minimize()\"\n >\n <svg class=\"wr-window__chrome-action-glyph\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <line x1=\"2\" y1=\"5\" x2=\"8\" y2=\"5\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n </svg>\n </button>\n }\n @if (showMaximize()) {\n <button\n type=\"button\"\n class=\"wr-window__chrome-action wr-window__chrome-action--maximize\"\n [attr.aria-label]=\"state() === 'maximized' ? 'Restore down' : 'Maximize'\"\n (click)=\"maximize()\"\n >\n <svg class=\"wr-window__chrome-action-glyph\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n @if (state() === 'maximized') {\n <path\n d=\"M3 1 L1 1 L1 3 M7 1 L9 1 L9 3 M1 7 L1 9 L3 9 M9 7 L9 9 L7 9\"\n stroke=\"currentColor\"\n stroke-width=\"1.4\"\n stroke-linecap=\"round\"\n fill=\"none\"\n />\n } @else {\n <path d=\"M2 5 L8 5 M5 2 L5 8\" stroke=\"currentColor\" stroke-width=\"1.4\" stroke-linecap=\"round\" />\n }\n </svg>\n </button>\n }\n } @else {\n <!-- Windows / Linux glyph buttons -->\n @if (resolvedOs() !== 'linux' && showMinimize()) {\n <button\n type=\"button\"\n class=\"wr-window__chrome-action wr-window__chrome-action--minimize\"\n [attr.aria-label]=\"state() === 'minimized' ? 'Restore' : 'Minimize'\"\n (click)=\"minimize()\"\n >\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <line x1=\"1\" y1=\"8\" x2=\"9\" y2=\"8\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n }\n\n @if (resolvedOs() !== 'linux' && showMaximize()) {\n <button\n type=\"button\"\n class=\"wr-window__chrome-action wr-window__chrome-action--maximize\"\n [attr.aria-label]=\"state() === 'maximized' ? 'Restore down' : 'Maximize'\"\n (click)=\"maximize()\"\n >\n @if (state() === 'maximized') {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <rect x=\"1.5\" y=\"2.5\" width=\"6\" height=\"6\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n <rect x=\"3\" y=\"1\" width=\"6\" height=\"6\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n </svg>\n } @else {\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <rect x=\"1\" y=\"1\" width=\"8\" height=\"8\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"1.2\" />\n </svg>\n }\n </button>\n }\n\n @if (showClose()) {\n <button\n type=\"button\"\n class=\"wr-window__chrome-action wr-window__chrome-action--close\"\n aria-label=\"Close\"\n (click)=\"close()\"\n >\n <svg width=\"10\" height=\"10\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M1 1 L9 9 M9 1 L1 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </button>\n }\n }\n </div>\n</div>\n\n<div class=\"wr-window__body\">\n <ng-content />\n</div>\n\n<div class=\"wr-window__status-bar\">\n <ng-content select=\"[wrWindowStatusBar]\" />\n</div>\n\n@if (resizable() && state() === 'normal') {\n <span class=\"wr-window__handle wr-window__handle--t\" (pointerdown)=\"resizeT($event)\"></span>\n <span class=\"wr-window__handle wr-window__handle--r\" (pointerdown)=\"resizeR($event)\"></span>\n <span class=\"wr-window__handle wr-window__handle--b\" (pointerdown)=\"resizeB($event)\"></span>\n <span class=\"wr-window__handle wr-window__handle--l\" (pointerdown)=\"resizeL($event)\"></span>\n <span class=\"wr-window__handle wr-window__handle--tl\" (pointerdown)=\"resizeTL($event)\"></span>\n <span class=\"wr-window__handle wr-window__handle--tr\" (pointerdown)=\"resizeTR($event)\"></span>\n <span class=\"wr-window__handle wr-window__handle--bl\" (pointerdown)=\"resizeBL($event)\"></span>\n <span class=\"wr-window__handle wr-window__handle--br\" (pointerdown)=\"resizeBR($event)\"></span>\n}\n", encapsulation: i0.ViewEncapsulation.None });
|
|
492
492
|
}
|
|
493
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
493
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindow, decorators: [{
|
|
494
494
|
type: Component,
|
|
495
495
|
args: [{ selector: 'wr-window', encapsulation: ViewEncapsulation.None, host: {
|
|
496
496
|
role: 'dialog',
|
|
@@ -565,7 +565,28 @@ class WrWindowContainer {
|
|
|
565
565
|
effect(() => this.ref._y.set(w.y()));
|
|
566
566
|
effect(() => this.ref._width.set(w.width()));
|
|
567
567
|
effect(() => this.ref._height.set(w.height()));
|
|
568
|
+
// Alongside the effective values, not instead of them: `saveLayout` needs
|
|
569
|
+
// the geometry a maximized or minimized window would go back to.
|
|
570
|
+
effect(() => this.ref._rawX.set(w.x_()));
|
|
571
|
+
effect(() => this.ref._rawY.set(w.y_()));
|
|
572
|
+
effect(() => this.ref._rawWidth.set(w.width_()));
|
|
573
|
+
effect(() => this.ref._rawHeight.set(w.height_()));
|
|
568
574
|
effect(() => this.ref._z.set(w.z()));
|
|
575
|
+
// The z-index has to land on the OVERLAY HOST, not only on `.wr-window`.
|
|
576
|
+
// Each window sits in its own CDK global wrapper, and that wrapper is
|
|
577
|
+
// `position: fixed` with a numeric `z-index` — which makes it a stacking
|
|
578
|
+
// context. A z-index written INSIDE it therefore only orders things
|
|
579
|
+
// against its own siblings, never against another window: the wrappers
|
|
580
|
+
// all carry the same z and stack by DOM order, so the most recently
|
|
581
|
+
// opened window painted on top for good. `bringToFront()` raised the
|
|
582
|
+
// number and nothing moved — measured in Chromium, `elementFromPoint` in
|
|
583
|
+
// the overlap kept returning the newer window after the older one's title
|
|
584
|
+
// bar was clicked.
|
|
585
|
+
effect(() => {
|
|
586
|
+
const host = this.ref._overlayRef?.hostElement;
|
|
587
|
+
if (host)
|
|
588
|
+
host.style.zIndex = String(w.z());
|
|
589
|
+
});
|
|
569
590
|
});
|
|
570
591
|
// 4. Seed the title signal from config.
|
|
571
592
|
this.ref._title.set(this.config.title ?? '');
|
|
@@ -640,10 +661,10 @@ class WrWindowContainer {
|
|
|
640
661
|
});
|
|
641
662
|
});
|
|
642
663
|
}
|
|
643
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
644
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
664
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindowContainer, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
665
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrWindowContainer, isStandalone: true, selector: "wr-window-container", viewQueries: [{ propertyName: "contentVcr", first: true, predicate: ["content"], descendants: true, read: ViewContainerRef, isSignal: true }, { propertyName: "wrWindow", first: true, predicate: WrWindow, descendants: true, isSignal: true }], ngImport: i0, template: "<wr-window\n [open]=\"true\"\n [title]=\"ref.title()\"\n [os]=\"config.os ?? 'auto'\"\n [size]=\"config.size ?? 'md'\"\n [chromeSize]=\"config.chromeSize ?? 'normal'\"\n [animations]=\"config.animations ?? true\"\n [initialX]=\"config.x ?? null\"\n [initialY]=\"config.y ?? null\"\n [initialWidth]=\"config.width ?? null\"\n [initialHeight]=\"config.height ?? null\"\n [minWidth]=\"config.minWidth ?? 220\"\n [minHeight]=\"config.minHeight ?? 140\"\n [maxWidth]=\"config.maxWidth ?? 1000000\"\n [maxHeight]=\"config.maxHeight ?? 1000000\"\n [movable]=\"config.movable ?? true\"\n [resizable]=\"config.resizable ?? true\"\n [keepInViewport]=\"config.keepInViewport ?? true\"\n [snap]=\"config.snap ?? 'none'\"\n [dragHandle]=\"config.dragHandle ?? null\"\n [showMinimize]=\"config.showMinimize ?? true\"\n [showMaximize]=\"config.showMaximize ?? true\"\n [showClose]=\"config.showClose ?? true\"\n (closed)=\"ref.close()\"\n #window\n>\n <ng-container #content />\n</wr-window>\n\n@if (window.snapTarget(); as target) {\n <div class=\"wr-window__snap-hint\" [attr.data-target]=\"target\" aria-hidden=\"true\"></div>\n}\n", dependencies: [{ kind: "component", type: WrWindow, selector: "wr-window", inputs: ["open", "state", "title", "initialX", "initialY", "size", "initialWidth", "initialHeight", "os", "chromeSize", "animations", "minWidth", "minHeight", "maxWidth", "maxHeight", "movable", "resizable", "keepInViewport", "snap", "dragHandle", "showMinimize", "showMaximize", "showClose"], outputs: ["openChange", "stateChange", "closed", "moved", "resized"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
645
666
|
}
|
|
646
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
667
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindowContainer, decorators: [{
|
|
647
668
|
type: Component,
|
|
648
669
|
args: [{ selector: 'wr-window-container', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, imports: [WrWindow], template: "<wr-window\n [open]=\"true\"\n [title]=\"ref.title()\"\n [os]=\"config.os ?? 'auto'\"\n [size]=\"config.size ?? 'md'\"\n [chromeSize]=\"config.chromeSize ?? 'normal'\"\n [animations]=\"config.animations ?? true\"\n [initialX]=\"config.x ?? null\"\n [initialY]=\"config.y ?? null\"\n [initialWidth]=\"config.width ?? null\"\n [initialHeight]=\"config.height ?? null\"\n [minWidth]=\"config.minWidth ?? 220\"\n [minHeight]=\"config.minHeight ?? 140\"\n [maxWidth]=\"config.maxWidth ?? 1000000\"\n [maxHeight]=\"config.maxHeight ?? 1000000\"\n [movable]=\"config.movable ?? true\"\n [resizable]=\"config.resizable ?? true\"\n [keepInViewport]=\"config.keepInViewport ?? true\"\n [snap]=\"config.snap ?? 'none'\"\n [dragHandle]=\"config.dragHandle ?? null\"\n [showMinimize]=\"config.showMinimize ?? true\"\n [showMaximize]=\"config.showMaximize ?? true\"\n [showClose]=\"config.showClose ?? true\"\n (closed)=\"ref.close()\"\n #window\n>\n <ng-container #content />\n</wr-window>\n\n@if (window.snapTarget(); as target) {\n <div class=\"wr-window__snap-hint\" [attr.data-target]=\"target\" aria-hidden=\"true\"></div>\n}\n" }]
|
|
649
670
|
}], ctorParameters: () => [], propDecorators: { contentVcr: [{ type: i0.ViewChild, args: ['content', { ...{ read: ViewContainerRef }, isSignal: true }] }], wrWindow: [{ type: i0.ViewChild, args: [i0.forwardRef(() => WrWindow), { isSignal: true }] }] } });
|
|
@@ -682,7 +703,15 @@ class WrWindowRef {
|
|
|
682
703
|
/** Stable id — used by the taskbar, workspace save, and DI. */
|
|
683
704
|
id;
|
|
684
705
|
/** @internal — emits the close result once and completes. */
|
|
685
|
-
|
|
706
|
+
/**
|
|
707
|
+
* A `ReplaySubject`, not a plain `Subject`, so the result survives a late
|
|
708
|
+
* subscriber — the same reasoning `WrDialogRef` already carries. A caller
|
|
709
|
+
* that holds the ref and awaits `afterClosed()` after any intervening
|
|
710
|
+
* `await` subscribes to an already-completed stream, and a plain Subject
|
|
711
|
+
* hands it nothing but `complete`: the promise resolved `undefined` and a
|
|
712
|
+
* saved result was indistinguishable from a dismissal.
|
|
713
|
+
*/
|
|
714
|
+
_closed = new ReplaySubject(1);
|
|
686
715
|
/** @internal — emits whenever the visual state changes. */
|
|
687
716
|
_stateChanged = new Subject();
|
|
688
717
|
/** @internal — set by the container right after attach. */
|
|
@@ -708,6 +737,23 @@ class WrWindowRef {
|
|
|
708
737
|
...(ngDevMode ? [{ debugName: "_height" }] : /* istanbul ignore next */ []));
|
|
709
738
|
/** @internal */ _z = signal(0, /* @ts-ignore */
|
|
710
739
|
...(ngDevMode ? [{ debugName: "_z" }] : /* istanbul ignore next */ []));
|
|
740
|
+
/**
|
|
741
|
+
* The geometry the USER chose, as opposed to the one the current state
|
|
742
|
+
* imposes. `_x` and friends mirror the window's EFFECTIVE values — a
|
|
743
|
+
* maximized window reports the viewport, a minimized one reports its
|
|
744
|
+
* collapsed header height — which is right for anything drawing the window
|
|
745
|
+
* and wrong for anything persisting it.
|
|
746
|
+
*
|
|
747
|
+
* @internal
|
|
748
|
+
*/
|
|
749
|
+
_rawX = signal(0, /* @ts-ignore */
|
|
750
|
+
...(ngDevMode ? [{ debugName: "_rawX" }] : /* istanbul ignore next */ []));
|
|
751
|
+
/** @internal */ _rawY = signal(0, /* @ts-ignore */
|
|
752
|
+
...(ngDevMode ? [{ debugName: "_rawY" }] : /* istanbul ignore next */ []));
|
|
753
|
+
/** @internal */ _rawWidth = signal(0, /* @ts-ignore */
|
|
754
|
+
...(ngDevMode ? [{ debugName: "_rawWidth" }] : /* istanbul ignore next */ []));
|
|
755
|
+
/** @internal */ _rawHeight = signal(0, /* @ts-ignore */
|
|
756
|
+
...(ngDevMode ? [{ debugName: "_rawHeight" }] : /* istanbul ignore next */ []));
|
|
711
757
|
/** @internal */ _title = signal('', /* @ts-ignore */
|
|
712
758
|
...(ngDevMode ? [{ debugName: "_title" }] : /* istanbul ignore next */ []));
|
|
713
759
|
/** Window state. */
|
|
@@ -916,6 +962,15 @@ class WrWindowManager {
|
|
|
916
962
|
positionStrategy: this.overlay.position().global(),
|
|
917
963
|
panelClass: 'wr-window-overlay',
|
|
918
964
|
hasBackdrop: false,
|
|
965
|
+
// OUT of the top layer, deliberately. The CDK puts overlay hosts there by
|
|
966
|
+
// default (`popover="manual"`), and the top layer orders strictly by
|
|
967
|
+
// ENTRY: whatever opened last paints on top and no z-index can change it.
|
|
968
|
+
// That is right for a menu or a modal and exactly wrong for a window
|
|
969
|
+
// manager, whose whole job is letting the user decide which window is in
|
|
970
|
+
// front. It also fixes the ordering against modals: a dialog stays in the
|
|
971
|
+
// top layer, so it now sits above every window instead of below whichever
|
|
972
|
+
// window happened to open after it.
|
|
973
|
+
usePopover: false,
|
|
919
974
|
});
|
|
920
975
|
const id = config.id ?? randomId('wr-window');
|
|
921
976
|
const ref = new WrWindowRef(id, overlayRef);
|
|
@@ -1000,13 +1055,20 @@ class WrWindowManager {
|
|
|
1000
1055
|
* matching components.
|
|
1001
1056
|
*/
|
|
1002
1057
|
saveLayout(name) {
|
|
1058
|
+
// The RAW geometry, not the live one. `ref.x()` / `ref.width()` report what
|
|
1059
|
+
// is on screen — a maximized window measures the viewport, a minimized one
|
|
1060
|
+
// measures its collapsed header — so saving those threw away the size the
|
|
1061
|
+
// user actually chose. Restoring then re-maximized over viewport-sized
|
|
1062
|
+
// "restore" geometry, and "Restore down" left the window filling the screen
|
|
1063
|
+
// with no way back; a minimized window came back from the taskbar as a stub
|
|
1064
|
+
// clamped to `minHeight`. The window knows the real numbers all along.
|
|
1003
1065
|
const snapshot = this._windows().map(ref => ({
|
|
1004
1066
|
id: ref.id,
|
|
1005
1067
|
state: ref.state(),
|
|
1006
|
-
x: ref.
|
|
1007
|
-
y: ref.
|
|
1008
|
-
width: ref.
|
|
1009
|
-
height: ref.
|
|
1068
|
+
x: ref._rawX(),
|
|
1069
|
+
y: ref._rawY(),
|
|
1070
|
+
width: ref._rawWidth(),
|
|
1071
|
+
height: ref._rawHeight(),
|
|
1010
1072
|
title: ref.title(),
|
|
1011
1073
|
}));
|
|
1012
1074
|
this.storage.set(this.layoutKey(name), snapshot);
|
|
@@ -1074,10 +1136,10 @@ class WrWindowManager {
|
|
|
1074
1136
|
clearLayout(name) {
|
|
1075
1137
|
this.storage.remove(this.layoutKey(name));
|
|
1076
1138
|
}
|
|
1077
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
1078
|
-
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.
|
|
1139
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindowManager, deps: [], target: i0.ɵɵFactoryTarget.Service });
|
|
1140
|
+
static ɵprov = i0.ɵɵngDeclareService({ minVersion: "22.0.0", version: "22.1.1", ngImport: i0, type: WrWindowManager });
|
|
1079
1141
|
}
|
|
1080
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
1142
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindowManager, decorators: [{
|
|
1081
1143
|
type: Service
|
|
1082
1144
|
}] });
|
|
1083
1145
|
|
|
@@ -1122,10 +1184,10 @@ class WrWindowTaskbar {
|
|
|
1122
1184
|
event.stopPropagation();
|
|
1123
1185
|
void ref.close();
|
|
1124
1186
|
}
|
|
1125
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.
|
|
1126
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.
|
|
1187
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindowTaskbar, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1188
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.1", type: WrWindowTaskbar, isStandalone: true, selector: "wr-window-taskbar", inputs: { position: { classPropertyName: "position", publicName: "position", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "role": "toolbar", "aria-label": "Minimized windows" }, properties: { "class": "classes()" } }, ngImport: i0, template: "@if (items().length > 0) {\n <div class=\"wr-window-taskbar__rail\">\n @for (ref of items(); track ref.id) {\n <button\n type=\"button\"\n class=\"wr-window-taskbar__tab\"\n [attr.aria-label]=\"`Restore ${ref.title() || 'Untitled'}`\"\n (click)=\"restore(ref)\"\n >\n <span class=\"wr-window-taskbar__tab-title\">{{ ref.title() || 'Untitled' }}</span>\n <span\n class=\"wr-window-taskbar__tab-close\"\n role=\"button\"\n tabindex=\"0\"\n aria-label=\"Close window\"\n (click)=\"close(ref, $event)\"\n (keydown.enter)=\"close(ref, $event)\"\n >\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M1 1 L9 9 M9 1 L1 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </span>\n </button>\n }\n </div>\n}\n", changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None });
|
|
1127
1189
|
}
|
|
1128
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.
|
|
1190
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.1", ngImport: i0, type: WrWindowTaskbar, decorators: [{
|
|
1129
1191
|
type: Component,
|
|
1130
1192
|
args: [{ selector: 'wr-window-taskbar', changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, host: { '[class]': 'classes()', role: 'toolbar', 'aria-label': 'Minimized windows' }, template: "@if (items().length > 0) {\n <div class=\"wr-window-taskbar__rail\">\n @for (ref of items(); track ref.id) {\n <button\n type=\"button\"\n class=\"wr-window-taskbar__tab\"\n [attr.aria-label]=\"`Restore ${ref.title() || 'Untitled'}`\"\n (click)=\"restore(ref)\"\n >\n <span class=\"wr-window-taskbar__tab-title\">{{ ref.title() || 'Untitled' }}</span>\n <span\n class=\"wr-window-taskbar__tab-close\"\n role=\"button\"\n tabindex=\"0\"\n aria-label=\"Close window\"\n (click)=\"close(ref, $event)\"\n (keydown.enter)=\"close(ref, $event)\"\n >\n <svg width=\"9\" height=\"9\" viewBox=\"0 0 10 10\" aria-hidden=\"true\">\n <path d=\"M1 1 L9 9 M9 1 L1 9\" stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\" />\n </svg>\n </span>\n </button>\n }\n </div>\n}\n" }]
|
|
1131
1193
|
}], propDecorators: { position: [{ type: i0.Input, args: [{ isSignal: true, alias: "position", required: false }] }] } });
|