azure-boards-ui 2.167.15 → 2.167.19
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.
|
@@ -34,6 +34,10 @@ export interface IWorkItemTypeIconProps {
|
|
|
34
34
|
* @default TypeIconSize.Normal
|
|
35
35
|
*/
|
|
36
36
|
size?: TypeIconSize;
|
|
37
|
+
/**
|
|
38
|
+
* Set to true to not set an aria label on the icon.
|
|
39
|
+
*/
|
|
40
|
+
suppressAriaLabel?: boolean;
|
|
37
41
|
/**
|
|
38
42
|
* Set to true to prevent a tooltip from showing up.
|
|
39
43
|
*/
|
|
@@ -44,3 +48,6 @@ export declare enum TypeIconSize {
|
|
|
44
48
|
large = 1,
|
|
45
49
|
small = 2
|
|
46
50
|
}
|
|
51
|
+
export interface IGetWorkITemTypeIconPropsProps extends Omit<IWorkItemTypeIconProps, "data"> {
|
|
52
|
+
data: WorkItemTypeColorAndIcon | undefined;
|
|
53
|
+
}
|
|
@@ -2,8 +2,13 @@ import "azure-devops-ui/CommonImports";
|
|
|
2
2
|
import "azure-devops-ui/Core/core.css";
|
|
3
3
|
import "./WorkItemTypeIcon.css";
|
|
4
4
|
import * as React from "react";
|
|
5
|
-
import {
|
|
5
|
+
import { IIconProps } from "azure-devops-ui/Icon";
|
|
6
|
+
import { IGetWorkITemTypeIconPropsProps, IWorkItemTypeIconProps } from "./WorkItemTypeIcon.props";
|
|
6
7
|
/**
|
|
7
8
|
* Display an icon for a work item type.
|
|
8
9
|
*/
|
|
9
10
|
export declare const WorkItemTypeIcon: React.FunctionComponent<IWorkItemTypeIconProps>;
|
|
11
|
+
/**
|
|
12
|
+
* Gets the IIconProps to pass to <Icon> to show a WorkItemTypeIcon
|
|
13
|
+
*/
|
|
14
|
+
export declare function getWorkItemTypeIconProps(props: IGetWorkITemTypeIconPropsProps): IIconProps;
|
|
@@ -13,30 +13,37 @@ import { TypeIconSize } from "./WorkItemTypeIcon.props";
|
|
|
13
13
|
* Display an icon for a work item type.
|
|
14
14
|
*/
|
|
15
15
|
export var WorkItemTypeIcon = function (props) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
var iconName = showDefault ? "ClipboardSolid" : "bowtie-icon bowtie-" + ICONNAME_TO_CLASSNAME_MAPPINGS[props.data.icon];
|
|
20
|
-
var iconColor = (!showDefault && parseColor(props.data.color)) || undefined;
|
|
21
|
-
var workItemTypeName = (props.data && props.data.workItemTypeName) || "";
|
|
22
|
-
var tooltipHostId = getId("work-item-type-icon-tooltip");
|
|
23
|
-
return (React.createElement(Icon, __assign({}, {
|
|
24
|
-
iconName: showDefault ? iconName : undefined,
|
|
25
|
-
className: css("work-item-type-icon", className, getSizeCssClass(size), showDefault ? "default" : iconName),
|
|
26
|
-
ariaDescribedBy: tooltipHostId,
|
|
27
|
-
ariaLabel: workItemTypeName,
|
|
28
|
-
style: {
|
|
29
|
-
color: iconColor
|
|
30
|
-
},
|
|
31
|
-
tooltipProps: !suppressTooltip
|
|
32
|
-
? {
|
|
33
|
-
id: tooltipHostId,
|
|
34
|
-
text: workItemTypeName
|
|
35
|
-
}
|
|
36
|
-
: undefined
|
|
37
|
-
})));
|
|
16
|
+
return (React.createElement(Observer, { data: props.data }, function (_a) {
|
|
17
|
+
var data = _a.data;
|
|
18
|
+
return React.createElement(Icon, __assign({}, getWorkItemTypeIconProps(__assign(__assign({}, props), { data: data }))));
|
|
38
19
|
}));
|
|
39
20
|
};
|
|
21
|
+
/**
|
|
22
|
+
* Gets the IIconProps to pass to <Icon> to show a WorkItemTypeIcon
|
|
23
|
+
*/
|
|
24
|
+
export function getWorkItemTypeIconProps(props) {
|
|
25
|
+
var data = props.data, className = props.className, size = props.size, suppressAriaLabel = props.suppressAriaLabel, suppressTooltip = props.suppressTooltip;
|
|
26
|
+
var showDefault = !data || data.icon === "__default__" || data.color === "__default__";
|
|
27
|
+
var iconName = showDefault ? "ClipboardSolid" : "bowtie-icon bowtie-" + ICONNAME_TO_CLASSNAME_MAPPINGS[data.icon];
|
|
28
|
+
var iconColor = (!showDefault && parseColor(data.color)) || undefined;
|
|
29
|
+
var workItemTypeName = (data && data.workItemTypeName) || "";
|
|
30
|
+
var tooltipHostId = getId("work-item-type-icon-tooltip");
|
|
31
|
+
return {
|
|
32
|
+
iconName: showDefault ? iconName : undefined,
|
|
33
|
+
className: css("work-item-type-icon", className, getSizeCssClass(size), showDefault ? "default" : iconName),
|
|
34
|
+
ariaDescribedBy: tooltipHostId,
|
|
35
|
+
ariaLabel: !suppressAriaLabel ? workItemTypeName : undefined,
|
|
36
|
+
style: {
|
|
37
|
+
color: iconColor
|
|
38
|
+
},
|
|
39
|
+
tooltipProps: !suppressTooltip
|
|
40
|
+
? {
|
|
41
|
+
id: tooltipHostId,
|
|
42
|
+
text: workItemTypeName
|
|
43
|
+
}
|
|
44
|
+
: undefined
|
|
45
|
+
};
|
|
46
|
+
}
|
|
40
47
|
function getSizeCssClass(size) {
|
|
41
48
|
switch (size) {
|
|
42
49
|
case TypeIconSize.small:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function getSizeCssClass(
|
|
1
|
+
function getSizeCssClass(e){switch(e){case TypeIconSize.small:return"small";case TypeIconSize.large:return"large";case TypeIconSize.normal:default:return"normal"}}import{__assign}from"tslib";import"azure-devops-ui/CommonImports";import"azure-devops-ui/Core/core.css";import"./WorkItemTypeIcon.css";import*as React from"react";import{getId}from"azure-devops-ui/Core/Util/Object";import{Icon}from"azure-devops-ui/Icon";import{Observer}from"azure-devops-ui/Observer";import{css}from"azure-devops-ui/Util";import{parseColor}from"../../Common/ColorUtilities";import{TypeIconSize}from"./WorkItemTypeIcon.props";export var WorkItemTypeIcon=function(e){return React.createElement(Observer,{data:e.data},function(o){var s=o.data;return React.createElement(Icon,__assign({},getWorkItemTypeIconProps(__assign(__assign({},e),{data:s}))))})};export function getWorkItemTypeIconProps(e){var o=e.data,s=e.className,t=e.size,i=e.suppressAriaLabel,r=e.suppressTooltip,a=!o||"__default__"===o.icon||"__default__"===o.color,n=a?"ClipboardSolid":"bowtie-icon bowtie-"+ICONNAME_TO_CLASSNAME_MAPPINGS[o.icon],c=!a&&parseColor(o.color)||void 0,l=o&&o.workItemTypeName||"",m=getId("work-item-type-icon-tooltip");return{iconName:a?n:void 0,className:css("work-item-type-icon",s,getSizeCssClass(t),a?"default":n),ariaDescribedBy:m,ariaLabel:i?void 0:l,style:{color:c},tooltipProps:r?void 0:{id:m,text:l}}};var ICONNAME_TO_CLASSNAME_MAPPINGS={icon_crown:"symbol-crown",icon_trophy:"symbol-trophy",icon_list:"symbol-list",icon_book:"symbol-book",icon_sticky_note:"symbol-stickynote",icon_clipboard:"symbol-task",icon_insect:"symbol-bug",icon_traffic_cone:"symbol-impediment",icon_chat_bubble:"symbol-review",icon_flame:"symbol-flame",icon_megaphone:"symbol-ask",icon_test_plan:"test-plan",icon_test_suite:"test-suite",icon_test_case:"test-case",icon_test_step:"test-step",icon_test_parameter:"test-parameter",icon_code_review:"symbol-review-request",icon_code_response:"symbol-review-response",icon_review:"symbol-feedback-request",icon_response:"symbol-feedback-response",icon_ribbon:"symbol-ribbon",icon_chart:"symbol-finance",icon_headphone:"symbol-headphone",icon_key:"symbol-key",icon_airplane:"symbol-airplane",icon_car:"symbol-car",icon_diamond:"symbol-diamond",icon_asterisk:"symbol-asterisk",icon_database_storage:"symbol-storage-database",icon_government:"symbol-government",icon_gavel:"symbol-decision",icon_parachute:"symbol-parachute",icon_paint_brush:"symbol-paint-brush",icon_palette:"symbol-color-palette",icon_gear:"settings-gear",icon_check_box:"status-success-box",icon_gift:"package-fill",icon_test_beaker:"test-fill",icon_broken_lightbulb:"symbol-defect",icon_clipboard_issue:"symbol-issue",icon_github:"brand-github",icon_pull_request:"tfvc-pull-request",icon_github_issue:"status-error-outline"};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "azure-boards-ui",
|
|
3
|
-
"version": "2.167.
|
|
3
|
+
"version": "2.167.19",
|
|
4
4
|
"description": "React components for building web UI in Azure Boards",
|
|
5
5
|
"author": "Microsoft Corporation",
|
|
6
6
|
"license": "MIT",
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/Microsoft/azure-devops-ui"
|
|
10
10
|
},
|
|
11
11
|
"dependencies": {
|
|
12
|
-
"azure-devops-ui": "2.167.
|
|
12
|
+
"azure-devops-ui": "2.167.19",
|
|
13
13
|
"tslib": "~1.10.0"
|
|
14
14
|
},
|
|
15
15
|
"peerDependencies": {
|