@truenas/ui-components 0.1.5 → 0.1.7
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.
|
@@ -709,11 +709,11 @@ class TnBannerComponent {
|
|
|
709
709
|
];
|
|
710
710
|
}, ...(ngDevMode ? [{ debugName: "classes" }] : []));
|
|
711
711
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TnBannerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
712
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: TnBannerComponent, isStandalone: true, selector: "tn-banner", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "actionContent", predicate: TnBannerActionDirective, isSignal: true }], ngImport: i0, template: "<div\n aria-live=\"polite\"\n [ngClass]=\"classes()\"\n [attr.role]=\"ariaRole()\"\n>\n <div class=\"tn-banner__main\">\n <div class=\"tn-banner__icon\">\n <tn-icon\n library=\"mdi\"\n size=\"md\"\n aria-hidden=\"true\"\n [name]=\"iconName()\"\n />\n </div>\n\n <div class=\"tn-banner__content\">\n <div class=\"tn-banner__heading\">\n {{ heading() }}\n </div>\n\n @if (message()) {\n <div class=\"tn-banner__message\">\n {{ message() }}\n </div>\n }\n </div>\n </div>\n\n @if (hasAction()) {\n <div class=\"tn-banner__action\">\n <ng-content select=\"[tnBannerAction]\" />\n </div>\n }\n</div>\n", styles: [".tn-banner{display:flex;align-items:center;padding:16px;border-radius:6px;border-left:4px solid;transition:opacity .2s ease}@media(prefers-reduced-motion:reduce){.tn-banner{transition:none}}.tn-banner--info{border-left-color:var(--tn-info, #3b82f6);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--info .tn-banner__heading,.tn-banner--info .tn-banner__icon{color:var(--tn-info, #3b82f6)}.tn-banner--warning{border-left-color:var(--tn-warning, #f59e0b);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--warning .tn-banner__heading,.tn-banner--warning .tn-banner__icon{color:var(--tn-warning, #f59e0b)}.tn-banner--error{border-left-color:var(--tn-error, #ef4444);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--error .tn-banner__heading,.tn-banner--error .tn-banner__icon{color:var(--tn-error, #ef4444)}.tn-banner--success{border-left-color:var(--tn-success, #10b981);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--success .tn-banner__heading,.tn-banner--success .tn-banner__icon{color:var(--tn-success, #10b981)}.tn-banner__main{display:flex;align-items:flex-start;gap:12px;flex:1;min-width:0}.tn-banner__icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:2px}.tn-banner__content{flex:1;min-width:0}.tn-banner__heading{font-size:1rem;font-weight:600;line-height:1.5;margin:0}.tn-banner__message{font-size:.875rem;color:var(--tn-fg2, #6b7280);line-height:1.5;margin-top:4px}.tn-banner__action{display:flex;align-items:center;flex-shrink:0;margin-left:auto;padding-left:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: TnIconComponent, selector: "tn-icon", inputs: ["name", "size", "color", "tooltip", "ariaLabel", "library"] }] });
|
|
712
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.0", type: TnBannerComponent, isStandalone: true, selector: "tn-banner", inputs: { heading: { classPropertyName: "heading", publicName: "heading", isSignal: true, isRequired: true, transformFunction: null }, message: { classPropertyName: "message", publicName: "message", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, queries: [{ propertyName: "actionContent", predicate: TnBannerActionDirective, isSignal: true }], ngImport: i0, template: "<div\n aria-live=\"polite\"\n [ngClass]=\"classes()\"\n [attr.role]=\"ariaRole()\"\n>\n <div class=\"tn-banner__main\">\n <div class=\"tn-banner__icon\">\n <tn-icon\n library=\"mdi\"\n size=\"md\"\n aria-hidden=\"true\"\n [name]=\"iconName()\"\n />\n </div>\n\n <div class=\"tn-banner__content\">\n <div class=\"tn-banner__heading\">\n {{ heading() }}\n </div>\n\n @if (message()) {\n <div class=\"tn-banner__message\">\n {{ message() }}\n </div>\n }\n </div>\n </div>\n\n @if (hasAction()) {\n <div class=\"tn-banner__action\">\n <ng-content select=\"[tnBannerAction]\" />\n </div>\n }\n</div>\n", styles: [".tn-banner{display:flex;align-items:center;padding:16px;border-radius:6px;border-left:4px solid;transition:opacity .2s ease}@media(prefers-reduced-motion:reduce){.tn-banner{transition:none}}.tn-banner--info{border-left-color:var(--tn-info, #3b82f6);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--info .tn-banner__heading,.tn-banner--info .tn-banner__icon{color:var(--tn-info, #3b82f6)}.tn-banner--warning{border-left-color:var(--tn-warning, #f59e0b);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--warning .tn-banner__heading,.tn-banner--warning .tn-banner__icon{color:var(--tn-warning, #f59e0b)}.tn-banner--error{border-left-color:var(--tn-error, #ef4444);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--error .tn-banner__heading,.tn-banner--error .tn-banner__icon{color:var(--tn-error, #ef4444)}.tn-banner--success{border-left-color:var(--tn-success, #10b981);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--success .tn-banner__heading,.tn-banner--success .tn-banner__icon{color:var(--tn-success, #10b981)}.tn-banner__main{display:flex;align-items:flex-start;gap:12px;flex:1;min-width:0}.tn-banner__icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:2px}.tn-banner__content{flex:1;min-width:0}.tn-banner__heading{font-size:1rem;font-weight:600;line-height:1.5;margin:0}.tn-banner__message{font-size:.875rem;color:var(--tn-fg2, #6b7280);line-height:1.5;margin-top:4px}.tn-banner__action{display:flex;align-items:center;flex-shrink:0;margin-left:auto;padding-left:16px;gap:16px}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: TnIconComponent, selector: "tn-icon", inputs: ["name", "size", "color", "tooltip", "ariaLabel", "library"] }] });
|
|
713
713
|
}
|
|
714
714
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImport: i0, type: TnBannerComponent, decorators: [{
|
|
715
715
|
type: Component,
|
|
716
|
-
args: [{ selector: 'tn-banner', standalone: true, imports: [CommonModule, TnIconComponent], template: "<div\n aria-live=\"polite\"\n [ngClass]=\"classes()\"\n [attr.role]=\"ariaRole()\"\n>\n <div class=\"tn-banner__main\">\n <div class=\"tn-banner__icon\">\n <tn-icon\n library=\"mdi\"\n size=\"md\"\n aria-hidden=\"true\"\n [name]=\"iconName()\"\n />\n </div>\n\n <div class=\"tn-banner__content\">\n <div class=\"tn-banner__heading\">\n {{ heading() }}\n </div>\n\n @if (message()) {\n <div class=\"tn-banner__message\">\n {{ message() }}\n </div>\n }\n </div>\n </div>\n\n @if (hasAction()) {\n <div class=\"tn-banner__action\">\n <ng-content select=\"[tnBannerAction]\" />\n </div>\n }\n</div>\n", styles: [".tn-banner{display:flex;align-items:center;padding:16px;border-radius:6px;border-left:4px solid;transition:opacity .2s ease}@media(prefers-reduced-motion:reduce){.tn-banner{transition:none}}.tn-banner--info{border-left-color:var(--tn-info, #3b82f6);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--info .tn-banner__heading,.tn-banner--info .tn-banner__icon{color:var(--tn-info, #3b82f6)}.tn-banner--warning{border-left-color:var(--tn-warning, #f59e0b);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--warning .tn-banner__heading,.tn-banner--warning .tn-banner__icon{color:var(--tn-warning, #f59e0b)}.tn-banner--error{border-left-color:var(--tn-error, #ef4444);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--error .tn-banner__heading,.tn-banner--error .tn-banner__icon{color:var(--tn-error, #ef4444)}.tn-banner--success{border-left-color:var(--tn-success, #10b981);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--success .tn-banner__heading,.tn-banner--success .tn-banner__icon{color:var(--tn-success, #10b981)}.tn-banner__main{display:flex;align-items:flex-start;gap:12px;flex:1;min-width:0}.tn-banner__icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:2px}.tn-banner__content{flex:1;min-width:0}.tn-banner__heading{font-size:1rem;font-weight:600;line-height:1.5;margin:0}.tn-banner__message{font-size:.875rem;color:var(--tn-fg2, #6b7280);line-height:1.5;margin-top:4px}.tn-banner__action{display:flex;align-items:center;flex-shrink:0;margin-left:auto;padding-left:16px}\n"] }]
|
|
716
|
+
args: [{ selector: 'tn-banner', standalone: true, imports: [CommonModule, TnIconComponent], template: "<div\n aria-live=\"polite\"\n [ngClass]=\"classes()\"\n [attr.role]=\"ariaRole()\"\n>\n <div class=\"tn-banner__main\">\n <div class=\"tn-banner__icon\">\n <tn-icon\n library=\"mdi\"\n size=\"md\"\n aria-hidden=\"true\"\n [name]=\"iconName()\"\n />\n </div>\n\n <div class=\"tn-banner__content\">\n <div class=\"tn-banner__heading\">\n {{ heading() }}\n </div>\n\n @if (message()) {\n <div class=\"tn-banner__message\">\n {{ message() }}\n </div>\n }\n </div>\n </div>\n\n @if (hasAction()) {\n <div class=\"tn-banner__action\">\n <ng-content select=\"[tnBannerAction]\" />\n </div>\n }\n</div>\n", styles: [".tn-banner{display:flex;align-items:center;padding:16px;border-radius:6px;border-left:4px solid;transition:opacity .2s ease}@media(prefers-reduced-motion:reduce){.tn-banner{transition:none}}.tn-banner--info{border-left-color:var(--tn-info, #3b82f6);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--info .tn-banner__heading,.tn-banner--info .tn-banner__icon{color:var(--tn-info, #3b82f6)}.tn-banner--warning{border-left-color:var(--tn-warning, #f59e0b);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--warning .tn-banner__heading,.tn-banner--warning .tn-banner__icon{color:var(--tn-warning, #f59e0b)}.tn-banner--error{border-left-color:var(--tn-error, #ef4444);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--error .tn-banner__heading,.tn-banner--error .tn-banner__icon{color:var(--tn-error, #ef4444)}.tn-banner--success{border-left-color:var(--tn-success, #10b981);background-color:var(--tn-alt-bg1, #383838)}.tn-banner--success .tn-banner__heading,.tn-banner--success .tn-banner__icon{color:var(--tn-success, #10b981)}.tn-banner__main{display:flex;align-items:flex-start;gap:12px;flex:1;min-width:0}.tn-banner__icon{flex-shrink:0;display:flex;align-items:center;justify-content:center;margin-top:2px}.tn-banner__content{flex:1;min-width:0}.tn-banner__heading{font-size:1rem;font-weight:600;line-height:1.5;margin:0}.tn-banner__message{font-size:.875rem;color:var(--tn-fg2, #6b7280);line-height:1.5;margin-top:4px}.tn-banner__action{display:flex;align-items:center;flex-shrink:0;margin-left:auto;padding-left:16px;gap:16px}\n"] }]
|
|
717
717
|
}], ctorParameters: () => [], propDecorators: { actionContent: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => TnBannerActionDirective), { isSignal: true }] }], heading: [{ type: i0.Input, args: [{ isSignal: true, alias: "heading", required: true }] }], message: [{ type: i0.Input, args: [{ isSignal: true, alias: "message", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }] } });
|
|
718
718
|
|
|
719
719
|
/**
|
|
@@ -946,6 +946,173 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
946
946
|
args: [{ selector: 'tn-icon-button', standalone: true, imports: [CommonModule, TnIconComponent], template: "<button\n type=\"button\"\n [ngClass]=\"classes()\"\n [disabled]=\"disabled()\"\n [attr.aria-label]=\"effectiveAriaLabel()\"\n [attr.title]=\"tooltip()\"\n (click)=\"onClick.emit($event)\"\n>\n <tn-icon\n [name]=\"name()\"\n [size]=\"size()\"\n [color]=\"color()\"\n [library]=\"library()\"\n [ariaLabel]=\"effectiveAriaLabel()\" />\n</button>\n", styles: [":host{display:inline-block;width:fit-content}.tn-icon-button{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;border:none;background:transparent;padding:8px;border-radius:4px;transition:background-color .2s ease,color .2s ease;color:var(--tn-fg2, #6b7280)}.tn-icon-button:hover:not(:disabled){background-color:var(--tn-bg3, #f3f4f6);color:var(--tn-fg1, #1f2937)}.tn-icon-button:active:not(:disabled){background-color:var(--tn-bg3, #e5e7eb)}.tn-icon-button:focus-visible{outline:2px solid var(--tn-primary, #2563eb);outline-offset:2px}.tn-icon-button:disabled{opacity:.5;cursor:not-allowed;pointer-events:none}\n"] }]
|
|
947
947
|
}], propDecorators: { disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], ariaLabel: [{ type: i0.Input, args: [{ isSignal: true, alias: "ariaLabel", required: false }] }], name: [{ type: i0.Input, args: [{ isSignal: true, alias: "name", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], color: [{ type: i0.Input, args: [{ isSignal: true, alias: "color", required: false }] }], tooltip: [{ type: i0.Input, args: [{ isSignal: true, alias: "tooltip", required: false }] }], library: [{ type: i0.Input, args: [{ isSignal: true, alias: "library", required: false }] }], onClick: [{ type: i0.Output, args: ["onClick"] }] } });
|
|
948
948
|
|
|
949
|
+
/**
|
|
950
|
+
* Harness for interacting with tn-icon-button in tests.
|
|
951
|
+
* Provides filtering by icon properties and methods for querying state and simulating interactions.
|
|
952
|
+
*
|
|
953
|
+
* @example
|
|
954
|
+
* ```typescript
|
|
955
|
+
* // Find icon button by name
|
|
956
|
+
* const closeBtn = await loader.getHarness(
|
|
957
|
+
* TnIconButtonHarness.with({ name: 'close' })
|
|
958
|
+
* );
|
|
959
|
+
*
|
|
960
|
+
* // Click an icon button
|
|
961
|
+
* const settingsBtn = await loader.getHarness(
|
|
962
|
+
* TnIconButtonHarness.with({ name: 'settings' })
|
|
963
|
+
* );
|
|
964
|
+
* await settingsBtn.click();
|
|
965
|
+
*
|
|
966
|
+
* // Check if disabled
|
|
967
|
+
* const deleteBtn = await loader.getHarness(
|
|
968
|
+
* TnIconButtonHarness.with({ name: 'delete' })
|
|
969
|
+
* );
|
|
970
|
+
* expect(await deleteBtn.isDisabled()).toBe(false);
|
|
971
|
+
* ```
|
|
972
|
+
*/
|
|
973
|
+
class TnIconButtonHarness extends ComponentHarness {
|
|
974
|
+
/**
|
|
975
|
+
* The selector for the host element of a `TnIconButtonComponent` instance.
|
|
976
|
+
*/
|
|
977
|
+
static hostSelector = 'tn-icon-button';
|
|
978
|
+
button = this.locatorFor('button');
|
|
979
|
+
/**
|
|
980
|
+
* Gets a `HarnessPredicate` that can be used to search for an icon button
|
|
981
|
+
* with specific attributes.
|
|
982
|
+
*
|
|
983
|
+
* @param options Options for filtering which icon button instances are considered a match.
|
|
984
|
+
* @returns A `HarnessPredicate` configured with the given options.
|
|
985
|
+
*
|
|
986
|
+
* @example
|
|
987
|
+
* ```typescript
|
|
988
|
+
* // Find icon button by name
|
|
989
|
+
* const button = await loader.getHarness(
|
|
990
|
+
* TnIconButtonHarness.with({ name: 'menu' })
|
|
991
|
+
* );
|
|
992
|
+
*
|
|
993
|
+
* // Find icon button by library
|
|
994
|
+
* const customButton = await loader.getHarness(
|
|
995
|
+
* TnIconButtonHarness.with({ library: 'mdi' })
|
|
996
|
+
* );
|
|
997
|
+
*
|
|
998
|
+
* // Find icon button with specific size
|
|
999
|
+
* const largeButton = await loader.getHarness(
|
|
1000
|
+
* TnIconButtonHarness.with({ size: 'lg' })
|
|
1001
|
+
* );
|
|
1002
|
+
* ```
|
|
1003
|
+
*/
|
|
1004
|
+
static with(options = {}) {
|
|
1005
|
+
return new HarnessPredicate(TnIconButtonHarness, options)
|
|
1006
|
+
.addOption('name', options.name, async (harness, name) => {
|
|
1007
|
+
return (await harness.getName()) === name;
|
|
1008
|
+
})
|
|
1009
|
+
.addOption('library', options.library, async (harness, library) => {
|
|
1010
|
+
return (await harness.getLibrary()) === library;
|
|
1011
|
+
})
|
|
1012
|
+
.addOption('size', options.size, async (harness, size) => {
|
|
1013
|
+
return (await harness.getSize()) === size;
|
|
1014
|
+
});
|
|
1015
|
+
}
|
|
1016
|
+
/**
|
|
1017
|
+
* Gets the icon name.
|
|
1018
|
+
*
|
|
1019
|
+
* @returns Promise resolving to the icon name.
|
|
1020
|
+
*
|
|
1021
|
+
* @example
|
|
1022
|
+
* ```typescript
|
|
1023
|
+
* const button = await loader.getHarness(TnIconButtonHarness);
|
|
1024
|
+
* const name = await button.getName();
|
|
1025
|
+
* expect(name).toBe('settings');
|
|
1026
|
+
* ```
|
|
1027
|
+
*/
|
|
1028
|
+
async getName() {
|
|
1029
|
+
const icon = await this.locatorFor('tn-icon')();
|
|
1030
|
+
return icon.getAttribute('name');
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
1033
|
+
* Gets the icon library.
|
|
1034
|
+
*
|
|
1035
|
+
* @returns Promise resolving to the icon library.
|
|
1036
|
+
*
|
|
1037
|
+
* @example
|
|
1038
|
+
* ```typescript
|
|
1039
|
+
* const button = await loader.getHarness(TnIconButtonHarness);
|
|
1040
|
+
* const library = await button.getLibrary();
|
|
1041
|
+
* expect(library).toBe('mdi');
|
|
1042
|
+
* ```
|
|
1043
|
+
*/
|
|
1044
|
+
async getLibrary() {
|
|
1045
|
+
const icon = await this.locatorFor('tn-icon')();
|
|
1046
|
+
return icon.getAttribute('library');
|
|
1047
|
+
}
|
|
1048
|
+
/**
|
|
1049
|
+
* Gets the icon size.
|
|
1050
|
+
*
|
|
1051
|
+
* @returns Promise resolving to the icon size.
|
|
1052
|
+
*
|
|
1053
|
+
* @example
|
|
1054
|
+
* ```typescript
|
|
1055
|
+
* const button = await loader.getHarness(TnIconButtonHarness);
|
|
1056
|
+
* const size = await button.getSize();
|
|
1057
|
+
* expect(size).toBe('lg');
|
|
1058
|
+
* ```
|
|
1059
|
+
*/
|
|
1060
|
+
async getSize() {
|
|
1061
|
+
const icon = await this.locatorFor('tn-icon')();
|
|
1062
|
+
return icon.getAttribute('size');
|
|
1063
|
+
}
|
|
1064
|
+
/**
|
|
1065
|
+
* Gets the icon color.
|
|
1066
|
+
*
|
|
1067
|
+
* @returns Promise resolving to the icon color.
|
|
1068
|
+
*
|
|
1069
|
+
* @example
|
|
1070
|
+
* ```typescript
|
|
1071
|
+
* const button = await loader.getHarness(TnIconButtonHarness);
|
|
1072
|
+
* const color = await button.getColor();
|
|
1073
|
+
* expect(color).toBe('primary');
|
|
1074
|
+
* ```
|
|
1075
|
+
*/
|
|
1076
|
+
async getColor() {
|
|
1077
|
+
const icon = await this.locatorFor('tn-icon')();
|
|
1078
|
+
return icon.getAttribute('color');
|
|
1079
|
+
}
|
|
1080
|
+
/**
|
|
1081
|
+
* Checks whether the icon button is disabled.
|
|
1082
|
+
*
|
|
1083
|
+
* @returns Promise resolving to true if the button is disabled.
|
|
1084
|
+
*
|
|
1085
|
+
* @example
|
|
1086
|
+
* ```typescript
|
|
1087
|
+
* const button = await loader.getHarness(
|
|
1088
|
+
* TnIconButtonHarness.with({ name: 'delete' })
|
|
1089
|
+
* );
|
|
1090
|
+
* expect(await button.isDisabled()).toBe(false);
|
|
1091
|
+
* ```
|
|
1092
|
+
*/
|
|
1093
|
+
async isDisabled() {
|
|
1094
|
+
const button = await this.button();
|
|
1095
|
+
return (await button.getProperty('disabled')) ?? false;
|
|
1096
|
+
}
|
|
1097
|
+
/**
|
|
1098
|
+
* Clicks the icon button.
|
|
1099
|
+
*
|
|
1100
|
+
* @returns Promise that resolves when the click action is complete.
|
|
1101
|
+
*
|
|
1102
|
+
* @example
|
|
1103
|
+
* ```typescript
|
|
1104
|
+
* const button = await loader.getHarness(
|
|
1105
|
+
* TnIconButtonHarness.with({ name: 'close' })
|
|
1106
|
+
* );
|
|
1107
|
+
* await button.click();
|
|
1108
|
+
* ```
|
|
1109
|
+
*/
|
|
1110
|
+
async click() {
|
|
1111
|
+
const button = await this.button();
|
|
1112
|
+
return button.click();
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
|
|
949
1116
|
var InputType;
|
|
950
1117
|
(function (InputType) {
|
|
951
1118
|
InputType["Email"] = "email";
|
|
@@ -2416,7 +2583,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
2416
2583
|
|
|
2417
2584
|
/**
|
|
2418
2585
|
* Harness for interacting with tn-icon in tests.
|
|
2419
|
-
* Provides filtering by icon name and library for existence checks.
|
|
2586
|
+
* Provides filtering by icon name and library for existence checks, as well as click interaction.
|
|
2420
2587
|
*
|
|
2421
2588
|
* @example
|
|
2422
2589
|
* ```typescript
|
|
@@ -2437,6 +2604,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
2437
2604
|
* const hasIcon = await loader.hasHarness(
|
|
2438
2605
|
* TnIconHarness.with({ name: 'check' })
|
|
2439
2606
|
* );
|
|
2607
|
+
*
|
|
2608
|
+
* // Click an icon
|
|
2609
|
+
* const closeIcon = await loader.getHarness(
|
|
2610
|
+
* TnIconHarness.with({ name: 'close' })
|
|
2611
|
+
* );
|
|
2612
|
+
* await closeIcon.click();
|
|
2440
2613
|
* ```
|
|
2441
2614
|
*/
|
|
2442
2615
|
class TnIconHarness extends ComponentHarness {
|
|
@@ -2545,6 +2718,21 @@ class TnIconHarness extends ComponentHarness {
|
|
|
2545
2718
|
const host = await this.host();
|
|
2546
2719
|
return host.getAttribute('color');
|
|
2547
2720
|
}
|
|
2721
|
+
/**
|
|
2722
|
+
* Clicks the icon.
|
|
2723
|
+
*
|
|
2724
|
+
* @returns Promise that resolves when the click action is complete.
|
|
2725
|
+
*
|
|
2726
|
+
* @example
|
|
2727
|
+
* ```typescript
|
|
2728
|
+
* const icon = await loader.getHarness(TnIconHarness.with({ name: 'close' }));
|
|
2729
|
+
* await icon.click();
|
|
2730
|
+
* ```
|
|
2731
|
+
*/
|
|
2732
|
+
async click() {
|
|
2733
|
+
const host = await this.host();
|
|
2734
|
+
return host.click();
|
|
2735
|
+
}
|
|
2548
2736
|
}
|
|
2549
2737
|
|
|
2550
2738
|
/**
|
|
@@ -8287,5 +8475,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.0", ngImpor
|
|
|
8287
8475
|
* Generated bundle index. Do not edit.
|
|
8288
8476
|
*/
|
|
8289
8477
|
|
|
8290
|
-
export { CommonShortcuts, DEFAULT_THEME, DiskIconComponent, DiskType, FileSizePipe, InputType, LinuxModifierKeys, LinuxShortcuts, ModifierKeys, QuickShortcuts, ShortcutBuilder, StripMntPrefixPipe, THEME_MAP, THEME_STORAGE_KEY, TN_THEME_DEFINITIONS, TnBannerActionDirective, TnBannerComponent, TnBannerHarness, TnBrandedSpinnerComponent, TnButtonComponent, TnButtonHarness, TnButtonToggleComponent, TnButtonToggleGroupComponent, TnCalendarComponent, TnCalendarHeaderComponent, TnCardComponent, TnCellDefDirective, TnCheckboxComponent, TnChipComponent, TnConfirmDialogComponent, TnDateInputComponent, TnDateRangeInputComponent, TnDialog, TnDialogShellComponent, TnDividerComponent, TnDividerDirective, TnExpansionPanelComponent, TnFilePickerComponent, TnFilePickerPopupComponent, TnFormFieldComponent, TnHeaderCellDefDirective, TnIconButtonComponent, TnIconComponent, TnIconHarness, TnIconRegistryService, TnIconTesting, TnInputComponent, TnInputDirective, TnKeyboardShortcutComponent, TnKeyboardShortcutService, TnListAvatarDirective, TnListComponent, TnListIconDirective, TnListItemComponent, TnListItemLineDirective, TnListItemPrimaryDirective, TnListItemSecondaryDirective, TnListItemTitleDirective, TnListItemTrailingDirective, TnListOptionComponent, TnListSubheaderComponent, TnMenuComponent, TnMenuTriggerDirective, TnMonthViewComponent, TnMultiYearViewComponent, TnNestedTreeNodeComponent, TnParticleProgressBarComponent, TnProgressBarComponent, TnRadioComponent, TnSelectComponent, TnSelectionListComponent, TnSlideToggleComponent, TnSliderComponent, TnSliderThumbDirective, TnSliderWithLabelDirective, TnSpinnerComponent, TnSpriteLoaderService, TnStepComponent, TnStepperComponent, TnTabComponent, TnTabPanelComponent, TnTableColumnDirective, TnTableComponent, TnTabsComponent, TnTheme, TnThemeService, TnTimeInputComponent, TnTooltipComponent, TnTooltipDirective, TnTreeComponent, TnTreeFlatDataSource, TnTreeFlattener, TnTreeNodeComponent, TnTreeNodeOutletDirective, TruncatePathPipe, WindowsModifierKeys, WindowsShortcuts, createLucideLibrary, createShortcut, defaultSpriteBasePath, defaultSpriteConfigPath, libIconMarker, registerLucideIcons, setupLucideIntegration, tnIconMarker };
|
|
8478
|
+
export { CommonShortcuts, DEFAULT_THEME, DiskIconComponent, DiskType, FileSizePipe, InputType, LinuxModifierKeys, LinuxShortcuts, ModifierKeys, QuickShortcuts, ShortcutBuilder, StripMntPrefixPipe, THEME_MAP, THEME_STORAGE_KEY, TN_THEME_DEFINITIONS, TnBannerActionDirective, TnBannerComponent, TnBannerHarness, TnBrandedSpinnerComponent, TnButtonComponent, TnButtonHarness, TnButtonToggleComponent, TnButtonToggleGroupComponent, TnCalendarComponent, TnCalendarHeaderComponent, TnCardComponent, TnCellDefDirective, TnCheckboxComponent, TnChipComponent, TnConfirmDialogComponent, TnDateInputComponent, TnDateRangeInputComponent, TnDialog, TnDialogShellComponent, TnDividerComponent, TnDividerDirective, TnExpansionPanelComponent, TnFilePickerComponent, TnFilePickerPopupComponent, TnFormFieldComponent, TnHeaderCellDefDirective, TnIconButtonComponent, TnIconButtonHarness, TnIconComponent, TnIconHarness, TnIconRegistryService, TnIconTesting, TnInputComponent, TnInputDirective, TnKeyboardShortcutComponent, TnKeyboardShortcutService, TnListAvatarDirective, TnListComponent, TnListIconDirective, TnListItemComponent, TnListItemLineDirective, TnListItemPrimaryDirective, TnListItemSecondaryDirective, TnListItemTitleDirective, TnListItemTrailingDirective, TnListOptionComponent, TnListSubheaderComponent, TnMenuComponent, TnMenuTriggerDirective, TnMonthViewComponent, TnMultiYearViewComponent, TnNestedTreeNodeComponent, TnParticleProgressBarComponent, TnProgressBarComponent, TnRadioComponent, TnSelectComponent, TnSelectionListComponent, TnSlideToggleComponent, TnSliderComponent, TnSliderThumbDirective, TnSliderWithLabelDirective, TnSpinnerComponent, TnSpriteLoaderService, TnStepComponent, TnStepperComponent, TnTabComponent, TnTabPanelComponent, TnTableColumnDirective, TnTableComponent, TnTabsComponent, TnTheme, TnThemeService, TnTimeInputComponent, TnTooltipComponent, TnTooltipDirective, TnTreeComponent, TnTreeFlatDataSource, TnTreeFlattener, TnTreeNodeComponent, TnTreeNodeOutletDirective, TruncatePathPipe, WindowsModifierKeys, WindowsShortcuts, createLucideLibrary, createShortcut, defaultSpriteBasePath, defaultSpriteConfigPath, libIconMarker, registerLucideIcons, setupLucideIntegration, tnIconMarker };
|
|
8291
8479
|
//# sourceMappingURL=truenas-ui-components.mjs.map
|