@awsui/components-react
Version:
AWS UI is a collection of [React](https://reactjs.org/) components that help create intuitive, responsive, and accessible user experiences for web applications. It is developed by Amazon Web Services (AWS). This work is available under the terms of the [A
38 lines (37 loc) • 1.26 kB
JavaScript
var defaults = {
"default": {
navigationOpen: true,
minContentWidth: 280,
maxContentWidth: undefined
},
cards: {
navigationOpen: true,
minContentWidth: 280,
maxContentWidth: undefined
},
form: {
navigationOpen: false,
minContentWidth: 280,
maxContentWidth: 800
},
table: {
navigationOpen: true,
minContentWidth: 280,
maxContentWidth: undefined
},
wizard: {
navigationOpen: false,
minContentWidth: 280,
maxContentWidth: 1080
}
};
export function applyDefaults(contentType, stateFromProps) {
var _a, _b, _c, _d;
var contentTypeDefaults = defaults[contentType];
return {
maxContentWidth: (_a = stateFromProps.maxContentWidth) !== null && _a !== void 0 ? _a : contentTypeDefaults.maxContentWidth,
minContentWidth: (_b = stateFromProps.minContentWidth) !== null && _b !== void 0 ? _b : contentTypeDefaults.minContentWidth,
navigationOpen: (_c = stateFromProps.navigationOpen) !== null && _c !== void 0 ? _c : contentTypeDefaults.navigationOpen,
toolsOpen: (_d = stateFromProps.toolsOpen) !== null && _d !== void 0 ? _d : contentTypeDefaults.toolsOpen
};
}