2023-04-10 15:36:59 +00:00
|
|
|
/**
|
|
|
|
* Copyright (c) HashiCorp, Inc.
|
|
|
|
* SPDX-License-Identifier: MPL-2.0
|
|
|
|
*/
|
|
|
|
|
2017-12-15 21:39:18 +00:00
|
|
|
import { helper } from '@ember/component/helper';
|
2022-04-07 19:51:41 +00:00
|
|
|
import { dasherize } from '@ember/string';
|
2017-09-19 14:47:10 +00:00
|
|
|
/**
|
|
|
|
* CSS Class
|
|
|
|
*
|
|
|
|
* Usage: {{css-class updateType}}
|
|
|
|
*
|
|
|
|
* Outputs a css friendly class string from any human string.
|
|
|
|
* Differs from dasherize by handling slashes.
|
|
|
|
*/
|
|
|
|
export function cssClass([updateType]) {
|
2022-04-07 19:51:41 +00:00
|
|
|
return dasherize(updateType.replace(/\//g, '-'));
|
2017-09-19 14:47:10 +00:00
|
|
|
}
|
|
|
|
|
2017-12-15 21:39:18 +00:00
|
|
|
export default helper(cssClass);
|