diff options
Diffstat (limited to 'app/assets/javascripts/lib/utils/table_utility.js')
-rw-r--r-- | app/assets/javascripts/lib/utils/table_utility.js | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/app/assets/javascripts/lib/utils/table_utility.js b/app/assets/javascripts/lib/utils/table_utility.js index 6d66335b832..5d3aba9f4ed 100644 --- a/app/assets/javascripts/lib/utils/table_utility.js +++ b/app/assets/javascripts/lib/utils/table_utility.js @@ -2,6 +2,7 @@ import { convertToSnakeCase, convertToCamelCase } from '~/lib/utils/text_utility import { DEFAULT_TH_CLASSES } from './constants'; /** + * Deprecated: use thWidthPercent instead * Generates the table header classes to be used for GlTable fields. * * @param {Number} width - The column width as a percentage. @@ -10,6 +11,15 @@ import { DEFAULT_TH_CLASSES } from './constants'; export const thWidthClass = (width) => `gl-w-${width}p ${DEFAULT_TH_CLASSES}`; /** + * Generates the table header class for width to be used for GlTable fields. + * + * @param {Number} width - The column width as a percentage. Only accepts values + * as defined in https://gitlab.com/gitlab-org/gitlab-ui/blob/main/src/scss/utility-mixins/sizing.scss + * @returns {String} The class to be used in GlTable fields object. + */ +export const thWidthPercent = (width) => `gl-w-${width}p`; + +/** * Converts a GlTable sort-changed event object into string format. * This string can be used as a sort argument on GraphQL queries. * |