@origostudio/origo-design 0.0.57 → 0.0.58
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 +5 -3
- package/dist/packages/angular-renderer/CHANGELOG.md +12 -0
- package/dist/packages/angular-renderer/package.json +3 -3
- package/dist/packages/angular-renderer/src/components/primitives/badge/badge.component.d.ts +72 -0
- package/dist/packages/angular-renderer/src/components/primitives/badge/badge.component.js +194 -0
- package/dist/packages/angular-renderer/src/components/primitives/badge/badge.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.d.ts +68 -0
- package/dist/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.js +172 -0
- package/dist/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/progress-bar/progress-bar.component.d.ts +71 -0
- package/dist/packages/angular-renderer/src/components/primitives/progress-bar/progress-bar.component.js +168 -0
- package/dist/packages/angular-renderer/src/components/primitives/progress-bar/progress-bar.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/skeleton/skeleton.component.d.ts +53 -0
- package/dist/packages/angular-renderer/src/components/primitives/skeleton/skeleton.component.js +100 -0
- package/dist/packages/angular-renderer/src/components/primitives/skeleton/skeleton.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/spinner/spinner.component.d.ts +58 -0
- package/dist/packages/angular-renderer/src/components/primitives/spinner/spinner.component.js +107 -0
- package/dist/packages/angular-renderer/src/components/primitives/spinner/spinner.component.js.map +1 -0
- package/dist/packages/angular-renderer/src/components/primitives/tag/tag.component.d.ts +68 -0
- package/dist/packages/angular-renderer/src/components/primitives/tag/tag.component.js +151 -0
- package/dist/packages/angular-renderer/src/components/primitives/tag/tag.component.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/primitives.provider.js +14 -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-CTTaxHaO.js → chunk-5Yqzzm3q.js} +1 -1
- package/dist/packages/playground/browser/{chunk-a7RvErrz.js → chunk-BYTs6gK5.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BvUCxmM0.js → chunk-BdLupCGg.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BxLGO71C.js → chunk-Bl9BxkHv.js} +1 -1
- package/dist/packages/playground/browser/{chunk-Dovts48g.js → chunk-BnM9Rxsh.js} +1 -1
- package/dist/packages/playground/browser/{chunk-B-3kt7Wr.js → chunk-CP3k9BzL.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BrnSLsyV.js → chunk-CnI6nZms.js} +1 -1
- package/dist/packages/playground/browser/{chunk-Xs7vKdpW.js → chunk-Co-XQzW3.js} +1 -1
- package/dist/packages/playground/browser/{chunk-cyLDjJx7.js → chunk-CoxwF-Pg.js} +1 -1
- package/dist/packages/playground/browser/{chunk-zG1F-IYa.js → chunk-DKTBnIQs.js} +1 -1
- package/dist/packages/playground/browser/{chunk-D5sCopgc.js → chunk-DLYkMHjx.js} +1 -1
- package/dist/packages/playground/browser/{chunk-BCLERDSo.js → chunk-DmmLTjRU.js} +1 -1
- package/dist/packages/playground/browser/{chunk-6bHgkN4C.js → chunk-GfiYWPsI.js} +1 -1
- package/dist/packages/playground/browser/{chunk-C5XVtbME.js → chunk-fJzAGRtQ.js} +1 -1
- package/dist/packages/playground/browser/{chunk-Ch_QEFhD.js → chunk-x22-q0p9.js} +1 -1
- package/dist/packages/playground/browser/index.html +1 -1
- package/dist/packages/playground/browser/main-XPPSTTY3.js +904 -0
- package/package.json +1 -1
- package/packages/angular-renderer/CHANGELOG.md +12 -0
- package/packages/angular-renderer/package.json +3 -3
- package/packages/angular-renderer/src/components/primitives/badge/badge.component.html +19 -0
- package/packages/angular-renderer/src/components/primitives/badge/badge.component.scss +158 -0
- package/packages/angular-renderer/src/components/primitives/badge/badge.component.ts +229 -0
- package/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.html +43 -0
- package/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.scss +76 -0
- package/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.ts +203 -0
- package/packages/angular-renderer/src/components/primitives/progress-bar/progress-bar.component.html +19 -0
- package/packages/angular-renderer/src/components/primitives/progress-bar/progress-bar.component.scss +95 -0
- package/packages/angular-renderer/src/components/primitives/progress-bar/progress-bar.component.ts +194 -0
- package/packages/angular-renderer/src/components/primitives/skeleton/skeleton.component.html +9 -0
- package/packages/angular-renderer/src/components/primitives/skeleton/skeleton.component.scss +86 -0
- package/packages/angular-renderer/src/components/primitives/skeleton/skeleton.component.ts +104 -0
- package/packages/angular-renderer/src/components/primitives/spinner/spinner.component.html +11 -0
- package/packages/angular-renderer/src/components/primitives/spinner/spinner.component.scss +108 -0
- package/packages/angular-renderer/src/components/primitives/spinner/spinner.component.ts +126 -0
- package/packages/angular-renderer/src/components/primitives/tag/tag.component.html +36 -0
- package/packages/angular-renderer/src/components/primitives/tag/tag.component.scss +186 -0
- package/packages/angular-renderer/src/components/primitives/tag/tag.component.ts +180 -0
- package/packages/angular-renderer/src/index.ts +6 -0
- package/packages/angular-renderer/src/lib/primitives.provider.ts +14 -0
- package/packages/angular-renderer/src/styles/overlay.scss +47 -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-G2CZZD2X.js +0 -898
package/CHANGELOG.md
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
## 0.0.
|
|
1
|
+
## 0.0.58 (2026-10-16)
|
|
2
2
|
|
|
3
3
|
### 🚀 Features
|
|
4
4
|
|
|
5
|
-
- add
|
|
6
|
-
- implement
|
|
5
|
+
- add sprint status tracker and story implementation file for status and loading indicators ([d377ec6](https://github.com/OrigoStudio/origo-design/commit/d377ec6))
|
|
6
|
+
- implement primitive status and loading components including skeleton, badge, and spinner in angular-renderer ([f3501b1](https://github.com/OrigoStudio/origo-design/commit/f3501b1))
|
|
7
|
+
- add primitive status and loading indicator components to angular renderer ([e62c5f9](https://github.com/OrigoStudio/origo-design/commit/e62c5f9))
|
|
8
|
+
- implement badge and block-ui components with unit tests for angular-renderer ([445abb2](https://github.com/OrigoStudio/origo-design/commit/445abb2))
|
|
7
9
|
|
|
8
10
|
### ❤️ Thank You
|
|
9
11
|
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
## 0.0.58 (2026-10-16)
|
|
2
|
+
|
|
3
|
+
### 🚀 Features
|
|
4
|
+
|
|
5
|
+
- implement badge and block-ui components with unit tests for angular-renderer ([445abb2](https://github.com/OrigoStudio/origo-design/commit/445abb2))
|
|
6
|
+
- add primitive status and loading indicator components to angular renderer ([e62c5f9](https://github.com/OrigoStudio/origo-design/commit/e62c5f9))
|
|
7
|
+
- implement primitive status and loading components including skeleton, badge, and spinner in angular-renderer ([f3501b1](https://github.com/OrigoStudio/origo-design/commit/f3501b1))
|
|
8
|
+
|
|
9
|
+
### ❤️ Thank You
|
|
10
|
+
|
|
11
|
+
- Hardik Patel @hardikpatelse
|
|
12
|
+
|
|
1
13
|
## 0.0.57 (2026-10-15)
|
|
2
14
|
|
|
3
15
|
### 🚀 Features
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@origostudio/angular-renderer",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.58",
|
|
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.58",
|
|
10
|
+
"@origostudio/design-tokens": "0.0.58",
|
|
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,72 @@
|
|
|
1
|
+
import { ViewContainerRef, ElementRef, AfterContentInit, AfterContentChecked } from '@angular/core';
|
|
2
|
+
import { InteractionContract } from '@origostudio/core';
|
|
3
|
+
import { OrigoAdapter, ContainerComponent } from '../../../adapters/web/adapter';
|
|
4
|
+
export interface BadgeProps {
|
|
5
|
+
value?: string | number;
|
|
6
|
+
severity?: 'primary' | 'secondary' | 'info' | 'success' | 'warn' | 'warning' | 'error' | 'contrast' | string;
|
|
7
|
+
size?: 'small' | 'medium' | 'large' | string;
|
|
8
|
+
shape?: 'circle' | 'rounded' | 'square' | string;
|
|
9
|
+
max?: number;
|
|
10
|
+
dot?: boolean;
|
|
11
|
+
interactive?: boolean;
|
|
12
|
+
permissions?: Record<string, string>;
|
|
13
|
+
rules?: Record<string, unknown>;
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
'aria-describedby'?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const BadgeContractSchema: {
|
|
19
|
+
readonly permissions: "object";
|
|
20
|
+
readonly rules: "object";
|
|
21
|
+
readonly metadata: "object";
|
|
22
|
+
readonly 'aria-label': "string";
|
|
23
|
+
readonly 'aria-describedby': "string";
|
|
24
|
+
readonly value: "string";
|
|
25
|
+
readonly severity: "string";
|
|
26
|
+
readonly size: "string";
|
|
27
|
+
readonly shape: "string";
|
|
28
|
+
readonly max: "number";
|
|
29
|
+
readonly dot: "boolean";
|
|
30
|
+
readonly interactive: "boolean";
|
|
31
|
+
};
|
|
32
|
+
export declare class BadgeComponent implements OrigoAdapter<BadgeProps>, ContainerComponent, AfterContentInit, AfterContentChecked {
|
|
33
|
+
static readonly contractSchema: {
|
|
34
|
+
readonly permissions: "object";
|
|
35
|
+
readonly rules: "object";
|
|
36
|
+
readonly metadata: "object";
|
|
37
|
+
readonly 'aria-label': "string";
|
|
38
|
+
readonly 'aria-describedby': "string";
|
|
39
|
+
readonly value: "string";
|
|
40
|
+
readonly severity: "string";
|
|
41
|
+
readonly size: "string";
|
|
42
|
+
readonly shape: "string";
|
|
43
|
+
readonly max: "number";
|
|
44
|
+
readonly dot: "boolean";
|
|
45
|
+
readonly interactive: "boolean";
|
|
46
|
+
};
|
|
47
|
+
static readonly strictContract = false;
|
|
48
|
+
contract: import("@angular/core").InputSignal<InteractionContract<BadgeProps>>;
|
|
49
|
+
vc: import("@angular/core").Signal<ViewContainerRef | undefined>;
|
|
50
|
+
contentWrapper: import("@angular/core").Signal<ElementRef<HTMLElement> | undefined>;
|
|
51
|
+
click: import("@angular/core").OutputEmitterRef<MouseEvent>;
|
|
52
|
+
private experienceAdapter;
|
|
53
|
+
private readonly _hasProjectedContent;
|
|
54
|
+
readonly contractId: import("@angular/core").Signal<string>;
|
|
55
|
+
readonly coercedProps: import("@angular/core").Signal<BadgeProps>;
|
|
56
|
+
readonly isDot: import("@angular/core").Signal<boolean>;
|
|
57
|
+
readonly displayValue: import("@angular/core").Signal<string>;
|
|
58
|
+
readonly isInteractive: import("@angular/core").Signal<boolean>;
|
|
59
|
+
readonly severity: import("@angular/core").Signal<string>;
|
|
60
|
+
readonly size: import("@angular/core").Signal<string>;
|
|
61
|
+
readonly shape: import("@angular/core").Signal<string>;
|
|
62
|
+
readonly ariaLabel: import("@angular/core").Signal<string | undefined>;
|
|
63
|
+
readonly ariaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
64
|
+
readonly computedAriaLabel: import("@angular/core").Signal<string | undefined>;
|
|
65
|
+
readonly hasContent: import("@angular/core").Signal<boolean>;
|
|
66
|
+
readonly computedBadgeClasses: import("@angular/core").Signal<string>;
|
|
67
|
+
ngAfterContentInit(): void;
|
|
68
|
+
ngAfterContentChecked(): void;
|
|
69
|
+
private checkProjectedContent;
|
|
70
|
+
onClick(event: MouseEvent): void;
|
|
71
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
72
|
+
}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BadgeComponent = exports.BadgeContractSchema = 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.BadgeContractSchema = {
|
|
10
|
+
permissions: 'object',
|
|
11
|
+
rules: 'object',
|
|
12
|
+
metadata: 'object',
|
|
13
|
+
'aria-label': 'string',
|
|
14
|
+
'aria-describedby': 'string',
|
|
15
|
+
value: 'string',
|
|
16
|
+
severity: 'string',
|
|
17
|
+
size: 'string',
|
|
18
|
+
shape: 'string',
|
|
19
|
+
max: 'number',
|
|
20
|
+
dot: 'boolean',
|
|
21
|
+
interactive: 'boolean',
|
|
22
|
+
};
|
|
23
|
+
let BadgeComponent = (() => {
|
|
24
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
25
|
+
selector: 'origo-badge',
|
|
26
|
+
standalone: true,
|
|
27
|
+
imports: [common_1.CommonModule],
|
|
28
|
+
templateUrl: './badge.component.html',
|
|
29
|
+
styleUrls: ['./badge.component.scss'],
|
|
30
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
31
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
32
|
+
host: {
|
|
33
|
+
'[class.origo-badge-host]': 'true',
|
|
34
|
+
'[attr.data-testid]': 'contractId()',
|
|
35
|
+
},
|
|
36
|
+
})];
|
|
37
|
+
let _classDescriptor;
|
|
38
|
+
let _classExtraInitializers = [];
|
|
39
|
+
let _classThis;
|
|
40
|
+
var BadgeComponent = class {
|
|
41
|
+
static { _classThis = this; }
|
|
42
|
+
static {
|
|
43
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
44
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
45
|
+
BadgeComponent = _classThis = _classDescriptor.value;
|
|
46
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
47
|
+
}
|
|
48
|
+
static contractSchema = exports.BadgeContractSchema;
|
|
49
|
+
static strictContract = false;
|
|
50
|
+
contract = core_1.input.required();
|
|
51
|
+
vc = (0, core_1.viewChild)('vc', { read: core_1.ViewContainerRef });
|
|
52
|
+
contentWrapper = (0, core_1.viewChild)('contentWrapper');
|
|
53
|
+
click = (0, core_1.output)();
|
|
54
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService, { optional: true });
|
|
55
|
+
_hasProjectedContent = (0, core_1.signal)(false);
|
|
56
|
+
contractId = (0, core_1.computed)(() => {
|
|
57
|
+
try {
|
|
58
|
+
return this.contract()?.id ?? '';
|
|
59
|
+
}
|
|
60
|
+
catch {
|
|
61
|
+
return '';
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
coercedProps = (0, core_1.computed)(() => {
|
|
65
|
+
let rawProps;
|
|
66
|
+
try {
|
|
67
|
+
rawProps = this.contract()?.props;
|
|
68
|
+
}
|
|
69
|
+
catch {
|
|
70
|
+
rawProps = undefined;
|
|
71
|
+
}
|
|
72
|
+
return (0, adapter_1.coerceContractProps)(rawProps, exports.BadgeContractSchema);
|
|
73
|
+
});
|
|
74
|
+
isDot = (0, core_1.computed)(() => {
|
|
75
|
+
const p = this.coercedProps();
|
|
76
|
+
if (p.dot === true)
|
|
77
|
+
return true;
|
|
78
|
+
const v = p.value;
|
|
79
|
+
return v === undefined || v === null || String(v).trim() === '';
|
|
80
|
+
});
|
|
81
|
+
displayValue = (0, core_1.computed)(() => {
|
|
82
|
+
const p = this.coercedProps();
|
|
83
|
+
const v = p.value;
|
|
84
|
+
if (v === undefined || v === null)
|
|
85
|
+
return '';
|
|
86
|
+
const maxVal = p.max;
|
|
87
|
+
if (maxVal !== undefined && maxVal !== null && !isNaN(Number(v)) && Number(v) > maxVal) {
|
|
88
|
+
return `${maxVal}+`;
|
|
89
|
+
}
|
|
90
|
+
return String(v);
|
|
91
|
+
});
|
|
92
|
+
isInteractive = (0, core_1.computed)(() => this.coercedProps().interactive === true);
|
|
93
|
+
severity = (0, core_1.computed)(() => {
|
|
94
|
+
const s = this.coercedProps().severity?.toLowerCase() || 'primary';
|
|
95
|
+
return s === 'warn' || s === 'warning' ? 'warning' : s;
|
|
96
|
+
});
|
|
97
|
+
size = (0, core_1.computed)(() => this.coercedProps().size || 'medium');
|
|
98
|
+
shape = (0, core_1.computed)(() => this.coercedProps().shape || 'rounded');
|
|
99
|
+
ariaLabel = (0, core_1.computed)(() => this.coercedProps()['aria-label']);
|
|
100
|
+
ariaDescribedBy = (0, core_1.computed)(() => this.coercedProps()['aria-describedby']);
|
|
101
|
+
computedAriaLabel = (0, core_1.computed)(() => {
|
|
102
|
+
if (this.ariaLabel())
|
|
103
|
+
return this.ariaLabel();
|
|
104
|
+
if (this.isDot())
|
|
105
|
+
return 'Status indicator';
|
|
106
|
+
return String(this.displayValue());
|
|
107
|
+
});
|
|
108
|
+
hasContent = (0, core_1.computed)(() => {
|
|
109
|
+
let contractWithChildren;
|
|
110
|
+
try {
|
|
111
|
+
contractWithChildren = this.contract();
|
|
112
|
+
}
|
|
113
|
+
catch {
|
|
114
|
+
contractWithChildren = undefined;
|
|
115
|
+
}
|
|
116
|
+
return this._hasProjectedContent() || (contractWithChildren?.children?.length ?? 0) > 0;
|
|
117
|
+
});
|
|
118
|
+
computedBadgeClasses = (0, core_1.computed)(() => {
|
|
119
|
+
const classes = [
|
|
120
|
+
'origo-badge',
|
|
121
|
+
`origo-badge--severity-${this.severity()}`,
|
|
122
|
+
`origo-badge--size-${this.size()}`,
|
|
123
|
+
`origo-badge--shape-${this.shape()}`,
|
|
124
|
+
];
|
|
125
|
+
if (this.isDot())
|
|
126
|
+
classes.push('origo-badge--dot');
|
|
127
|
+
if (this.isInteractive())
|
|
128
|
+
classes.push('origo-badge--interactive');
|
|
129
|
+
return classes.join(' ');
|
|
130
|
+
});
|
|
131
|
+
ngAfterContentInit() {
|
|
132
|
+
this.checkProjectedContent(true);
|
|
133
|
+
}
|
|
134
|
+
ngAfterContentChecked() {
|
|
135
|
+
this.checkProjectedContent(false);
|
|
136
|
+
}
|
|
137
|
+
checkProjectedContent(synchronous) {
|
|
138
|
+
const wrapper = this.contentWrapper();
|
|
139
|
+
if (wrapper) {
|
|
140
|
+
const el = wrapper.nativeElement;
|
|
141
|
+
let hasChildren = false;
|
|
142
|
+
for (let i = 0; i < el.childNodes.length; i++) {
|
|
143
|
+
const node = el.childNodes[i];
|
|
144
|
+
if (node.nodeType === 1) {
|
|
145
|
+
// ELEMENT_NODE
|
|
146
|
+
hasChildren = true;
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
else if (node.nodeType === 3 && (node.textContent?.trim().length ?? 0) > 0) {
|
|
150
|
+
// TEXT_NODE
|
|
151
|
+
hasChildren = true;
|
|
152
|
+
break;
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
if (this._hasProjectedContent() !== hasChildren) {
|
|
156
|
+
if (synchronous) {
|
|
157
|
+
this._hasProjectedContent.set(hasChildren);
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
queueMicrotask(() => {
|
|
161
|
+
this._hasProjectedContent.set(hasChildren);
|
|
162
|
+
});
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
onClick(event) {
|
|
168
|
+
if (this.isInteractive()) {
|
|
169
|
+
event.stopPropagation();
|
|
170
|
+
this.click.emit(event);
|
|
171
|
+
if (this.contract()?.id) {
|
|
172
|
+
this.experienceAdapter?.dispatchCapability(this.contract().id, 'click', { event });
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
}
|
|
176
|
+
onKeyDown(event) {
|
|
177
|
+
if (this.isInteractive() && (event.key === 'Enter' || event.key === ' ')) {
|
|
178
|
+
event.preventDefault();
|
|
179
|
+
event.stopPropagation();
|
|
180
|
+
const syntheticMouseEvent = new MouseEvent('click', {
|
|
181
|
+
bubbles: false,
|
|
182
|
+
cancelable: true,
|
|
183
|
+
});
|
|
184
|
+
this.onClick(syntheticMouseEvent);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
static {
|
|
188
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
return BadgeComponent = _classThis;
|
|
192
|
+
})();
|
|
193
|
+
exports.BadgeComponent = BadgeComponent;
|
|
194
|
+
//# sourceMappingURL=badge.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"badge.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/badge/badge.component.ts"],"names":[],"mappings":";;;;AAAA,wCAcuB;AACvB,4CAA+C;AAE/C,2DAIuC;AACvC,iGAA+F;AA0BlF,QAAA,mBAAmB,GAAG;IACjC,WAAW,EAAE,QAAQ;IACrB,KAAK,EAAE,QAAQ;IACf,QAAQ,EAAE,QAAQ;IAClB,YAAY,EAAE,QAAQ;IACtB,kBAAkB,EAAE,QAAQ;IAC5B,KAAK,EAAE,QAAQ;IACf,QAAQ,EAAE,QAAQ;IAClB,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,QAAQ;IACf,GAAG,EAAE,QAAQ;IACb,GAAG,EAAE,SAAS;IACd,WAAW,EAAE,SAAS;CACd,CAAC;IAeE,cAAc;4BAb1B,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,cAAc;aACrC;SACF,CAAC;;;;;;;;YACF,qLAwJC;;;;QArJC,MAAM,CAAU,cAAc,GAAG,2BAAmB,CAAC;QACrD,MAAM,CAAU,cAAc,GAAG,KAAK,CAAC;QAEvC,QAAQ,GAAG,YAAK,CAAC,QAAQ,EAAmC,CAAC;QAC7D,EAAE,GAAG,IAAA,gBAAS,EAAC,IAAI,EAAE,EAAE,IAAI,EAAE,uBAAgB,EAAE,CAAC,CAAC;QACjD,cAAc,GAAG,IAAA,gBAAS,EAA0B,gBAAgB,CAAC,CAAC;QAEtE,KAAK,GAAG,IAAA,aAAM,GAAc,CAAC;QAErB,iBAAiB,GAAG,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C,eAAe,EAAE,CAAC;gBACxB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;gBACvB,IAAI,IAAI,CAAC,QAAQ,EAAE,EAAE,EAAE,EAAE,CAAC;oBACxB,IAAI,CAAC,iBAAiB,EAAE,kBAAkB,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;gBACrF,CAAC;YACH,CAAC;QACH,CAAC;QAED,SAAS,CAAC,KAAoB;YAC5B,IAAI,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,KAAK,CAAC,GAAG,KAAK,OAAO,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,CAAC,EAAE,CAAC;gBACzE,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;gBACxB,MAAM,mBAAmB,GAAG,IAAI,UAAU,CAAC,OAAO,EAAE;oBAClD,OAAO,EAAE,KAAK;oBACd,UAAU,EAAE,IAAI;iBACjB,CAAC,CAAC;gBACH,IAAI,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;YACpC,CAAC;QACH,CAAC;;YAvJU,+DAAc;;;;;AAAd,wCAAc"}
|
package/dist/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.d.ts
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { ViewContainerRef, TemplateRef } from '@angular/core';
|
|
2
|
+
import { InteractionContract } from '@origostudio/core';
|
|
3
|
+
import { OrigoAdapter, ContainerComponent } from '../../../adapters/web/adapter';
|
|
4
|
+
import { SpinnerProps } from '../spinner/spinner.component';
|
|
5
|
+
export interface BlockUIProps {
|
|
6
|
+
blocked?: boolean;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
fullScreen?: boolean;
|
|
9
|
+
message?: string;
|
|
10
|
+
spinner?: boolean;
|
|
11
|
+
baseZIndex?: number;
|
|
12
|
+
permissions?: Record<string, string>;
|
|
13
|
+
rules?: Record<string, unknown>;
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
'aria-describedby'?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const BlockUIContractSchema: {
|
|
19
|
+
readonly permissions: "object";
|
|
20
|
+
readonly rules: "object";
|
|
21
|
+
readonly metadata: "object";
|
|
22
|
+
readonly 'aria-label': "string";
|
|
23
|
+
readonly 'aria-describedby': "string";
|
|
24
|
+
readonly blocked: "boolean";
|
|
25
|
+
readonly loading: "boolean";
|
|
26
|
+
readonly fullScreen: "boolean";
|
|
27
|
+
readonly message: "string";
|
|
28
|
+
readonly spinner: "boolean";
|
|
29
|
+
readonly baseZIndex: "number";
|
|
30
|
+
};
|
|
31
|
+
export declare class BlockUIComponent implements OrigoAdapter<BlockUIProps>, ContainerComponent {
|
|
32
|
+
static readonly contractSchema: {
|
|
33
|
+
readonly permissions: "object";
|
|
34
|
+
readonly rules: "object";
|
|
35
|
+
readonly metadata: "object";
|
|
36
|
+
readonly 'aria-label': "string";
|
|
37
|
+
readonly 'aria-describedby': "string";
|
|
38
|
+
readonly blocked: "boolean";
|
|
39
|
+
readonly loading: "boolean";
|
|
40
|
+
readonly fullScreen: "boolean";
|
|
41
|
+
readonly message: "string";
|
|
42
|
+
readonly spinner: "boolean";
|
|
43
|
+
readonly baseZIndex: "number";
|
|
44
|
+
};
|
|
45
|
+
static readonly strictContract = false;
|
|
46
|
+
contract: import("@angular/core").InputSignal<InteractionContract<BlockUIProps>>;
|
|
47
|
+
vc: import("@angular/core").Signal<ViewContainerRef | undefined>;
|
|
48
|
+
fullScreenOverlayTemplate: import("@angular/core").Signal<TemplateRef<unknown> | undefined>;
|
|
49
|
+
blockedChange: import("@angular/core").OutputEmitterRef<boolean>;
|
|
50
|
+
private overlayRef?;
|
|
51
|
+
private readonly overlayService;
|
|
52
|
+
private readonly destroyRef;
|
|
53
|
+
private readonly platformId;
|
|
54
|
+
private readonly vcr;
|
|
55
|
+
private readonly experienceAdapter;
|
|
56
|
+
private lastBlockedState;
|
|
57
|
+
readonly contractId: import("@angular/core").Signal<string>;
|
|
58
|
+
readonly coercedProps: import("@angular/core").Signal<BlockUIProps>;
|
|
59
|
+
readonly isBlocked: import("@angular/core").Signal<boolean>;
|
|
60
|
+
readonly isFullScreen: import("@angular/core").Signal<boolean>;
|
|
61
|
+
readonly message: import("@angular/core").Signal<string>;
|
|
62
|
+
readonly showSpinner: import("@angular/core").Signal<boolean>;
|
|
63
|
+
readonly computedZIndex: import("@angular/core").Signal<number>;
|
|
64
|
+
readonly spinnerContract: import("@angular/core").Signal<InteractionContract<SpinnerProps>>;
|
|
65
|
+
constructor();
|
|
66
|
+
onKeyDown(event: KeyboardEvent): void;
|
|
67
|
+
private openFullScreenOverlay;
|
|
68
|
+
}
|
package/dist/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.js
ADDED
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BlockUIComponent = exports.BlockUIContractSchema = 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
|
+
const overlay_service_1 = require("../../../lib/overlay/overlay.service");
|
|
10
|
+
const spinner_component_1 = require("../spinner/spinner.component");
|
|
11
|
+
exports.BlockUIContractSchema = {
|
|
12
|
+
permissions: 'object',
|
|
13
|
+
rules: 'object',
|
|
14
|
+
metadata: 'object',
|
|
15
|
+
'aria-label': 'string',
|
|
16
|
+
'aria-describedby': 'string',
|
|
17
|
+
blocked: 'boolean',
|
|
18
|
+
loading: 'boolean',
|
|
19
|
+
fullScreen: 'boolean',
|
|
20
|
+
message: 'string',
|
|
21
|
+
spinner: 'boolean',
|
|
22
|
+
baseZIndex: 'number',
|
|
23
|
+
};
|
|
24
|
+
let BlockUIComponent = (() => {
|
|
25
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
26
|
+
selector: 'origo-block-ui',
|
|
27
|
+
standalone: true,
|
|
28
|
+
imports: [common_1.CommonModule, spinner_component_1.SpinnerComponent],
|
|
29
|
+
templateUrl: './block-ui.component.html',
|
|
30
|
+
styleUrls: ['./block-ui.component.scss'],
|
|
31
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
32
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
33
|
+
host: {
|
|
34
|
+
'[class.origo-block-ui-host]': 'true',
|
|
35
|
+
'[attr.data-testid]': 'contractId()',
|
|
36
|
+
'[attr.aria-busy]': "isBlocked() ? 'true' : null",
|
|
37
|
+
},
|
|
38
|
+
})];
|
|
39
|
+
let _classDescriptor;
|
|
40
|
+
let _classExtraInitializers = [];
|
|
41
|
+
let _classThis;
|
|
42
|
+
let _instanceExtraInitializers = [];
|
|
43
|
+
let _onKeyDown_decorators;
|
|
44
|
+
var BlockUIComponent = class {
|
|
45
|
+
static { _classThis = this; }
|
|
46
|
+
static {
|
|
47
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
48
|
+
_onKeyDown_decorators = [(0, core_1.HostListener)('keydown', ['$event'])];
|
|
49
|
+
tslib_1.__esDecorate(this, null, _onKeyDown_decorators, { kind: "method", name: "onKeyDown", static: false, private: false, access: { has: obj => "onKeyDown" in obj, get: obj => obj.onKeyDown }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
50
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
51
|
+
BlockUIComponent = _classThis = _classDescriptor.value;
|
|
52
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
53
|
+
}
|
|
54
|
+
static contractSchema = exports.BlockUIContractSchema;
|
|
55
|
+
static strictContract = false;
|
|
56
|
+
contract = (tslib_1.__runInitializers(this, _instanceExtraInitializers), core_1.input.required());
|
|
57
|
+
vc = (0, core_1.viewChild)('vc', { read: core_1.ViewContainerRef });
|
|
58
|
+
fullScreenOverlayTemplate = (0, core_1.viewChild)('fullScreenOverlayTemplate');
|
|
59
|
+
blockedChange = (0, core_1.output)();
|
|
60
|
+
overlayRef;
|
|
61
|
+
overlayService = (0, core_1.inject)(overlay_service_1.OrigoOverlayService);
|
|
62
|
+
destroyRef = (0, core_1.inject)(core_1.DestroyRef);
|
|
63
|
+
platformId = (0, core_1.inject)(core_1.PLATFORM_ID);
|
|
64
|
+
vcr = (0, core_1.inject)(core_1.ViewContainerRef);
|
|
65
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService, { optional: true });
|
|
66
|
+
lastBlockedState = null;
|
|
67
|
+
contractId = (0, core_1.computed)(() => {
|
|
68
|
+
try {
|
|
69
|
+
return this.contract()?.id ?? '';
|
|
70
|
+
}
|
|
71
|
+
catch {
|
|
72
|
+
return '';
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
coercedProps = (0, core_1.computed)(() => {
|
|
76
|
+
let rawProps;
|
|
77
|
+
try {
|
|
78
|
+
rawProps = this.contract()?.props;
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
rawProps = undefined;
|
|
82
|
+
}
|
|
83
|
+
return (0, adapter_1.coerceContractProps)(rawProps, exports.BlockUIContractSchema);
|
|
84
|
+
});
|
|
85
|
+
isBlocked = (0, core_1.computed)(() => {
|
|
86
|
+
const p = this.coercedProps();
|
|
87
|
+
return !!(p.blocked || p.loading);
|
|
88
|
+
});
|
|
89
|
+
isFullScreen = (0, core_1.computed)(() => !!this.coercedProps().fullScreen);
|
|
90
|
+
message = (0, core_1.computed)(() => this.coercedProps().message ?? '');
|
|
91
|
+
showSpinner = (0, core_1.computed)(() => this.coercedProps().spinner !== false);
|
|
92
|
+
computedZIndex = (0, core_1.computed)(() => this.coercedProps().baseZIndex ?? 1000);
|
|
93
|
+
spinnerContract = (0, core_1.computed)(() => ({
|
|
94
|
+
id: `${this.contractId()}-spinner`,
|
|
95
|
+
type: 'Spinner',
|
|
96
|
+
props: {
|
|
97
|
+
label: this.message() || 'Loading...',
|
|
98
|
+
},
|
|
99
|
+
}));
|
|
100
|
+
constructor() {
|
|
101
|
+
this.destroyRef.onDestroy(() => {
|
|
102
|
+
this.overlayRef?.dispose();
|
|
103
|
+
});
|
|
104
|
+
(0, core_1.effect)(() => {
|
|
105
|
+
const blocked = this.isBlocked();
|
|
106
|
+
const fullScreen = this.isFullScreen();
|
|
107
|
+
const contractId = this.contractId();
|
|
108
|
+
if (this.lastBlockedState !== null && this.lastBlockedState !== blocked) {
|
|
109
|
+
(0, core_1.untracked)(() => {
|
|
110
|
+
this.blockedChange.emit(blocked);
|
|
111
|
+
if (contractId) {
|
|
112
|
+
this.experienceAdapter?.updateState(contractId, 'blocked', blocked);
|
|
113
|
+
this.experienceAdapter?.dispatchCapability(contractId, 'blockedChange', { blocked });
|
|
114
|
+
}
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
this.lastBlockedState = blocked;
|
|
118
|
+
const tpl = this.fullScreenOverlayTemplate();
|
|
119
|
+
if ((0, common_1.isPlatformBrowser)(this.platformId) && fullScreen) {
|
|
120
|
+
if (blocked) {
|
|
121
|
+
if (!this.overlayRef && tpl) {
|
|
122
|
+
(0, core_1.untracked)(() => this.openFullScreenOverlay(tpl));
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
else {
|
|
126
|
+
if (this.overlayRef) {
|
|
127
|
+
(0, core_1.untracked)(() => {
|
|
128
|
+
this.overlayRef?.close();
|
|
129
|
+
this.overlayRef?.dispose();
|
|
130
|
+
this.overlayRef = undefined;
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
else if (!fullScreen && this.overlayRef) {
|
|
136
|
+
(0, core_1.untracked)(() => {
|
|
137
|
+
this.overlayRef?.close();
|
|
138
|
+
this.overlayRef?.dispose();
|
|
139
|
+
this.overlayRef = undefined;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
}
|
|
144
|
+
onKeyDown(event) {
|
|
145
|
+
if (this.isBlocked() && !this.isFullScreen()) {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
event.stopPropagation();
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
openFullScreenOverlay(tpl) {
|
|
151
|
+
this.overlayRef = this.overlayService.create({
|
|
152
|
+
position: {
|
|
153
|
+
type: 'global',
|
|
154
|
+
position: 'center',
|
|
155
|
+
width: '100vw',
|
|
156
|
+
height: '100vh',
|
|
157
|
+
},
|
|
158
|
+
hasBackdrop: false,
|
|
159
|
+
trapFocus: true,
|
|
160
|
+
panelClass: ['origo-overlay-pane', 'origo-overlay-pane--block-ui'],
|
|
161
|
+
viewContainerRef: this.vcr,
|
|
162
|
+
}, this.destroyRef);
|
|
163
|
+
this.overlayRef.open(tpl, this.vcr);
|
|
164
|
+
}
|
|
165
|
+
static {
|
|
166
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
return BlockUIComponent = _classThis;
|
|
170
|
+
})();
|
|
171
|
+
exports.BlockUIComponent = BlockUIComponent;
|
|
172
|
+
//# sourceMappingURL=block-ui.component.js.map
|
package/dist/packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"block-ui.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/block-ui/block-ui.component.ts"],"names":[],"mappings":";;;;AAAA,wCAgBuB;AACvB,4CAAkE;AAElE,2DAIuC;A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AoB;YAC5B,IAAI,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC;gBAC7C,KAAK,CAAC,cAAc,EAAE,CAAC;gBACvB,KAAK,CAAC,eAAe,EAAE,CAAC;YAC1B,CAAC;QACH,CAAC;QAEO,qBAAqB,CAAC,GAAyB;YACrD,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,cAAc,CAAC,MAAM,CAC1C;gBACE,QAAQ,EAAE;oBACR,IAAI,EAAE,QAAQ;oBACd,QAAQ,EAAE,QAAQ;oBAClB,KAAK,EAAE,OAAO;oBACd,MAAM,EAAE,OAAO;iBAChB;gBACD,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,IAAI;gBACf,UAAU,EAAE,CAAC,oBAAoB,EAAE,8BAA8B,CAAC;gBAClE,gBAAgB,EAAE,IAAI,CAAC,GAAG;aAC3B,EACD,IAAI,CAAC,UAAU,CAChB,CAAC;YAEF,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;QACtC,CAAC;;YAlIU,+DAAgB;;;;;AAAhB,4CAAgB"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { InteractionContract } from '@origostudio/core';
|
|
2
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
3
|
+
export interface ProgressBarProps {
|
|
4
|
+
value?: number;
|
|
5
|
+
mode?: 'determinate' | 'indeterminate';
|
|
6
|
+
showValue?: boolean;
|
|
7
|
+
max?: number;
|
|
8
|
+
label?: string;
|
|
9
|
+
unit?: string;
|
|
10
|
+
severity?: 'primary' | 'info' | 'success' | 'warn' | 'warning' | 'error' | string;
|
|
11
|
+
height?: string;
|
|
12
|
+
permissions?: Record<string, string>;
|
|
13
|
+
rules?: Record<string, unknown>;
|
|
14
|
+
metadata?: Record<string, unknown>;
|
|
15
|
+
'aria-label'?: string;
|
|
16
|
+
'aria-describedby'?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare const ProgressBarContractSchema: {
|
|
19
|
+
readonly permissions: "object";
|
|
20
|
+
readonly rules: "object";
|
|
21
|
+
readonly metadata: "object";
|
|
22
|
+
readonly 'aria-label': "string";
|
|
23
|
+
readonly 'aria-describedby': "string";
|
|
24
|
+
readonly value: "number";
|
|
25
|
+
readonly mode: "string";
|
|
26
|
+
readonly showValue: "boolean";
|
|
27
|
+
readonly max: "number";
|
|
28
|
+
readonly label: "string";
|
|
29
|
+
readonly unit: "string";
|
|
30
|
+
readonly severity: "string";
|
|
31
|
+
readonly height: "string";
|
|
32
|
+
};
|
|
33
|
+
export declare class ProgressBarComponent implements OrigoAdapter<ProgressBarProps> {
|
|
34
|
+
static readonly contractSchema: {
|
|
35
|
+
readonly permissions: "object";
|
|
36
|
+
readonly rules: "object";
|
|
37
|
+
readonly metadata: "object";
|
|
38
|
+
readonly 'aria-label': "string";
|
|
39
|
+
readonly 'aria-describedby': "string";
|
|
40
|
+
readonly value: "number";
|
|
41
|
+
readonly mode: "string";
|
|
42
|
+
readonly showValue: "boolean";
|
|
43
|
+
readonly max: "number";
|
|
44
|
+
readonly label: "string";
|
|
45
|
+
readonly unit: "string";
|
|
46
|
+
readonly severity: "string";
|
|
47
|
+
readonly height: "string";
|
|
48
|
+
};
|
|
49
|
+
static readonly strictContract = false;
|
|
50
|
+
contract: import("@angular/core").InputSignal<InteractionContract<ProgressBarProps>>;
|
|
51
|
+
complete: import("@angular/core").OutputEmitterRef<void>;
|
|
52
|
+
valueChange: import("@angular/core").OutputEmitterRef<number>;
|
|
53
|
+
private experienceAdapter;
|
|
54
|
+
private hasCompleted;
|
|
55
|
+
private lastReportedValue;
|
|
56
|
+
private lastContractId;
|
|
57
|
+
readonly coercedProps: import("@angular/core").Signal<ProgressBarProps>;
|
|
58
|
+
readonly mode: import("@angular/core").Signal<"determinate" | "indeterminate">;
|
|
59
|
+
readonly safeMax: import("@angular/core").Signal<number>;
|
|
60
|
+
readonly clampedValue: import("@angular/core").Signal<number>;
|
|
61
|
+
readonly percentage: import("@angular/core").Signal<number>;
|
|
62
|
+
readonly showValue: import("@angular/core").Signal<boolean>;
|
|
63
|
+
readonly computedLabel: import("@angular/core").Signal<string | undefined>;
|
|
64
|
+
readonly ariaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
65
|
+
readonly unit: import("@angular/core").Signal<string>;
|
|
66
|
+
readonly formattedValue: import("@angular/core").Signal<string>;
|
|
67
|
+
readonly computedHeight: import("@angular/core").Signal<string | undefined>;
|
|
68
|
+
readonly computedSeverityClass: import("@angular/core").Signal<string>;
|
|
69
|
+
readonly computedHostClasses: import("@angular/core").Signal<string>;
|
|
70
|
+
constructor();
|
|
71
|
+
}
|