@origostudio/origo-design 0.0.56 → 0.0.57
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/CHANGELOG.md +3 -4
- package/dist/packages/angular-renderer/CHANGELOG.md +11 -0
- package/dist/packages/angular-renderer/package.json +3 -3
- package/dist/packages/angular-renderer/src/components/primitives/alert/alert.component.d.ts +92 -0
- package/dist/packages/angular-renderer/src/components/primitives/alert/alert.component.js +137 -0
- package/dist/packages/angular-renderer/src/components/primitives/alert/alert.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/banner/banner.component.d.ts +99 -0
- package/dist/packages/angular-renderer/src/components/primitives/banner/banner.component.js +140 -0
- package/dist/packages/angular-renderer/src/components/primitives/banner/banner.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/popover/popover.component.d.ts +1 -1
- package/dist/packages/angular-renderer/src/components/primitives/snackbar/snackbar.component.d.ts +90 -0
- package/dist/packages/angular-renderer/src/components/primitives/snackbar/snackbar.component.js +214 -0
- package/dist/packages/angular-renderer/src/components/primitives/snackbar/snackbar.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.component.d.ts +70 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.component.js +318 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.models.d.ts +58 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.models.js +24 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.models.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.service.d.ts +11 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.service.js +69 -0
- package/dist/packages/angular-renderer/src/components/primitives/toast/toast.service.js.map +1 -0
- package/dist/packages/angular-renderer/src/index.d.ts +6 -0
- package/dist/packages/angular-renderer/src/index.js +6 -0
- package/dist/packages/angular-renderer/src/index.js.map +1 -1
- package/dist/packages/angular-renderer/src/lib/overlay/overlay.models.d.ts +1 -1
- package/dist/packages/angular-renderer/src/lib/overlay/overlay.service.js +54 -0
- package/dist/packages/angular-renderer/src/lib/overlay/overlay.service.js.map +1 -1
- package/dist/packages/angular-renderer/src/lib/primitives.provider.js +9 -0
- package/dist/packages/angular-renderer/src/lib/primitives.provider.js.map +1 -1
- package/dist/packages/cli/CHANGELOG.md +4 -0
- package/dist/packages/cli/package.json +2 -2
- package/dist/packages/cli/package.json.bak +2 -2
- package/dist/packages/core/CHANGELOG.md +4 -0
- package/dist/packages/core/package.json +1 -1
- package/dist/packages/core/package.json.bak +1 -1
- package/dist/packages/design-tokens/CHANGELOG.md +4 -0
- package/dist/packages/design-tokens/package.json +1 -1
- package/dist/packages/playground/browser/{chunk-DiYrE5js.js → chunk-6bHgkN4C.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BQzQEZtb.js → chunk-B-3kt7Wr.js} +1 -1
- package/dist/packages/playground/browser/{chunk-CVI627RV.js → chunk-BCLERDSo.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BJUlPnGj.js → chunk-BrnSLsyV.js} +1 -1
- package/dist/packages/playground/browser/{chunk-CKodZfQB.js → chunk-BvUCxmM0.js} +1 -1
- package/dist/packages/playground/browser/{chunk-YNHZb2Tp.js → chunk-BxLGO71C.js} +1 -1
- package/dist/packages/playground/browser/{chunk-99Z1ZSho.js → chunk-C5XVtbME.js} +1 -1
- package/dist/packages/playground/browser/{chunk-1EpKMVqg.js → chunk-CTTaxHaO.js} +1 -1
- package/dist/packages/playground/browser/{chunk-Dq1v5PE5.js → chunk-Ch_QEFhD.js} +1 -1
- package/dist/packages/playground/browser/{chunk-D9WDO3Mq.js → chunk-D5sCopgc.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BhCIuVBX.js → chunk-Dovts48g.js} +1 -1
- package/dist/packages/playground/browser/{chunk-DFbzJcTS.js → chunk-Xs7vKdpW.js} +1 -1
- package/dist/packages/playground/browser/{chunk-ClkrBRsl.js → chunk-a7RvErrz.js} +1 -1
- package/dist/packages/playground/browser/{chunk-DyacuCzl.js → chunk-cyLDjJx7.js} +1 -1
- package/dist/packages/playground/browser/{chunk-B6I7DcL1.js → chunk-zG1F-IYa.js} +1 -1
- package/dist/packages/playground/browser/index.html +1 -1
- package/dist/packages/playground/browser/main-G2CZZD2X.js +898 -0
- package/package.json +1 -1
- package/packages/angular-renderer/CHANGELOG.md +11 -0
- package/packages/angular-renderer/package.json +3 -3
- package/packages/angular-renderer/src/components/primitives/alert/alert.component.html +97 -0
- package/packages/angular-renderer/src/components/primitives/alert/alert.component.scss +202 -0
- package/packages/angular-renderer/src/components/primitives/alert/alert.component.ts +184 -0
- package/packages/angular-renderer/src/components/primitives/banner/banner.component.html +102 -0
- package/packages/angular-renderer/src/components/primitives/banner/banner.component.scss +209 -0
- package/packages/angular-renderer/src/components/primitives/banner/banner.component.ts +190 -0
- package/packages/angular-renderer/src/components/primitives/snackbar/snackbar.component.html +38 -0
- package/packages/angular-renderer/src/components/primitives/snackbar/snackbar.component.scss +119 -0
- package/packages/angular-renderer/src/components/primitives/snackbar/snackbar.component.ts +265 -0
- package/packages/angular-renderer/src/components/primitives/toast/toast.component.html +92 -0
- package/packages/angular-renderer/src/components/primitives/toast/toast.component.scss +152 -0
- package/packages/angular-renderer/src/components/primitives/toast/toast.component.ts +370 -0
- package/packages/angular-renderer/src/components/primitives/toast/toast.models.ts +71 -0
- package/packages/angular-renderer/src/components/primitives/toast/toast.service.ts +64 -0
- package/packages/angular-renderer/src/index.ts +6 -0
- package/packages/angular-renderer/src/lib/overlay/overlay.models.ts +16 -1
- package/packages/angular-renderer/src/lib/overlay/overlay.service.ts +50 -0
- package/packages/angular-renderer/src/lib/primitives.provider.ts +9 -0
- package/packages/angular-renderer/src/styles/overlay.scss +30 -0
- package/packages/cli/CHANGELOG.md +4 -0
- package/packages/cli/package.json +2 -2
- package/packages/core/CHANGELOG.md +4 -0
- package/packages/core/package.json +1 -1
- package/packages/design-tokens/CHANGELOG.md +4 -0
- package/packages/design-tokens/package.json +1 -1
- package/packages/devtools/CHANGELOG.md +4 -0
- package/packages/devtools/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/packages/devtools/package.json +3 -3
- package/packages/playground/CHANGELOG.md +4 -0
- package/packages/playground/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/packages/playground/package.json +3 -3
- package/dist/packages/playground/browser/main-LRA6JC6Y.js +0 -894
package/CHANGELOG.md
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
|
-
## 0.0.
|
|
1
|
+
## 0.0.57 (2026-10-15)
|
|
2
2
|
|
|
3
3
|
### 🚀 Features
|
|
4
4
|
|
|
5
|
-
-
|
|
6
|
-
- implement
|
|
7
|
-
- implement modal and overlay primitives including dialog, drawer, popover, and tooltip components ([ca3030d](https://github.com/OrigoStudio/origo-design/commit/ca3030d))
|
|
5
|
+
- add angular primitive components including overlays, dialogs, and notifications ([9c962b8](https://github.com/OrigoStudio/origo-design/commit/9c962b8))
|
|
6
|
+
- implement messaging and notification primitive components in angular-renderer ([84687eb](https://github.com/OrigoStudio/origo-design/commit/84687eb))
|
|
8
7
|
|
|
9
8
|
### ❤️ Thank You
|
|
10
9
|
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
## 0.0.57 (2026-10-15)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- implement messaging and notification primitive components in angular-renderer ([84687eb](https://github.com/OrigoStudio/origo-design/commit/84687eb))
|
|
6
|
+
- add angular primitive components including overlays, dialogs, and notifications ([9c962b8](https://github.com/OrigoStudio/origo-design/commit/9c962b8))
|
|
7
|
+
|
|
8
|
+
### ❤️ Thank You
|
|
9
|
+
|
|
10
|
+
- Hardik Patel @hardikpatelse
|
|
11
|
+
|
|
1
12
|
## 0.0.56 (2026-10-13)
|
|
2
13
|
|
|
3
14
|
### 🚀 Features
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origostudio/angular-renderer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.57",
|
|
4
4
|
"private": false,
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"main": "./dist/index.js",
|
|
7
7
|
"types": "./dist/index.d.ts",
|
|
8
8
|
"dependencies": {
|
|
9
|
-
"@origostudio/core": "0.0.
|
|
10
|
-
"@origostudio/design-tokens": "0.0.
|
|
9
|
+
"@origostudio/core": "0.0.57",
|
|
10
|
+
"@origostudio/design-tokens": "0.0.57",
|
|
11
11
|
"tslib": "^2.3.0",
|
|
12
12
|
"@analogjs/vite-plugin-angular": "^2.7.1",
|
|
13
13
|
"zone.js": "^0.16.3",
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { InteractionContract } from '@origostudio/core';
|
|
3
|
+
import { OrigoAdapter, ContainerComponent } from '../../../adapters/web/adapter';
|
|
4
|
+
export interface AlertAction {
|
|
5
|
+
label: string;
|
|
6
|
+
action: string;
|
|
7
|
+
variant?: 'primary' | 'secondary' | 'text' | string;
|
|
8
|
+
}
|
|
9
|
+
export interface AlertProps {
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
severity?: 'info' | 'success' | 'warn' | 'warning' | 'error';
|
|
12
|
+
title?: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
text?: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
variant?: 'standard' | 'outlined' | 'filled';
|
|
18
|
+
actions?: AlertAction[];
|
|
19
|
+
life?: number;
|
|
20
|
+
permissions?: Record<string, string>;
|
|
21
|
+
rules?: Record<string, unknown>;
|
|
22
|
+
metadata?: Record<string, unknown>;
|
|
23
|
+
'aria-label'?: string;
|
|
24
|
+
'aria-describedby'?: string;
|
|
25
|
+
}
|
|
26
|
+
export declare const AlertContractSchema: {
|
|
27
|
+
readonly visible: "boolean";
|
|
28
|
+
readonly severity: "string";
|
|
29
|
+
readonly title: "string";
|
|
30
|
+
readonly message: "string";
|
|
31
|
+
readonly text: "string";
|
|
32
|
+
readonly icon: "string";
|
|
33
|
+
readonly closable: "boolean";
|
|
34
|
+
readonly variant: "string";
|
|
35
|
+
readonly actions: "array";
|
|
36
|
+
readonly life: "number";
|
|
37
|
+
readonly permissions: "object";
|
|
38
|
+
readonly rules: "object";
|
|
39
|
+
readonly metadata: "object";
|
|
40
|
+
readonly 'aria-label': "string";
|
|
41
|
+
readonly 'aria-describedby': "string";
|
|
42
|
+
};
|
|
43
|
+
export declare class AlertComponent implements OrigoAdapter<AlertProps>, ContainerComponent {
|
|
44
|
+
static readonly contractSchema: {
|
|
45
|
+
readonly visible: "boolean";
|
|
46
|
+
readonly severity: "string";
|
|
47
|
+
readonly title: "string";
|
|
48
|
+
readonly message: "string";
|
|
49
|
+
readonly text: "string";
|
|
50
|
+
readonly icon: "string";
|
|
51
|
+
readonly closable: "boolean";
|
|
52
|
+
readonly variant: "string";
|
|
53
|
+
readonly actions: "array";
|
|
54
|
+
readonly life: "number";
|
|
55
|
+
readonly permissions: "object";
|
|
56
|
+
readonly rules: "object";
|
|
57
|
+
readonly metadata: "object";
|
|
58
|
+
readonly 'aria-label': "string";
|
|
59
|
+
readonly 'aria-describedby': "string";
|
|
60
|
+
};
|
|
61
|
+
static readonly strictContract = false;
|
|
62
|
+
contract: import("@angular/core").InputSignal<InteractionContract<AlertProps>>;
|
|
63
|
+
vc: import("@angular/core").Signal<ViewContainerRef | undefined>;
|
|
64
|
+
close: import("@angular/core").OutputEmitterRef<void>;
|
|
65
|
+
action: import("@angular/core").OutputEmitterRef<{
|
|
66
|
+
action: string;
|
|
67
|
+
data?: unknown;
|
|
68
|
+
}>;
|
|
69
|
+
visibleChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
70
|
+
private experienceAdapter;
|
|
71
|
+
private destroyRef;
|
|
72
|
+
private platformId;
|
|
73
|
+
private autoDismissTimer;
|
|
74
|
+
private readonly manuallyClosed;
|
|
75
|
+
readonly isVisible: import("@angular/core").Signal<boolean>;
|
|
76
|
+
readonly coercedProps: import("@angular/core").Signal<AlertProps>;
|
|
77
|
+
readonly normalizedSeverity: import("@angular/core").Signal<"info" | "success" | "warning" | "error">;
|
|
78
|
+
readonly computedVariant: import("@angular/core").Signal<"outlined" | "filled" | "standard">;
|
|
79
|
+
readonly computedTitle: import("@angular/core").Signal<string | undefined>;
|
|
80
|
+
readonly computedMessage: import("@angular/core").Signal<string>;
|
|
81
|
+
readonly isClosable: import("@angular/core").Signal<boolean>;
|
|
82
|
+
readonly actions: import("@angular/core").Signal<AlertAction[]>;
|
|
83
|
+
readonly customIcon: import("@angular/core").Signal<string | undefined>;
|
|
84
|
+
readonly role: import("@angular/core").Signal<"alert" | "status">;
|
|
85
|
+
readonly ariaLive: import("@angular/core").Signal<"assertive" | "polite">;
|
|
86
|
+
readonly ariaLabel: import("@angular/core").Signal<string | undefined>;
|
|
87
|
+
readonly ariaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
88
|
+
constructor();
|
|
89
|
+
private clearTimer;
|
|
90
|
+
onClose(): void;
|
|
91
|
+
onActionClick(act: AlertAction): void;
|
|
92
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AlertComponent = exports.AlertContractSchema = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const common_1 = require("@angular/common");
|
|
7
|
+
const adapter_1 = require("../../../adapters/web/adapter");
|
|
8
|
+
const experience_adapter_service_1 = require("../../../adapters/web/experience-adapter.service");
|
|
9
|
+
exports.AlertContractSchema = {
|
|
10
|
+
visible: 'boolean',
|
|
11
|
+
severity: 'string',
|
|
12
|
+
title: 'string',
|
|
13
|
+
message: 'string',
|
|
14
|
+
text: 'string',
|
|
15
|
+
icon: 'string',
|
|
16
|
+
closable: 'boolean',
|
|
17
|
+
variant: 'string',
|
|
18
|
+
actions: 'array',
|
|
19
|
+
life: 'number',
|
|
20
|
+
permissions: 'object',
|
|
21
|
+
rules: 'object',
|
|
22
|
+
metadata: 'object',
|
|
23
|
+
'aria-label': 'string',
|
|
24
|
+
'aria-describedby': 'string',
|
|
25
|
+
};
|
|
26
|
+
let AlertComponent = (() => {
|
|
27
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
28
|
+
selector: 'origo-alert',
|
|
29
|
+
standalone: true,
|
|
30
|
+
imports: [common_1.CommonModule],
|
|
31
|
+
templateUrl: './alert.component.html',
|
|
32
|
+
styleUrls: ['./alert.component.scss'],
|
|
33
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
34
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
35
|
+
host: {
|
|
36
|
+
'[class.origo-alert-host]': 'true',
|
|
37
|
+
'[attr.data-testid]': 'contract().id',
|
|
38
|
+
'[class.origo-alert--hidden]': '!isVisible()',
|
|
39
|
+
},
|
|
40
|
+
})];
|
|
41
|
+
let _classDescriptor;
|
|
42
|
+
let _classExtraInitializers = [];
|
|
43
|
+
let _classThis;
|
|
44
|
+
var AlertComponent = class {
|
|
45
|
+
static { _classThis = this; }
|
|
46
|
+
static {
|
|
47
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
48
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
49
|
+
AlertComponent = _classThis = _classDescriptor.value;
|
|
50
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
51
|
+
}
|
|
52
|
+
static contractSchema = exports.AlertContractSchema;
|
|
53
|
+
static strictContract = false;
|
|
54
|
+
contract = core_1.input.required();
|
|
55
|
+
vc = (0, core_1.viewChild)('vc', { read: core_1.ViewContainerRef });
|
|
56
|
+
close = (0, core_1.output)();
|
|
57
|
+
action = (0, core_1.output)();
|
|
58
|
+
visibleChange = (0, core_1.output)();
|
|
59
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService);
|
|
60
|
+
destroyRef = (0, core_1.inject)(core_1.DestroyRef);
|
|
61
|
+
platformId = (0, core_1.inject)(core_1.PLATFORM_ID);
|
|
62
|
+
autoDismissTimer = null;
|
|
63
|
+
manuallyClosed = (0, core_1.signal)(false);
|
|
64
|
+
isVisible = (0, core_1.computed)(() => {
|
|
65
|
+
if (this.manuallyClosed())
|
|
66
|
+
return false;
|
|
67
|
+
return this.coercedProps().visible !== false;
|
|
68
|
+
});
|
|
69
|
+
coercedProps = (0, core_1.computed)(() => (0, adapter_1.coerceContractProps)(this.contract()?.props, exports.AlertContractSchema));
|
|
70
|
+
normalizedSeverity = (0, core_1.computed)(() => {
|
|
71
|
+
const sev = this.coercedProps().severity?.toLowerCase();
|
|
72
|
+
if (sev === 'warn' || sev === 'warning')
|
|
73
|
+
return 'warning';
|
|
74
|
+
if (sev === 'error')
|
|
75
|
+
return 'error';
|
|
76
|
+
if (sev === 'success')
|
|
77
|
+
return 'success';
|
|
78
|
+
return 'info';
|
|
79
|
+
});
|
|
80
|
+
computedVariant = (0, core_1.computed)(() => this.coercedProps().variant || 'standard');
|
|
81
|
+
computedTitle = (0, core_1.computed)(() => this.coercedProps().title);
|
|
82
|
+
computedMessage = (0, core_1.computed)(() => this.coercedProps().message ?? this.coercedProps().text ?? '');
|
|
83
|
+
isClosable = (0, core_1.computed)(() => this.coercedProps().closable === true);
|
|
84
|
+
actions = (0, core_1.computed)(() => this.coercedProps().actions ?? []);
|
|
85
|
+
customIcon = (0, core_1.computed)(() => this.coercedProps().icon);
|
|
86
|
+
role = (0, core_1.computed)(() => {
|
|
87
|
+
const sev = this.normalizedSeverity();
|
|
88
|
+
return sev === 'error' || sev === 'warning' ? 'alert' : 'status';
|
|
89
|
+
});
|
|
90
|
+
ariaLive = (0, core_1.computed)(() => {
|
|
91
|
+
const sev = this.normalizedSeverity();
|
|
92
|
+
return sev === 'error' || sev === 'warning' ? 'assertive' : 'polite';
|
|
93
|
+
});
|
|
94
|
+
ariaLabel = (0, core_1.computed)(() => this.coercedProps()['aria-label']);
|
|
95
|
+
ariaDescribedBy = (0, core_1.computed)(() => this.coercedProps()['aria-describedby']);
|
|
96
|
+
constructor() {
|
|
97
|
+
this.destroyRef.onDestroy(() => this.clearTimer());
|
|
98
|
+
(0, core_1.effect)(() => {
|
|
99
|
+
const props = this.coercedProps();
|
|
100
|
+
const contractVisible = props.visible !== false;
|
|
101
|
+
this.clearTimer();
|
|
102
|
+
if (contractVisible && props.life && props.life > 0 && (0, common_1.isPlatformBrowser)(this.platformId)) {
|
|
103
|
+
this.autoDismissTimer = setTimeout(() => {
|
|
104
|
+
this.onClose();
|
|
105
|
+
}, props.life);
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
clearTimer() {
|
|
110
|
+
if (this.autoDismissTimer) {
|
|
111
|
+
clearTimeout(this.autoDismissTimer);
|
|
112
|
+
this.autoDismissTimer = null;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
onClose() {
|
|
116
|
+
this.clearTimer();
|
|
117
|
+
this.manuallyClosed.set(true);
|
|
118
|
+
this.visibleChange.emit(false);
|
|
119
|
+
this.close.emit();
|
|
120
|
+
if (this.contract()?.id) {
|
|
121
|
+
this.experienceAdapter.updateState(this.contract().id, 'visible', false);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
onActionClick(act) {
|
|
125
|
+
this.action.emit({ action: act.action, data: act });
|
|
126
|
+
if (this.contract()?.id) {
|
|
127
|
+
this.experienceAdapter.dispatchCapability(this.contract().id, act.action, act);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
static {
|
|
131
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
return AlertComponent = _classThis;
|
|
135
|
+
})();
|
|
136
|
+
exports.AlertComponent = AlertComponent;
|
|
137
|
+
//# sourceMappingURL=alert.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"alert.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/alert/alert.component.ts"],"names":[],"mappings":";;;;AAAA,wCAcuB;AACvB,4CAAkE;AAElE,2DAIuC;AACvC,iGAA+F;AA0BlF,QAAA,mBAAmB,GAAG;IACjC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,SAAS;IACnB,OAAO,EAAE,QAAQ;IACjB,OAAO,EAAE,OAAO;IAChB,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,QAAQ;IACf,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,QAAQ;IACtB,kBAAkB,EAAE,QAAQ;CACpB,CAAC;IAgBE,cAAc;4BAd1B,IAAA,gBAAS,EAAC;YACT,QAAQ,EAAE,aAAa;YACvB,UAAU,EAAE,IAAI;YAChB,OAAO,EAAE,CAAC,qBAAY,CAAC;YACvB,WAAW,EAAE,wBAAwB;YACrC,SAAS,EAAE,CAAC,wBAAwB,CAAC;YACrC,eAAe,EAAE,8BAAuB,CAAC,MAAM;YAC/C,aAAa,EAAE,wBAAiB,CAAC,SAAS;YAC1C,IAAI,EAAE;gBACJ,0BAA0B,EAAE,MAAM;gBAClC,oBAAoB,EAAE,eAAe;gBACrC,6BAA6B,EAAE,cAAc;aAC9C;SACF,CAAC;;;;;;;;YACF,qLAuGC;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9B,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;YAC/B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAClB,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;gBACxB,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;YAC3E,CAAC;QACH,CAAC;QAED,aAAa,CAAC,GAAgB;YAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAC;YACpD,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;gBACxB,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;;YAtGU,+DAAc;;;;;AAAd,wCAAc"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import { ViewContainerRef } from '@angular/core';
|
|
2
|
+
import { InteractionContract } from '@origostudio/core';
|
|
3
|
+
import { OrigoAdapter, ContainerComponent } from '../../../adapters/web/adapter';
|
|
4
|
+
export interface BannerAction {
|
|
5
|
+
label: string;
|
|
6
|
+
action: string;
|
|
7
|
+
variant?: 'primary' | 'secondary' | 'text' | string;
|
|
8
|
+
}
|
|
9
|
+
export interface BannerProps {
|
|
10
|
+
visible?: boolean;
|
|
11
|
+
severity?: 'info' | 'success' | 'warn' | 'warning' | 'error';
|
|
12
|
+
title?: string;
|
|
13
|
+
message?: string;
|
|
14
|
+
text?: string;
|
|
15
|
+
icon?: string;
|
|
16
|
+
closable?: boolean;
|
|
17
|
+
sticky?: boolean;
|
|
18
|
+
fluid?: boolean;
|
|
19
|
+
variant?: 'standard' | 'outlined' | 'filled';
|
|
20
|
+
actions?: BannerAction[];
|
|
21
|
+
life?: number;
|
|
22
|
+
permissions?: Record<string, string>;
|
|
23
|
+
rules?: Record<string, unknown>;
|
|
24
|
+
metadata?: Record<string, unknown>;
|
|
25
|
+
'aria-label'?: string;
|
|
26
|
+
'aria-describedby'?: string;
|
|
27
|
+
}
|
|
28
|
+
export declare const BannerContractSchema: {
|
|
29
|
+
readonly visible: "boolean";
|
|
30
|
+
readonly severity: "string";
|
|
31
|
+
readonly title: "string";
|
|
32
|
+
readonly message: "string";
|
|
33
|
+
readonly text: "string";
|
|
34
|
+
readonly icon: "string";
|
|
35
|
+
readonly closable: "boolean";
|
|
36
|
+
readonly sticky: "boolean";
|
|
37
|
+
readonly fluid: "boolean";
|
|
38
|
+
readonly variant: "string";
|
|
39
|
+
readonly actions: "array";
|
|
40
|
+
readonly life: "number";
|
|
41
|
+
readonly permissions: "object";
|
|
42
|
+
readonly rules: "object";
|
|
43
|
+
readonly metadata: "object";
|
|
44
|
+
readonly 'aria-label': "string";
|
|
45
|
+
readonly 'aria-describedby': "string";
|
|
46
|
+
};
|
|
47
|
+
export declare class BannerComponent implements OrigoAdapter<BannerProps>, ContainerComponent {
|
|
48
|
+
static readonly contractSchema: {
|
|
49
|
+
readonly visible: "boolean";
|
|
50
|
+
readonly severity: "string";
|
|
51
|
+
readonly title: "string";
|
|
52
|
+
readonly message: "string";
|
|
53
|
+
readonly text: "string";
|
|
54
|
+
readonly icon: "string";
|
|
55
|
+
readonly closable: "boolean";
|
|
56
|
+
readonly sticky: "boolean";
|
|
57
|
+
readonly fluid: "boolean";
|
|
58
|
+
readonly variant: "string";
|
|
59
|
+
readonly actions: "array";
|
|
60
|
+
readonly life: "number";
|
|
61
|
+
readonly permissions: "object";
|
|
62
|
+
readonly rules: "object";
|
|
63
|
+
readonly metadata: "object";
|
|
64
|
+
readonly 'aria-label': "string";
|
|
65
|
+
readonly 'aria-describedby': "string";
|
|
66
|
+
};
|
|
67
|
+
static readonly strictContract = false;
|
|
68
|
+
contract: import("@angular/core").InputSignal<InteractionContract<BannerProps>>;
|
|
69
|
+
vc: import("@angular/core").Signal<ViewContainerRef | undefined>;
|
|
70
|
+
visibleChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
71
|
+
close: import("@angular/core").OutputEmitterRef<void>;
|
|
72
|
+
action: import("@angular/core").OutputEmitterRef<{
|
|
73
|
+
action: string;
|
|
74
|
+
data?: unknown;
|
|
75
|
+
}>;
|
|
76
|
+
private experienceAdapter;
|
|
77
|
+
private destroyRef;
|
|
78
|
+
private platformId;
|
|
79
|
+
private autoDismissTimer;
|
|
80
|
+
private readonly manuallyClosed;
|
|
81
|
+
readonly isVisible: import("@angular/core").Signal<boolean>;
|
|
82
|
+
readonly coercedProps: import("@angular/core").Signal<BannerProps>;
|
|
83
|
+
readonly normalizedSeverity: import("@angular/core").Signal<"info" | "success" | "warning" | "error">;
|
|
84
|
+
readonly computedTitle: import("@angular/core").Signal<string | undefined>;
|
|
85
|
+
readonly computedMessage: import("@angular/core").Signal<string>;
|
|
86
|
+
readonly computedVariant: import("@angular/core").Signal<"outlined" | "filled" | "standard">;
|
|
87
|
+
readonly isClosable: import("@angular/core").Signal<boolean>;
|
|
88
|
+
readonly isSticky: import("@angular/core").Signal<boolean>;
|
|
89
|
+
readonly isFluid: import("@angular/core").Signal<boolean>;
|
|
90
|
+
readonly actions: import("@angular/core").Signal<BannerAction[]>;
|
|
91
|
+
readonly customIcon: import("@angular/core").Signal<string | undefined>;
|
|
92
|
+
readonly ariaLabel: import("@angular/core").Signal<string>;
|
|
93
|
+
readonly ariaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
94
|
+
readonly ariaLive: import("@angular/core").Signal<"assertive" | "polite">;
|
|
95
|
+
constructor();
|
|
96
|
+
private clearTimer;
|
|
97
|
+
onClose(): void;
|
|
98
|
+
onActionClick(act: BannerAction): void;
|
|
99
|
+
}
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BannerComponent = exports.BannerContractSchema = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const common_1 = require("@angular/common");
|
|
7
|
+
const adapter_1 = require("../../../adapters/web/adapter");
|
|
8
|
+
const experience_adapter_service_1 = require("../../../adapters/web/experience-adapter.service");
|
|
9
|
+
exports.BannerContractSchema = {
|
|
10
|
+
visible: 'boolean',
|
|
11
|
+
severity: 'string',
|
|
12
|
+
title: 'string',
|
|
13
|
+
message: 'string',
|
|
14
|
+
text: 'string',
|
|
15
|
+
icon: 'string',
|
|
16
|
+
closable: 'boolean',
|
|
17
|
+
sticky: 'boolean',
|
|
18
|
+
fluid: 'boolean',
|
|
19
|
+
variant: 'string',
|
|
20
|
+
actions: 'array',
|
|
21
|
+
life: 'number',
|
|
22
|
+
permissions: 'object',
|
|
23
|
+
rules: 'object',
|
|
24
|
+
metadata: 'object',
|
|
25
|
+
'aria-label': 'string',
|
|
26
|
+
'aria-describedby': 'string',
|
|
27
|
+
};
|
|
28
|
+
let BannerComponent = (() => {
|
|
29
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
30
|
+
selector: 'origo-banner',
|
|
31
|
+
standalone: true,
|
|
32
|
+
imports: [common_1.CommonModule],
|
|
33
|
+
templateUrl: './banner.component.html',
|
|
34
|
+
styleUrls: ['./banner.component.scss'],
|
|
35
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
36
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
37
|
+
host: {
|
|
38
|
+
'[class.origo-banner-host]': 'true',
|
|
39
|
+
'[attr.data-testid]': 'contract().id',
|
|
40
|
+
'[class.origo-banner--sticky]': 'isSticky()',
|
|
41
|
+
'[class.origo-banner--hidden]': '!isVisible()',
|
|
42
|
+
},
|
|
43
|
+
})];
|
|
44
|
+
let _classDescriptor;
|
|
45
|
+
let _classExtraInitializers = [];
|
|
46
|
+
let _classThis;
|
|
47
|
+
var BannerComponent = class {
|
|
48
|
+
static { _classThis = this; }
|
|
49
|
+
static {
|
|
50
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
51
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
52
|
+
BannerComponent = _classThis = _classDescriptor.value;
|
|
53
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
54
|
+
}
|
|
55
|
+
static contractSchema = exports.BannerContractSchema;
|
|
56
|
+
static strictContract = false;
|
|
57
|
+
contract = core_1.input.required();
|
|
58
|
+
vc = (0, core_1.viewChild)('vc', { read: core_1.ViewContainerRef });
|
|
59
|
+
visibleChange = (0, core_1.output)();
|
|
60
|
+
close = (0, core_1.output)();
|
|
61
|
+
action = (0, core_1.output)();
|
|
62
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService);
|
|
63
|
+
destroyRef = (0, core_1.inject)(core_1.DestroyRef);
|
|
64
|
+
platformId = (0, core_1.inject)(core_1.PLATFORM_ID);
|
|
65
|
+
autoDismissTimer = null;
|
|
66
|
+
manuallyClosed = (0, core_1.signal)(false);
|
|
67
|
+
isVisible = (0, core_1.computed)(() => {
|
|
68
|
+
if (this.manuallyClosed())
|
|
69
|
+
return false;
|
|
70
|
+
return this.coercedProps().visible !== false;
|
|
71
|
+
});
|
|
72
|
+
coercedProps = (0, core_1.computed)(() => (0, adapter_1.coerceContractProps)(this.contract()?.props, exports.BannerContractSchema));
|
|
73
|
+
normalizedSeverity = (0, core_1.computed)(() => {
|
|
74
|
+
const s = this.coercedProps().severity?.toLowerCase();
|
|
75
|
+
if (s === 'warn' || s === 'warning')
|
|
76
|
+
return 'warning';
|
|
77
|
+
if (s === 'error')
|
|
78
|
+
return 'error';
|
|
79
|
+
if (s === 'success')
|
|
80
|
+
return 'success';
|
|
81
|
+
return 'info';
|
|
82
|
+
});
|
|
83
|
+
computedTitle = (0, core_1.computed)(() => this.coercedProps().title);
|
|
84
|
+
computedMessage = (0, core_1.computed)(() => this.coercedProps().message ?? this.coercedProps().text ?? '');
|
|
85
|
+
computedVariant = (0, core_1.computed)(() => this.coercedProps().variant || 'standard');
|
|
86
|
+
isClosable = (0, core_1.computed)(() => this.coercedProps().closable === true);
|
|
87
|
+
isSticky = (0, core_1.computed)(() => this.coercedProps().sticky === true);
|
|
88
|
+
isFluid = (0, core_1.computed)(() => this.coercedProps().fluid !== false);
|
|
89
|
+
actions = (0, core_1.computed)(() => this.coercedProps().actions ?? []);
|
|
90
|
+
customIcon = (0, core_1.computed)(() => this.coercedProps().icon);
|
|
91
|
+
ariaLabel = (0, core_1.computed)(() => {
|
|
92
|
+
return this.coercedProps()['aria-label'] || this.computedTitle() || 'System announcement';
|
|
93
|
+
});
|
|
94
|
+
ariaDescribedBy = (0, core_1.computed)(() => this.coercedProps()['aria-describedby']);
|
|
95
|
+
ariaLive = (0, core_1.computed)(() => {
|
|
96
|
+
const s = this.normalizedSeverity();
|
|
97
|
+
return s === 'error' || s === 'warning' ? 'assertive' : 'polite';
|
|
98
|
+
});
|
|
99
|
+
constructor() {
|
|
100
|
+
this.destroyRef.onDestroy(() => this.clearTimer());
|
|
101
|
+
(0, core_1.effect)(() => {
|
|
102
|
+
const props = this.coercedProps();
|
|
103
|
+
const contractVisible = props.visible !== false;
|
|
104
|
+
this.clearTimer();
|
|
105
|
+
if (contractVisible && props.life && props.life > 0 && (0, common_1.isPlatformBrowser)(this.platformId)) {
|
|
106
|
+
this.autoDismissTimer = setTimeout(() => {
|
|
107
|
+
this.onClose();
|
|
108
|
+
}, props.life);
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
clearTimer() {
|
|
113
|
+
if (this.autoDismissTimer) {
|
|
114
|
+
clearTimeout(this.autoDismissTimer);
|
|
115
|
+
this.autoDismissTimer = null;
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
onClose() {
|
|
119
|
+
this.clearTimer();
|
|
120
|
+
this.manuallyClosed.set(true);
|
|
121
|
+
this.visibleChange.emit(false);
|
|
122
|
+
this.close.emit();
|
|
123
|
+
if (this.contract()?.id) {
|
|
124
|
+
this.experienceAdapter.updateState(this.contract().id, 'visible', false);
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
onActionClick(act) {
|
|
128
|
+
this.action.emit({ action: act.action, data: act });
|
|
129
|
+
if (this.contract()?.id) {
|
|
130
|
+
this.experienceAdapter.dispatchCapability(this.contract().id, act.action, act);
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
static {
|
|
134
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
return BannerComponent = _classThis;
|
|
138
|
+
})();
|
|
139
|
+
exports.BannerComponent = BannerComponent;
|
|
140
|
+
//# sourceMappingURL=banner.component.js.map
|
package/dist/packages/angular-renderer/src/components/primitives/banner/banner.component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"banner.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/banner/banner.component.ts"],"names":[],"mappings":";;;;AAAA,wCAcuB;AACvB,4CAAkE;AAElE,2DAIuC;AACvC,iGAA+F;AA4BlF,QAAA,oBAAoB,GAAG;IAClC,OAAO,EAAE,SAAS;IAClB,QAAQ,EAAE,QAAQ;IAClB,KAAK,EAAE,QAAQ;IACf,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,QAAQ;IACd,QAAQ,EAAE,SAAS;IACnB,MAAM,EAAE,SAAS;IACjB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,QAAQ;IACjB,O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AC,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;YACjF,CAAC;QACH,CAAC;;YAvGU,+DAAe;;;;;AAAf,0CAAe"}
|
package/dist/packages/angular-renderer/src/components/primitives/popover/popover.component.d.ts
CHANGED
|
@@ -64,7 +64,7 @@ export declare class PopoverComponent implements OrigoAdapter<PopoverProps>, Con
|
|
|
64
64
|
private isPopoverOpen;
|
|
65
65
|
coercedProps: import("@angular/core").Signal<PopoverProps>;
|
|
66
66
|
computedVisible: import("@angular/core").Signal<boolean>;
|
|
67
|
-
computedPlacement: import("@angular/core").Signal<"left" | "top" | "bottom" | "
|
|
67
|
+
computedPlacement: import("@angular/core").Signal<"left" | "top" | "bottom" | "top-start" | "top-end" | "bottom-start" | "bottom-end" | "right" | "left-start" | "left-end" | "right-start" | "right-end">;
|
|
68
68
|
computedDismissible: import("@angular/core").Signal<boolean>;
|
|
69
69
|
computedCloseOnEscape: import("@angular/core").Signal<boolean>;
|
|
70
70
|
computedShowClose: import("@angular/core").Signal<boolean>;
|
package/dist/packages/angular-renderer/src/components/primitives/snackbar/snackbar.component.d.ts
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { TemplateRef } from '@angular/core';
|
|
2
|
+
import { InteractionContract } from '@origostudio/core';
|
|
3
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
4
|
+
export type SnackbarPosition = 'bottom-center' | 'bottom-start' | 'bottom-end' | 'top-center' | 'top-start' | 'top-end';
|
|
5
|
+
export interface SnackbarProps {
|
|
6
|
+
visible?: boolean;
|
|
7
|
+
message?: string;
|
|
8
|
+
action?: string;
|
|
9
|
+
actionLabel?: string;
|
|
10
|
+
duration?: number;
|
|
11
|
+
life?: number;
|
|
12
|
+
position?: SnackbarPosition;
|
|
13
|
+
severity?: 'info' | 'success' | 'warn' | 'error';
|
|
14
|
+
closable?: boolean;
|
|
15
|
+
permissions?: Record<string, string>;
|
|
16
|
+
rules?: Record<string, unknown>;
|
|
17
|
+
metadata?: Record<string, unknown>;
|
|
18
|
+
'aria-label'?: string;
|
|
19
|
+
'aria-describedby'?: string;
|
|
20
|
+
}
|
|
21
|
+
export declare const SnackbarContractSchema: {
|
|
22
|
+
readonly visible: "boolean";
|
|
23
|
+
readonly message: "string";
|
|
24
|
+
readonly action: "string";
|
|
25
|
+
readonly actionLabel: "string";
|
|
26
|
+
readonly duration: "number";
|
|
27
|
+
readonly life: "number";
|
|
28
|
+
readonly position: "string";
|
|
29
|
+
readonly severity: "string";
|
|
30
|
+
readonly closable: "boolean";
|
|
31
|
+
readonly permissions: "object";
|
|
32
|
+
readonly rules: "object";
|
|
33
|
+
readonly metadata: "object";
|
|
34
|
+
readonly 'aria-label': "string";
|
|
35
|
+
readonly 'aria-describedby': "string";
|
|
36
|
+
};
|
|
37
|
+
export declare class SnackbarComponent implements OrigoAdapter<SnackbarProps> {
|
|
38
|
+
static readonly contractSchema: {
|
|
39
|
+
readonly visible: "boolean";
|
|
40
|
+
readonly message: "string";
|
|
41
|
+
readonly action: "string";
|
|
42
|
+
readonly actionLabel: "string";
|
|
43
|
+
readonly duration: "number";
|
|
44
|
+
readonly life: "number";
|
|
45
|
+
readonly position: "string";
|
|
46
|
+
readonly severity: "string";
|
|
47
|
+
readonly closable: "boolean";
|
|
48
|
+
readonly permissions: "object";
|
|
49
|
+
readonly rules: "object";
|
|
50
|
+
readonly metadata: "object";
|
|
51
|
+
readonly 'aria-label': "string";
|
|
52
|
+
readonly 'aria-describedby': "string";
|
|
53
|
+
};
|
|
54
|
+
static readonly strictContract = false;
|
|
55
|
+
contract: import("@angular/core").InputSignal<InteractionContract<SnackbarProps>>;
|
|
56
|
+
visibleChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
57
|
+
open: import("@angular/core").OutputEmitterRef<void>;
|
|
58
|
+
close: import("@angular/core").OutputEmitterRef<void>;
|
|
59
|
+
actionClick: import("@angular/core").OutputEmitterRef<void>;
|
|
60
|
+
snackbarTemplate: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
|
|
61
|
+
private overlayService;
|
|
62
|
+
private experienceAdapter;
|
|
63
|
+
private destroyRef;
|
|
64
|
+
private vcr;
|
|
65
|
+
private platformId;
|
|
66
|
+
private overlayRef;
|
|
67
|
+
private autoDismissTimer;
|
|
68
|
+
private lastContractVisible;
|
|
69
|
+
readonly isVisible: import("@angular/core").WritableSignal<boolean>;
|
|
70
|
+
readonly coercedProps: import("@angular/core").Signal<SnackbarProps>;
|
|
71
|
+
readonly computedMessage: import("@angular/core").Signal<string>;
|
|
72
|
+
readonly computedActionLabel: import("@angular/core").Signal<string>;
|
|
73
|
+
readonly position: import("@angular/core").Signal<SnackbarPosition>;
|
|
74
|
+
readonly normalizedSeverity: import("@angular/core").Signal<"info" | "success" | "warning" | "error">;
|
|
75
|
+
readonly severity: import("@angular/core").Signal<"info" | "success" | "warning" | "error">;
|
|
76
|
+
readonly isClosable: import("@angular/core").Signal<boolean>;
|
|
77
|
+
readonly duration: import("@angular/core").Signal<number>;
|
|
78
|
+
readonly ariaLabel: import("@angular/core").Signal<string>;
|
|
79
|
+
readonly ariaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
80
|
+
readonly role: import("@angular/core").Signal<"alert" | "status">;
|
|
81
|
+
readonly ariaLive: import("@angular/core").Signal<"assertive" | "polite">;
|
|
82
|
+
constructor();
|
|
83
|
+
onEscapeKey(): void;
|
|
84
|
+
openSnackbar(): void;
|
|
85
|
+
closeSnackbar(notify?: boolean): void;
|
|
86
|
+
onAction(): void;
|
|
87
|
+
private scheduleDismiss;
|
|
88
|
+
private clearTimer;
|
|
89
|
+
private ensureOverlay;
|
|
90
|
+
}
|