216 lines
9.7 KiB
JavaScript
216 lines
9.7 KiB
JavaScript
"use strict";
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
exports.getStyles = void 0;
|
|
var tslib_1 = require("tslib");
|
|
var Styling_1 = require("../../../Styling");
|
|
var Utilities_1 = require("../../../Utilities");
|
|
exports.getStyles = (0, Utilities_1.memoizeFunction)(function (theme, customStyles) {
|
|
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s;
|
|
var effects = theme.effects, palette = theme.palette, semanticColors = theme.semanticColors;
|
|
var buttonHighContrastFocus = {
|
|
left: -2,
|
|
top: -2,
|
|
bottom: -2,
|
|
right: -2,
|
|
border: 'none',
|
|
};
|
|
var splitButtonDividerBaseStyles = {
|
|
position: 'absolute',
|
|
width: 1,
|
|
right: 31,
|
|
top: 8,
|
|
bottom: 8,
|
|
};
|
|
var splitButtonStyles = {
|
|
splitButtonContainer: [
|
|
(0, Styling_1.getFocusStyle)(theme, { highContrastStyle: buttonHighContrastFocus, inset: 2, pointerEvents: 'none' }),
|
|
{
|
|
display: 'inline-flex',
|
|
'.ms-Button--default': {
|
|
borderTopRightRadius: '0',
|
|
borderBottomRightRadius: '0',
|
|
borderRight: 'none',
|
|
flexGrow: '1',
|
|
},
|
|
'.ms-Button--primary': (_a = {
|
|
borderTopRightRadius: '0',
|
|
borderBottomRightRadius: '0',
|
|
border: 'none',
|
|
flexGrow: '1',
|
|
':hover': {
|
|
border: 'none',
|
|
},
|
|
':active': {
|
|
border: 'none',
|
|
}
|
|
},
|
|
_a[Styling_1.HighContrastSelector] = tslib_1.__assign(tslib_1.__assign({ color: 'WindowText', backgroundColor: 'Window', border: '1px solid WindowText', borderRightWidth: '0' }, (0, Styling_1.getHighContrastNoAdjustStyle)()), { ':hover': {
|
|
backgroundColor: 'Highlight',
|
|
border: '1px solid Highlight',
|
|
borderRightWidth: '0',
|
|
color: 'HighlightText',
|
|
}, ':active': {
|
|
border: '1px solid Highlight',
|
|
} }),
|
|
_a),
|
|
'.ms-Button--default + .ms-Button': (_b = {},
|
|
_b[Styling_1.HighContrastSelector] = {
|
|
border: '1px solid WindowText',
|
|
borderLeftWidth: '0',
|
|
':hover': {
|
|
backgroundColor: 'HighlightText',
|
|
borderColor: 'Highlight',
|
|
color: 'Highlight',
|
|
'.ms-Button-menuIcon': tslib_1.__assign({ backgroundColor: 'HighlightText', color: 'Highlight' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
|
|
},
|
|
},
|
|
_b),
|
|
'.ms-Button--default + .ms-Button[aria-expanded="true"]': (_c = {},
|
|
_c[Styling_1.HighContrastSelector] = {
|
|
backgroundColor: 'HighlightText',
|
|
borderColor: 'Highlight',
|
|
color: 'Highlight',
|
|
'.ms-Button-menuIcon': tslib_1.__assign({ backgroundColor: 'HighlightText', color: 'Highlight' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
|
|
},
|
|
_c),
|
|
'.ms-Button--primary + .ms-Button': (_d = {
|
|
border: 'none'
|
|
},
|
|
_d[Styling_1.HighContrastSelector] = {
|
|
border: '1px solid WindowText',
|
|
borderLeftWidth: '0',
|
|
':hover': {
|
|
borderLeftWidth: '0',
|
|
backgroundColor: 'Highlight',
|
|
borderColor: 'Highlight',
|
|
color: 'HighlightText',
|
|
'.ms-Button-menuIcon': tslib_1.__assign(tslib_1.__assign({}, (0, Styling_1.getHighContrastNoAdjustStyle)()), { color: 'HighlightText' }),
|
|
},
|
|
},
|
|
_d),
|
|
'.ms-Button--primary + .ms-Button[aria-expanded="true"]': (_e = {},
|
|
_e[Styling_1.HighContrastSelector] = tslib_1.__assign(tslib_1.__assign({ backgroundColor: 'Highlight', borderColor: 'Highlight', color: 'HighlightText' }, (0, Styling_1.getHighContrastNoAdjustStyle)()), { '.ms-Button-menuIcon': {
|
|
color: 'HighlightText',
|
|
} }),
|
|
_e),
|
|
'.ms-Button.is-disabled': (_f = {},
|
|
_f[Styling_1.HighContrastSelector] = {
|
|
color: 'GrayText',
|
|
borderColor: 'GrayText',
|
|
backgroundColor: 'Window',
|
|
},
|
|
_f),
|
|
},
|
|
],
|
|
splitButtonContainerHovered: {
|
|
'.ms-Button--default.is-disabled': (_g = {
|
|
backgroundColor: semanticColors.buttonBackgroundDisabled,
|
|
color: semanticColors.buttonTextDisabled
|
|
},
|
|
_g[Styling_1.HighContrastSelector] = {
|
|
color: 'GrayText',
|
|
borderColor: 'GrayText',
|
|
backgroundColor: 'Window',
|
|
},
|
|
_g),
|
|
'.ms-Button--primary.is-disabled': (_h = {
|
|
backgroundColor: semanticColors.primaryButtonBackgroundDisabled,
|
|
color: semanticColors.primaryButtonTextDisabled
|
|
},
|
|
_h[Styling_1.HighContrastSelector] = {
|
|
color: 'GrayText',
|
|
borderColor: 'GrayText',
|
|
backgroundColor: 'Window',
|
|
},
|
|
_h),
|
|
},
|
|
splitButtonContainerChecked: {
|
|
'.ms-Button--primary': (_j = {},
|
|
_j[Styling_1.HighContrastSelector] = tslib_1.__assign({ color: 'Window', backgroundColor: 'WindowText' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
|
|
_j),
|
|
},
|
|
splitButtonContainerCheckedHovered: {
|
|
'.ms-Button--primary': (_k = {},
|
|
_k[Styling_1.HighContrastSelector] = tslib_1.__assign({ color: 'Window', backgroundColor: 'WindowText' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
|
|
_k),
|
|
},
|
|
splitButtonContainerFocused: {
|
|
outline: 'none!important',
|
|
},
|
|
splitButtonMenuButton: (_l = {
|
|
padding: 6,
|
|
height: 'auto',
|
|
boxSizing: 'border-box',
|
|
borderRadius: 0,
|
|
borderTopRightRadius: effects.roundedCorner2,
|
|
borderBottomRightRadius: effects.roundedCorner2,
|
|
border: "1px solid ".concat(palette.neutralSecondaryAlt),
|
|
borderLeft: 'none',
|
|
outline: 'transparent',
|
|
userSelect: 'none',
|
|
display: 'inline-block',
|
|
textDecoration: 'none',
|
|
textAlign: 'center',
|
|
cursor: 'pointer',
|
|
verticalAlign: 'top',
|
|
width: 32,
|
|
marginLeft: -1,
|
|
marginTop: 0,
|
|
marginRight: 0,
|
|
marginBottom: 0
|
|
},
|
|
_l[Styling_1.HighContrastSelector] = {
|
|
'.ms-Button-menuIcon': {
|
|
color: 'WindowText',
|
|
},
|
|
},
|
|
_l),
|
|
splitButtonDivider: tslib_1.__assign(tslib_1.__assign({}, splitButtonDividerBaseStyles), (_m = {}, _m[Styling_1.HighContrastSelector] = {
|
|
backgroundColor: 'WindowText',
|
|
}, _m)),
|
|
splitButtonDividerDisabled: tslib_1.__assign(tslib_1.__assign({}, splitButtonDividerBaseStyles), (_o = {}, _o[Styling_1.HighContrastSelector] = {
|
|
backgroundColor: 'GrayText',
|
|
}, _o)),
|
|
splitButtonMenuButtonDisabled: (_p = {
|
|
pointerEvents: 'none',
|
|
border: 'none',
|
|
':hover': {
|
|
cursor: 'default',
|
|
},
|
|
'.ms-Button--primary': (_q = {},
|
|
_q[Styling_1.HighContrastSelector] = {
|
|
color: 'GrayText',
|
|
borderColor: 'GrayText',
|
|
backgroundColor: 'Window',
|
|
},
|
|
_q),
|
|
'.ms-Button-menuIcon': (_r = {},
|
|
_r[Styling_1.HighContrastSelector] = {
|
|
color: 'GrayText',
|
|
},
|
|
_r)
|
|
},
|
|
_p[Styling_1.HighContrastSelector] = {
|
|
color: 'GrayText',
|
|
border: '1px solid GrayText',
|
|
backgroundColor: 'Window',
|
|
},
|
|
_p),
|
|
splitButtonFlexContainer: {
|
|
display: 'flex',
|
|
height: '100%',
|
|
flexWrap: 'nowrap',
|
|
justifyContent: 'center',
|
|
alignItems: 'center',
|
|
},
|
|
splitButtonContainerDisabled: (_s = {
|
|
outline: 'none',
|
|
border: 'none'
|
|
},
|
|
_s[Styling_1.HighContrastSelector] = tslib_1.__assign({ color: 'GrayText', borderColor: 'GrayText', backgroundColor: 'Window' }, (0, Styling_1.getHighContrastNoAdjustStyle)()),
|
|
_s),
|
|
splitButtonMenuFocused: tslib_1.__assign({}, (0, Styling_1.getFocusStyle)(theme, { highContrastStyle: buttonHighContrastFocus, inset: 2 })),
|
|
};
|
|
return (0, Styling_1.concatStyleSets)(splitButtonStyles, customStyles);
|
|
});
|
|
//# sourceMappingURL=SplitButton.styles.js.map
|