@carbon/ibm-products
Version:
Carbon for IBM Products
51 lines (48 loc) • 1.77 kB
JavaScript
/**
* Copyright IBM Corp. 2020, 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
const deprecated_StringFormatterAlignment = {
TOP: 'top',
TOP_LEFT: 'top-left',
TOP_RIGHT: 'top-right',
BOTTOM: 'bottom',
BOTTOM_LEFT: 'bottom-left',
BOTTOM_RIGHT: 'bottom-right',
LEFT: 'left',
LEFT_BOTTOM: 'left-bottom',
LEFT_TOP: 'left-top',
RIGHT: 'right',
RIGHT_BOTTOM: 'right-bottom',
RIGHT_TOP: 'right-top'
};
const StringFormatterAlignment = {
TOP: 'top',
TOP_START: 'top-start',
TOP_END: 'top-end',
BOTTOM: 'bottom',
BOTTOM_START: 'bottom-start',
BOTTOM_END: 'bottom-end',
LEFT: 'left',
LEFT_END: 'left-end',
LEFT_START: 'left-start',
RIGHT: 'right',
RIGHT_END: 'right-end',
RIGHT_START: 'right-start'
};
const propMappingFunction = deprecatedValue => {
const mapping = {
[]: StringFormatterAlignment.TOP_START,
[]: StringFormatterAlignment.TOP_END,
[]: StringFormatterAlignment.BOTTOM_START,
[]: StringFormatterAlignment.BOTTOM_END,
[]: StringFormatterAlignment.LEFT_END,
[]: StringFormatterAlignment.LEFT_START,
[]: StringFormatterAlignment.RIGHT_END,
[]: StringFormatterAlignment.RIGHT_START
};
return mapping[deprecatedValue];
};
export { StringFormatterAlignment, deprecated_StringFormatterAlignment, propMappingFunction };