@origostudio/angular-renderer 0.0.40
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 +424 -0
- package/README.md +11 -0
- package/package.json +25 -0
- package/src/adapters/web/adapter.d.ts +20 -0
- package/src/adapters/web/adapter.js +140 -0
- package/src/adapters/web/adapter.js.map +1 -0
- package/src/adapters/web/experience-adapter.service.d.ts +6 -0
- package/src/adapters/web/experience-adapter.service.js +44 -0
- package/src/adapters/web/experience-adapter.service.js.map +1 -0
- package/src/components/primitives/breadcrumbs/breadcrumbs.component.d.ts +27 -0
- package/src/components/primitives/breadcrumbs/breadcrumbs.component.js +77 -0
- package/src/components/primitives/breadcrumbs/breadcrumbs.component.js.map +1 -0
- package/src/components/primitives/button/button.component.d.ts +26 -0
- package/src/components/primitives/button/button.component.js +74 -0
- package/src/components/primitives/button/button.component.js.map +1 -0
- package/src/components/primitives/card/card.component.d.ts +27 -0
- package/src/components/primitives/card/card.component.js +77 -0
- package/src/components/primitives/card/card.component.js.map +1 -0
- package/src/components/primitives/checkbox/checkbox.component.d.ts +29 -0
- package/src/components/primitives/checkbox/checkbox.component.js +81 -0
- package/src/components/primitives/checkbox/checkbox.component.js.map +1 -0
- package/src/components/primitives/chip/chip.component.d.ts +22 -0
- package/src/components/primitives/chip/chip.component.js +79 -0
- package/src/components/primitives/chip/chip.component.js.map +1 -0
- package/src/components/primitives/data-grid/data-grid.component.d.ts +48 -0
- package/src/components/primitives/data-grid/data-grid.component.js +135 -0
- package/src/components/primitives/data-grid/data-grid.component.js.map +1 -0
- package/src/components/primitives/form-field/form-field.component.d.ts +30 -0
- package/src/components/primitives/form-field/form-field.component.js +81 -0
- package/src/components/primitives/form-field/form-field.component.js.map +1 -0
- package/src/components/primitives/hbox/hbox.component.d.ts +25 -0
- package/src/components/primitives/hbox/hbox.component.js +92 -0
- package/src/components/primitives/hbox/hbox.component.js.map +1 -0
- package/src/components/primitives/label/label.component.d.ts +23 -0
- package/src/components/primitives/label/label.component.js +62 -0
- package/src/components/primitives/label/label.component.js.map +1 -0
- package/src/components/primitives/list/list.component.d.ts +25 -0
- package/src/components/primitives/list/list.component.js +79 -0
- package/src/components/primitives/list/list.component.js.map +1 -0
- package/src/components/primitives/radio-group/radio-group.component.d.ts +35 -0
- package/src/components/primitives/radio-group/radio-group.component.js +86 -0
- package/src/components/primitives/radio-group/radio-group.component.js.map +1 -0
- package/src/components/primitives/select/select.component.d.ts +39 -0
- package/src/components/primitives/select/select.component.js +91 -0
- package/src/components/primitives/select/select.component.js.map +1 -0
- package/src/components/primitives/sidebar/sidebar.component.d.ts +37 -0
- package/src/components/primitives/sidebar/sidebar.component.js +106 -0
- package/src/components/primitives/sidebar/sidebar.component.js.map +1 -0
- package/src/components/primitives/switch/switch.component.d.ts +22 -0
- package/src/components/primitives/switch/switch.component.js +80 -0
- package/src/components/primitives/switch/switch.component.js.map +1 -0
- package/src/components/primitives/tabs/tabs.component.d.ts +34 -0
- package/src/components/primitives/tabs/tabs.component.js +124 -0
- package/src/components/primitives/tabs/tabs.component.js.map +1 -0
- package/src/components/primitives/text-input/text-input.component.d.ts +29 -0
- package/src/components/primitives/text-input/text-input.component.js +81 -0
- package/src/components/primitives/text-input/text-input.component.js.map +1 -0
- package/src/components/primitives/textarea/textarea.component.d.ts +36 -0
- package/src/components/primitives/textarea/textarea.component.js +91 -0
- package/src/components/primitives/textarea/textarea.component.js.map +1 -0
- package/src/components/primitives/vbox/vbox.component.d.ts +25 -0
- package/src/components/primitives/vbox/vbox.component.js +92 -0
- package/src/components/primitives/vbox/vbox.component.js.map +1 -0
- package/src/devtools/devtools-bridge.d.ts +34 -0
- package/src/devtools/devtools-bridge.js +146 -0
- package/src/devtools/devtools-bridge.js.map +1 -0
- package/src/devtools/index.d.ts +1 -0
- package/src/devtools/index.js +5 -0
- package/src/devtools/index.js.map +1 -0
- package/src/index.d.ts +23 -0
- package/src/index.js +27 -0
- package/src/index.js.map +1 -0
- package/src/lib/primitives.provider.d.ts +2 -0
- package/src/lib/primitives.provider.js +54 -0
- package/src/lib/primitives.provider.js.map +1 -0
- package/src/lib/renderer.component.d.ts +12 -0
- package/src/lib/renderer.component.js +114 -0
- package/src/lib/renderer.component.js.map +1 -0
- package/src/lib/renderer.tokens.d.ts +2 -0
- package/src/lib/renderer.tokens.js +10 -0
- package/src/lib/renderer.tokens.js.map +1 -0
- package/src/lib/theme.provider.d.ts +13 -0
- package/src/lib/theme.provider.js +77 -0
- package/src/lib/theme.provider.js.map +1 -0
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WebExperienceAdapterService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
let WebExperienceAdapterService = (() => {
|
|
7
|
+
let _classDecorators = [(0, core_1.Injectable)({ providedIn: 'root' })];
|
|
8
|
+
let _classDescriptor;
|
|
9
|
+
let _classExtraInitializers = [];
|
|
10
|
+
let _classThis;
|
|
11
|
+
var WebExperienceAdapterService = class {
|
|
12
|
+
static { _classThis = this; }
|
|
13
|
+
static {
|
|
14
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
15
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
16
|
+
WebExperienceAdapterService = _classThis = _classDescriptor.value;
|
|
17
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
18
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
19
|
+
}
|
|
20
|
+
_state = (0, core_1.signal)({});
|
|
21
|
+
getState(nodeId, property) {
|
|
22
|
+
return this._state()[nodeId]?.[property];
|
|
23
|
+
}
|
|
24
|
+
dispatchCapability(nodeId, actionName, payload) {
|
|
25
|
+
// In Phase 1, this provides the stateless translation boundary (AD-15).
|
|
26
|
+
// Real dispatching logic to the core BADL engine would be wired here.
|
|
27
|
+
console.debug(`[ExperienceAdapter] Dispatched capability '${actionName}' for node '${nodeId}'`, payload);
|
|
28
|
+
}
|
|
29
|
+
updateState(nodeId, property, value) {
|
|
30
|
+
// In Phase 1, this provides the stateless translation boundary (AD-15).
|
|
31
|
+
console.debug(`[ExperienceAdapter] Updated state for node '${nodeId}', property '${property}'`, value);
|
|
32
|
+
this._state.update(state => ({
|
|
33
|
+
...state,
|
|
34
|
+
[nodeId]: {
|
|
35
|
+
...state[nodeId],
|
|
36
|
+
[property]: value,
|
|
37
|
+
},
|
|
38
|
+
}));
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
return WebExperienceAdapterService = _classThis;
|
|
42
|
+
})();
|
|
43
|
+
exports.WebExperienceAdapterService = WebExperienceAdapterService;
|
|
44
|
+
//# sourceMappingURL=experience-adapter.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experience-adapter.service.js","sourceRoot":"","sources":["../../../../../../packages/angular-renderer/src/adapters/web/experience-adapter.service.ts"],"names":[],"mappings":";;;;AAAA,wCAAmD;IAGtC,2BAA2B;4BADvC,IAAA,iBAAU,EAAC,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;;;;;;;;YACnC,qLA+BC;;;YA/BY,+DAA2B;;QAC9B,MAAM,GAAG,IAAA,aAAM,EAA0C,EAAE,CAAC,CAAC;QAErE,QAAQ,CAAC,MAAc,EAAE,QAAgB;YACvC,OAAO,IAAI,CAAC,MAAM,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC;QAC3C,CAAC;QAED,kBAAkB,CAAC,MAAc,EAAE,UAAkB,EAAE,OAAiB;YACtE,wEAAwE;YACxE,sEAAsE;YACtE,OAAO,CAAC,KAAK,CACX,8CAA8C,UAAU,eAAe,MAAM,GAAG,EAChF,OAAO,CACR,CAAC;QACJ,CAAC;QAED,WAAW,CAAC,MAAc,EAAE,QAAgB,EAAE,KAAc;YAC1D,wEAAwE;YACxE,OAAO,CAAC,KAAK,CACX,+CAA+C,MAAM,gBAAgB,QAAQ,GAAG,EAChF,KAAK,CACN,CAAC;YAEF,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;gBAC3B,GAAG,KAAK;gBACR,CAAC,MAAM,CAAC,EAAE;oBACR,GAAG,KAAK,CAAC,MAAM,CAAC;oBAChB,CAAC,QAAQ,CAAC,EAAE,KAAK;iBAClB;aACF,CAAC,CAAC,CAAC;QACN,CAAC;;;;AA9BU,kEAA2B"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InteractionContract } from '@origostudio/core';
|
|
2
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
3
|
+
export interface BreadcrumbItem {
|
|
4
|
+
label: string;
|
|
5
|
+
outcomeRef?: string;
|
|
6
|
+
}
|
|
7
|
+
export interface BreadcrumbsProps {
|
|
8
|
+
items?: Array<BreadcrumbItem>;
|
|
9
|
+
'aria-label'?: string;
|
|
10
|
+
'aria-describedby'?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare class BreadcrumbsComponent implements OrigoAdapter<BreadcrumbsProps> {
|
|
13
|
+
static readonly contractSchema: {
|
|
14
|
+
items: string;
|
|
15
|
+
};
|
|
16
|
+
static readonly strictContract = false;
|
|
17
|
+
contract: import("@angular/core").InputSignal<InteractionContract<BreadcrumbsProps>>;
|
|
18
|
+
private experienceAdapter;
|
|
19
|
+
private sanitizer;
|
|
20
|
+
computedAriaLabel: import("@angular/core").Signal<string>;
|
|
21
|
+
computedAriaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
22
|
+
computedItems: import("@angular/core").Signal<{
|
|
23
|
+
label: string;
|
|
24
|
+
outcomeRef: string | undefined;
|
|
25
|
+
}[]>;
|
|
26
|
+
onItemClick(event: Event, item: BreadcrumbItem, isLast: boolean): void;
|
|
27
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BreadcrumbsComponent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const platform_browser_1 = require("@angular/platform-browser");
|
|
7
|
+
const experience_adapter_service_1 = require("../../../adapters/web/experience-adapter.service");
|
|
8
|
+
let BreadcrumbsComponent = (() => {
|
|
9
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
10
|
+
selector: 'origo-breadcrumbs',
|
|
11
|
+
standalone: true,
|
|
12
|
+
templateUrl: './breadcrumbs.component.html',
|
|
13
|
+
styleUrls: ['./breadcrumbs.component.scss'],
|
|
14
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
15
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
16
|
+
host: {
|
|
17
|
+
'[class.origo-breadcrumbs]': 'true',
|
|
18
|
+
'[attr.data-testid]': 'contract().id',
|
|
19
|
+
'[attr.aria-label]': 'computedAriaLabel()',
|
|
20
|
+
'[attr.aria-describedby]': 'computedAriaDescribedBy()',
|
|
21
|
+
role: 'navigation',
|
|
22
|
+
},
|
|
23
|
+
})];
|
|
24
|
+
let _classDescriptor;
|
|
25
|
+
let _classExtraInitializers = [];
|
|
26
|
+
let _classThis;
|
|
27
|
+
var BreadcrumbsComponent = class {
|
|
28
|
+
static { _classThis = this; }
|
|
29
|
+
static {
|
|
30
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
31
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
32
|
+
BreadcrumbsComponent = _classThis = _classDescriptor.value;
|
|
33
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
34
|
+
}
|
|
35
|
+
static contractSchema = {
|
|
36
|
+
items: 'array',
|
|
37
|
+
};
|
|
38
|
+
static strictContract = false;
|
|
39
|
+
contract = core_1.input.required();
|
|
40
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService);
|
|
41
|
+
sanitizer = (0, core_1.inject)(platform_browser_1.DomSanitizer);
|
|
42
|
+
computedAriaLabel = (0, core_1.computed)(() => {
|
|
43
|
+
const label = this.contract().props?.['aria-label'];
|
|
44
|
+
return label !== undefined && label !== null ? String(label) : 'Breadcrumbs';
|
|
45
|
+
});
|
|
46
|
+
computedAriaDescribedBy = (0, core_1.computed)(() => {
|
|
47
|
+
const desc = this.contract().props?.['aria-describedby'];
|
|
48
|
+
return desc !== undefined && desc !== null ? String(desc) : undefined;
|
|
49
|
+
});
|
|
50
|
+
computedItems = (0, core_1.computed)(() => {
|
|
51
|
+
const items = this.contract().props?.items;
|
|
52
|
+
if (!Array.isArray(items))
|
|
53
|
+
return [];
|
|
54
|
+
return items
|
|
55
|
+
.filter(item => item != null && item.label != null)
|
|
56
|
+
.map(item => {
|
|
57
|
+
return {
|
|
58
|
+
label: String(item.label),
|
|
59
|
+
outcomeRef: item.outcomeRef ? String(item.outcomeRef) : undefined,
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
});
|
|
63
|
+
onItemClick(event, item, isLast) {
|
|
64
|
+
if (isLast || !item.outcomeRef) {
|
|
65
|
+
event.preventDefault();
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
this.experienceAdapter.updateState(this.contract().id, 'activeOutcome', item.outcomeRef);
|
|
69
|
+
}
|
|
70
|
+
static {
|
|
71
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return BreadcrumbsComponent = _classThis;
|
|
75
|
+
})();
|
|
76
|
+
exports.BreadcrumbsComponent = BreadcrumbsComponent;
|
|
77
|
+
//# sourceMappingURL=breadcrumbs.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"breadcrumbs.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/breadcrumbs/breadcrumbs.component.ts"],"names":[],"mappings":";;;;AAAA,wCAOuB;AACvB,gEAAyD;AAGzD,iGAA+F;IA4BlF,oBAAoB;4BAfhC,IAAA,gBAAS,EAAC;YACT,QAAQ,EAAE,mBAAmB;YAC7B,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,8BAA8B;YAC3C,SAAS,EAAE,CAAC,8BAA8B,CAAC;YAC3C,eAAe,EAAE,8BAAuB,CAAC,MAAM;YAC/C,aAAa,EAAE,wBAAiB,CAAC,SAAS;YAC1C,IAAI,EAAE;gBACJ,2BAA2B,EAAE,MAAM;gBACnC,oBAAoB,EAAE,eAAe;gBACrC,mBAAmB,EAAE,qBAAqB;gBAC1C,yBAAyB,EAAE,2BAA2B;gBACtD,IAAI,EAAE,YAAY;aACnB;SACF,CAAC;;;;;;;;YACF,qLA2CC;;;;QA1CC,MAAM,CAAU,cAAc,GAAG;YAC/B,KAAK,EAAE,OAAO;SACf,CAAC;QACF,MAAM,CAAU,cAAc,GAAG,KAAK,CAAC;QAEvC,QAAQ,GAAG,YAAK,CAAC,QAAQ,EAAyC,CAAC;QAE3D,iBAAiB,GAAG,IAAA,aAAM,EAAC,wDAA2B,CAAC,CAAC;QACxD,SAAS,GAAG,IAAA,aAAM,EAAC,+BAAY,CAAC,CAAC;QAEzC,iBAAiB,GAAG,IAAA,eAAQ,EAAC,GAAG,EAAE;YAChC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,CAAC;YACpD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAA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Ae,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;QAC3F,CAAC;;YA1CU,+DAAoB;;;;;AAApB,oDAAoB"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { InteractionContract } from '@origostudio/core';
|
|
2
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
3
|
+
export interface ButtonProps {
|
|
4
|
+
label?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
type?: 'button' | 'submit' | 'reset';
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
'aria-describedby'?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class ButtonComponent implements OrigoAdapter<ButtonProps> {
|
|
11
|
+
static readonly contractSchema: {
|
|
12
|
+
label: string;
|
|
13
|
+
disabled: string;
|
|
14
|
+
type: string;
|
|
15
|
+
};
|
|
16
|
+
static readonly strictContract = false;
|
|
17
|
+
contract: import("@angular/core").InputSignal<InteractionContract<ButtonProps>>;
|
|
18
|
+
computedLabel: import("@angular/core").Signal<string>;
|
|
19
|
+
computedDisabled: import("@angular/core").Signal<boolean>;
|
|
20
|
+
computedType: import("@angular/core").Signal<"button" | "submit" | "reset">;
|
|
21
|
+
computedAriaLabel: import("@angular/core").Signal<string | undefined>;
|
|
22
|
+
computedAriaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
23
|
+
action: import("@angular/core").OutputEmitterRef<void>;
|
|
24
|
+
private experienceAdapter;
|
|
25
|
+
onClick(): void;
|
|
26
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ButtonComponent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const experience_adapter_service_1 = require("../../../adapters/web/experience-adapter.service");
|
|
7
|
+
let ButtonComponent = (() => {
|
|
8
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
9
|
+
selector: 'origo-button',
|
|
10
|
+
standalone: true,
|
|
11
|
+
templateUrl: './button.component.html',
|
|
12
|
+
styleUrls: ['./button.component.scss'],
|
|
13
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
14
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
15
|
+
host: {
|
|
16
|
+
'[class.origo-button]': 'true',
|
|
17
|
+
'[attr.data-testid]': 'contract().id ?? ""',
|
|
18
|
+
},
|
|
19
|
+
})];
|
|
20
|
+
let _classDescriptor;
|
|
21
|
+
let _classExtraInitializers = [];
|
|
22
|
+
let _classThis;
|
|
23
|
+
var ButtonComponent = class {
|
|
24
|
+
static { _classThis = this; }
|
|
25
|
+
static {
|
|
26
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
27
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
28
|
+
ButtonComponent = _classThis = _classDescriptor.value;
|
|
29
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
30
|
+
}
|
|
31
|
+
static contractSchema = {
|
|
32
|
+
label: 'string',
|
|
33
|
+
disabled: 'boolean',
|
|
34
|
+
type: 'string',
|
|
35
|
+
};
|
|
36
|
+
static strictContract = false;
|
|
37
|
+
contract = core_1.input.required();
|
|
38
|
+
computedLabel = (0, core_1.computed)(() => this.contract().props?.label ?? 'Button');
|
|
39
|
+
computedDisabled = (0, core_1.computed)(() => !!this.contract().props?.disabled);
|
|
40
|
+
computedType = (0, core_1.computed)(() => {
|
|
41
|
+
const type = this.contract().props?.type;
|
|
42
|
+
return type === 'button' || type === 'submit' || type === 'reset' ? type : 'button';
|
|
43
|
+
});
|
|
44
|
+
computedAriaLabel = (0, core_1.computed)(() => {
|
|
45
|
+
const label = this.contract().props?.['aria-label'];
|
|
46
|
+
return label !== undefined && label !== null && String(label).trim() !== ''
|
|
47
|
+
? String(label)
|
|
48
|
+
: undefined;
|
|
49
|
+
});
|
|
50
|
+
computedAriaDescribedBy = (0, core_1.computed)(() => {
|
|
51
|
+
const desc = this.contract().props?.['aria-describedby'];
|
|
52
|
+
return desc !== undefined && desc !== null && String(desc).trim() !== ''
|
|
53
|
+
? String(desc)
|
|
54
|
+
: undefined;
|
|
55
|
+
});
|
|
56
|
+
action = (0, core_1.output)();
|
|
57
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService);
|
|
58
|
+
onClick() {
|
|
59
|
+
if (this.computedDisabled())
|
|
60
|
+
return;
|
|
61
|
+
const id = this.contract().id;
|
|
62
|
+
if (!id)
|
|
63
|
+
return;
|
|
64
|
+
this.experienceAdapter.dispatchCapability(id, 'click');
|
|
65
|
+
this.action.emit();
|
|
66
|
+
}
|
|
67
|
+
static {
|
|
68
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return ButtonComponent = _classThis;
|
|
72
|
+
})();
|
|
73
|
+
exports.ButtonComponent = ButtonComponent;
|
|
74
|
+
//# sourceMappingURL=button.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"button.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/button/button.component.ts"],"names":[],"mappings":";;;;AAAA,wCAQuB;AAGvB,iGAA+F;IAsBlF,eAAe;4BAZ3B,IAAA,gBAAS,EAAC;YACT,QAAQ,EAAE,cAAc;YACxB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,yBAAyB;YACtC,SAAS,EAAE,CAAC,yBAAyB,CAAC;YACtC,eAAe,EAAE,8BAAuB,CAAC,MAAM;YAC/C,aAAa,EAAE,wBAAiB,CAAC,SAAS;YAC1C,IAAI,EAAE;gBACJ,sBAAsB,EAAE,MAAM;gBAC9B,oBAAoB,EAAE,q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IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,kBAAkB,CAAC,CAAC;YACzD,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,IAAI,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE;gBACtE,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC;gBACd,CAAC,CAAC,SAAS,CAAC;QAChB,CAAC,CAAC,CAAC;QAEH,MAAM,GAAG,IAAA,aAAM,GAAQ,CAAC;QAEhB,iBAAiB,GAAG,IAAA,aAAM,EAAC,wDAA2B,CAAC,CAAC;QAEhE,OAAO;YACL,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAAE,OAAO;YAEpC,MAAM,EAAE,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,CAAC;YAC9B,IAAI,CAAC,EAAE;gBAAE,OAAO;YAEhB,IAAI,CAAC,iBAAiB,CAAC,kBAAkB,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;YACvD,IAAI,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;QACrB,CAAC;;YAzCU,+DAAe;;;;;AAAf,0CAAe"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { InteractionContract } from '@origostudio/core';
|
|
2
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
3
|
+
export interface CardProps {
|
|
4
|
+
title?: string;
|
|
5
|
+
subtitle?: string;
|
|
6
|
+
imageUrl?: string;
|
|
7
|
+
imageAlt?: string;
|
|
8
|
+
'aria-label'?: string;
|
|
9
|
+
'aria-describedby'?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare class CardComponent implements OrigoAdapter<CardProps> {
|
|
12
|
+
static readonly contractSchema: {
|
|
13
|
+
title: string;
|
|
14
|
+
subtitle: string;
|
|
15
|
+
imageUrl: string;
|
|
16
|
+
imageAlt: string;
|
|
17
|
+
};
|
|
18
|
+
static readonly strictContract = false;
|
|
19
|
+
contract: import("@angular/core").InputSignal<InteractionContract<CardProps>>;
|
|
20
|
+
private sanitizer;
|
|
21
|
+
computedTitle: import("@angular/core").Signal<string | undefined>;
|
|
22
|
+
computedSubtitle: import("@angular/core").Signal<string | undefined>;
|
|
23
|
+
computedImageUrl: import("@angular/core").Signal<string | undefined>;
|
|
24
|
+
computedImageAlt: import("@angular/core").Signal<string>;
|
|
25
|
+
computedAriaLabel: import("@angular/core").Signal<string | undefined>;
|
|
26
|
+
computedAriaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
27
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CardComponent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const platform_browser_1 = require("@angular/platform-browser");
|
|
7
|
+
let CardComponent = (() => {
|
|
8
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
9
|
+
selector: 'origo-card',
|
|
10
|
+
standalone: true,
|
|
11
|
+
templateUrl: './card.component.html',
|
|
12
|
+
styleUrls: ['./card.component.scss'],
|
|
13
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
14
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
15
|
+
host: {
|
|
16
|
+
'[class.origo-card]': 'true',
|
|
17
|
+
'[attr.data-testid]': 'contract().id',
|
|
18
|
+
'[attr.aria-label]': 'computedAriaLabel()',
|
|
19
|
+
'[attr.aria-describedby]': 'computedAriaDescribedBy()',
|
|
20
|
+
},
|
|
21
|
+
})];
|
|
22
|
+
let _classDescriptor;
|
|
23
|
+
let _classExtraInitializers = [];
|
|
24
|
+
let _classThis;
|
|
25
|
+
var CardComponent = class {
|
|
26
|
+
static { _classThis = this; }
|
|
27
|
+
static {
|
|
28
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
29
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
30
|
+
CardComponent = _classThis = _classDescriptor.value;
|
|
31
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
32
|
+
}
|
|
33
|
+
static contractSchema = {
|
|
34
|
+
title: 'string',
|
|
35
|
+
subtitle: 'string',
|
|
36
|
+
imageUrl: 'string',
|
|
37
|
+
imageAlt: 'string',
|
|
38
|
+
};
|
|
39
|
+
static strictContract = false;
|
|
40
|
+
contract = core_1.input.required();
|
|
41
|
+
sanitizer = (0, core_1.inject)(platform_browser_1.DomSanitizer);
|
|
42
|
+
computedTitle = (0, core_1.computed)(() => {
|
|
43
|
+
const title = this.contract().props?.title;
|
|
44
|
+
return title !== undefined && title !== null ? String(title) : undefined;
|
|
45
|
+
});
|
|
46
|
+
computedSubtitle = (0, core_1.computed)(() => {
|
|
47
|
+
const subtitle = this.contract().props?.subtitle;
|
|
48
|
+
return subtitle !== undefined && subtitle !== null ? String(subtitle) : undefined;
|
|
49
|
+
});
|
|
50
|
+
computedImageUrl = (0, core_1.computed)(() => {
|
|
51
|
+
const url = this.contract().props?.imageUrl;
|
|
52
|
+
if (url === undefined || url === null || url === '')
|
|
53
|
+
return undefined;
|
|
54
|
+
// Sanitize URL for image source
|
|
55
|
+
const sanitizedUrl = this.sanitizer.sanitize(core_1.SecurityContext.URL, String(url));
|
|
56
|
+
return sanitizedUrl || undefined;
|
|
57
|
+
});
|
|
58
|
+
computedImageAlt = (0, core_1.computed)(() => {
|
|
59
|
+
const alt = this.contract().props?.imageAlt;
|
|
60
|
+
return alt !== undefined && alt !== null ? String(alt) : '';
|
|
61
|
+
});
|
|
62
|
+
computedAriaLabel = (0, core_1.computed)(() => {
|
|
63
|
+
const label = this.contract().props?.['aria-label'];
|
|
64
|
+
return label !== undefined && label !== null ? String(label) : undefined;
|
|
65
|
+
});
|
|
66
|
+
computedAriaDescribedBy = (0, core_1.computed)(() => {
|
|
67
|
+
const desc = this.contract().props?.['aria-describedby'];
|
|
68
|
+
return desc !== undefined && desc !== null ? String(desc) : undefined;
|
|
69
|
+
});
|
|
70
|
+
static {
|
|
71
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
return CardComponent = _classThis;
|
|
75
|
+
})();
|
|
76
|
+
exports.CardComponent = CardComponent;
|
|
77
|
+
//# sourceMappingURL=card.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"card.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/card/card.component.ts"],"names":[],"mappings":";;;;AAAA,wCAQuB;AACvB,gEAAyD;IA2B5C,aAAa;4BAdzB,IAAA,gBAAS,EAAC;YACT,QAAQ,EAAE,YAAY;YACtB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,uBAAuB;YACpC,SAAS,EAAE,CAAC,uBAAuB,CAAC;YACpC,eAAe,EAAE,8BAAuB,CAAC,MAAM;YAC/C,aAAa,EAAE,wBAAiB,CAAC,SAAS;YAC1C,IAAI,EAAE;gBACJ,oBAAoB,EAAE,MAAM;gBAC5B,oBAAoB,EAAE,eAAe;gBACrC,mBAAmB,EAAE,qBAAqB;gBAC1C,yBAAyB,EAAE,2BAA2B;aACvD;SACF,CAAC;;;;;;;;YACF,qLA8CC;;;;QA7CC,MAAM,CAAU,cAAc,GAAG;YAC/B,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,QAAQ;YAClB,QAAQ,EAAE,QAAQ;SACnB,CAAC;QACF,MAAM,CAAU,cAAc,GAAG,KAAK,CAAC;QAEvC,QAAQ,GAAG,YAAK,CAAC,QAAQ,EAAkC,CAAC;QAEpD,SAAS,GAAG,IAAA,aAAM,EAAC,+BAAY,CA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,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QAC9D,CAAC,CAAC,CAAC;QAEH,iBAAiB,GAAG,IAAA,eAAQ,EAAC,GAAG,EAAE;YAChC,MAAM,KAAK,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,YAAY,CAAC,CAAC;YACpD,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC3E,CAAC,CAAC,CAAC;QAEH,uBAAuB,GAAG,IAAA,eAAQ,EAAC,GAAG,EAAE;YACtC,MAAM,IAAI,GAAG,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,kBAAkB,CAAC,CAAC;YACzD,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QACxE,CAAC,CAAC,CAAC;;YA7CQ,+DAAa;;;;;AAAb,sCAAa"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { InteractionContract } from '@origostudio/core';
|
|
2
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
3
|
+
export interface CheckboxProps {
|
|
4
|
+
checked?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
'aria-describedby'?: string;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare class CheckboxComponent implements OrigoAdapter<CheckboxProps> {
|
|
12
|
+
static readonly contractSchema: {
|
|
13
|
+
checked: string;
|
|
14
|
+
label: string;
|
|
15
|
+
disabled: string;
|
|
16
|
+
required: string;
|
|
17
|
+
};
|
|
18
|
+
static readonly strictContract = false;
|
|
19
|
+
contract: import("@angular/core").InputSignal<InteractionContract<CheckboxProps>>;
|
|
20
|
+
checked: import("@angular/core").ModelSignal<boolean>;
|
|
21
|
+
computedLabel: import("@angular/core").Signal<string>;
|
|
22
|
+
computedDisabled: import("@angular/core").Signal<boolean>;
|
|
23
|
+
computedRequired: import("@angular/core").Signal<boolean>;
|
|
24
|
+
computedAriaLabel: import("@angular/core").Signal<string | undefined>;
|
|
25
|
+
computedAriaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
26
|
+
private experienceAdapter;
|
|
27
|
+
constructor();
|
|
28
|
+
onChange(event: Event): void;
|
|
29
|
+
}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CheckboxComponent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const experience_adapter_service_1 = require("../../../adapters/web/experience-adapter.service");
|
|
7
|
+
let CheckboxComponent = (() => {
|
|
8
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
9
|
+
selector: 'origo-checkbox',
|
|
10
|
+
standalone: true,
|
|
11
|
+
templateUrl: './checkbox.component.html',
|
|
12
|
+
styleUrls: ['./checkbox.component.scss'],
|
|
13
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
14
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
15
|
+
host: {
|
|
16
|
+
'[class.origo-checkbox]': 'true',
|
|
17
|
+
'[attr.data-testid]': 'contract().id ?? ""',
|
|
18
|
+
},
|
|
19
|
+
})];
|
|
20
|
+
let _classDescriptor;
|
|
21
|
+
let _classExtraInitializers = [];
|
|
22
|
+
let _classThis;
|
|
23
|
+
var CheckboxComponent = class {
|
|
24
|
+
static { _classThis = this; }
|
|
25
|
+
static {
|
|
26
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
27
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
28
|
+
CheckboxComponent = _classThis = _classDescriptor.value;
|
|
29
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
30
|
+
}
|
|
31
|
+
static contractSchema = {
|
|
32
|
+
checked: 'boolean',
|
|
33
|
+
label: 'string',
|
|
34
|
+
disabled: 'boolean',
|
|
35
|
+
required: 'boolean',
|
|
36
|
+
};
|
|
37
|
+
static strictContract = false;
|
|
38
|
+
contract = core_1.input.required();
|
|
39
|
+
checked = (0, core_1.model)(false);
|
|
40
|
+
computedLabel = (0, core_1.computed)(() => this.contract().props?.label ?? '');
|
|
41
|
+
computedDisabled = (0, core_1.computed)(() => !!this.contract().props?.disabled);
|
|
42
|
+
computedRequired = (0, core_1.computed)(() => !!this.contract().props?.required);
|
|
43
|
+
computedAriaLabel = (0, core_1.computed)(() => {
|
|
44
|
+
const label = this.contract().props?.['aria-label'];
|
|
45
|
+
return label !== undefined && label !== null && String(label).trim() !== ''
|
|
46
|
+
? String(label)
|
|
47
|
+
: undefined;
|
|
48
|
+
});
|
|
49
|
+
computedAriaDescribedBy = (0, core_1.computed)(() => {
|
|
50
|
+
const desc = this.contract().props?.['aria-describedby'];
|
|
51
|
+
return desc !== undefined && desc !== null && String(desc).trim() !== ''
|
|
52
|
+
? String(desc)
|
|
53
|
+
: undefined;
|
|
54
|
+
});
|
|
55
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService);
|
|
56
|
+
constructor() {
|
|
57
|
+
(0, core_1.effect)(() => {
|
|
58
|
+
const contractVal = !!this.contract().props?.checked;
|
|
59
|
+
(0, core_1.untracked)(() => {
|
|
60
|
+
if (contractVal === this.checked())
|
|
61
|
+
return;
|
|
62
|
+
this.checked.set(contractVal);
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
onChange(event) {
|
|
67
|
+
const target = event.target;
|
|
68
|
+
if (!target || this.computedDisabled())
|
|
69
|
+
return;
|
|
70
|
+
const isChecked = target.checked;
|
|
71
|
+
this.checked.set(isChecked);
|
|
72
|
+
this.experienceAdapter.updateState(this.contract().id, 'checked', isChecked);
|
|
73
|
+
}
|
|
74
|
+
static {
|
|
75
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
return CheckboxComponent = _classThis;
|
|
79
|
+
})();
|
|
80
|
+
exports.CheckboxComponent = CheckboxComponent;
|
|
81
|
+
//# sourceMappingURL=checkbox.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"checkbox.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/checkbox/checkbox.component.ts"],"names":[],"mappings":";;;;AAAA,wCAUuB;AAGvB,iGAA+F;IAuBlF,iBAAiB;4BAZ7B,IAAA,gBAAS,EAAC;YACT,QAAQ,EAAE,gBAAgB;YAC1B,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,2BAA2B;YACxC,SAAS,EAAE,CAAC,2BAA2B,CAAC;YACxC,eAAe,EAAE,8BAAuB,CAAC,MAAM;YAC/C,aAAa,EAAE,wBAAiB,CAAC,SAAS;YAC1C,IAAI,EAAE;gBACJ,wBAAwB,EAAE,MAAM;gBAChC,oBAAoB,EAAE,qBAAqB;aAC5C;SACF,CAAC;;;;;;;;YACF,qLAgDC;;;;QA/CC,MAAM,CAAU,cAAc,GAAG;YAC/B,OAAO,EAAE,SAAS;YAClB,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,SAAS;YACnB,QAAQ,EAAE,SAAS;SACpB,CAAC;QACF,MAAM,CAAU,cAAc,GAAG,KAAK,CAAC;QAEvC,QAAQ,GAAG,YAAK,CAAC,QAAQ,EAAsC,CAAC;QAChE,OAAO,GAAG,IAAA,YAAK,EAAU,KAAK,CAAC,CAAC;QA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C,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;gBACrD,IAAA,gBAAS,EAAC,GAAG,EAAE;oBACb,IAAI,WAAW,KAAK,IAAI,CAAC,OAAO,EAAE;wBAAE,OAAO;oBAC3C,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,CAAC,CAAC;gBAChC,CAAC,CAAC,CAAC;YACL,CAAC,CAAC,CAAC;QACL,CAAC;QAED,QAAQ,CAAC,KAAY;YACnB,MAAM,MAAM,GAAG,KAAK,CAAC,MAAiC,CAAC;YACvD,IAAI,CAAC,MAAM,IAAI,IAAI,CAAC,gBAAgB,EAAE;gBAAE,OAAO;YAE/C,MAAM,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC;YACjC,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC;YAC5B,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;QAC/E,CAAC;;YA/CU,+DAAiB;;;;;AAAjB,8CAAiB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { InteractionContract } from '@origostudio/core';
|
|
2
|
+
import { OrigoAdapter } from '../../../adapters/web/adapter';
|
|
3
|
+
export interface ChipProps {
|
|
4
|
+
selected?: boolean;
|
|
5
|
+
label?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
'aria-label'?: string;
|
|
8
|
+
'aria-describedby'?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare class ChipComponent implements OrigoAdapter<ChipProps> {
|
|
11
|
+
static readonly contractSchema: Record<string, 'string' | 'number' | 'boolean' | 'object' | 'array'>;
|
|
12
|
+
static readonly strictContract = false;
|
|
13
|
+
contract: import("@angular/core").InputSignal<InteractionContract<ChipProps>>;
|
|
14
|
+
selected: import("@angular/core").ModelSignal<boolean>;
|
|
15
|
+
computedLabel: import("@angular/core").Signal<string>;
|
|
16
|
+
computedDisabled: import("@angular/core").Signal<boolean>;
|
|
17
|
+
computedAriaLabel: import("@angular/core").Signal<string | undefined>;
|
|
18
|
+
computedAriaDescribedBy: import("@angular/core").Signal<string | undefined>;
|
|
19
|
+
private experienceAdapter;
|
|
20
|
+
constructor();
|
|
21
|
+
onClick(): void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ChipComponent = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const core_1 = require("@angular/core");
|
|
6
|
+
const adapter_1 = require("../../../adapters/web/adapter");
|
|
7
|
+
const experience_adapter_service_1 = require("../../../adapters/web/experience-adapter.service");
|
|
8
|
+
let ChipComponent = (() => {
|
|
9
|
+
let _classDecorators = [(0, core_1.Component)({
|
|
10
|
+
selector: 'origo-chip',
|
|
11
|
+
standalone: true,
|
|
12
|
+
templateUrl: './chip.component.html',
|
|
13
|
+
styleUrls: ['./chip.component.scss'],
|
|
14
|
+
changeDetection: core_1.ChangeDetectionStrategy.OnPush,
|
|
15
|
+
encapsulation: core_1.ViewEncapsulation.ShadowDom,
|
|
16
|
+
host: {
|
|
17
|
+
'[class.origo-chip]': 'true',
|
|
18
|
+
'[attr.data-testid]': 'contract().id ?? ""',
|
|
19
|
+
},
|
|
20
|
+
})];
|
|
21
|
+
let _classDescriptor;
|
|
22
|
+
let _classExtraInitializers = [];
|
|
23
|
+
let _classThis;
|
|
24
|
+
var ChipComponent = class {
|
|
25
|
+
static { _classThis = this; }
|
|
26
|
+
static {
|
|
27
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(null) : void 0;
|
|
28
|
+
tslib_1.__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
29
|
+
ChipComponent = _classThis = _classDescriptor.value;
|
|
30
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
31
|
+
}
|
|
32
|
+
static contractSchema = {
|
|
33
|
+
selected: 'boolean',
|
|
34
|
+
label: 'string',
|
|
35
|
+
disabled: 'boolean',
|
|
36
|
+
};
|
|
37
|
+
static strictContract = false;
|
|
38
|
+
contract = core_1.input.required();
|
|
39
|
+
selected = (0, core_1.model)(false);
|
|
40
|
+
computedLabel = (0, core_1.computed)(() => this.contract().props?.label ?? '');
|
|
41
|
+
computedDisabled = (0, core_1.computed)(() => !!this.contract().props?.disabled);
|
|
42
|
+
computedAriaLabel = (0, core_1.computed)(() => {
|
|
43
|
+
const v = this.contract().props?.['aria-label'];
|
|
44
|
+
return v !== undefined && v !== null && String(v).trim() !== '' ? String(v) : undefined;
|
|
45
|
+
});
|
|
46
|
+
computedAriaDescribedBy = (0, core_1.computed)(() => {
|
|
47
|
+
const v = this.contract().props?.['aria-describedby'];
|
|
48
|
+
return v !== undefined && v !== null && String(v).trim() !== '' ? String(v) : undefined;
|
|
49
|
+
});
|
|
50
|
+
experienceAdapter = (0, core_1.inject)(experience_adapter_service_1.WebExperienceAdapterService);
|
|
51
|
+
constructor() {
|
|
52
|
+
(0, core_1.effect)(() => {
|
|
53
|
+
const props = this.contract().props;
|
|
54
|
+
const coerced = props
|
|
55
|
+
? (0, adapter_1.coerceContractProps)(props, ChipComponent.contractSchema)
|
|
56
|
+
: {};
|
|
57
|
+
const contractVal = coerced['selected'] !== undefined ? !!coerced['selected'] : this.selected();
|
|
58
|
+
(0, core_1.untracked)(() => {
|
|
59
|
+
if (contractVal === this.selected())
|
|
60
|
+
return;
|
|
61
|
+
this.selected.set(contractVal);
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
onClick() {
|
|
66
|
+
if (this.computedDisabled() || !this.contract().id)
|
|
67
|
+
return;
|
|
68
|
+
const nextSelected = !this.selected();
|
|
69
|
+
this.selected.set(nextSelected);
|
|
70
|
+
this.experienceAdapter.updateState(this.contract().id, 'selected', nextSelected);
|
|
71
|
+
}
|
|
72
|
+
static {
|
|
73
|
+
tslib_1.__runInitializers(_classThis, _classExtraInitializers);
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
return ChipComponent = _classThis;
|
|
77
|
+
})();
|
|
78
|
+
exports.ChipComponent = ChipComponent;
|
|
79
|
+
//# sourceMappingURL=chip.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chip.component.js","sourceRoot":"","sources":["../../../../../../../packages/angular-renderer/src/components/primitives/chip/chip.component.ts"],"names":[],"mappings":";;;;AAAA,wCAUuB;AAEvB,2DAAkF;AAClF,iGAA+F;IAsBlF,aAAa;4BAZzB,IAAA,gBAAS,EAAC;YACT,QAAQ,EAAE,YAAY;YACtB,UAAU,EAAE,IAAI;YAChB,WAAW,EAAE,uBAAuB;YACpC,SAAS,EAAE,CAAC,uBAAuB,CAAC;YACpC,eAAe,EAAE,8BAAuB,CAAC,MAAM;YAC/C,aAAa,EAAE,wBAAiB,CAAC,SAAS;YAC1C,IAAI,EAAE;gBACJ,oBAAoB,EAAE,MAAM;gBAC5B,oBAAoB,EAAE,qBAAqB;aAC5C;SACF,CAAC;;;;;;;;YACF,qLAiDC;;;;QAhDC,MAAM,CAAU,cAAc,GAG1B;YACF,QAAQ,EAAE,SAAS;YACnB,KAAK,EAAE,QAAQ;YACf,QAAQ,EAAE,SAAS;SACpB,CAAC;QACF,MAAM,CAAU,cAAc,GAAG,KAAK,CAAC;QAEvC,QAAQ,GAAG,YAAK,CAAC,QAAQ,EAAkC,CAAC;QAC5D,QAAQ,GAAG,IAAA,YAAK,EAAU,KAAK,CAAC,CAAC;QAEjC,aAAa,GAAG,IAAA,eAAQ,EAAC,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC;QACnE,g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