@bravura/ui 1.25.0 → 1.26.0
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 -0
- package/alert/testing/bravura-ui-alert-testing.d.ts +5 -0
- package/alert/testing/package.json +10 -0
- package/alert/testing/test-api.d.ts +24 -0
- package/bundles/bravura-ui-alert-testing.umd.js +442 -0
- package/bundles/bravura-ui-alert-testing.umd.js.map +1 -0
- package/bundles/bravura-ui-alert.umd.js +1 -1
- package/bundles/bravura-ui-alert.umd.js.map +1 -1
- package/bundles/bravura-ui-radio-panel-testing.umd.js +431 -0
- package/bundles/bravura-ui-radio-panel-testing.umd.js.map +1 -0
- package/esm2015/alert/alert-message.component.js +2 -2
- package/esm2015/alert/testing/bravura-ui-alert-testing.js +5 -0
- package/esm2015/alert/testing/test-api.js +57 -0
- package/esm2015/radio-panel/testing/bravura-ui-radio-panel-testing.js +5 -0
- package/esm2015/radio-panel/testing/test-api.js +56 -0
- package/fesm2015/bravura-ui-alert-testing.js +64 -0
- package/fesm2015/bravura-ui-alert-testing.js.map +1 -0
- package/fesm2015/bravura-ui-alert.js +1 -1
- package/fesm2015/bravura-ui-alert.js.map +1 -1
- package/fesm2015/bravura-ui-radio-panel-testing.js +63 -0
- package/fesm2015/bravura-ui-radio-panel-testing.js.map +1 -0
- package/package.json +1 -1
- package/radio-panel/testing/bravura-ui-radio-panel-testing.d.ts +5 -0
- package/radio-panel/testing/package.json +10 -0
- package/radio-panel/testing/test-api.d.ts +28 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
3
|
+
export class AlertMessageHarness extends ComponentHarness {
|
|
4
|
+
constructor() {
|
|
5
|
+
super(...arguments);
|
|
6
|
+
this._getBackdrop = this.locatorFor('.bui-alert-backdrop');
|
|
7
|
+
this._getDeleteButton = this.locatorFor('.bui-alert-button');
|
|
8
|
+
this._getContentDiv = this.locatorFor('.bui-alert-content');
|
|
9
|
+
}
|
|
10
|
+
static with(options = {}) {
|
|
11
|
+
return new HarnessPredicate(this, options).addOption('content', options.content, AlertMessageHarness.filterByContent);
|
|
12
|
+
}
|
|
13
|
+
getColor() {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
return (yield this._getBackdrop()).getCssValue('background-color');
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
delete() {
|
|
19
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
20
|
+
yield (yield this._getDeleteButton()).click();
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
getContent(options) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
return (yield this._getContentDiv()).text(options);
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
static filterByContent(harness, content) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const contentText = yield harness.getContent();
|
|
31
|
+
return content.test(contentText);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
AlertMessageHarness.hostSelector = '.bui-alert';
|
|
36
|
+
export class AlertContainerHarness extends ComponentHarness {
|
|
37
|
+
constructor() {
|
|
38
|
+
super(...arguments);
|
|
39
|
+
this._items = this.locatorForAll(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel' }));
|
|
40
|
+
this._floatingFrame = this.locatorFor('.bui-alert-float-panel-frame');
|
|
41
|
+
}
|
|
42
|
+
getAlertItem(content) {
|
|
43
|
+
return this.locatorForOptional(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel', content }))();
|
|
44
|
+
}
|
|
45
|
+
countAlertItems() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
return (yield this._items()).length;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
isFloated() {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
return (yield (yield this._floatingFrame()).getCssValue('display')) !== 'none';
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
AlertContainerHarness.hostSelector = '.bui-alert-container';
|
|
57
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGVzdC1hcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi9wcm9qZWN0cy91aS9hbGVydC90ZXN0aW5nL3Rlc3QtYXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxPQUFPLEVBQ04sZ0JBQWdCLEVBSWhCLGdCQUFnQixFQUNoQixNQUFNLHNCQUFzQixDQUFDO0FBTzlCLE1BQU0sT0FBTyxtQkFBb0IsU0FBUSxnQkFBZ0I7SUFBekQ7O1FBRVMsaUJBQVksR0FBRyxJQUFJLENBQUMsVUFBVSxDQUFDLHFCQUFxQixDQUFDLENBQUM7UUFDdEQscUJBQWdCLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQyxtQkFBbUIsQ0FBQyxDQUFDO1FBQ3hELG1CQUFjLEdBQUcsSUFBSSxDQUFDLFVBQVUsQ0FBQyxvQkFBb0IsQ0FBQyxDQUFDO0lBNkJoRSxDQUFDO0lBM0JBLE1BQU0sQ0FBQyxJQUFJLENBRVYsVUFBc0MsRUFBRTtRQUV4QyxPQUFPLElBQUksZ0JBQWdCLENBQUMsSUFBSSxFQUFFLE9BQU8sQ0FBQyxDQUFDLFNBQVMsQ0FDbkQsU0FBUyxFQUNULE9BQU8sQ0FBQyxPQUFPLEVBQ2YsbUJBQW1CLENBQUMsZUFBZSxDQUNuQyxDQUFDO0lBQ0gsQ0FBQztJQUVLLFFBQVE7O1lBQ2IsT0FBTyxDQUFDLE1BQU0sSUFBSSxDQUFDLFlBQVksRUFBRSxDQUFDLENBQUMsV0FBVyxDQUFDLG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V0dXJuIChhd2FpdCAoYXdhaXQgdGhpcy5fZmxvYXRpbmdGcmFtZSgpKS5nZXRDc3NWYWx1ZSgnZGlzcGxheScpKSAhPT0gJ25vbmUnO1xuXHR9XG59XG4iXX0=
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
export * from './test-api';
|
|
5
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnJhdnVyYS11aS1yYWRpby1wYW5lbC10ZXN0aW5nLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vLi4vcHJvamVjdHMvdWkvcmFkaW8tcGFuZWwvdGVzdGluZy9icmF2dXJhLXVpLXJhZGlvLXBhbmVsLXRlc3RpbmcudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7O0dBRUc7QUFFSCxjQUFjLFlBQVksQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbIi8qKlxuICogR2VuZXJhdGVkIGJ1bmRsZSBpbmRleC4gRG8gbm90IGVkaXQuXG4gKi9cblxuZXhwb3J0ICogZnJvbSAnLi90ZXN0LWFwaSc7XG4iXX0=
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { __awaiter } from "tslib";
|
|
2
|
+
import { HarnessPredicate } from '@angular/cdk/testing';
|
|
3
|
+
import { MatRadioButtonHarness, _MatRadioGroupHarnessBase } from '@angular/material/radio/testing';
|
|
4
|
+
export class RadioPanelItemHarness extends MatRadioButtonHarness {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this.getLabelElement = this.locatorFor('label');
|
|
8
|
+
this._textLabel = this.locatorFor('label .bui-label-title');
|
|
9
|
+
this._clickLabel = this.getLabelElement;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Gets a `HarnessPredicate` that can be used to search for a radio button with specific
|
|
13
|
+
* attributes.
|
|
14
|
+
* @param options Options for filtering which radio button instances are considered a match.
|
|
15
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
16
|
+
*/
|
|
17
|
+
static with(options = {}) {
|
|
18
|
+
return new HarnessPredicate(this, options)
|
|
19
|
+
.addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabelText(), label))
|
|
20
|
+
.addOption('value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));
|
|
21
|
+
}
|
|
22
|
+
click() {
|
|
23
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
+
const element = yield this.getLabelElement();
|
|
25
|
+
element.click();
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
getLabelCssValue(prop) {
|
|
29
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
30
|
+
const element = yield this.getLabelElement();
|
|
31
|
+
return element.getCssValue(prop);
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
getBorderColor() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const label = yield this.getLabelElement();
|
|
37
|
+
return label.getCssValue('border-color');
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
RadioPanelItemHarness.hostSelector = 'bui-radio-panel-item';
|
|
42
|
+
export class RadioPanelHarness extends _MatRadioGroupHarnessBase {
|
|
43
|
+
constructor() {
|
|
44
|
+
super(...arguments);
|
|
45
|
+
this._buttonClass = RadioPanelItemHarness;
|
|
46
|
+
this.getItem = (filters) => this.locatorFor(RadioPanelItemHarness.with(filters))();
|
|
47
|
+
}
|
|
48
|
+
getFlexDir() {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
return (yield this.host()).getCssValue('flex-direction');
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/** The selector for the host element of a `MatRadioGroup` instance. */
|
|
55
|
+
RadioPanelHarness.host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G5cdGFzeW5jIGdldEZsZXhEaXIoKTogUHJvbWlzZTxzdHJpbmc+IHtcblx0XHRyZXR1cm4gKGF3YWl0IHRoaXMuaG9zdCgpKS5nZXRDc3NWYWx1ZSgnZmxleC1kaXJlY3Rpb24nKTtcblx0fVxufVxuIl19
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { ComponentHarness, HarnessPredicate } from '@angular/cdk/testing';
|
|
3
|
+
|
|
4
|
+
class AlertMessageHarness extends ComponentHarness {
|
|
5
|
+
constructor() {
|
|
6
|
+
super(...arguments);
|
|
7
|
+
this._getBackdrop = this.locatorFor('.bui-alert-backdrop');
|
|
8
|
+
this._getDeleteButton = this.locatorFor('.bui-alert-button');
|
|
9
|
+
this._getContentDiv = this.locatorFor('.bui-alert-content');
|
|
10
|
+
}
|
|
11
|
+
static with(options = {}) {
|
|
12
|
+
return new HarnessPredicate(this, options).addOption('content', options.content, AlertMessageHarness.filterByContent);
|
|
13
|
+
}
|
|
14
|
+
getColor() {
|
|
15
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
16
|
+
return (yield this._getBackdrop()).getCssValue('background-color');
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
delete() {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
yield (yield this._getDeleteButton()).click();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getContent(options) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
return (yield this._getContentDiv()).text(options);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
static filterByContent(harness, content) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const contentText = yield harness.getContent();
|
|
32
|
+
return content.test(contentText);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
AlertMessageHarness.hostSelector = '.bui-alert';
|
|
37
|
+
class AlertContainerHarness extends ComponentHarness {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this._items = this.locatorForAll(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel' }));
|
|
41
|
+
this._floatingFrame = this.locatorFor('.bui-alert-float-panel-frame');
|
|
42
|
+
}
|
|
43
|
+
getAlertItem(content) {
|
|
44
|
+
return this.locatorForOptional(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel', content }))();
|
|
45
|
+
}
|
|
46
|
+
countAlertItems() {
|
|
47
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
48
|
+
return (yield this._items()).length;
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
isFloated() {
|
|
52
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
+
return (yield (yield this._floatingFrame()).getCssValue('display')) !== 'none';
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
AlertContainerHarness.hostSelector = '.bui-alert-container';
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Generated bundle index. Do not edit.
|
|
61
|
+
*/
|
|
62
|
+
|
|
63
|
+
export { AlertContainerHarness, AlertMessageHarness };
|
|
64
|
+
//# sourceMappingURL=bravura-ui-alert-testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-alert-testing.js","sources":["../../../projects/ui/alert/testing/test-api.ts","../../../projects/ui/alert/testing/bravura-ui-alert-testing.ts"],"sourcesContent":["import {\n\tComponentHarness,\n\tTextOptions,\n\tBaseHarnessFilters,\n\tComponentHarnessConstructor,\n\tHarnessPredicate\n} from '@angular/cdk/testing';\n\nexport interface AlertMessageHarnessFilters extends BaseHarnessFilters {\n\t/** only select the alert with the content matching this regular expression */\n\tcontent?: RegExp;\n}\n\nexport class AlertMessageHarness extends ComponentHarness {\n\tstatic hostSelector = '.bui-alert';\n\tprivate _getBackdrop = this.locatorFor('.bui-alert-backdrop');\n\tprivate _getDeleteButton = this.locatorFor('.bui-alert-button');\n\tprivate _getContentDiv = this.locatorFor('.bui-alert-content');\n\n\tstatic with<T extends AlertMessageHarness>(\n\t\tthis: ComponentHarnessConstructor<T>,\n\t\toptions: AlertMessageHarnessFilters = {}\n\t): HarnessPredicate<T> {\n\t\treturn new HarnessPredicate(this, options).addOption(\n\t\t\t'content',\n\t\t\toptions.content,\n\t\t\tAlertMessageHarness.filterByContent\n\t\t);\n\t}\n\n\tasync getColor(): Promise<string> {\n\t\treturn (await this._getBackdrop()).getCssValue('background-color');\n\t}\n\n\tasync delete(): Promise<void> {\n\t\tawait (await this._getDeleteButton()).click();\n\t}\n\n\tasync getContent(options?: TextOptions): Promise<string> {\n\t\treturn (await this._getContentDiv()).text(options);\n\t}\n\n\tprivate static async filterByContent(harness: AlertMessageHarness, content: RegExp): Promise<boolean> {\n\t\tconst contentText = await harness.getContent();\n\t\treturn content.test(contentText);\n\t}\n}\n\nexport class AlertContainerHarness extends ComponentHarness {\n\tstatic hostSelector = '.bui-alert-container';\n\n\tprivate _items = this.locatorForAll(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel' }));\n\tprivate _floatingFrame = this.locatorFor('.bui-alert-float-panel-frame');\n\n\tgetAlertItem(content: RegExp): Promise<AlertMessageHarness | null> {\n\t\treturn this.locatorForOptional(AlertMessageHarness.with({ ancestor: '.bui-alert-fixed-panel', content }))();\n\t}\n\n\tasync countAlertItems(): Promise<number> {\n\t\treturn (await this._items()).length;\n\t}\n\n\tasync isFloated(): Promise<boolean> {\n\t\treturn (await (await this._floatingFrame()).getCssValue('display')) !== 'none';\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './test-api';\n"],"names":[],"mappings":";;;MAaa,mBAAoB,SAAQ,gBAAgB;IAAzD;;QAES,iBAAY,GAAG,IAAI,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC;QACtD,qBAAgB,GAAG,IAAI,CAAC,UAAU,CAAC,mBAAmB,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,CAAC,MAAM,IAAI,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC;SACpC;KAAA;IAEK,SAAS;;YACd,OAAO,CAAC,MAAM,CAAC,MAAM,IAAI,CAAC,cAAc,EAAE,EAAE,WAAW,CAAC,SAAS,CAAC,MAAM,MAAM,CAAC;SAC/E;KAAA;;AAfM,kCAAY,GAAG,sBAAsB;;ACjD7C;;;;;;"}
|
|
@@ -80,7 +80,7 @@ class AlertMessageComponent {
|
|
|
80
80
|
}
|
|
81
81
|
}
|
|
82
82
|
AlertMessageComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AlertMessageComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
83
|
-
AlertMessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AlertMessageComponent, selector: "bui-alert", inputs: { type: "type", message: "message", politeness: "politeness", dismissible: "dismissible", _id: ["id", "_id"] }, outputs: { dismissed: "dismissed", initialised: "initialised" }, host: { properties: { "class": "'bui-alert bui-host bui-alert-' + (type === 'warn' ? 'warning' : type) + (dismissible ? ' bui-alert-dismissible' : '')", "role": "politeness === 'off' ? 'region' : 'alert'", "attr.aria-live": "politeness === 'assertive' ? undefined : politeness", "id": "this._id" } }, ngImport: i0, template: "<div class=\"bui-alert-backdrop\"></div>\n<div class=\"bui-alert-frame\"></div>\n\n<div class=\"bui-alert-wrapper\">\n\t<div class=\"bui-alert-icon-area\">\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\n\t</div>\n\t<div class=\"bui-alert-content\">\n\t\t<div [innerHTML]=\"message\"></div>\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\n\t<div class=\"bui-alert-button-backdrop\"></div>\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\n\t\t<mat-icon>cancel</mat-icon>\n\t</button>\n</div>\n", styles: [":host(:not([hidden])){display:block;padding:12px 14px 12px 19px;position:relative;border-radius:5px}:host-context([dir=rtl]) :host(:not([hidden])){padding:12px 19px 12px 14px}:host(:not([hidden])),:host(:not([hidden])) *{box-sizing:border-box}.bui-alert-backdrop,.bui-alert-frame{position:absolute;top:0;right:0;bottom:0;left:0}.bui-alert-backdrop{opacity:.1}:host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 18.75px) 18.75px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0,18.75px 18.75px)}.bui-alert-frame{border-radius:5px;border-width:1px 1px 1px 5px;border-style:solid}:host-context([dir=rtl]) .bui-alert-frame{border-width:1px 5px 1px 1px}:host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 25px) 25px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0)}.bui-alert-button-area{position:absolute;right:-15px;top:-15px;width:40px;height:40px;border-radius:20px;display:flex;align-items:center;justify-content:center}:host-context([dir=rtl]) .bui-alert-button-area{right:unset;left:-15px}.bui-alert-button-backdrop{position:absolute;border-radius:20px;width:100%;height:100%;clip-path:polygon(0 15px,25px 15px,25px 100%,0% 100%)}:host-context([dir=rtl]) .bui-alert-button-backdrop{clip-path:polygon(15px 15px,15px 100%,100% 100%,100% 15px)}.bui-alert-wrapper{display:flex;align-items:stretch}.bui-alert-icon-area{flex-shrink:0;display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;margin-right:14px;color:var(--bui-bg-card)}:host-context([dir=rtl]) .bui-alert-icon-area{margin-right:unset;margin-left:14px}.bui-alert-content{z-index:1;flex-grow:1}:host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 0,calc(100% - 11px) 0,100% 13px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 13px,0 100%,100% 100%,100% 0,11px 0)}:host(.bui-alert-success) .bui-alert-frame{border-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-backdrop,:host(.bui-alert-success) .bui-alert-icon-area{background-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-button-backdrop{border:1px var(--bui-color-success) solid}:host(.bui-alert-success) .bui-alert-button{color:var(--bui-color-success)}:host(.bui-alert-info) .bui-alert-frame{border-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-backdrop,:host(.bui-alert-info) .bui-alert-icon-area{background-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-button-backdrop{border:1px var(--bui-color-info) solid}:host(.bui-alert-info) .bui-alert-button{color:var(--bui-color-info)}:host(.bui-alert-warning) .bui-alert-frame{border-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-backdrop,:host(.bui-alert-warning) .bui-alert-icon-area{background-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-button-backdrop{border:1px var(--bui-color-warning) solid}:host(.bui-alert-warning) .bui-alert-button{color:var(--bui-color-warning)}:host(.bui-alert-error) .bui-alert-frame{border-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-backdrop,:host(.bui-alert-error) .bui-alert-icon-area{background-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-button-backdrop{border:1px var(--bui-color-error) solid}:host(.bui-alert-error) .bui-alert-button{color:var(--bui-color-error)}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:first-child\"; margin-top: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:last-child\"; margin-bottom: 0;}\n"], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
83
|
+
AlertMessageComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", type: AlertMessageComponent, selector: "bui-alert", inputs: { type: "type", message: "message", politeness: "politeness", dismissible: "dismissible", _id: ["id", "_id"] }, outputs: { dismissed: "dismissed", initialised: "initialised" }, host: { properties: { "class": "'bui-alert bui-host bui-alert-' + (type === 'warn' ? 'warning' : type) + (dismissible ? ' bui-alert-dismissible' : '')", "role": "politeness === 'off' ? 'region' : 'alert'", "attr.aria-live": "politeness === 'assertive' ? undefined : politeness", "id": "this._id" } }, ngImport: i0, template: "<div class=\"bui-alert-backdrop\"></div>\n<div class=\"bui-alert-frame\"></div>\n\n<div class=\"bui-alert-wrapper\">\n\t<div class=\"bui-alert-icon-area\">\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\n\t</div>\n\t<div class=\"bui-alert-content\">\n\t\t<div [innerHTML]=\"message\" *ngIf=\"message\"></div>\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\n\t<div class=\"bui-alert-button-backdrop\"></div>\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\n\t\t<mat-icon>cancel</mat-icon>\n\t</button>\n</div>\n", styles: [":host(:not([hidden])){display:block;padding:12px 14px 12px 19px;position:relative;border-radius:5px}:host-context([dir=rtl]) :host(:not([hidden])){padding:12px 19px 12px 14px}:host(:not([hidden])),:host(:not([hidden])) *{box-sizing:border-box}.bui-alert-backdrop,.bui-alert-frame{position:absolute;top:0;right:0;bottom:0;left:0}.bui-alert-backdrop{opacity:.1}:host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 18.75px) 18.75px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-backdrop{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0,18.75px 18.75px)}.bui-alert-frame{border-radius:5px;border-width:1px 1px 1px 5px;border-style:solid}:host-context([dir=rtl]) .bui-alert-frame{border-width:1px 5px 1px 1px}:host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 0,calc(100% - 25px) 0,calc(100% - 25px) 25px,100% 25px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-frame{clip-path:polygon(0 25px,0 100%,100% 100%,100% 0,25px 0)}.bui-alert-button-area{position:absolute;right:-15px;top:-15px;width:40px;height:40px;border-radius:20px;display:flex;align-items:center;justify-content:center}:host-context([dir=rtl]) .bui-alert-button-area{right:unset;left:-15px}.bui-alert-button-backdrop{position:absolute;border-radius:20px;width:100%;height:100%;clip-path:polygon(0 15px,25px 15px,25px 100%,0% 100%)}:host-context([dir=rtl]) .bui-alert-button-backdrop{clip-path:polygon(15px 15px,15px 100%,100% 100%,100% 15px)}.bui-alert-wrapper{display:flex;align-items:stretch}.bui-alert-icon-area{flex-shrink:0;display:flex;justify-content:center;align-items:center;border-radius:5px;width:30px;height:30px;margin-right:14px;color:var(--bui-bg-card)}:host-context([dir=rtl]) .bui-alert-icon-area{margin-right:unset;margin-left:14px}.bui-alert-content{z-index:1;flex-grow:1;display:flex;flex-direction:column;justify-content:center;grid-gap:1rem;gap:1rem}:host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 0,calc(100% - 11px) 0,100% 13px,100% 100%,0 100%)}:host-context([dir=rtl]) :host(.bui-alert-dismissible) .bui-alert-content{clip-path:polygon(0 13px,0 100%,100% 100%,100% 0,11px 0)}:host(.bui-alert-success) .bui-alert-frame{border-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-backdrop,:host(.bui-alert-success) .bui-alert-icon-area{background-color:var(--bui-color-success)}:host(.bui-alert-success) .bui-alert-button-backdrop{border:1px var(--bui-color-success) solid}:host(.bui-alert-success) .bui-alert-button{color:var(--bui-color-success)}:host(.bui-alert-info) .bui-alert-frame{border-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-backdrop,:host(.bui-alert-info) .bui-alert-icon-area{background-color:var(--bui-color-info)}:host(.bui-alert-info) .bui-alert-button-backdrop{border:1px var(--bui-color-info) solid}:host(.bui-alert-info) .bui-alert-button{color:var(--bui-color-info)}:host(.bui-alert-warning) .bui-alert-frame{border-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-backdrop,:host(.bui-alert-warning) .bui-alert-icon-area{background-color:var(--bui-color-warning)}:host(.bui-alert-warning) .bui-alert-button-backdrop{border:1px var(--bui-color-warning) solid}:host(.bui-alert-warning) .bui-alert-button{color:var(--bui-color-warning)}:host(.bui-alert-error) .bui-alert-frame{border-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-backdrop,:host(.bui-alert-error) .bui-alert-icon-area{background-color:var(--bui-color-error)}:host(.bui-alert-error) .bui-alert-button-backdrop{border:1px var(--bui-color-error) solid}:host(.bui-alert-error) .bui-alert-button{color:var(--bui-color-error)}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:first-child\"; margin-top: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > div > *:last-child\"; margin-bottom: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > *:first-child\"; margin-top: 0;}@polyfill-unscoped-rule{content: \".bui-alert .bui-alert-content > *:last-child\"; margin-bottom: 0;}\n"], components: [{ type: i1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { type: i2.MatButton, selector: "button[mat-button], button[mat-raised-button], button[mat-icon-button], button[mat-fab], button[mat-mini-fab], button[mat-stroked-button], button[mat-flat-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }], directives: [{ type: i3.IconDirective, selector: "[buiIcon]", inputs: ["buiIcon", "size", "variant"] }, { type: i3$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
84
84
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: AlertMessageComponent, decorators: [{
|
|
85
85
|
type: Component,
|
|
86
86
|
args: [{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bravura-ui-alert.js","sources":["../../../projects/ui/alert/alert-message.component.ts","../../../projects/ui/alert/alert-message.component.html","../../../projects/ui/alert/alert-container.component.ts","../../../projects/ui/alert/alert-container.component.html","../../../projects/ui/alert/alert.module.ts","../../../projects/ui/alert/bravura-ui-alert.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, OnInit, Output } from '@angular/core';\nimport { generateID } from '@bravura/ui/common';\n\n/** @ignore */\nconst ICONS: any = {\n\tsuccess: 'check_circle',\n\tinfo: 'info',\n\twarn: 'report_problem',\n\terror: 'cancel'\n};\n\n/** @ignore */\nconst DEFAULT_POLITENESS = {\n\tsuccess: 'polite',\n\tinfo: 'polite',\n\twarn: 'assertive',\n\terror: 'assertive'\n};\n\n/**\n * An alert style message usually appears in a global notification area.\n *\n * The base color of the message is determined by the `type` of the message and a list of predefined\n * CSS custom properties.\n *\n * ```scss\n * --bui-color-success: #519602;\n * --bui-color-info: #0dcaf0;\n * --bui-color-warning: #ffc107;\n * --bui-color-error: #dc3545;\n * ```\n *\n *\n */\n@Component({\n\tselector: 'bui-alert',\n\ttemplateUrl: './alert-message.component.html',\n\tstyleUrls: ['./alert-message.component.scss'],\n\thost: {\n\t\t'[class]': `'bui-alert bui-host bui-alert-' + (type === 'warn' ? 'warning' : type) + (dismissible ? ' bui-alert-dismissible' : '')`,\n\t\t'[role]': `politeness === 'off' ? 'region' : 'alert'`,\n\t\t'[attr.aria-live]': `politeness === 'assertive' ? undefined : politeness`\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AlertMessageComponent implements OnInit {\n\t/** @ignore */\n\tstatic ngAcceptInputType_dismissible: boolean | string | null | undefined;\n\t/** @ignore */\n\tstatic ngAcceptInputType_blink: boolean | string | null | undefined;\n\n\t/** The type of the message, used to derive the icon and base color. */\n\t@Input()\n\ttype: 'success' | 'info' | 'warn' | 'error' = 'error';\n\n\t/** The message to be displayed, HTML supported. */\n\t@Input()\n\tmessage = '';\n\n\t/** Specifies the ARIA live region politeness. */\n\t@Input()\n\tpoliteness!: 'off' | 'polite' | 'assertive';\n\n\t/** Whether to display the button to fire the `dismissed` event. */\n\t@Input()\n\tget dismissible() {\n\t\treturn this._dismissible;\n\t}\n\tset dismissible(value: any) {\n\t\tthis._dismissible = coerceBooleanProperty(value);\n\t}\n\n\t/** To be emitted when the user choose to dismiss the message. The event object is the ID of the element. */\n\t@Output()\n\tdismissed = new EventEmitter<string>();\n\n\t/** To be emitted when the component finishes initialisation. The event object is the ID of the element. */\n\t@Output()\n\tinitialised = new EventEmitter<string>();\n\n\t@Input('id')\n\t@HostBinding('id')\n\t/** @ignore */\n\t_id = `bui-alert-${generateID()}`;\n\n\tprivate _dismissible = false;\n\tprivate _blink = false;\n\n\tconstructor() {}\n\n\tngOnInit(): void {\n\t\tthis.politeness = this.politeness || DEFAULT_POLITENESS[this.type];\n\t\tthis.initialised.emit(this._id);\n\t}\n\n\t/** @ignore */\n\tget iconName(): string {\n\t\treturn ICONS[this.type];\n\t}\n\n\t/** @ignore */\n\t_dismiss() {\n\t\tthis.dismissed.emit(this._id);\n\t}\n}\n","<div class=\"bui-alert-backdrop\"></div>\n<div class=\"bui-alert-frame\"></div>\n\n<div class=\"bui-alert-wrapper\">\n\t<div class=\"bui-alert-icon-area\">\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\n\t</div>\n\t<div class=\"bui-alert-content\">\n\t\t<div [innerHTML]=\"message\"></div>\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\n\t<div class=\"bui-alert-button-backdrop\"></div>\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\n\t\t<mat-icon>cancel</mat-icon>\n\t</button>\n</div>\n","import { animate, state, style, transition, trigger, AnimationEvent } from '@angular/animations';\nimport { ScrollDispatcher } from '@angular/cdk/scrolling';\nimport {\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tInput,\n\tNgZone,\n\tOnDestroy,\n\tOnInit\n} from '@angular/core';\nimport { generateID, isElementInViewport } from '@bravura/ui/common';\nimport { Subject, Subscription, timer } from 'rxjs';\nimport { delay, take, takeUntil, tap } from 'rxjs/operators';\n\n/**@internal */\nclass InternalAlertOject {\n\tid: string;\n\tdeleted = false;\n\tconstructor(public readonly type: 'success' | 'info' | 'warn' | 'error', public readonly message: string) {\n\t\tthis.id = `bui-alert-cont-alert-${generateID()}`;\n\t}\n}\n\n/**\n * Use this component in a designated area of a page for displaying notification messages\n *\n */\n@Component({\n\tselector: 'bui-alert-container',\n\ttemplateUrl: './alert-container.component.html',\n\tstyleUrls: ['./alert-container.component.scss'],\n\thost: {\n\t\t'[class]': `'bui-alert-container bui-host bui-alert-container-' + (_remaining.length ? 'not-empty': 'empty')`\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tanimations: [\n\t\ttrigger('floatTransition', [\n\t\t\ttransition(':enter', [style({ opacity: '0', transform: 'translateY(-10vh)' }), animate('.3s ease-in')]),\n\t\t\ttransition(':leave', [animate('.4s ease-out', style({ transform: 'translateY(-10vh)', opacity: '0' }))])\n\t\t]),\n\t\ttrigger('alertTransition', [\n\t\t\tstate('visible', style({})),\n\t\t\tstate(\n\t\t\t\t'hidden',\n\t\t\t\tstyle({\n\t\t\t\t\theight: 0,\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\ttransform: 'scaleY(0)',\n\t\t\t\t\topacity: 0,\n\t\t\t\t\t'margin-top': '-1rem'\n\t\t\t\t})\n\t\t\t),\n\t\t\ttransition('void => visible', [\n\t\t\t\tstyle({ transform: 'translateY(100%)', height: 0, opacity: '0', overflow: 'hidden' }),\n\t\t\t\tanimate('250ms cubic-bezier(0.42, 0.0, 0.58, 1.0)')\n\t\t\t]),\n\t\t\ttransition('visible => hidden', [animate('250ms cubic-bezier(0.25, 0, 0.3, 1.0)')])\n\t\t])\n\t]\n})\nexport class AlertContainerComponent implements OnInit, OnDestroy {\n\t/** The maximum number of messages displayed in the container area. */\n\t@Input()\n\tmax = 5;\n\n\t/**\n\t * This property determines the behavior for displaying the notifications when the container is outside the viewport.\n\t *\n\t * `scroll`: The component will try to scroll to reveal the new notifications.\n\t * `float`: The component will float the alert panel to the center of the screen for a couple of seconds and move it back to the original position.\n\t */\n\t@Input()\n\toutsideViewportBehavior: 'scroll' | 'float' = 'float';\n\n\t/**\n\t * The number of milliseconds for which the alert container will be floated when new notification arrives.\n\t *\n\t * This will only take effect when `outsideViewportBehavior` is set to `float` and the container is outside the viewport.\n\t */\n\t@Input()\n\tfloatDuration = 2000;\n\n\t/**@internal */\n\t_alerts: InternalAlertOject[] = [];\n\t/**@internal */\n\t_floated = false;\n\t/**@internal */\n\t_floatPanelHidden = true;\n\n\t/** @ignore Emits whenever the animation is started. */\n\treadonly _animationStarted = new Subject<AnimationEvent>();\n\t/** @ignore Emits whenever the animation is done. */\n\treadonly _animationEnded = new Subject<AnimationEvent>();\n\n\tprivate _destroyed$ = new Subject<void>();\n\tprivate _endFloatingSub?: Subscription;\n\n\tconstructor(\n\t\tprivate zone: NgZone,\n\t\tprivate cdRef: ChangeDetectorRef,\n\t\tprivate _elementRef: ElementRef<HTMLElement>,\n\t\tprivate scroll: ScrollDispatcher\n\t) {}\n\n\tngOnInit(): void {\n\t\tconst checkScroll = () => {\n\t\t\tif (isElementInViewport(this._elementRef.nativeElement)) {\n\t\t\t\tthis._endFloating();\n\t\t\t}\n\t\t};\n\t\tthis.scroll\n\t\t\t.ancestorScrolled(this._elementRef.nativeElement)\n\t\t\t.pipe(takeUntil(this._destroyed$))\n\t\t\t.subscribe(checkScroll);\n\t\tcheckScroll();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._destroyed$.next();\n\t\tthis._destroyed$.complete();\n\t\tthis._endFloatingSub?.unsubscribe();\n\t}\n\n\t/**@internal */\n\tget _remaining() {\n\t\treturn this._alerts.filter(a => !a.deleted);\n\t}\n\n\t/**@internal */\n\tget _width() {\n\t\treturn this._elementRef.nativeElement.clientWidth;\n\t}\n\n\t/** Add a message to the notification area */\n\tasync notify(type: 'success' | 'info' | 'warn' | 'error', message: string) {\n\t\tthis._endFloatingSub?.unsubscribe();\n\t\tconst duplicate = this._remaining.find(_a => message === _a.message);\n\t\tif (duplicate) {\n\t\t\tthis._dismiss(duplicate);\n\t\t}\n\n\t\tconst remaining = this._remaining;\n\t\tif (remaining.length >= this.max) {\n\t\t\tthis._dismiss(remaining[0]);\n\t\t}\n\n\t\tconst a = new InternalAlertOject(type, message);\n\t\tawait this._checkViewport();\n\t\tthis.zone.run(() => {\n\t\t\tthis._alerts.push(a);\n\t\t\tthis.cdRef.markForCheck();\n\t\t});\n\t}\n\n\t/**@ignore */\n\tasync _checkViewport() {\n\t\tif (!isElementInViewport(this._elementRef.nativeElement)) {\n\t\t\tif (this.outsideViewportBehavior === 'float') {\n\t\t\t\tconst d = this._floated ? 0 : 100;\n\t\t\t\tthis._floated = true;\n\t\t\t\tthis._floatPanelHidden = false;\n\t\t\t\tthis._endFloating(this.floatDuration);\n\t\t\t\tthis.cdRef.markForCheck();\n\t\t\t\tawait timer(d).toPromise();\n\t\t\t} else {\n\t\t\t\tthis._elementRef.nativeElement.scrollIntoView({ block: 'start', behavior: 'smooth' });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**@ignore */\n\tasync _dismiss(a: InternalAlertOject) {\n\t\tconst id = a.id;\n\t\ta.deleted = true;\n\t\tthis.cdRef.markForCheck();\n\t\tawait this._animationEnded.pipe(take(1)).toPromise();\n\t\tthis.zone.run(() => {\n\t\t\tthis._alerts = this._alerts.filter(_a => _a.id !== id);\n\t\t\tthis.cdRef.markForCheck();\n\t\t});\n\t}\n\n\t/** Remove all messages currently displayed. */\n\tasync clear() {\n\t\tawait Promise.all(this._remaining.map(a => this._dismiss(a)));\n\t\tthis._endFloating();\n\t}\n\n\tprivate _endFloating(_delay = 0) {\n\t\tif (!this._floated) {\n\t\t\treturn;\n\t\t}\n\t\tthis._endFloatingSub?.unsubscribe();\n\t\tthis._endFloatingSub = timer(_delay)\n\t\t\t.pipe(\n\t\t\t\ttap(() => {\n\t\t\t\t\tthis._floated = false;\n\t\t\t\t\tthis.zone.run(() => this.cdRef.markForCheck());\n\t\t\t\t}),\n\t\t\t\tdelay(400)\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._floatPanelHidden = true;\n\t\t\t\tthis.zone.run(() => this.cdRef.markForCheck());\n\t\t\t});\n\t}\n}\n","<div\n\tclass=\"bui-alert-fixed-panel\"\n\t[style.opacity]=\"_floatPanelHidden ? 1 : 0\"\n\t[class.bui-alert-fixed-panel-blink]=\"outsideViewportBehavior === 'scroll'\"\n>\n\t<bui-alert\n\t\t*ngFor=\"let a of _alerts\"\n\t\t[id]=\"a.id\"\n\t\t[type]=\"a.type\"\n\t\t[message]=\"a.message\"\n\t\tdismissible\n\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\n\t\t(@alertTransition.start)=\"_animationStarted.next($event)\"\n\t\t(@alertTransition.done)=\"_animationEnded.next($event)\"\n\t\t(dismissed)=\"_dismiss(a)\"\n\t></bui-alert>\n</div>\n\n<div class=\"bui-alert-float-panel-frame\" [hidden]=\"_floatPanelHidden\" [class.bui-alert-float-panel-shaded]=\"_floated\">\n\t<div class=\"bui-alert-float-panel\" [style.max-width]=\"_width + 'px'\" [@floatTransition]=\"'visible'\" *ngIf=\"_floated\">\n\t\t<bui-alert\n\t\t\t*ngFor=\"let a of _alerts\"\n\t\t\t[id]=\"a.id\"\n\t\t\t[type]=\"a.type\"\n\t\t\t[message]=\"a.message\"\n\t\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\n\t\t></bui-alert>\n\t</div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { IconFontModule } from '@bravura/ui/icon-font';\nimport { AlertContainerComponent } from './alert-container.component';\nimport { AlertMessageComponent } from './alert-message.component';\n\n@NgModule({\n\tdeclarations: [AlertMessageComponent, AlertContainerComponent],\n\timports: [CommonModule, IconFontModule, MatButtonModule],\n\texports: [AlertMessageComponent, AlertContainerComponent]\n})\nexport class AlertModule {}\n\nexport { AlertMessageComponent, AlertContainerComponent };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA;AACA,MAAM,KAAK,GAAQ;IAClB,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,QAAQ;CACf,CAAC;AAEF;AACA,MAAM,kBAAkB,GAAG;IAC1B,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;MA0Ba,qBAAqB;IA2CjC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E,CAAC;gCACT,QAAQ,EAAE,QAAQ;gCAClB,SAAS,EAAE,WAAW;gCACtB,OAAO,EAAE,CAAC;gCACV,YAAY,EAAE,OAAO;6BACrB,CAAC,CACF;4BACD,UAAU,CAAC,iBAAiB,EAAE;gCAC7B,KAAK,CAAC,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,CAAC;gCACrF,OAAO,CAAC,0CAA0C,CAAC;6BACnD,CAAC;4BACF,UAAU,CAAC,mBAAmB,EAAE,CAAC,OAAO,CAAC,uCAAuC,CAAC,CAAC,CAAC;yBACnF,CAAC;qBACF;iBACD;uLAIA,GAAG;sBADF,KAAK;gBAUN,uBAAuB;sBADtB,KAAK;gBASN,aAAa;sBADZ,KAAK;;;MErEM,WAAW;;yGAAX,WAAW;0GAAX,WAAW,iBAJR,qBAAqB,EAAE,uBAAuB,aACnD,YAAY,EAAE,cAAc,EAAE,eAAe,aAC7C,qBAAqB,EAAE,uBAAuB;0GAE5C,WAAW,YAHd,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,CAAC;4FAG5C,WAAW;kBALvB,QAAQ;mBAAC;oBACT,YAAY,EAAE,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;oBAC9D,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,CAAC;oBACxD,OAAO,EAAE,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;iBACzD;;;ACXD;;;;;;"}
|
|
1
|
+
{"version":3,"file":"bravura-ui-alert.js","sources":["../../../projects/ui/alert/alert-message.component.ts","../../../projects/ui/alert/alert-message.component.html","../../../projects/ui/alert/alert-container.component.ts","../../../projects/ui/alert/alert-container.component.html","../../../projects/ui/alert/alert.module.ts","../../../projects/ui/alert/bravura-ui-alert.ts"],"sourcesContent":["import { coerceBooleanProperty } from '@angular/cdk/coercion';\nimport { ChangeDetectionStrategy, Component, EventEmitter, HostBinding, Input, OnInit, Output } from '@angular/core';\nimport { generateID } from '@bravura/ui/common';\n\n/** @ignore */\nconst ICONS: any = {\n\tsuccess: 'check_circle',\n\tinfo: 'info',\n\twarn: 'report_problem',\n\terror: 'cancel'\n};\n\n/** @ignore */\nconst DEFAULT_POLITENESS = {\n\tsuccess: 'polite',\n\tinfo: 'polite',\n\twarn: 'assertive',\n\terror: 'assertive'\n};\n\n/**\n * An alert style message usually appears in a global notification area.\n *\n * The base color of the message is determined by the `type` of the message and a list of predefined\n * CSS custom properties.\n *\n * ```scss\n * --bui-color-success: #519602;\n * --bui-color-info: #0dcaf0;\n * --bui-color-warning: #ffc107;\n * --bui-color-error: #dc3545;\n * ```\n *\n *\n */\n@Component({\n\tselector: 'bui-alert',\n\ttemplateUrl: './alert-message.component.html',\n\tstyleUrls: ['./alert-message.component.scss'],\n\thost: {\n\t\t'[class]': `'bui-alert bui-host bui-alert-' + (type === 'warn' ? 'warning' : type) + (dismissible ? ' bui-alert-dismissible' : '')`,\n\t\t'[role]': `politeness === 'off' ? 'region' : 'alert'`,\n\t\t'[attr.aria-live]': `politeness === 'assertive' ? undefined : politeness`\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush\n})\nexport class AlertMessageComponent implements OnInit {\n\t/** @ignore */\n\tstatic ngAcceptInputType_dismissible: boolean | string | null | undefined;\n\t/** @ignore */\n\tstatic ngAcceptInputType_blink: boolean | string | null | undefined;\n\n\t/** The type of the message, used to derive the icon and base color. */\n\t@Input()\n\ttype: 'success' | 'info' | 'warn' | 'error' = 'error';\n\n\t/** The message to be displayed, HTML supported. */\n\t@Input()\n\tmessage = '';\n\n\t/** Specifies the ARIA live region politeness. */\n\t@Input()\n\tpoliteness!: 'off' | 'polite' | 'assertive';\n\n\t/** Whether to display the button to fire the `dismissed` event. */\n\t@Input()\n\tget dismissible() {\n\t\treturn this._dismissible;\n\t}\n\tset dismissible(value: any) {\n\t\tthis._dismissible = coerceBooleanProperty(value);\n\t}\n\n\t/** To be emitted when the user choose to dismiss the message. The event object is the ID of the element. */\n\t@Output()\n\tdismissed = new EventEmitter<string>();\n\n\t/** To be emitted when the component finishes initialisation. The event object is the ID of the element. */\n\t@Output()\n\tinitialised = new EventEmitter<string>();\n\n\t@Input('id')\n\t@HostBinding('id')\n\t/** @ignore */\n\t_id = `bui-alert-${generateID()}`;\n\n\tprivate _dismissible = false;\n\tprivate _blink = false;\n\n\tconstructor() {}\n\n\tngOnInit(): void {\n\t\tthis.politeness = this.politeness || DEFAULT_POLITENESS[this.type];\n\t\tthis.initialised.emit(this._id);\n\t}\n\n\t/** @ignore */\n\tget iconName(): string {\n\t\treturn ICONS[this.type];\n\t}\n\n\t/** @ignore */\n\t_dismiss() {\n\t\tthis.dismissed.emit(this._id);\n\t}\n}\n","<div class=\"bui-alert-backdrop\"></div>\n<div class=\"bui-alert-frame\"></div>\n\n<div class=\"bui-alert-wrapper\">\n\t<div class=\"bui-alert-icon-area\">\n\t\t<mat-icon [buiIcon]=\"iconName\" variant=\"outlined\"></mat-icon>\n\t</div>\n\t<div class=\"bui-alert-content\">\n\t\t<div [innerHTML]=\"message\" *ngIf=\"message\"></div>\n\t\t<ng-content></ng-content>\n\t</div>\n</div>\n\n<div class=\"bui-alert-button-area\" *ngIf=\"dismissible\">\n\t<div class=\"bui-alert-button-backdrop\"></div>\n\t<button mat-icon-button class=\"bui-alert-button\" (click)=\"_dismiss()\" aria-label=\"dismiss alert\">\n\t\t<mat-icon>cancel</mat-icon>\n\t</button>\n</div>\n","import { animate, state, style, transition, trigger, AnimationEvent } from '@angular/animations';\nimport { ScrollDispatcher } from '@angular/cdk/scrolling';\nimport {\n\tChangeDetectionStrategy,\n\tChangeDetectorRef,\n\tComponent,\n\tElementRef,\n\tInput,\n\tNgZone,\n\tOnDestroy,\n\tOnInit\n} from '@angular/core';\nimport { generateID, isElementInViewport } from '@bravura/ui/common';\nimport { Subject, Subscription, timer } from 'rxjs';\nimport { delay, take, takeUntil, tap } from 'rxjs/operators';\n\n/**@internal */\nclass InternalAlertOject {\n\tid: string;\n\tdeleted = false;\n\tconstructor(public readonly type: 'success' | 'info' | 'warn' | 'error', public readonly message: string) {\n\t\tthis.id = `bui-alert-cont-alert-${generateID()}`;\n\t}\n}\n\n/**\n * Use this component in a designated area of a page for displaying notification messages\n *\n */\n@Component({\n\tselector: 'bui-alert-container',\n\ttemplateUrl: './alert-container.component.html',\n\tstyleUrls: ['./alert-container.component.scss'],\n\thost: {\n\t\t'[class]': `'bui-alert-container bui-host bui-alert-container-' + (_remaining.length ? 'not-empty': 'empty')`\n\t},\n\tchangeDetection: ChangeDetectionStrategy.OnPush,\n\tanimations: [\n\t\ttrigger('floatTransition', [\n\t\t\ttransition(':enter', [style({ opacity: '0', transform: 'translateY(-10vh)' }), animate('.3s ease-in')]),\n\t\t\ttransition(':leave', [animate('.4s ease-out', style({ transform: 'translateY(-10vh)', opacity: '0' }))])\n\t\t]),\n\t\ttrigger('alertTransition', [\n\t\t\tstate('visible', style({})),\n\t\t\tstate(\n\t\t\t\t'hidden',\n\t\t\t\tstyle({\n\t\t\t\t\theight: 0,\n\t\t\t\t\toverflow: 'hidden',\n\t\t\t\t\ttransform: 'scaleY(0)',\n\t\t\t\t\topacity: 0,\n\t\t\t\t\t'margin-top': '-1rem'\n\t\t\t\t})\n\t\t\t),\n\t\t\ttransition('void => visible', [\n\t\t\t\tstyle({ transform: 'translateY(100%)', height: 0, opacity: '0', overflow: 'hidden' }),\n\t\t\t\tanimate('250ms cubic-bezier(0.42, 0.0, 0.58, 1.0)')\n\t\t\t]),\n\t\t\ttransition('visible => hidden', [animate('250ms cubic-bezier(0.25, 0, 0.3, 1.0)')])\n\t\t])\n\t]\n})\nexport class AlertContainerComponent implements OnInit, OnDestroy {\n\t/** The maximum number of messages displayed in the container area. */\n\t@Input()\n\tmax = 5;\n\n\t/**\n\t * This property determines the behavior for displaying the notifications when the container is outside the viewport.\n\t *\n\t * `scroll`: The component will try to scroll to reveal the new notifications.\n\t * `float`: The component will float the alert panel to the center of the screen for a couple of seconds and move it back to the original position.\n\t */\n\t@Input()\n\toutsideViewportBehavior: 'scroll' | 'float' = 'float';\n\n\t/**\n\t * The number of milliseconds for which the alert container will be floated when new notification arrives.\n\t *\n\t * This will only take effect when `outsideViewportBehavior` is set to `float` and the container is outside the viewport.\n\t */\n\t@Input()\n\tfloatDuration = 2000;\n\n\t/**@internal */\n\t_alerts: InternalAlertOject[] = [];\n\t/**@internal */\n\t_floated = false;\n\t/**@internal */\n\t_floatPanelHidden = true;\n\n\t/** @ignore Emits whenever the animation is started. */\n\treadonly _animationStarted = new Subject<AnimationEvent>();\n\t/** @ignore Emits whenever the animation is done. */\n\treadonly _animationEnded = new Subject<AnimationEvent>();\n\n\tprivate _destroyed$ = new Subject<void>();\n\tprivate _endFloatingSub?: Subscription;\n\n\tconstructor(\n\t\tprivate zone: NgZone,\n\t\tprivate cdRef: ChangeDetectorRef,\n\t\tprivate _elementRef: ElementRef<HTMLElement>,\n\t\tprivate scroll: ScrollDispatcher\n\t) {}\n\n\tngOnInit(): void {\n\t\tconst checkScroll = () => {\n\t\t\tif (isElementInViewport(this._elementRef.nativeElement)) {\n\t\t\t\tthis._endFloating();\n\t\t\t}\n\t\t};\n\t\tthis.scroll\n\t\t\t.ancestorScrolled(this._elementRef.nativeElement)\n\t\t\t.pipe(takeUntil(this._destroyed$))\n\t\t\t.subscribe(checkScroll);\n\t\tcheckScroll();\n\t}\n\n\tngOnDestroy(): void {\n\t\tthis._destroyed$.next();\n\t\tthis._destroyed$.complete();\n\t\tthis._endFloatingSub?.unsubscribe();\n\t}\n\n\t/**@internal */\n\tget _remaining() {\n\t\treturn this._alerts.filter(a => !a.deleted);\n\t}\n\n\t/**@internal */\n\tget _width() {\n\t\treturn this._elementRef.nativeElement.clientWidth;\n\t}\n\n\t/** Add a message to the notification area */\n\tasync notify(type: 'success' | 'info' | 'warn' | 'error', message: string) {\n\t\tthis._endFloatingSub?.unsubscribe();\n\t\tconst duplicate = this._remaining.find(_a => message === _a.message);\n\t\tif (duplicate) {\n\t\t\tthis._dismiss(duplicate);\n\t\t}\n\n\t\tconst remaining = this._remaining;\n\t\tif (remaining.length >= this.max) {\n\t\t\tthis._dismiss(remaining[0]);\n\t\t}\n\n\t\tconst a = new InternalAlertOject(type, message);\n\t\tawait this._checkViewport();\n\t\tthis.zone.run(() => {\n\t\t\tthis._alerts.push(a);\n\t\t\tthis.cdRef.markForCheck();\n\t\t});\n\t}\n\n\t/**@ignore */\n\tasync _checkViewport() {\n\t\tif (!isElementInViewport(this._elementRef.nativeElement)) {\n\t\t\tif (this.outsideViewportBehavior === 'float') {\n\t\t\t\tconst d = this._floated ? 0 : 100;\n\t\t\t\tthis._floated = true;\n\t\t\t\tthis._floatPanelHidden = false;\n\t\t\t\tthis._endFloating(this.floatDuration);\n\t\t\t\tthis.cdRef.markForCheck();\n\t\t\t\tawait timer(d).toPromise();\n\t\t\t} else {\n\t\t\t\tthis._elementRef.nativeElement.scrollIntoView({ block: 'start', behavior: 'smooth' });\n\t\t\t}\n\t\t}\n\t}\n\n\t/**@ignore */\n\tasync _dismiss(a: InternalAlertOject) {\n\t\tconst id = a.id;\n\t\ta.deleted = true;\n\t\tthis.cdRef.markForCheck();\n\t\tawait this._animationEnded.pipe(take(1)).toPromise();\n\t\tthis.zone.run(() => {\n\t\t\tthis._alerts = this._alerts.filter(_a => _a.id !== id);\n\t\t\tthis.cdRef.markForCheck();\n\t\t});\n\t}\n\n\t/** Remove all messages currently displayed. */\n\tasync clear() {\n\t\tawait Promise.all(this._remaining.map(a => this._dismiss(a)));\n\t\tthis._endFloating();\n\t}\n\n\tprivate _endFloating(_delay = 0) {\n\t\tif (!this._floated) {\n\t\t\treturn;\n\t\t}\n\t\tthis._endFloatingSub?.unsubscribe();\n\t\tthis._endFloatingSub = timer(_delay)\n\t\t\t.pipe(\n\t\t\t\ttap(() => {\n\t\t\t\t\tthis._floated = false;\n\t\t\t\t\tthis.zone.run(() => this.cdRef.markForCheck());\n\t\t\t\t}),\n\t\t\t\tdelay(400)\n\t\t\t)\n\t\t\t.subscribe(() => {\n\t\t\t\tthis._floatPanelHidden = true;\n\t\t\t\tthis.zone.run(() => this.cdRef.markForCheck());\n\t\t\t});\n\t}\n}\n","<div\n\tclass=\"bui-alert-fixed-panel\"\n\t[style.opacity]=\"_floatPanelHidden ? 1 : 0\"\n\t[class.bui-alert-fixed-panel-blink]=\"outsideViewportBehavior === 'scroll'\"\n>\n\t<bui-alert\n\t\t*ngFor=\"let a of _alerts\"\n\t\t[id]=\"a.id\"\n\t\t[type]=\"a.type\"\n\t\t[message]=\"a.message\"\n\t\tdismissible\n\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\n\t\t(@alertTransition.start)=\"_animationStarted.next($event)\"\n\t\t(@alertTransition.done)=\"_animationEnded.next($event)\"\n\t\t(dismissed)=\"_dismiss(a)\"\n\t></bui-alert>\n</div>\n\n<div class=\"bui-alert-float-panel-frame\" [hidden]=\"_floatPanelHidden\" [class.bui-alert-float-panel-shaded]=\"_floated\">\n\t<div class=\"bui-alert-float-panel\" [style.max-width]=\"_width + 'px'\" [@floatTransition]=\"'visible'\" *ngIf=\"_floated\">\n\t\t<bui-alert\n\t\t\t*ngFor=\"let a of _alerts\"\n\t\t\t[id]=\"a.id\"\n\t\t\t[type]=\"a.type\"\n\t\t\t[message]=\"a.message\"\n\t\t\t[@alertTransition]=\"a.deleted ? 'hidden' : 'visible'\"\n\t\t></bui-alert>\n\t</div>\n</div>\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { MatButtonModule } from '@angular/material/button';\nimport { IconFontModule } from '@bravura/ui/icon-font';\nimport { AlertContainerComponent } from './alert-container.component';\nimport { AlertMessageComponent } from './alert-message.component';\n\n@NgModule({\n\tdeclarations: [AlertMessageComponent, AlertContainerComponent],\n\timports: [CommonModule, IconFontModule, MatButtonModule],\n\texports: [AlertMessageComponent, AlertContainerComponent]\n})\nexport class AlertModule {}\n\nexport { AlertMessageComponent, AlertContainerComponent };\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAIA;AACA,MAAM,KAAK,GAAQ;IAClB,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,gBAAgB;IACtB,KAAK,EAAE,QAAQ;CACf,CAAC;AAEF;AACA,MAAM,kBAAkB,GAAG;IAC1B,OAAO,EAAE,QAAQ;IACjB,IAAI,EAAE,QAAQ;IACd,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;CAClB,CAAC;AAEF;;;;;;;;;;;;;;;MA0Ba,qBAAqB;IA2CjC;;QAnCA,SAAI,GAA0C,OAAO,CAAC;;QAItD,YAAO,GAAG,EAAE,CAAC;;QAiBb,cAAS,GAAG,IAAI,YAAY,EAAU,CAAC;;QAIvC,gBAAW,GAAG,IAAI,YAAY,EAAU,CAAC;;QAKzC,QAAG,GAAG,aAAa,UAAU,EAAE,EAAE,CAAC;QAE1B,iBAAY,GAAG,KAAK,CAAC;QACrB,WAAM,GAAG,KAAK,CAAC;KAEP;;IAxBhB,IACI,WAAW;QACd,OAAO,IAAI,CAAC,YAAY,CAAC;KACzB;IACD,IAAI,WAAW,CAAC,KAAU;QACzB,IAAI,CAAC,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;KACjD;IAoBD,QAAQ;QACP,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU,IAAI,kBAAkB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QACnE,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAChC;;IAGD,IAAI,QAAQ;QACX,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;KACxB;;IAGD,QAAQ;QACP,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC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AAE,uBAAuB,CAAC;oBAC9D,OAAO,EAAE,CAAC,YAAY,EAAE,cAAc,EAAE,eAAe,CAAC;oBACxD,OAAO,EAAE,CAAC,qBAAqB,EAAE,uBAAuB,CAAC;iBACzD;;;ACXD;;;;;;"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { __awaiter } from 'tslib';
|
|
2
|
+
import { HarnessPredicate } from '@angular/cdk/testing';
|
|
3
|
+
import { MatRadioButtonHarness, _MatRadioGroupHarnessBase } from '@angular/material/radio/testing';
|
|
4
|
+
|
|
5
|
+
class RadioPanelItemHarness extends MatRadioButtonHarness {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(...arguments);
|
|
8
|
+
this.getLabelElement = this.locatorFor('label');
|
|
9
|
+
this._textLabel = this.locatorFor('label .bui-label-title');
|
|
10
|
+
this._clickLabel = this.getLabelElement;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Gets a `HarnessPredicate` that can be used to search for a radio button with specific
|
|
14
|
+
* attributes.
|
|
15
|
+
* @param options Options for filtering which radio button instances are considered a match.
|
|
16
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
17
|
+
*/
|
|
18
|
+
static with(options = {}) {
|
|
19
|
+
return new HarnessPredicate(this, options)
|
|
20
|
+
.addOption('label', options.label, (harness, label) => HarnessPredicate.stringMatches(harness.getLabelText(), label))
|
|
21
|
+
.addOption('value', options.value, (harness, value) => HarnessPredicate.stringMatches(harness.getValue(), value));
|
|
22
|
+
}
|
|
23
|
+
click() {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const element = yield this.getLabelElement();
|
|
26
|
+
element.click();
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
getLabelCssValue(prop) {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const element = yield this.getLabelElement();
|
|
32
|
+
return element.getCssValue(prop);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
getBorderColor() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const label = yield this.getLabelElement();
|
|
38
|
+
return label.getCssValue('border-color');
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
RadioPanelItemHarness.hostSelector = 'bui-radio-panel-item';
|
|
43
|
+
class RadioPanelHarness extends _MatRadioGroupHarnessBase {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this._buttonClass = RadioPanelItemHarness;
|
|
47
|
+
this.getItem = (filters) => this.locatorFor(RadioPanelItemHarness.with(filters))();
|
|
48
|
+
}
|
|
49
|
+
getFlexDir() {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
return (yield this.host()).getCssValue('flex-direction');
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/** The selector for the host element of a `MatRadioGroup` instance. */
|
|
56
|
+
RadioPanelHarness.hostSelector = 'bui-radio-panel';
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Generated bundle index. Do not edit.
|
|
60
|
+
*/
|
|
61
|
+
|
|
62
|
+
export { RadioPanelHarness, RadioPanelItemHarness };
|
|
63
|
+
//# sourceMappingURL=bravura-ui-radio-panel-testing.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bravura-ui-radio-panel-testing.js","sources":["../../../projects/ui/radio-panel/testing/test-api.ts","../../../projects/ui/radio-panel/testing/bravura-ui-radio-panel-testing.ts"],"sourcesContent":["import { ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';\nimport {\n\tMatRadioButtonHarness,\n\tRadioButtonHarnessFilters,\n\t_MatRadioGroupHarnessBase\n} from '@angular/material/radio/testing';\n\nexport interface RadioPanelItemHarnessFilters extends RadioButtonHarnessFilters {\n\tvalue?: string | RegExp;\n}\n\nexport class RadioPanelItemHarness extends MatRadioButtonHarness {\n\tstatic hostSelector = 'bui-radio-panel-item';\n\tgetLabelElement = this.locatorFor('label');\n\n\tprotected _textLabel = this.locatorFor('label .bui-label-title');\n\tprotected _clickLabel = this.getLabelElement;\n\n\t/**\n\t * Gets a `HarnessPredicate` that can be used to search for a radio button with specific\n\t * attributes.\n\t * @param options Options for filtering which radio button instances are considered a match.\n\t * @return a `HarnessPredicate` configured with the given options.\n\t */\n\tstatic with<T extends MatRadioButtonHarness>(\n\t\tthis: ComponentHarnessConstructor<T>,\n\t\toptions: RadioPanelItemHarnessFilters = {}\n\t): HarnessPredicate<T> {\n\t\treturn new HarnessPredicate(this, options)\n\t\t\t.addOption('label', options.label, (harness, label) =>\n\t\t\t\tHarnessPredicate.stringMatches(harness.getLabelText(), label)\n\t\t\t)\n\t\t\t.addOption('value', options.value, (harness, value) =>\n\t\t\t\tHarnessPredicate.stringMatches(harness.getValue(), value)\n\t\t\t) as HarnessPredicate<T>;\n\t}\n\n\tasync click() {\n\t\tconst element = await this.getLabelElement();\n\t\telement.click();\n\t}\n\n\tasync getLabelCssValue(prop: string): Promise<string> {\n\t\tconst element = await this.getLabelElement();\n\t\treturn element.getCssValue(prop);\n\t}\n\n\tasync getBorderColor(): Promise<string> {\n\t\tconst label = await this.getLabelElement();\n\t\treturn label.getCssValue('border-color');\n\t}\n}\n\nexport class RadioPanelHarness extends _MatRadioGroupHarnessBase<\n\ttypeof RadioPanelItemHarness,\n\tRadioPanelItemHarness,\n\tRadioButtonHarnessFilters\n> {\n\t/** The selector for the host element of a `MatRadioGroup` instance. */\n\tstatic hostSelector = 'bui-radio-panel';\n\n\tprotected _buttonClass = RadioPanelItemHarness;\n\n\tgetItem = (filters?: RadioPanelItemHarnessFilters) => this.locatorFor(RadioPanelItemHarness.with(filters))();\n\n\tasync getFlexDir(): Promise<string> {\n\t\treturn (await this.host()).getCssValue('flex-direction');\n\t}\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './test-api';\n"],"names":[],"mappings":";;;;MAWa,qBAAsB,SAAQ,qB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AI,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC;KAK7G;IAHM,UAAU;;YACf,OAAO,CAAC,MAAM,IAAI,CAAC,IAAI,EAAE,EAAE,WAAW,CAAC,gBAAgB,CAAC,CAAC;SACzD;KAAA;;AATD;AACO,8BAAY,GAAG,iBAAiB;;AC3DxC;;;;;;"}
|
package/package.json
CHANGED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"main": "../../bundles/bravura-ui-radio-panel-testing.umd.js",
|
|
3
|
+
"module": "../../fesm2015/bravura-ui-radio-panel-testing.js",
|
|
4
|
+
"es2015": "../../fesm2015/bravura-ui-radio-panel-testing.js",
|
|
5
|
+
"esm2015": "../../esm2015/radio-panel/testing/bravura-ui-radio-panel-testing.js",
|
|
6
|
+
"fesm2015": "../../fesm2015/bravura-ui-radio-panel-testing.js",
|
|
7
|
+
"typings": "bravura-ui-radio-panel-testing.d.ts",
|
|
8
|
+
"sideEffects": false,
|
|
9
|
+
"name": "@bravura/ui/radio-panel/testing"
|
|
10
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { ComponentHarnessConstructor, HarnessPredicate } from '@angular/cdk/testing';
|
|
2
|
+
import { MatRadioButtonHarness, RadioButtonHarnessFilters, _MatRadioGroupHarnessBase } from '@angular/material/radio/testing';
|
|
3
|
+
export interface RadioPanelItemHarnessFilters extends RadioButtonHarnessFilters {
|
|
4
|
+
value?: string | RegExp;
|
|
5
|
+
}
|
|
6
|
+
export declare class RadioPanelItemHarness extends MatRadioButtonHarness {
|
|
7
|
+
static hostSelector: string;
|
|
8
|
+
getLabelElement: import("@angular/cdk/testing").AsyncFactoryFn<import("@angular/cdk/testing").TestElement>;
|
|
9
|
+
protected _textLabel: import("@angular/cdk/testing").AsyncFactoryFn<import("@angular/cdk/testing").TestElement>;
|
|
10
|
+
protected _clickLabel: import("@angular/cdk/testing").AsyncFactoryFn<import("@angular/cdk/testing").TestElement>;
|
|
11
|
+
/**
|
|
12
|
+
* Gets a `HarnessPredicate` that can be used to search for a radio button with specific
|
|
13
|
+
* attributes.
|
|
14
|
+
* @param options Options for filtering which radio button instances are considered a match.
|
|
15
|
+
* @return a `HarnessPredicate` configured with the given options.
|
|
16
|
+
*/
|
|
17
|
+
static with<T extends MatRadioButtonHarness>(this: ComponentHarnessConstructor<T>, options?: RadioPanelItemHarnessFilters): HarnessPredicate<T>;
|
|
18
|
+
click(): Promise<void>;
|
|
19
|
+
getLabelCssValue(prop: string): Promise<string>;
|
|
20
|
+
getBorderColor(): Promise<string>;
|
|
21
|
+
}
|
|
22
|
+
export declare class RadioPanelHarness extends _MatRadioGroupHarnessBase<typeof RadioPanelItemHarness, RadioPanelItemHarness, RadioButtonHarnessFilters> {
|
|
23
|
+
/** The selector for the host element of a `MatRadioGroup` instance. */
|
|
24
|
+
static hostSelector: string;
|
|
25
|
+
protected _buttonClass: typeof RadioPanelItemHarness;
|
|
26
|
+
getItem: (filters?: RadioPanelItemHarnessFilters | undefined) => Promise<RadioPanelItemHarness>;
|
|
27
|
+
getFlexDir(): Promise<string>;
|
|
28
|
+
}
|