@dvrd/dvr-controls 1.0.47 → 1.0.49
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/package.json
CHANGED
|
@@ -28,8 +28,8 @@ export default function DvrdButton(props: DvrdButtonProps) {
|
|
|
28
28
|
{
|
|
29
29
|
className, disabled, label, labelClassName, onClick, ornamentClassName, ornaments, red, secondary,
|
|
30
30
|
customBaseColor, customContrastColor
|
|
31
|
-
} = props
|
|
32
|
-
|
|
31
|
+
} = props;
|
|
32
|
+
const [hover, setHover] = useState(false);
|
|
33
33
|
|
|
34
34
|
function onMouseEnter() {
|
|
35
35
|
setHover(true);
|
|
@@ -71,7 +71,7 @@ export default function DvrdButton(props: DvrdButtonProps) {
|
|
|
71
71
|
} else if (secondary) color = context.contrastColor;
|
|
72
72
|
else color = context.baseColor;
|
|
73
73
|
color = convertColor(color);
|
|
74
|
-
if (hover) color = editColor(-.2, color);
|
|
74
|
+
if (hover && !disabled) color = editColor(-.2, color);
|
|
75
75
|
return color;
|
|
76
76
|
}
|
|
77
77
|
|
package/src/js/dialog/dialog.tsx
CHANGED
|
@@ -121,10 +121,10 @@ export default class Dialog extends React.Component<Props, State> {
|
|
|
121
121
|
return {color: convertColor(color)};
|
|
122
122
|
};
|
|
123
123
|
|
|
124
|
-
extendOnClick = (
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
124
|
+
extendOnClick = (action: DialogActionShape): MouseEventHandler => (evt: any) => {
|
|
125
|
+
if (!action.keepOpen)
|
|
126
|
+
this.onClose();
|
|
127
|
+
action.onClick?.(evt);
|
|
128
128
|
};
|
|
129
129
|
|
|
130
130
|
getActions = () => {
|
|
@@ -146,7 +146,7 @@ export default class Dialog extends React.Component<Props, State> {
|
|
|
146
146
|
type={this.buttonVariant} containerClass='dialogButton'/>
|
|
147
147
|
);
|
|
148
148
|
return (
|
|
149
|
-
<ButtonController {...keyProp} label={action.label} onClick={this.extendOnClick(action
|
|
149
|
+
<ButtonController {...keyProp} label={action.label} onClick={this.extendOnClick(action)}
|
|
150
150
|
type={this.buttonVariant} containerClass='dialogButton' primary={action.primary}/>
|
|
151
151
|
);
|
|
152
152
|
};
|
|
@@ -159,7 +159,8 @@ export default function DvrdMultiSelect(props: Props) {
|
|
|
159
159
|
const label = selectableItemLabel ?? item.label;
|
|
160
160
|
if (['number', 'string'].includes(typeof label)) return (
|
|
161
161
|
<label key={index} className={classNames('dvrd-select-item', isSelected && 'selected', itemClassName)}
|
|
162
|
-
onClick={onClickItem(value)}
|
|
162
|
+
onClick={onClickItem(value)}>{selected &&
|
|
163
|
+
<AwesomeIcon name='check' className='check-icon'/>} {label}</label>
|
|
163
164
|
);
|
|
164
165
|
const labelElement: ReactElement = label as ReactElement;
|
|
165
166
|
const onClick = (evt: React.MouseEvent) => {
|